<?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-ietf-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="2024"/>

    <area>OPS Area</area>

    <workgroup>IVY</workgroup>

    <keyword>Network Inventory Topology</keyword>

    <abstract>
      <t>This document defines a YANG model for network inventory topology to
      correlate the network inventory data with the general topology model 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 data of the underlay network for agile service
      provisioning and network maintenance analysis.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t><xref target="I-D.ietf-ivy-network-inventory-yang"/> defines base
      Network Inventory (NI) model to aggregate the inventory data of the
      Network Elements (NEs) on the network, which includes NEs and their
      hardware components, firmware components, and software components.
      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 mapping, 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 topology
        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 topology 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 title="The Structure of the Network Inventory Mapping Data Model">
        <artwork><![CDATA[module: ietf-network-inventory-topology
  augment /nw:networks/nw:network/nw:network-types:
    +--rw network-inventory-mapping!
  augment /nw:networks/nw:network/nw:node:
    +--rw inventory-mapping-attributes
       +--rw node-name?            string
       +--ro ne-ref?               ne-ref
       +--rw system-mount-point
  augment /nw:networks/nw:network/nt:link:
    +--rw inventory-mapping-attributes
       +--rw link-name?    string
       +--ro cable-name?   string
       +--ro link-type?    string
  augment /nw:networks/nw:network/nw:node/nt:termination-point:
    +--rw inventory-mapping-attributes
       +--ro tp-name?              string
       +--ro port-component-ref?   leafref
       +--rw interface-name*       string
       +--rw system-mount-point
]]></artwork>
      </figure>

      <t>The module augments the original "ietf-network- topology" modules as
      follows: <list style="symbols">
          <t>A new network topology type: "network-inventory-mapping". The
          corresponding container augments the network-types of the
          "ietf-network" module.</t>

          <t>Inventory mapping attributes for nodes, links, and termination
          points: The corresponding containers augments the topology module
          with the references to the base network inventory, references to
          interface management, and system mount points .</t>
        </list>Being an independent underlaying topology, the inventory
      topology model associates inventory data with abstract topologies. It
      can be used as the "supporting-networks" of SAP, Layer 2, or Layer 3
      topologies.</t>
    </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@2024-04-29.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";
  }
  import ietf-network-inventory {
    prefix nwi;
    reference
      "RFC AAAA: A YANG Data Model for Network Inventory";
  }

  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) 2024 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 2024-04-29 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: A YANG Data Model for Network Inventory Mapping 
	             Topology";
  }

  /* Identities */
  /* Typedef */

  typedef ne-ref {
    type leafref {
      path "/nwi:network-inventory/nwi:network-elements"
         + "/nwi:network-element/nwi:ne-id";
    }
    description
      "This type is used by data models that need to reference
       Network Element.";
  }

  /* Groupings */

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

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

  grouping node-inventory-attributes {
    description
      "Network Inventory mapping node scope attributes";
    container inventory-mapping-attributes {
      description
        "The container node attributes of Network Inventory mapping.";
      leaf node-name {
        type string;
        description
          "The name of the node.";
      }
      leaf ne-ref {
        type ne-ref;
        config false;
        description
          "The reference of the Network Element (NE) from which this
           node is abstracted.";
      }
      uses system-mount-point;
    }
  }

  grouping termination-point-inventory-attributes {
    description
      "Network Inventory mapping termination point (TP) scope
       attributes";
    container inventory-mapping-attributes {
      description
        "The container TP attributes of Network Inventory mapping.";
      leaf tp-name {
        type string;
        config false;
        description
          "The name of the TP.";
      }
      leaf port-component-ref {
        type leafref {
          path
            "/nwi:network-inventory/nwi:network-elements"
          + "/nwi:network-element[nwi:ne-id=current()/../../../"
          + "inventory-mapping-attributes/ne-ref]/nwi:components"
          + "/nwi:component/nwi:component-id";
        }
        config false;
        description
          "The reference of the port component from which this
           termination point is abstracted.";
      }
      leaf-list 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;
    }
  }

  grouping link-inventory-attributes {
    description
      "Network Inventory mapping link scope attributes";
    container inventory-mapping-attributes {
      description
        "The container link attributes of network inventory mapping.";
      leaf link-name {
        type string;
        description
          "The name of the link.";
      }
      leaf cable-name {
        type string;
        config false;
        description
          "The reference of the cable inventory from which
           this link is abstracted
           Note: this will be changed based on the future inventoy
           cable model.";
      }
      leaf link-type {
        type string;
        config false;
        description
          "The type of the link.
           Note: this will be changed based on the future inventoy
           cable model.";
      }
    }
  }

  /* Main blocks */

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

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

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

  augment
    "/nw:networks/nw:network/nw:node/nt:termination-point" {
      when '/nw:networks/nw:network/nw:network-types/
     nwit:network-inventory-mapping' {
        description
          "Augmentation parameters apply only for network
           inventory.";
      }
      description
        "Augments inventory termination point information.";
      uses termination-point-inventory-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>The authors wish to thank Italo Busi, Olga Havel, Aihua Guo, Oscar
      Gonzalez de Dios, and many others for their helpful comments and
      suggestions.</t>
    </section>

    <section title="Contributors">
      <t>The following authors contributed significantly to this document:</t>

      <figure>
        <artwork><![CDATA[   Chaode Yu
   Huawei Technologies
   Email: yuchaode@huawei.com
]]></artwork>
      </figure>
    </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.I-D.ietf-ivy-network-inventory-yang'?>
    </references>

    <references title="Informative References">
      <?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="Option to correlate between Topologies and Network Inventory">
      <t>The "ietf-network-inventory-topology" provides the topology mapping
      with the network inventory by using references. This design does not
      impact the existing topology models.</t>

      <t>This appendix also introduces a YANG module that defines a simple
      topology model for network inventory reference. This module is intended
      to serve as an example that illustrates how the general topology model
      can be refined with inventory references across multiple levels of
      topology, e.g. TE topology, Layer 2 topology, Layer 3 topology, service
      attachment points (SAPs) topology.</t>

      <section title="Model Overview">
        <t><xref target="inv-ref-tree"/> below shows the tree diagram of the
        YANG data model defined in module "example-topo-inventory-ref"<figure
            anchor="inv-ref-tree"
            title="Topology with Network Inventory Reference Tree">
            <artwork><![CDATA[module: example-topology-inv-ref
  augment /nw:networks/nw:network/nw:node:
    +--ro ne-reference?   ne-ref
  augment /nw:networks/nw:network/nw:node/nt:termination-point:
    +--ro port-component-ref?   leafref]]></artwork>
          </figure></t>
      </section>

      <section title="Network Inventory Reference YANG Module">
        <t>The Topology Inventory Reference YANG module is specified below. As
        mentioned, the module is intended as an example for how the topology
        model can be extended to cover inventory references, but it is only
        for discusson. Accordingly, the module is not delimited with &lt;CODE
        BEGINS&gt; and &lt;CODE ENDS&gt; tags.</t>

        <figure>
          <artwork><![CDATA[module example-topology-inv-ref {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:example-topology-inv-ref";
  prefix nwir;

  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";
  }

  import ietf-network-inventory {
    prefix nwi;
    reference
      "RFC AAAA: A YANG Data Model for Network Inventory";
  } 


  description
    "This module is intended as an example for how the
          base topology model can be extended to cover
          inventory references.";

  /* Main blocks */

  augment "/nw:networks/nw:network/nw:node" {
    description
      "Information that allows the relationship between the node in
       the topology and the Network Element (NE) in the network
       inventory model from which the node is abstracted";
    leaf ne-ref {
      type leafref {
        path "/nwi:network-inventory/nwi:network-elements"
           + "/nwi:network-element/nwi:ne-id";
      }
      config false;
      description
        "The reference of the Network Element (NE) from which this
         node is abstracted";
    }
  }

  augment
    "/nw:networks/nw:network/nw:node/nt:termination-point" {
      description
        "Information that allows the relationship between the
         Termination Point (TP) and the port component in the network
         inventory model from which this TP is abstracted.";
      leaf port-component-ref {
        type leafref {
          path "/nwi:network-inventory/nwi:network-elements"
             + "/nwi:network-element[nwi:ne-id=current()/../../"
             + "ne-ref]/nwi:components/nwi:component"
             + "/nwi:component-id";
        }
        config false;
        description
          "The reference of the port component from which this
           Termination Point (TP) is abstracted";
      }
  }
}]]></artwork>
        </figure>
      </section>
    </section>

    <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>
