<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-wd-teas-nrp-yang-00" ipr="trust200902">
  <front>
    <title abbrev="NRP YANG">A YANG Data Model for Network Resource Partition
    (NRP)</title>

    <author fullname="Bo Wu" initials="B." surname="Wu">
      <organization>Huawei Technologies</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="Dhruv Dhody" initials="D." surname="Dhody">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>Divyashree Techno Park</street>

          <city>Bangalore</city>

          <region>Karnataka</region>

          <code>560066</code>

          <country>India</country>
        </postal>

        <email>dhruv.ietf@gmail.com</email>
      </address>
    </author>

    <author fullname="Ying Cheng" initials="Y." surname="Cheng">
      <organization>China Unicom</organization>

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <region/>

          <code/>

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

        <email>chengying10@chinaunicom.cn</email>
      </address>
    </author>

    <date year="2022"/>

    <area>Routing Area</area>

    <abstract>
      <t>This document defines a YANG data model for managing Network Resource
      Partition (NRP) topologies and associated resource allocation. The model
      can be used for the realization of IETF network slice services.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t><xref target="I-D.ietf-teas-ietf-network-slices"/> defines IETF
      network slice services that provide connectivity coupled with network
      resources commitment between a number of endpoints over a shared network
      infrastructure and, for scalability concerns, defines network resource
      partition (NRP) to host one or a group of network slice services
      according to characteristics including SLOs and SLEs. <xref
      target="I-D.dong-teas-nrp-scalability"/> analyzes the scalability issues
      of network slice services in detail and suggests candidate technologies
      of control and forwarding planes of the NRP.</t>

      <t>This document defines a YANG model of NRP that the IETF NSC (Network
      Slice controller) can use to manage NRP instances to realize the network
      slicing services. According to the YANG model classification of <xref
      target="RFC8309"/>, the NRP model is a network configuration model.</t>
    </section>

    <section title="Terminology">
      <t>The following terms are defined in <xref target="RFC6241"/> and are
      used in this specification: <list style="symbols">
          <t>configuration data</t>

          <t>state data</t>
        </list></t>

      <t>The following terms are defined in <xref target="RFC7950"/> and are
      used in this specification: <list style="symbols">
          <t>augment</t>

          <t>data model</t>

          <t>data node</t>
        </list>The terminology for describing YANG data models is found in
      <xref target="RFC7950"/>.</t>

      <section anchor="tree-diagrams" title="Tree Diagrams">
        <t>The tree diagram used in this document follows the notation defined
        in <xref target="RFC8340"/>.</t>
      </section>
    </section>

    <section title="NRP Modelling Consideration">
      <t>As specified in <xref target="I-D.ietf-teas-ietf-network-slices"/>,
      an NRP is a subset of dedicated or shared nodes and links in a network,
      and includes associated control plane and forwarding plane technologies
      so that the traffic received from NRP edge nodes that is characterized
      to match the NRP traffic classification rule is constrained to the NRP
      exclusive topology and resource allocation. The NRP allows network
      operators to manage the resources of IETF network slices which are used
      to provide network slice service traffic with specific SLOs and
      SLEs.</t>

      <t>An NRP is a subset of resources allocated from a physical network or
      logical network. Depending on the SLO and SLE requirements of the
      slicing service and also the available resources of the operator's
      network, there are several options of creating an NRP. One option is
      that each physical link is allocated to only one specific NRP, and
      different NRPs do not share any physical link. One more typical option
      is that multiple NRPs share the same physical links, and each NRP is
      built with virtual links with a certain subset of the bandwidth
      available on the physical links to provide network resource
      isolation.</t>

      <t>To constrain the traffic that matches NRP traffic classification to
      be forwarded based on the NRP topology and resources, an NRP also
      includes the control and forwarding plane functions. As defined in <xref
      target="I-D.dong-teas-nrp-scalability"/>, the draft discusses NRP
      control plane and data plane requirements in different provisioning
      scenarios, and describes that the NRP control plane is used to exchange
      network resource attributes and associated logical topology information
      between nodes of the NRP so that NRP-specific routing and forwarding
      tables could be generated. For the NRP control plane, distributed
      control plane mechanism, such as Multi-topology, Flex-Algo or
      centralized SDN or hybrid combination could be defined. To help with
      forwarding entries, several data-plane encapsulation options are also
      discussed to carry NRP information in the NRP traffic packets. The
      example NRP data plane identifier could be the IPv6 addresses or the
      MPLS forwarding labels or dedicated NRP data-plane identifiers.</t>

      <t>An example of NRP instances and a physical network is illustrated in
      <xref target="exp"/>. In the example, each NRP instance has a customized
      network topology comprised of a set of links and nodes in the physical
      network. In control plane, each NRP could be associated with a
      multi-topology or a Flex-Algo. And it also has its own forwarding plane
      resources and identifiers which provide NRP-specific packet
      forwarding.</t>

      <figure anchor="exp" title="An NRP Example">
        <artwork><![CDATA[            ++++   ++++   ++++
            +--+===+--+===+--+
            +--+===+--+===+--+
            ++++   +++\\  ++++
             ||     || \\  ||             Physical
             ||     ||  \\ ||             Network
     ++++   ++++   ++++  \\+++   ++++
     +  +===+--+===+--+===+--+===+  +
     +  +===+--+===+--+===+--+===+  +
     ++++   ++++   ++++   ++++   ++++
      PE1                         PE2
                      |
                     \|/

             o----o-----o
            /          /              NRP-1
     o-----o-----o----o----o


             o----o
            /    / \                  NRP-2
     o-----o----o---o------o

                                       ...

                  o----o
                 /    /               NPR-n
     o-----o----o----o-----o

        o   is a virtual node
        --- is a virtual link]]></artwork>
      </figure>

      <t/>

      <t><xref target="I-D.ietf-teas-ietf-network-slices"/> also describes the
      management of the NRP. After an NRP created, the NRP may need to be
      refined and modified as the network status and slice services change,
      and could be extended if necessary to meet the customers' demands. In
      addition to configuration management, the NRP should also provide
      detailed monitoring information about underlying resources to further
      provide monitoring for the hosted slice services.</t>

      <section title="NRP Model Usage example">
        <t>One major application of network slices is 5G services. <xref
        target="Usecase"/> shows the use of the NRP model to realize the IETF
        Network Slice for the 5G use case, based on the reference framework
        defined in <xref target="I-D.ietf-teas-ietf-network-slices"/>. The
        figure shows that the NSC uses the L3VPN network model <xref
        target="I-D.ietf-opsawg-l3sm-l3nm"/> to map to an IETF Network Slice
        service and uses the NRP model to map VPN traffic to underlying
        network resources, so that the SLO and SLE required by the IETF
        network slice service are ensured when the VPN service traverses the
        underlying network.</t>

        <t><figure anchor="Usecase" title="Reference Module Use Case">
            <artwork><![CDATA[       +------------------------------------------+
       |                 Customer                 |
       |                                          |
       +------------------------------------------+
                            A
                            | Network slice service interface
                            V
       +------------------------------------------+
       |    IETF Network Slice Controller (NSC)   |
       +------------------------------------------+
                            A
               L3NM model   | NSC SBI  NRP model
                            V          NRP as VPN underlay
       +------------------------------------------+
       |           Network Controller(s)          |
       +------------------------------------------+
                            A
                            |    Device model    
                            V       
    +------------------------------------------------+
                          Network
]]></artwork>
          </figure></t>

        <t>In the process of realizing an IETF network slice service, the NSC
        can use a static NRP instance or dynamically create one as one or a
        group of VPNs underlay construct. Compared with existing VPN
        underlying built with full mesh tunneling mechanisms, the NRP could
        provide resource isolation, topology constraints, and simplified
        configuration. Additionally, specific service flows of a VPN can be
        further optimized using SR policies defined in <xref
        target="I-D.dong-idr-sr-policy-vtn"/>.</t>
      </section>

      <section title="NRP Modeling Design">
        <t>An NRP is modeled as network topology defined in <xref
        target="RFC8345"/> with augmentations. A new network type "nrp" is
        defined. A network topology data instance containing the nrp network
        type, indicates an NRP instance.</t>

        <t>As discussed in <xref target="I-D.dong-teas-nrp-scalability"/>, an
        NRP could have multiple control plane implementation options. For a
        better network scalability, an NRP does not require an independent
        Layer 3 topology, that is, multiple NRPs can share a same Layer 3
        topology or TE topology. Thus, an NRP can use a predefined basic TE
        topology by referring to the TE network instance or a predefined basic
        Layer3 TE topology by referring to the network instance with both TE
        and Layer3 type enabled or other topology combination. The <xref
        target="ref"/> shows the example references between this module and
        other YANG modules.</t>

        <t><figure anchor="ref" title="Topology References">
            <artwork><![CDATA[                                        +--------------------------+
                                        |  ietf-te-topology:       |
                                        |+------------------------+|
                                        || ietf-network-topology: ||
                                    +-->||   network-id (key)     ||
 +-------------------------------+  |   ||   network-types: {     ||
 |   ietf-nrp:                   |  |   ||     te-topology        ||
 | +---------------------------+ |  |   ||   }                    ||
 | | ietf-network-topology:    | |  |   ||   <other attributes>   ||
 | |   network-id (key)        | |  |   |+------------------------+|
 | |   network-types: {        | |  |   |    <TE attributes>       |
 | |     nrp:                  | |--+   +--------------------------+
 | |   }                       | |  |
 | |  <other attributes>       | |  |   +-----------------------------+
 | +---------------------------+ |  |   |  ietf-l3-te-topology:       |
 |    network-ref                |  |   |+---------------------------+|
 |                               |  |   || ietf-network-topology:    ||
 +-------------------------------+  |   ||   network-id (key)        ||
                                    |   ||   network-types: {        ||
                                    +-->||     l3-unicast-topology   ||
                                        ||     te-topology           ||
                                        ||   }                       ||
                                        ||   <other attributes>      ||
                                        |+---------------------------+|
                                        |    <L3 unicast attributes>  |
                                        |    <TE attributes>          |
                                        +-----------------------------+
]]></artwork>
          </figure></t>

        <t>But in some situations, an NRP may need its own Layer 3 topology or
        Traffic Engineering (TE) topology to support route forwarding or TE
        forwarding capability. Inheriting the extensibility from <xref
        target="RFC8345"/>, an NRP can have several types of networks
        simultaneously. The Layer 3 Topologies model defined in <xref
        target="RFC8346"/> can be used to enable an NRP unicast capable. And
        the TE Topology model defined in <xref target="RFC8795"/> can be used
        to make an NRP TE capable. The <xref target="overall"/> shows the
        relationship between this module and other YANG modules.<figure
            anchor="overall" title="NRP Model Relationship">
            <artwork><![CDATA[               +-----------------------+
               |Network Topology Model |
               |       RFC8345         |
               +-----------------------+
                      |
        +-------------+-------------+-------------+
        |             |             |             |
        V             V             V             V
   ............ +----------+   ............  ............
   :   L3     : |  Network |   :    TE    :  :    L2    :
   :Topology  : | Resource |   : Topology :  : Topology :
   :  Model   : | Partition|   :   Model  :  :   Model  :
   :..........: |   Model  |   :..........:  :..........:
       |        +----------+
       |
       V
.................
: ospf-topology :
:...............:]]></artwork>
          </figure></t>

        <t>The container "nrp" under 'network' of <xref target="RFC8345"/>
        defines global parameters for an NRP, which defines the specific
        control plane and data plane mechanisms of an NRP. And also, the
        traffic steering policy of the NRP may include a dynamic color based
        policies or an ACL-based static ones.</t>

        <t>Each NRP instance consists of a set of nodes and a set of links.
        Each node and link have different attributes that represent the
        allocated resources or the operational status of the NRP. An NRP could
        support several resource partition methods, which are defined by
        'link-partition-type'' under an NRP link, which can further be
        supported by FlexE or independent queue techniques.</t>

        <t>There are multiple modes of NRP operations to be supported as
        follows:<list style="symbols">
            <t>NRP instantiation: Depending on the slice services types and
            also network status, there can be two types of approaches. One
            method is to create an NRP instance before the network controller
            processes the IETF network slice service request. Another one is
            that the network controller may start creating an NRP instance
            while configuring the IETF network slice service request.</t>

            <t>NRP modification: When the capacity of an existing NPR link is
            close to capacity, the bandwidth of the link could be increased.
            And when the NRP link or node resources are insufficient, new NRP
            links and nodes could be added.</t>

            <t>NRP Deletion: If the NSC determines that no slice service is
            using an NRP, the NSC can delete the NRP instance.</t>

            <t>NRP Monitoring: The NSC can use the NRP model to track and
            monitor NRP resource status and usage.</t>
          </list></t>
      </section>
    </section>

    <section title="Description of NRP YANG Module">
      <t>The description of the NRP data nodes are as follows:</t>

      <t><list style="symbols">
          <t>"nrp-id": Is an identifier that is used to uniquely identify an
          NRP instance within the network scope.</t>

          <t>NRP resources reservation: The nodes and links represent the
          network resource allocated for an NRP instance.
          'bandwidth-reservation' specifies the bandwidth allocated to an NRP
          instance, or is overridden by the configuration of the NRP link.
          'link-partition-type' specifies the resource partition types of the
          physical interfaces associated with an NRP link.</t>

          <t>NRP control plane: When an NRP shares an IGP topology or TE
          topology with other NRPs, "network-ref" or
          "te-topology-identifier&ldquo; is used to refer to the existing IGP
          network instance or TE topology instance. And an NRP can further use
          Multi-Topology Routing (MTR) or Flex-algo to refer to the IGP
          instance to generate its own NRP-specific forwarding tables.
          Multi-Topology Routing (MTR) is defined in <xref target="RFC4915"/>,
          <xref target="RFC5120"/>, and <xref
          target="I-D.ietf-lsr-isis-sr-vtn-mt"/> or Flex-algo is defined in
          <xref target="I-D.ietf-lsr-flex-algo"/>.</t>

          <t>NRP data plane: Defines the data plane mechanism and the NRP
          identifier of the network domain managed by the network controller.
          The data plane mechanism could be based on MPLS or IPv6 forwarding.
          The container "data plane" is used to specify the NRP data plane
          encapsulation types and values that are used to identify
          NRP-specific network resources. The NRP data plane identifier is
          defined in <xref target="I-D.ietf-spring-sr-for-enhanced-vpn"/>
          and<xref target="I-D.dong-6man-enhanced-vpn-vtn-id"/>.</t>

          <t>NRP steering policy: The leaf-list "color-id" is used for dynamic
          traffic steering based on SR policy of an NRP and The leaf-list
          "acl-ref" is used for common traffic steering.</t>
        </list></t>
    </section>

    <section title="NRP Yang Module Tree">
      <t><figure>
          <artwork><![CDATA[
module: ietf-nrp
  augment /nw:networks/nw:network/nw:network-types:
    +--rw nrp!
  augment /nw:networks/nw:network:
    +--rw nrp
       +--rw nrp-id?                  uint32
       +--rw nrp-name?                string
       +--rw bandwidth-reservation
       |  +--rw (bandwidth-type)?
       |     +--:(bandwidth-value)
       |     |  +--rw bandwidth-value?     uint64
       |     +--:(bandwidth-percentage)
       |        +--rw bandwidth-percent?   rt-types:percentage
       +--rw control-plane
       |  +--rw topology-ref
       |     +--rw igp-topology-ref
       |     |  +--rw network-ref?
       |     |  |       -> /nw:networks/network/network-id
       |     |  +--rw multi-topology-id?   uint32
       |     |  +--rw flex-algo-id?        uint32
       |     +--rw te-topology-identifier
       |        +--rw provider-id?   te-global-id
       |        +--rw client-id?     te-global-id
       |        +--rw topology-id?   te-topology-id
       +--rw data-plane
       |  +--rw global-resource-identifier
       |  |  +--rw nrp-dataplane-ipv6-type
       |  |  |  +--rw nrp-dp-value?   inet:ipv6-address
       |  |  +--rw nrp-dataplane-mpls-type
       |  |     +--rw nrp-dp-value?   uint32
       |  +--rw nrp-aware-dp
       |     +--rw nrp-aware-srv6-type!
       |     +--rw nrp-aware-sr-mpls-type!
       +--rw steering-policy
          +--rw color-id*   uint32
          +--rw acl-ref*    -> /acl:acls/acl/name
  augment /nw:networks/nw:network/nw:node:
    +--rw nrp
       +--rw nrp-aware-srv6
       |  +--rw nrp-dp-value?   srv6-types:srv6-sid
       +--rw nrp-aware-sr-mpls
          +--rw nrp-dp-value?   rt-types:mpls-label
  augment /nw:networks/nw:network/nt:link:
    +--rw nrp
    |  +--rw link-partition-type?     identityref
    |  +--rw bandwidth-reservation
    |  |  +--rw (bandwidth-type)?
    |  |     +--:(bandwidth-value)
    |  |     |  +--rw bandwidth-value?     uint64
    |  |     +--:(bandwidth-percentage)
    |  |        +--rw bandwidth-percent?   rt-types:percentage
    |  +--rw nrp-aware-srv6
    |  |  +--rw nrp-dp-value?   srv6-types:srv6-sid
    |  +--rw nrp-aware-sr-mpls
    |     +--rw nrp-dp-value?   rt-types:mpls-label
    +--ro statistics
       +--ro admin-status?                  te-types:te-admin-status
       +--ro oper-status?                   te-types:te-oper-status
       +--ro one-way-available-bandwidth?
       |       rt-types:bandwidth-ieee-float32
       +--ro one-way-utilized-bandwidth?
       |       rt-types:bandwidth-ieee-float32
       +--ro one-way-min-delay?             uint32
       +--ro one-way-max-delay?             uint32
       +--ro one-way-delay-variation?       uint32
       +--ro one-way-packet-loss?           decimal64

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

    <section title="NRP Yang Module">
      <t>&lt;CODE BEGINS&gt; file "ietf-nrp@2022-01-29.yang"<figure>
          <artwork><![CDATA[module ietf-nrp {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-nrp";
  prefix nrp;

  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-routing-types {
    prefix rt-types;
    reference
      "RFC 8294: Common YANG Data Types for the Routing Area";
  }
  import ietf-te-types {
    prefix te-types;
    reference
      "RFC 8776: Traffic Engineering Common YANG Types";
  }
  import ietf-te-packet-types {
    prefix te-packet-types;
    reference
      "RFC 8776: Traffic Engineering Common YANG Types";
  }
  import ietf-srv6-types {
    prefix srv6-types;
  }
  import ietf-inet-types {
    prefix inet;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-access-control-list {
    prefix acl;
    reference
      "RFC 8519: YANG Data Model for Network Access Control Lists
       (ACLs)";
  }

  organization
    "IETF TEAS Working Group";
  contact
    "
     WG Web: <http://tools.ietf.org/wg/teas/>
     WG List:<mailto:teas@ietf.org>

     Editor: Bo Wu <lana.wubo@huawei.com>
           : Dhruv Dhody <dhruv.ietf@gmail.com>";
  description
    "This YANG module defines a network data module for
     NRP(Network Resource Partition).

     Copyright (c) 2022 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 Simplified 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 2022-01-29 {
    description
      "This is the initial version of NRP YANG model.";
    reference
      "RFC XXX: A YANG Data Model for Network Resource Partition";
  }

  identity link-partition-type {
    description
      "Base identity for interface partition type.";
  }

  identity virtual-sub-interface-partition {
    base link-partition-type;
    description
      "Identity for virtual interface or sub-interface, e.g. FlexE.";
  }

  identity queue-partition {
    base link-partition-type;
    description
      "Identity for queue partition type.";
  }

  identity nrp-dataplane-type {
    description
      "Base identity for NRP data plane type.";
  }

  identity nrp-dataplane-ipv6 {
    base nrp-dataplane-type;
    description
      "Identity for NRP specific packet forwarding of IPv6.";
  }

  identity nrp-dataplane-mpls {
    base nrp-dataplane-type;
    description
      "Identity for NRP specific packet forwarding of MPLS.";
  }

  identity nrp-dataplane-sr-mpls {
    base nrp-dataplane-type;
    description
      "Identity for NRP specific packet forwarding of SR MPLS.";
  }

  identity nrp-dataplane-srv6 {
    base nrp-dataplane-type;
    description
      "Identity for NRP specific packet forwarding of SRv6.";
  }

  /*
   * Groupings
   */

  grouping nrp-bandwidth-reservation {
    description
      "Grouping for NRP bandwidth reservation.";
    container bandwidth-reservation {
      description
        "Container for NRP bandwidth reservation.";
      choice bandwidth-type {
        description
          "Choice of bandwidth reservation type.";
        case bandwidth-value {
          leaf bandwidth-value {
            type uint64;
            units "bps";
            description
              "Bandwidth allocation for the NRP as absolute value.";
          }
        }
        case bandwidth-percentage {
          leaf bandwidth-percent {
            type rt-types:percentage;
            description
              "Bandwidth allocation for the NRP as a percentage
               of a link.";
          }
        }
      }
    }
  }

  grouping nrp-control-plane-attributes {
    description
      "Grouping for NRP control plane attributes.";
    container control-plane {
      description
        "The container of NRP control plane mechanisms.";
      container topology-ref {
        description
          "Container for topology reference.";
        container igp-topology-ref {
          description
            "Container for IGP topology reference.";
          uses nw:network-ref;
          leaf multi-topology-id {
            type uint32;
            description
              "The MT-id of an NRP.";
          }
          leaf flex-algo-id {
            type uint32;
            description
              "The flex-algo-id of an NRP.";
          }
        }
        uses te-types:te-topology-identifier;
      }
    }
  }

  grouping nrp-data-plane-attributes {
    description
      "Grouping for NRP data plane attributes.";
    container data-plane {
      description
        "The data plane mechanisms of an NRP. The forwarding plane
         could be MPLS, IPv6, SRv6, or SR-MPLS.";
      container global-resource-identifier {
        description
          "The container of global NRP data-plane ID.";
        container nrp-dataplane-ipv6-type {
          description
            "The container of IPv6 based NRP data-plane identifier.";
          leaf nrp-dp-value {
            type inet:ipv6-address;
            description
              "Indicates the IPv6 NRP data-plane identifier.";
          }
        }
        container nrp-dataplane-mpls-type {
          description
            "The container of MPLS based NRP data-plane identifier.";
          leaf nrp-dp-value {
            type uint32;
            description
              "Indicates MPLS metadata values to identify MPLS NRP
               data plane identifier, e.g. Ancillary data.";
          }
        }
      }
      container nrp-aware-dp {
        description
          "The container of SR based NRP data-plane identifier.";
        container nrp-aware-srv6-type {
          presence "Enables SRv6 data plane type.";
          description
            "The container of SRv6 based NRP data-plane identifier.";
        }
        container nrp-aware-sr-mpls-type {
          presence "Enables SR MPLS data plane type.";
          description
            "The container of SR MPLS based NRP data-plane identifier.";
        }
      }
    }
  }

  grouping nrp-traffic-steering-policy {
    description
      "The grouping of the NRP traffic steering policy.";
    container steering-policy {
      description
        "The container of a policy set
         matching an NRP traffic classifier.";
      leaf-list color-id {
        type uint32;
        description
          "A list of color ID for NRP traffic steering based on
           SR policy.";
      }
      leaf-list acl-ref {
        type leafref {
          path "/acl:acls/acl:acl/acl:name";
        }
        description
          "A list of ACL for NRP traffic classification.";
      }
    }
  }

  grouping nrp-aware-id {
    description
      "The grouping of NRP aware SR ID.";
    container nrp-aware-srv6 {
      description
        "The container of SRv6 based NRP data plane identifier.";
      leaf nrp-dp-value {
        type srv6-types:srv6-sid;
        description
          "Indicates the SRv6 SID value as the NRP data plane
           identifier.";
      }
    }
    container nrp-aware-sr-mpls {
      description
        "The container of SR MPLS based NRP data plane identifier.";
      leaf nrp-dp-value {
        type rt-types:mpls-label;
        description
          "Indicates the SR MPLS ID value as the NRP data plane
           identifier.";
      }
    }
  }

  grouping nrp-topology-attributes {
    description
      "NRP global attributes.";
    container nrp {
      description
        "Containing NRP topology attributes.";
      leaf nrp-id {
        type uint32;
        description
          "NRP identifier.";
      }
      leaf nrp-name {
        type string;
        description
          "NRP Name.";
      }
      uses nrp-bandwidth-reservation;
      uses nrp-control-plane-attributes;
      uses nrp-data-plane-attributes;
      uses nrp-traffic-steering-policy;
    }
    // nrp
  }

  // nrp-node-attributes

  grouping nrp-node-attributes {
    description
      "NRP node scope attributes.";
    container nrp {
      description
        "Containing NRP attributes.";
      uses nrp-aware-id;
    }
  }

  // nrp-node-attributes

  grouping nrp-link-attributes {
    description
      "NRP link scope attributes.";
    container nrp {
      description
        "Containing NRP attributes.";
      leaf link-partition-type {
        type identityref {
          base link-partition-type;
        }
        description
          "Indicates the resource partition type of a link.";
      }
      uses nrp-bandwidth-reservation;
      uses nrp-aware-id;
    }
  }

  // nrp-statistics  

  grouping statistics-per-nrp {
    description
      "Statistics attributes per NRP.";
  }

  // nrp-node-statistics

  grouping statistics-per-node {
    description
      "Statistics attributes per NRP node.";
  }

  // one-way-performance-metrics

  grouping one-way-performance-bandwidth {
    description
      "Grouping for one-way performance bandwidth.";
    leaf one-way-available-bandwidth {
      type rt-types:bandwidth-ieee-float32;
      units "bytes per second";
      default "0x0p0";
      description
        "Available bandwidth that is defined to be NRP link
         bandwidth minus bandwidth utilization. For a
         bundled link, available bandwidth is defined to be the
         sum of the component link available bandwidths.";
    }
    leaf one-way-utilized-bandwidth {
      type rt-types:bandwidth-ieee-float32;
      units "bytes per second";
      default "0x0p0";
      description
        "Bandwidth utilization that represents the actual
         utilization of the link (i.e. as measured in the router).
         For a bundled link, bandwidth utilization is defined to
         be the sum of the component link bandwidth
         utilizations.";
    }
  }

  // nrp-link-statistics

  grouping nrp-statistics-per-link {
    description
      "Statistics attributes per NRP link.";
    container statistics {
      config false;
      description
        "Statistics for NRP link.";
      leaf admin-status {
        type te-types:te-admin-status;
        description
          "The administrative state of the link.";
      }
      leaf oper-status {
        type te-types:te-oper-status;
        description
          "The current operational state of the link.";
      }
      uses one-way-performance-bandwidth;
      uses te-packet-types:one-way-performance-metrics-packet;
    }
  }

  augment "/nw:networks/nw:network/nw:network-types" {
    description
      "Defines the NRP topology type.";
    container nrp {
      presence "Indicates NRP topology";
      description
        "The presence identifies the NRP type.";
    }
  }

  augment "/nw:networks/nw:network" {
    when 'nw:network-types/nrp:nrp' {
      description
        "Augment only for NRP topology.";
    }
    description
      "Augment NRP configuration and state.";
    uses nrp-topology-attributes;
  }

  augment "/nw:networks/nw:network/nw:node" {
    when '../nw:network-types/nrp:nrp' {
      description
        "Augment only for NRP topology.";
    }
    description
      "Augment node configuration and state.";
    uses nrp-node-attributes;
  }

  augment "/nw:networks/nw:network/nt:link" {
    when '../nw:network-types/nrp:nrp' {
      description
        "Augment only for NRP topology.";
    }
    description
      "Augment link configuration and state.";
    uses nrp-link-attributes;
    uses nrp-statistics-per-link;
  }
}


]]></artwork>
        </figure>&lt;CODE ENDS&gt;</t>
    </section>

    <section title="Security Considerations">
      <t>The YANG module defined in this document is designed to be accessed
      via network management protocols such as NETCONF <xref
      target="RFC6241"/> or RESTCONF <xref target="RFC8040"/>. The lowest
      NETCONF layer is the secure transport layer, and the
      mandatory-to-implement secure transport is Secure Shell (SSH) <xref
      target="RFC6242"/>. The lowest RESTCONF layer is HTTPS, and the
      mandatory-to-implement secure transport is TLS <xref
      target="RFC8446"/>.</t>

      <t>The NETCONF access control model <xref target="RFC8341"/> provides
      the means to restrict access for particular NETCONF or RESTCONF users to
      a preconfigured subset of all available NETCONF or RESTCONF protocol
      operations and content.</t>

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

      <t>nrp-link: A malicious client could attempt to remove a link from a
      topology, add a new link. In each case, the structure of the topology
      would be sabotaged, and this scenario could, for example, result in an
      NRP topology that is less than optimal.</t>

      <t>The entries in the nodes above include the whole network
      configurations corresponding with the NRP, and indirectly create or
      modify the PE or P device configurations. Unexpected changes to these
      entries could lead to service disruption and/or network misbehavior.</t>
    </section>

    <section 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 is requested to be made:</t>

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


]]></artwork>
      </figure>

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

      <figure>
        <artwork><![CDATA[
           Name: ietf-nrp
           Namespace: urn:ietf:params:xml:ns:yang:ietf-nrp
           Prefix: nrp
           Reference: RFC XXXX 
]]></artwork>
      </figure>
    </section>

    <section anchor="Acknowledgements" title="Contributor">
      <t><figure>
          <artwork><![CDATA[   Zhenbin Li
   Huawei

   Email: lizhenbin@huawei.com


   Jie Dong
   Huawei

   Email: jie.dong@huawei.com
]]></artwork>
        </figure></t>
    </section>
  </middle>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      <?rfc include='reference.I-D.ietf-lsr-isis-sr-vtn-mt'?>

      <?rfc include='reference.I-D.ietf-lsr-flex-algo'?>

      <?rfc include='reference.I-D.ietf-spring-sr-for-enhanced-vpn'?>

      <?rfc include='reference.I-D.dong-6man-enhanced-vpn-vtn-id'?>

      <?rfc include='reference.I-D.dong-idr-sr-policy-vtn'?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.I-D.dong-teas-nrp-scalability'?>

      <?rfc include='reference.I-D.ietf-opsawg-l3sm-l3nm'?>

      <?rfc include='reference.I-D.ietf-teas-ietf-network-slices'?>
    </references>

    <section title="An Example">
      <t>This section contains an example of an instance data tree in JSON
      encoding <xref target="RFC7951"/>. The example instantiates ietf-nrp for
      the topology that is depicted in the following diagram. There are three
      nodes, D1, D2, and D3. D1 has three termination points, 1-0-1, 1-2-1,
      and 1-3-1. D2 has three termination points as well, 2-1-1, 2-0-1, and
      2-3-1. D3 has two termination points, 3-1-1 and 3-2-1. In addition there
      are six links, two between each pair of nodes with one going in each
      direction.</t>

      <figure align="center" anchor="example-topology"
              title="An NRP Instance Example">
        <artwork align="left"><![CDATA[
   
   
             +------------+                   +------------+
             |     D1     |                   |     D2     |
            /-\          /-\                 /-\          /-\
            | | 1-0-1    | |---------------->| | 2-1-1    | |
            | |    1-2-1 | |<----------------| |    2-0-1 | |
            \-/  1-3-1   \-/                 \-/  2-3-1   \-/
             |   /----\   |                   |   /----\   |
             +---|    |---+                   +---|    |---+
                 \----/                           \----/
                  |  |                             |  |
                  |  |                             |  |      
                  |  |                             |  |
                  |  |       +------------+        |  |
                  |  |       |     D3     |        |  |
                  |  |      /-\          /-\       |  |
                  |  +----->| | 3-1-1    | |-------+  |
                  +---------| |    3-2-1 | |<---------+
                            \-/          \-/
                             |            |
                             +------------+
     ]]></artwork>
      </figure>

      <t>The corresponding NRP instance data tree is depicted below:</t>

      <figure align="center" anchor="instance-data-tree-example"
              title="Instance data tree">
        <artwork align="left"><![CDATA[{
   "ietf-network:networks":{
      "network":[
         {
            "network-types":{
               "ietf-nrp:nrp":{                 
               }
            },
            "network-id":"nrp-example",
            "ietf-nrp:nrp":{
               "nrp-id":"NRP1",
               "bandwidth-reservation":{
                  "bandwidth-value":10000
               },
               "control-plane":{
                  "topology-ref":{
                     "igp-topology-ref":{
                        " network-ref":"L3-topology",
                        " flex-algo-id":129
                     }
                  }
               },
               "data-plane":{
                  "global-resource-identifier":{
                     "nrp-dataplane-ipv6-type":{
                        " nrp-dp-value:":100
                     }
                  }
               },
               "steering-policy":{
                  "color-id":100
               }
            },
            "node":[
               {
                  "node-id":"D1",
                  "termination-point":[
                     {
                        "tp-id":"1-0-1"
                     },
                     {
                        "tp-id":"1-2-1"
                     },
                     {
                        "tp-id":"1-3-1"
                     }
                  ]
               },
               {
                  "node-id":"D2",
                  "termination-point":[
                     {
                        "tp-id":"2-0-1"
                     },
                     {
                        "tp-id":"2-1-1"
                     },
                     {
                        "tp-id":"2-3-1"
                     }
                  ]
               },
               {
                  "node-id":"D3",
                  "termination-point":[
                     {
                        
                     },
                     {
                        "tp-id":"3-2-1"
                     }
                  ]
               }
            ],
            "ietf-network-topology:link":[
               {
                  "link-id":"D1,1-2-1,D2,2-1-1",
                  "source":{
                     "source-node":"D1",
                     "source-tp":"1-2-1"
                  },
                  "destination":{
                     "dest-node":"D2",
                     "dest-tp":"2-1-1"
                  },
                  "ietf-nrp:nrp":{
                     "link-partition-type":
                      "virtual-sub-interface-partition",
                     "bandwidth-reservation":{
                        "bandwidth-value":"10000"
                     },
                     "nrp-aware-srv6":{
                        " nrp-dp-value:":101
                     }
                  }
               },
               {
                  "link-id":"D2,2-1-1,D1,1-2-1",
                  "source":{
                     "source-node":"D2",
                     "source-tp":"2-1-1"
                  },
                  "destination":{
                     "dest-node":"D1",
                     "dest-tp":"1-2-1"
                  },
                  "ietf-nrp:nrp":{
                     "link-partition-type":
                        "virtual-sub-interface-partition",
                     "bandwidth-reservation":{
                        "bandwidth-value":"10000"
                     },
                     "nrp-aware-srv6":{
                        " nrp-dp-value:":101
                     }
                  }
               },
               {
                  "link-id":"D1,1-3-1,D3,3-1-1",
                  "source":{
                     "source-node":"D1",
                     "source-tp":"1-3-1"
                  },
                  "destination":{
                     "dest-node":"D3",
                     "dest-tp":"3-1-1"
                  },
                  "ietf-nrp:nrp":{
                     "link-partition-type":
                       "virtual-sub-interface-partition",
                     "bandwidth-reservation":{
                        "bandwidth-value":"10000"
                     },
                     "nrp-aware-srv6":{
                        " nrp-dp-value:":101
                     }
                  }
               },
               {
                  "link-id":"D3,3-1-1,D1,1-3-1",
                  "source":{
                     "source-node":"D3",
                     "source-tp":"3-1-1"
                  },
                  "destination":{
                     "dest-node":"D1",
                     "dest-tp":"1-3-1"
                  },
                  "ietf-nrp:nrp":{
                     "link-partition-type":
                   "virtual-sub-interface-partition",
                     "bandwidth-reservation":{
                        "bandwidth-value":"10000"
                     },
                     "nrp-aware-srv6":{
                        " nrp-dp-value:":101
                     }
                  }
               },
               {
                  "link-id":"D2,2-3-1,D3,3-2-1",
                  "source":{
                     "source-node":"D2",
                     "source-tp":"2-3-1"
                  },
                  "destination":{
                     "dest-node":"D3",
                     "dest-tp":"3-2-1"
                  },
                  "ietf-nrp:nrp":{
                     "link-partition-type":
                      "virtual-sub-interface-partition",
                     "bandwidth-reservation":{
                        "bandwidth-value":"10000"
                     },
                     "nrp-aware-srv6":{
                        " nrp-dp-value:":101
                     }
                  }
               },
               {
                  "link-id":"D3,3-2-1,D2,2-3-1",
                  "source":{
                     "source-node":"D3",
                     "source-tp":"3-2-1"
                  },
                  "destination":{
                     "dest-node":"D2",
                     "dest-tp":"2-3-1"
                  },
                  "ietf-nrp:nrp":{
                     "link-partition-type":
                      "virtual-sub-interface-partition",
                     "bandwidth-reservation":{
                        "bandwidth-value":"10000"
                     },
                     "nrp-aware-srv6":{
                        " nrp-dp-value:":101
                     }
                  }
               }
            ]
         }
      ]
   }
}
]]></artwork>
      </figure>
    </section>
  </back>
</rfc>
