<?xml version="1.0" encoding="US-ASCII"?>
<!-- This is built from a template for a generic Internet Draft. Suggestions for
     improvement welcome - write to Brian Carpenter, brian.e.carpenter @ gmail.com 
     This can be converted using the Web service at http://xml.resource.org/ -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<!-- You want a table of contents -->
<!-- Use symbolic labels for references -->
<!-- This sorts the references -->
<!-- Change to "yes" if someone has disclosed IPR for the draft -->
<!-- This defines the specific filename and version number of your draft (and inserts the appropriate IETF boilerplate -->
<?rfc sortrefs="yes"?>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc topblock="yes"?>
<?rfc comments="no"?>
<rfc category="std" docName="draft-wzwb-ivy-network-inventory-topology-00"
     ipr="trust200902">
  <front>
    <title abbrev="Network Inventory Topology">A Network Inventory Topology
    Model</title>

    <author fullname="Bo Wu" initials="B." surname="Wu">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <city>Nanjing</city>

          <region>Jiangsu</region>

          <code>210012</code>

          <country>China</country>
        </postal>

        <email>lana.wubo@huawei.com</email>
      </address>
    </author>

    <author fullname="Cheng Zhou" initials="C." surname="Zhou">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <code>100053</code>

          <country>China</country>
        </postal>

        <email>zhouchengyjy@chinamobile.com</email>
      </address>
    </author>

    <author fullname="Qin Wu" initials="Q." surname="Wu">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <city>Nanjing</city>

          <region>Jiangsu</region>

          <code>210012</code>

          <country>China</country>
        </postal>

        <email>bill.wu@huawei.com</email>
      </address>
    </author>

    <author fullname="Mohamed Boucadair" initials="M." surname="Boucadair">
      <organization>Orange</organization>

      <address>
        <postal>
          <street>Rennes 35000</street>

          <country>France</country>
        </postal>

        <email>mohamed.boucadair@orange.com</email>
      </address>
    </author>

    <!---->

    <date day="" month="" year="2023"/>

    <area>OPS Area</area>

    <workgroup>IVY</workgroup>

    <workgroup/>

    <workgroup/>

    <keyword>Network Inventory Topology</keyword>

    <abstract>
      <t>This document defines a YANG model for network inventory topology to
      correlate the network inventory with the general topology to form a base
      underlay network, which can facilitate the mapping and correlation of
      the layer (e.g. Layer 2, Layer3) topology information above to the
      inventory resource of the underlay network for agile service
      provisioning and network maintenance analysis.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>The Network Inventory supports the inventory management of all the
      network devices, hardware components, firmware components, and software
      components on the a managed network domain. Examples of inventory
      hardware components could be rack, shelf, slot, board and physical port.
      Examples of inventory software components could be platform operating
      system (OS), software-patch, bios, and boot-loader.</t>

      <t>This document extends the RFC 8345 network topology model for network
      inventory references, which facilitates the correlation with existing
      network and topology models, such as SAP <xref target="RFC9408"/>, L2
      topology <xref target="RFC8944"/>, and L3 topology <xref
      target="RFC8346"/>, to support agile service provisioning and network
      maintenance.</t>

      <t>In addition, the network inventory topology can also provide anchor
      points to mount specific device configuration and state information,
      e.g. QoS policies, ACL policies, to support configuration verification
      of cross-domain policies.</t>
    </section>

    <section title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
      "OPTIONAL" in this document are to be interpreted as described in BCP 14
      <xref target="RFC2119"/><xref target="RFC8174"/> when, and only when,
      they appear in all capitals, as shown here.</t>
    </section>

    <section title="Sample Use Cases">
      <section title="Determin Available Resource of Service Attachment Points (SAPs)">
        <t>The inventory topology model can be used as a base to correlate
        underlay information, such as physical port components. The figure
        belows gives an example of the usage.</t>

        <t>During service provisioning, to check available physical port
        resources, the Service Attachment Points (SAPs) information can be
        associated with the underlay inventory information and interface
        information associated with the inventory topology, e.g.
        "parent-termination-point" of SAP Model can be associated with the
        "port-component-ref" and "interface-name" of the inventory model,
        which can be used to check the availability and capacity of physical
        ports.</t>

        <t><figure title="An Example Usage of Network Inventory Topology">
            <artwork><![CDATA[                     +-----------------+
                     |     Customer    |
                     +--------+--------+
     Customer Service Models  |
        (e.g., L3SM, L2SM)    |
                     +--------+--------+
                     |    Service      |
                     |  Orchestration  |
                     +------+---+------+
                            |   |
          SAP Network Model |   | Inventory Topology Model
                     +------+---+------+
                     |     Network     |
                     |   Controller    |
                     +--------+--------+
                              |
        +---------------------+---------------------+
        |                  Network                  |
        +-------------------------------------------+

]]></artwork>
          </figure></t>
      </section>

      <section title="The Example Digital Twin Network">
        <t><xref target="I-D.irtf-nmrg-network-digital-twin-arch"/> defines
        "digital twin network" as a virtual representation of the physical
        network. Such virtual representation of the network is meant to be
        used to analyze, diagnose, emulate, and then manage the physical
        network based on data, models, and interfaces.</t>

        <t>The management system can use digital twin technology to build
        visual multi-layer topology maps for networks and endpoints with
        relationship types and dependencies, and identify potential impacts on
        configuration management information from incidents, problems, and
        changes.</t>

        <t>The inventory model can, for example, be used to emulate several
        what-if scenario such as the impact of EOL or depletion of a hardware
        component on the network resilience and service availability.</t>
      </section>
    </section>

    <section title="Model Overview">
      <t>The following tree diagram <xref target="RFC8340"/> provides an
      overview of the data model for "ietf-network-inventory-topology"
      module.</t>

      <figure>
        <artwork><![CDATA[module: ietf-network-inventory-topology
  augment /nw:networks/nw:network/nw:network-types:
    +--rw network-inventory!

  augment /nw:networks/nw:network/nw:node:
    +--rw name?                            string
    +--ro node-type?                       identityref
    +--ro network-element-inventory-ref*   -> /nwi:network-elements/network-element/name
    +--rw system-mount-point
    +--ro oper-state?                      oper-state

  augment /nw:networks/nw:network/nt:link:
    +--ro link-name?          string
    +--ro cable-ref?          -> /nwi:cables/cable/name
    +--ro link-description?   string
    +--ro link-type?          string
    +--ro oper-state?         oper-state

  augment /nw:networks/nw:network/nw:node/nt:termination-point:
    +--ro tp-name?                        string
    +--ro tp-description?                 string
    +--ro tp-type?                        identityref
    +--ro port-component-inventory-ref?   -> /nwi:network-elements/network-element/components/component/name
    +--rw interface-name?                 string
    +--rw system-mount-point
    +--ro oper-state?                     oper-state
]]></artwork>
      </figure>
    </section>

    <section title="YANG Data model for Network Inventory Topology">
      <t>The "ietf-network-inventory-topology" module uses types defined in
      <xref target="RFC8345"/>.</t>

      <figure>
        <artwork><![CDATA[<CODE BEGINS> file="ietf-network-inventory-topology@2023-10-18.yang"
module ietf-network-inventory-topology {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-network-inventory-topology";
  prefix nwit;

  import ietf-network {
    prefix nw;
    reference
      "RFC 8345: A YANG Data Model for Network Topologies";
  }
  import ietf-network-topology {
    prefix nt;
    reference
      "RFC 8345: A YANG Data Model for Network Topologies";
  }

  organization
    "IETF Network Inventory YANG (ivy) Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/ivy>
     WG List:  <mailto:inventory-yang@ietf.org>

     Editor: Bo Wu
          <lana.wubo@huawei.com>
     Editor: Cheng Zhou
          <zhouchengyjy@chinamobile.com>
     Editor: Qin Wu
          <bill.wu@huawei.com>
     Editor: Mohamed Boucadair
          <mohamed.boucadair@orange.com>";
  description
    "This YANG module defines XXX.

     Copyright (c) 2023 IETF Trust and the persons identified
     as authors of the code. All rights reserved.

     Redistribution and use in source and binary forms, with
     or without modification, is permitted pursuant to, and
     subject to the license terms contained in, the Revised
     BSD License set forth in Section 4.c of the IETF Trust's
     Legal Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC
     itself for full legal notices.";

  revision 2023-10-18 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: A YANG Data Model for Network Inventory Topology";
  }

  identity node-type {
    description
      "Base identity for node device type.";
  }

  identity switch {
    base node-type;
    description
      "Identity for switch device.";
  }

  identity router {
    base node-type;
    description
      "Identity for router device.";
  }

  identity firewall {
    base node-type;
    description
      "Identity for Firewall device.";
  }

  identity access-controller {
    base node-type;
    description
      "Identity for WIFI access controller device.";
  }

  identity access-point {
    base node-type;
    description
      "Identity for WIFI access point device.";
  }

  identity sdn-controller {
    base node-type;
    description
      "Identity for controller.";
  }

  identity server {
    base node-type;
    description
      "Identity for computing server device.";
  }

  identity vm {
    base node-type;
    description
      "Identity for VM node.";
  }

  identity camera {
    base node-type;
    description
      "Identity for camera device.";
  }

  identity printer {
    base node-type;
    description
      "Identity for camera device.";
  }

  identity cell-phone {
    base node-type;
    description
      "Identity for mobile phone.";
  }

  identity port-type {
    description
      "Base identity for device port type.";
  }

  typedef oper-state {
    type enumeration {
      enum unknown {
        value 1;
        description
          "The resource is unable to report its operational
           state.";
      }
      enum disabled {
        value 2;
        description
          "The resource is totally inoperable.";
      }
      enum enabled {
        value 3;
        description
          "The resource is partially or fully operable.";
      }
      enum testing {
        value 4;
        description
          "The resource is currently being tested and cannot
           therefore report whether or not it is operational.";
      }
    }
    description
      "Represents the possible values of operational states.";
    reference
      "RFC 4268: Entity State MIB - EntityOperState";
  }

  /* Groupings */

  grouping inventory-network-type {
    description
      "Indicates the topology type to be inventory.";
    container network-inventory {
      presence "Indicates Network Inventory.";
      description
        "The presence of the container node indicates
         Network Inventory.";
    }
  }

  grouping system-mount-point {
    container system-mount-point {
      description
        "Container for system configuration or state mount-point.";
    }
  }

  grouping inventory-node-attributes {
    description
      "Augment used to define attach the node configuration";
    leaf name {
      type string;
      description
        "The name of the node.";
    }
    leaf node-type {
      type identityref {
        base node-type;
      }
      config false;
      description
        "Node type.";
    }
    leaf-list network-element-inventory-ref {
      type leafref {
        path "/nwi:network-elements"
           + "/nwi:network-element/nwi:name";
      }
      config false;
      description
        "The reference of the Network Elements (NEs) from which this
         node is abstracted. For example, in the case of cluster device,
         one node can abstract multiple NEs.";
    }
    uses system-mount-point;
    leaf oper-state {
      type oper-state;
      config false;
      description
        "The operational state for this component.
         Note that this node does not follow the administrative
         state.  An administrative state of 'down' does not
         predict an operational state of 'disabled'.
         Note that some implementations may not be able to
         accurately report oper-state while the admin-state node
         has a value other than 'unlocked'.  In these cases, this
         node MUST have a value of 'unknown'.";
      reference
        "RFC 4268: Entity State MIB - entStateOper";
    }
  }

  grouping inventory-termination-point-attributes {
    description
      "Augment used to define attach the termination point
       attributes.";
    leaf tp-name {
      type string;
      config false;
      description
        "The name of the interface.";
    }
    leaf tp-description {
      type string;
      config false;
      description
        "A textual description of the interface.";
    }
    leaf tp-type {
      type identityref {
        base port-type;
      }
      config false;
      description
        "The port type of the interface, e.g. console port";
    }
    leaf port-component-inventory-ref {
      type leafref {
        path "/nwi:network-elements/nwi:network-element/"
           + "nwi:components/nwi:component/nwi:name";
      }
      config false;
      description
        "The reference of the port component from which this
         termination point is abstracted.";
    }
    leaf interface-name {
      type string;
      description
        "Name of the interface.  The name can (but does not
         have to) correspond to an interface reference of a
         containing node's interface, i.e., the path name of a
         corresponding interface data node on the containing
         node is reminiscent of data type interface-ref defined
         in RFC 8343.  It should be noted that data type
         interface-ref of RFC 8343 cannot be used directly,
         as this data type is used to reference an interface
         in a datastore of a single node in the network, not
         to uniquely reference interfaces across a network.";
    }
    uses system-mount-point;
    leaf oper-state {
      type oper-state;
      config false;
      description
        "The operational state for this component.
         Note that this node does not follow the administrative
         state.  An administrative state of 'down' does not
         predict an operational state of 'disabled'.
         Note that some implementations may not be able to
         accurately report oper-state while the admin-state node
         has a value other than 'unlocked'.  In these cases, this
         node MUST have a value of 'unknown'.";
      reference
        "RFC 4268: Entity State MIB - entStateOper";
    }
  }

  grouping inventory-link-attributes {
    description
      "Augment used to define attach the termination point
       attributes.";
    leaf link-name {
      type string;
      config false;
      description
        "The name of the link.";
    }
    leaf cable-ref {
      type leafref {
        path "/nwi:cables/nwi:cable/nwi:name";
      }
      config false;
      description
        "The reference of the cable inventory information from which
         this link is abstracted.";
    }
    leaf link-description {
      type string;
      config false;
      description
        "A textual description of the interface.";
    }
    leaf link-type {
      type string;
      config false;
      description
        "The type of the link.";
    }
    leaf oper-state {
      type oper-state;
      config false;
      description
        "The operational state for this link.";
    }
  }

  /* Main blocks */

  augment "/nw:networks/nw:network/nw:network-types" {
    description
      "Introduces new network type for network inventory.";
    uses inventory-network-type;
  }

  augment "/nw:networks/nw:network/nw:node" {
    when '/nw:networks/nw:network/nw:network-types/
   nwit:network-inventory' {
      description
        "Augmentation parameters apply only for network inventory.";
    }
    description
      "Configuration parameters for inventory at the node
       level.";
    uses inventory-node-attributes;
  }

  augment "/nw:networks/nw:network/nt:link" {
    when '/nw:networks/nw:network/nw:network-types/
     nwit:network-inventory' {
      description
        "Augmentation parameters apply only for network
         inventory.";
    }
    description
      "Augments inventory topology link information.";
    uses inventory-link-attributes;
  }

  augment
    "/nw:networks/nw:network/nw:node/nt:termination-point" {
      when '/nw:networks/nw:network/nw:network-types/
     nwit:network-inventory' {
        description
          "Augmentation parameters apply only for network
           inventory.";
      }
      description
        "Augments inventory termination point information.";
      uses inventory-termination-point-attributes;
  }
}


<CODE ENDS>]]></artwork>
      </figure>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>The YANG module specified in this document defines a data schema
      designed to be accessed through network management protocols such as
      NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer is the
      secure transport layer, and the required secure transport is Secure
      Shell (SSH) [RFC6242]. The lowest RESTCONF layer is HTTPS, and the
      required secure transport is TLS [RFC8446].</t>

      <t>The Network Configuration Access Control Model (NACM) [RFC8341]
      provides a means of restricting access to specific NETCONF or RESTCONF
      users to a preconfigured subset of all available NETCONF or RESTCONF
      protocol operations and contents. Thus, NACM SHOULD be used to restrict
      the NSF registration from unauthorized users.</t>

      <t>There are a number of data nodes defined in this YANG module that are
      writable, creatable, and deletable (i.e., config true, which is the
      default). These data nodes may be considered sensitive or vulnerable in
      some network environments. Write operations to these data nodes could
      have a negative effect on network and security operations.</t>

      <t>Some of the readable data nodes in this YANG module may be considered
      sensitive or vulnerable in some network environments. It is thus
      important to control read access (e.g., via get, get-config, or
      notification) to these data nodes. These are the subtrees and data nodes
      and their sensitivity/vulnerability:</t>

      <t>&lt;&lt;&lt;to be completed&gt;&gt;&gt;</t>
    </section>

    <section title="Privacy Considerations">
      <t>The model includes sensitive PII data. More to be discussed:<list
          style="symbols">
          <t>Data related to BYOD devices</t>
        </list></t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document registers a URI in the "IETF XML Registry" <xref
      target="RFC3688"/>. Following the format in <xref target="RFC3688"/>,
      the following registration has been made.</t>

      <figure>
        <artwork><![CDATA[     URI: urn:ietf:params:xml:ns:yang:ietf-network-inventory-topology
     Registrant Contact: The IESG.
     XML: N/A, the requested URI is an XML namespace.]]></artwork>
      </figure>

      <t>This document registers a YANG module in the "YANG Module Names"
      registry<xref target="RFC7950"/> .</t>

      <figure>
        <artwork><![CDATA[     name:         ietf-network-inventory-topology
     namespace:    urn:ietf:params:xml:ns:yang:ietf-network-inventory-topology
     prefix:       nwit
     maintained by IANA:
     reference:    RFC xxxx
]]></artwork>
      </figure>
    </section>

    <section title="Acknowledgements">
      <t>TBD</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

      <?rfc include='reference.RFC.3688'?>

      <?rfc include='reference.RFC.6242'?>

      <?rfc include='reference.RFC.7950'?>

      <?rfc include='reference.RFC.8040'?>

      <?rfc include='reference.RFC.8446'?>

      <?rfc include='reference.RFC.8341'?>

      <?rfc include="reference.RFC.8174"?>

      <?rfc include="reference.RFC.6241"?>

      <?rfc include="reference.RFC.8345"?>

      <?rfc include="reference.RFC.8348"?>

      <?rfc include="reference.RFC.9179"?>

      <?rfc include="reference.RFC.6991"?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.I-D.ietf-opsawg-sap'?>

      <?rfc include="reference.RFC.8944"?>

      <?rfc include="reference.RFC.9408"?>

      <?rfc include="reference.RFC.8346"?>

      <?rfc include="reference.RFC.8340"?>

      <?rfc include='reference.I-D.irtf-nmrg-network-digital-twin-arch'?>
    </references>

    <section title="Network Policy Management in Enterprise Network">
      <t>Enterprise networks are becoming heterogenous and supporting a
      variety of device types, such as BYOD vs. enterprise-supplied devices,
      Internet of things (IoT) devices, IP phones, printers, IP cameras), OT
      (Operation Technology) devices (e.g., sensors), etc. Also, these
      networks are designed to support both localized applications and
      cloud-based applications (e.g., public cloud computing, storage, etc.),
      or hybrid applications. Also, means to access network resources are not
      anymore from within specific sites, but access can be granted from
      anywhere. Dedicated gateways and authorization procedures are being
      generalized.</t>

      <t>This trend is observed for the medical, power, manufacturing, or
      other infrastructure industries. These networks host a large number of
      multi-vendor IoT or OT devices, with frequent additions and changes.
      These complex environments often expose unknown safety and reliability
      blind spots.</t>

      <t>The endpoints connected to an Enterprise network lack unified
      modelling and lifecycle management, and different services are modelled,
      collected, processed, and stored separately. The same category of
      network device and network endpoints may be (repeatedly) discovered,
      processed, and stored. Therefore, the inventory is difficult to manage
      when they are tracked in different places. Maintaining a centralized and
      up-to-date inventory is a technical enabler in order to implement a
      coherent control strategy for all endpoint types connected to an
      Enterprise network.</t>

      <t><xref target="orchestration"/> shows an example of an enterprise
      network consisting of two network domains: one campus network domain and
      one cloud network domain. The inventory data in the network can include
      network infrastructure devices (such as routers, switchs, security
      devices) and network endpoints (such as IoT/OT devices, servers, laptop,
      mobile devices). The management systems or network controllers in
      different domains can automatically collect or discover the inventory by
      multiple approaches.</t>

      <figure anchor="orchestration"
              title="An Example of Enterprise Network Inventory Management">
        <artwork><![CDATA[            +-------------------------------------+
            | Service/network   Orchestration     |
            +-------------------------------------+
                |                               |
                | Network Inventory Model       | 
                | Network Inventory Topology Model
                |                               |
        +----------------+              +----------------+
        | Campus manager |              | SD-WAN manager |
        +----------------+              +-------+--------+
                |                               |
                |                               |
                |                               |
  +-------------------------+            +------+--------------------+
  |     Campus Domain #1    |            |     Cloud network         |
  |                         |            |                           |
  |-------+  +-----------+  |            | +-----------+   +-------+ |
  |+IT/OTs+- +  Router   +--+---------   +-+vRouter    +---+Service| |
  |-------+  +-----------+  |            | ------------+   +-------+ |
  |                         |            |                           |
  |Site A                   |            |             Cloud Site B  |
  +-------------------------+            +---------------------------+
]]></artwork>
      </figure>

      <t>With the inventory data collected from the underlying network, the
      network orchestration system can centrally manage security and network
      policies related to network endpoints.</t>
    </section>
  </back>
</rfc>
