<?xml version="1.0" encoding="UTF-8"?>
<!--
  Device:2 Root Data Model: Common Object definitions [Logical]

  Copyright (c) 2021-2024, Broadband Forum

  Redistribution and use in source and binary forms, with or
  without modification, are permitted provided that the following
  conditions are met:

  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above
     copyright notice, this list of conditions and the following
     disclaimer in the documentation and/or other materials
     provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its
     contributors may be used to endorse or promote products
     derived from this software without specific prior written
     permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

  The above license is used as a license under copyright only.
  Please reference the Forum IPR Policy for patent licensing terms
  <https://www.broadband-forum.org/ipr-policy>.

  Any moral rights which are necessary to exercise under the above
  license grant are also deemed granted under this license.

  Comments or questions about this Broadband Forum data model should be
  directed to <info@broadband-forum.org>.
-->

<dm:document
    xmlns:dm="urn:broadband-forum-org:cwmp:datamodel-1-10"
    xmlns:dmr="urn:broadband-forum-org:cwmp:datamodel-report-1-0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
      urn:broadband-forum-org:cwmp:datamodel-1-10
        https://www.broadband-forum.org/cwmp/cwmp-datamodel-1-10.xsd
      urn:broadband-forum-org:cwmp:datamodel-report-1-0
        https://www.broadband-forum.org/cwmp/cwmp-datamodel-report-1-0.xsd"
    spec="urn:broadband-forum-org:tr-181-2-18-0-logical"
    file="tr-181-2-18-0-logical.xml">

  <import file="tr-069-biblio.xml" spec="urn:broadband-forum-org:tr-069"/>

  <import file="tr-106-types.xml" spec="urn:broadband-forum-org:tr-106">
    <component name="Alias"/>
  </import>

  <import file="tr-181-2-root.xml"
      spec="urn:broadband-forum-org:tr-181-2-16-root">
    <component name="Root"/>
  </import>

  <component name="Logical">
    <object name="Device.Logical." access="readOnly" minEntries="1"
        maxEntries="1" version="2.16">
      <description>
        Logical object. This object models several Logical interface objects,
        each representing a different stack layer, including:
        {{object|Interface}}. {{object|Interface}} is a logical interface which
        can point to other stackable interface layers.

        The intention of the logical interface is to simplify the configuration
        management of individual {{bibref|TR-181i2}} services. Instead of
        configuring the individual network services with a physical interface
        and deal with reconfiguration problems that may arise from switching
        between WAN interfaces. The intention is that the network services are
        configured with a logical interface and that this configuration stays
        unchanged during the switching between WAN interfaces. The software
        service (For example a WAN mode manger.) responsible for handling the
        WAN interface changes must then only care about rewriting the
        LowerLayers parameter of the Logical Interface Objects.
      </description>
      <parameter name="InterfaceNumberOfEntries" access="readOnly">
        <description>
          {{numentries}}
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
    </object>
    <object name="Device.Logical.Interface.{i}." access="readWrite"
        numEntriesParameter="InterfaceNumberOfEntries" minEntries="0"
        maxEntries="unbounded" version="2.16">
      <description>
        Logical interface table (a stackable interface object as described in
        {{bibref|TR-181i2|Section 4.2}}). This table models only logical
        interfaces.
      </description>
      <uniqueKey functional="false">
        <parameter ref="Alias"/>
      </uniqueKey>
      <uniqueKey functional="false">
        <parameter ref="Name"/>
      </uniqueKey>
      <parameter name="Enable" access="readWrite">
        <description>
          Enables or disables the interface. This parameter is based on
          ''ifAdminStatus'' from {{bibref|RFC2863}}.
        </description>
        <syntax>
          <boolean/>
        </syntax>
      </parameter>
      <parameter name="Status" access="readOnly">
        <description>
          The current operational state of the logical interface (see
          {{bibref|TR-181i2|Section 4.2.2}}). {{enum}} This parameter is based
          on ''ifOperStatus'' from {{bibref|RFC2863}}.
        </description>
        <syntax>
          <string>
            <enumeration value="Up">
              <description>
                When {{param|Enable}} is changed to {{true}} then {{param}}
                SHOULD change to {{enum|Up}} if and only if all the active
                lower layer interfaces are able to transmit and receive network
                traffic
              </description>
            </enumeration>
            <enumeration value="Down">
              <description>
                When {{param|Enable}} is {{false}} then {{param}} SHOULD
                normally be {{enum|Down}}
              </description>
            </enumeration>
            <enumeration value="Unknown">
              <description>
                It SHOULD change to {{enum|Unknown}} if the state of one or
                more of the active lower interfaces can not be determined for
                some reason
              </description>
            </enumeration>
            <enumeration value="Dormant">
              <description>
                It SHOULD change to {{enum|Dormant}} if and only if one ore
                more of the active lower interfaces is operable but is waiting
                for external actions before it can transmit and receive network
                traffic (and subsequently change to {{enum|Up}} if still
                operable when the expected actions have completed)
              </description>
            </enumeration>
            <enumeration value="NotPresent">
              <description>
                It SHOULD remain in the {{enum|NotPresent}} state if the
                interface, or one or more of the active lower interfaces has
                missing (typically hardware) components
              </description>
            </enumeration>
            <enumeration value="LowerLayerDown">
              <description>
                It SHOULD change to {{enum|LowerLayerDown}} if and only if one
                or more of the active lower interfaces is prevented from
                entering the {{enum|Up}} state because one or more of the
                interfaces beneath it is down
              </description>
            </enumeration>
            <enumeration value="Error" optional="true">
              <description>
                It SHOULD remain in the {{enum|Error}} state if there is an
                error or other fault condition detected with one more of the
                active lower layer interfaces
              </description>
          </enumeration>
          </string>
          <default type="object" value="Down"/>
        </syntax>
      </parameter>
      <component ref="Alias"/>
      <parameter name="Name" access="readWrite">
        <description>
          The textual name of the logical interface as assigned by a static
          configuration file or dynamically by a controller.
        </description>
        <syntax>
          <string>
            <size maxLength="64"/>
          </string>
        </syntax>
      </parameter>
      <parameter name="LastChange" access="readOnly" activeNotify="canDeny">
        <description>
          The accumulated time in {{units}} since the logical interface entered
          its current operational state.
        </description>
        <syntax>
          <unsignedInt>
            <units value="seconds"/>
          </unsignedInt>
        </syntax>
      </parameter>
      <parameter name="LowerLayers" access="readWrite">
        <description>
          {{list}} {{reference|an interface object that is stacked immediately
          below this interface object}} See {{bibref|TR-181i2|Section 4.2.1}}.
        </description>
        <syntax>
          <list>
            <size maxLength="1024"/>
          </list>
          <string>
            <pathRef refType="strong" targetType="row"/>
          </string>
        </syntax>
      </parameter>
    </object>
    <object name="Device.Logical.Interface.{i}.Stats." access="readOnly"
        minEntries="1" maxEntries="1" version="2.16">
      <description>
        Throughput statistics for this interface. The CPE MUST reset the
        interface's Stats parameters (unless otherwise stated in individual
        object or parameter descriptions) either when the interface becomes
        operationally down due to a previous administrative down (i.e. the
        interface's {{param|#.Status}} parameter transitions to a down state
        after the interface is disabled) or when the interface becomes
        administratively up (i.e. the interface's {{param|#.Enable}} parameter
        transitions from {{false}} to {{true}}). Administrative and operational
        interface status is discussed in {{bibref|TR-181i2|section 4.2.2}}.

        This information SHOULD be mirrored or aggregated from the active
        underlying interfaces.
      </description>
      <parameter name="BytesSent" access="readOnly" activeNotify="canDeny">
        <description>
          The total number of bytes transmitted out of the interface, including
          framing characters.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="BytesReceived" access="readOnly" activeNotify="canDeny">
        <description>
          The total number of bytes received on the interface, including
          framing characters.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="PacketsSent" access="readOnly" activeNotify="canDeny">
        <description>
          The total number of packets transmitted out of the interface.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="PacketsReceived" access="readOnly"
          activeNotify="canDeny">
        <description>
          The total number of packets received on the interface.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="ErrorsSent" access="readOnly" activeNotify="canDeny">
        <description>
          The total number of outbound packets that could not be transmitted
          because of errors.
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
      <parameter name="ErrorsReceived" access="readOnly"
          activeNotify="canDeny">
        <description>
          The total number of inbound packets that contained errors preventing
          them from being delivered to a higher-layer protocol.
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
      <parameter name="UnicastPacketsSent" access="readOnly"
          activeNotify="canDeny">
        <description>
          The total number of packets requested for transmission which were not
          addressed to a multicast or broadcast address at this layer,
          including those that were discarded or not sent.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="UnicastPacketsReceived" access="readOnly"
          activeNotify="canDeny">
        <description>
          The total number of received packets, delivered by this layer to a
          higher layer, which were not addressed to a multicast or broadcast
          address at this layer.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="DiscardPacketsSent" access="readOnly"
          activeNotify="canDeny">
        <description>
          The total number of outbound packets which were chosen to be
          discarded even though no errors had been detected to prevent their
          being transmitted. One possible reason for discarding such a packet
          could be to free up buffer space.
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
      <parameter name="DiscardPacketsReceived" access="readOnly"
          activeNotify="canDeny">
        <description>
          The total number of inbound packets which were chosen to be discarded
          even though no errors had been detected to prevent their being
          delivered. One possible reason for discarding such a packet could be
          to free up buffer space.
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
      <parameter name="MulticastPacketsSent" access="readOnly"
          activeNotify="canDeny">
        <description>
          The total number of packets that higher-level protocols requested for
          transmission and which were addressed to a multicast address at this
          layer, including those that were discarded or not sent.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="MulticastPacketsReceived" access="readOnly"
          activeNotify="canDeny">
        <description>
          The total number of received packets, delivered by this layer to a
          higher layer, which were addressed to a multicast address at this
          layer.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="BroadcastPacketsSent" access="readOnly">
        <description>
          The total number of packets that higher-level protocols requested for
          transmission and which were addressed to a broadcast address at this
          layer, including those that were discarded or not sent. Note that
          IPv6 does not define broadcast addresses, so IPv6 packets will never
          cause this counter to increment.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="BroadcastPacketsReceived" access="readOnly">
        <description>
          The total number of received packets, delivered by this layer to a
          higher layer, which were addressed to a broadcast address at this
          layer. Note that IPv6 does not define broadcast addresses, so IPv6
          packets will never cause this counter to increment.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
      <parameter name="UnknownProtoPacketsReceived" access="readOnly"
          activeNotify="canDeny">
        <description>
          The total number of packets received via the interface which were
          discarded because of an unknown or unsupported protocol.
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
    </object>
    <profile name="Logical:1" version="2.16">
      <object ref="Device.Logical." requirement="present">
        <parameter ref="InterfaceNumberOfEntries" requirement="readOnly"/>
      </object>
      <object ref="Device.Logical.Interface.{i}." requirement="present">
        <parameter ref="Enable" requirement="readWrite"/>
        <parameter ref="Status" requirement="readOnly"/>
        <parameter ref="Alias" requirement="writeOnceReadOnly"/>
        <parameter ref="Name" requirement="readOnly"/>
        <parameter ref="LastChange" requirement="readOnly"/>
        <parameter ref="LowerLayers" requirement="readWrite"/>
      </object>
      <object ref="Device.Logical.Interface.{i}.Stats." requirement="present">
        <parameter ref="BytesSent" requirement="readOnly"/>
        <parameter ref="BytesReceived" requirement="readOnly"/>
        <parameter ref="PacketsSent" requirement="readOnly"/>
        <parameter ref="PacketsReceived" requirement="readOnly"/>
        <parameter ref="ErrorsSent" requirement="readOnly"/>
        <parameter ref="ErrorsReceived" requirement="readOnly"/>
      </object>
    </profile>
  </component>

  <model name="Logical:2.18">
    <component ref="Root"/>
    <component ref="Logical"/>
  </model>
</dm:document>
