<?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-wdbsp-teas-nrp-yang-01" ipr="trust200902">
  <front>
    <title abbrev="NRP YANG">A YANG Data Model for Network Resource Partitions
    (NRPs)</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="Vishnu Pavan Beeram" initials="V.P." surname="Beeram">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>vbeeram@juniper.net</email>

        <uri/>
      </address>
    </author>

    <author fullname="Tarek Saad" initials="T." surname="Saad">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>tsaad.net@gmail.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Shaofu Peng" initials="S. " surname="Peng">
      <organization>ZTE Corporation</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>peng.shaofu@zte.com.cn</email>

        <uri/>
      </address>
    </author>

    <date year="2023"/>

    <area>Routing Area</area>

    <abstract>
      <t>This document defines a YANG data model for Network Resource
      Partitions (NRPs). The model can be used, in particular, for the
      realization of the IETF Network Slice Services.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t><xref target="I-D.ietf-teas-ietf-network-slices"/> defines a
      framework for IETF Network Slice Services, which provide connectivity
      coupled with network resources commitment between a number of Service
      Demarcation Points (SDPs) over a shared network infrastructure. The IETF
      Network Slice service is expressed in terms of one or more connectivity
      constructs, which can be of a connection type (point-to-point (P2P),
      point-to-multipoint (P2MP), or any-to-any (A2A)) and any combination of
      these types.</t>

      <t>This draft defines a YANG module of NRPs for mapping one or more
      connection constructs of one or more IETF network slices, for ensuring
      SLO and SLE and network scalability. An IETF Network Slice Controller
      (NSC) can use it to manage NRP instances in order to implement Network
      Slice Services.</t>

      <t>An NRP Policy <xref target="I-D.ietf-teas-ns-ip-mpls"/> is a policy
      construct that enables instantiation of mechanisms in support of service
      specific control and data plane behaviors on select topological elements
      associated with the NRP.<xref target="nrp-ins"/> describes the detailed
      definition of NRP policy in NRP instantiation.</t>

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

      <t>The tree diagram used in this document follows the notation defined
      in <xref target="RFC8340"/>.</t>
    </section>

    <section title="NRP Data Model">
      <t>There are multiple modes of NRP operations to be supported as
      follows:<list style="symbols">
          <t>NRP instantiation: Depending on the slice service 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 anchor="nrp-ins" title="NRP Instantiation">
        <t>An NRP policy specifies the rules for determining the topology
        associated with the NRP and dictates how an NRP can be realized in
        IP/MPLS networks using one of three partition modes. The NRP policy
        dictates if the partitioning of the shared network resources can be
        achieved in (a) just the data plane or in (b) just the control plane
        or in (c) both the control and data planes.</t>

        <t>The NRP policy modes (a) and (c) require the forwarding engine on
        each NRP capable node to identify the traffic belonging to a specific
        NRP and to apply the corresponding Per-Hop Behavior (PHB) or
        forwarding mechanism that determines the forwarding treatment of the
        packets belonging to the NRP. When catering to IETF Network Slices,
        this NRP identification is referred to as the NRP selector and may
        comprises of traffic streams from one or more connectivity constructs
        (belonging to one or more IETF network slices) mapped to a specific
        NRP. The NRP policy modes (b) and (c) require the
        distributed/centralized resource reservation management.</t>

        <t>'nrp-policy' is defined to enable NRP Stateful Traffic Engineering
        (NRP-TE) <xref target="I-D.ietf-teas-ns-ip-mpls"/> and/or NRP IGP
        forwarding in IP/MPLS networks.</t>

        <t>The tree diagram used in this document follows the notation defined
        in <xref target="RFC8340"/>.</t>

        <t>The high-level model structure of NRP policy defined by this
        document is as shown in <xref target="fig-nrppol"/>:</t>

        <figure anchor="fig-nrppol"
                title="NRP Policy subtree high-level structure">
          <artwork><![CDATA[module: ietf-nrp
  augment /nw:networks:
    +--rw nrp-policies
       +--rw nrp-policy* [name]
          +--rw name                    string
          +--rw nrp-id?                 uint32
          +--rw mode?                   identityref
          +--rw resource-reservation
          |     ...
          +--rw selector
          |     ...
          +--rw phb-profile?            string
          +--rw topology
                ...
]]></artwork>
        </figure>

        <t>The 'networks' container from the 'ietf-network' module [RFC8345]
        provides a placeholder for an inventory of nodes in the network. This
        container is augmented to carry a set of NRP policies.</t>

        <t>The 'nrp-policies' container carries a list of NRP policies. Each
        'nrp-policy' entry is identified by a name and holds the set of
        attributes needed to instantiate the NRP. Each entry also carries an
        'nrp-id' leaf which uniquely identifies the NRP created by the
        enforcement of this policy. The</t>

        <t>The description of the 'nrp-policies' data nodes are as follows,
        and the other key elements of each nrp-policy entry are discussed in
        the following sub-sections.</t>

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

            <t>'mode': Refers to control plane resource partition, data plane
            resource partition, or a combination of both types.</t>
          </list></t>

        <section title="Resource Reservation">
          <t>The 'resource-reservation' container specifies the bandwidth
          resource allocated to an NRP instance, or can be overridden by the
          configuration of the link specific 'resource-reservation' nodes of
          'nrp-topology'.</t>

          <figure title="NRP Resource Reservation YANG subtree structure">
            <artwork><![CDATA[+--rw resource-reservation
  +--rw (max-bw-type)?
     +--:(bw-value)
     |  +--rw maximum-bandwidth?           uint64
     +--:(bw-percentage)
        +--rw maximum-bandwidth-percent?   rt-types:percentage]]></artwork>
          </figure>
        </section>

        <section title="NRP Selector">
          <t>NRP selector defines the data plane encapsulation types and
          values that are used to identify NRP-specific network resources. The
          data plane mechanism could be based on IP, MPLS, or SRv6
          forwarding.</t>

          <figure title="NRP Selector YANG subtree structure">
            <artwork><![CDATA[+--rw selector
   +--rw ipv4
   |  +--rw destination-prefix*   inet:ipv4-prefix
   +--rw ipv6
   |  +--rw (selector-type)?
   |     +--:(dedicated)
   |     |  +--rw ipv6-hbh-eh?          uint32
   |     +--:(srv6-sid-derived)
   |     |  +--rw srv6-sid*             inet:ipv6-prefix
   |     +--:(ipv6-destination-derived)
   |        +--rw destination-prefix*   inet:ipv6-prefix
   +--rw mpls
   |  +--rw (selector-type)?
   |     +--:(dedicated)
   |     |  +--rw label?                   rt-types:mpls-label
   |     |  +--rw label-position?          identityref
   |     |  +--rw label-position-offset?   uint8
   |     +--:(derived)
   |        +--rw forwarding-label?        empty
   +--rw acl-ref*   nrp-acl-ref

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

        <section title="NRP Topology">
          <t>'nrp-topology' defines a dedicated NRP topology.</t>

          <t>When an NRP support IGP forwarding, the topology of the NRP must
          be congruent with an IGP instance.The topology used for IGP route
          computation and forwarding can be derived using Multi-Topology
          Routing (MTR) or Flex-algo. 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="RFC9350"/>.</t>

          <t>The 'selection' container consists of a list of select subset of
          links of an underlay topology or a pre-built topology.</t>

          <t>The 'filter' container consists of a list of filters where each
          entry references a topology filter <xref
          target="I-D.bestbar-teas-yang-topology-filter"/>. The topological
          elements that satisfy the membership criteria can optionally
          override the default resource-reservation and nrp-selector specific
          leafs.</t>

          <figure title="NRP Topology YANG subtree structure">
            <artwork><![CDATA[+--rw topology
   +--rw igp-congruent!
   |  +--rw multi-topology-id?   uint32
   |  +--rw algo-id?             uint32
   |  +--rw sharing?             boolean
   +--rw (topology-type)?
      +--:(selection)
      |  +--rw select
      |     +--rw topology-group* [group-id]
      |        +--rw group-id                string
      |        +--rw base-topology-ref
      |        |     ...
      |        +--rw links* [link-ref]
      |        |     ...
      |        +--rw resource-reservation
      |        |     ...
      |        +--rw link-partition-type?
      |        |       identityref
      |        +--rw phb-profile?            string
      +--:(filter)
         +--rw filters
            +--rw filter* [filter-ref]
               +--rw filter-ref
               |       nrp-topo-filter-ref
               +--rw resource-reservation
               |     ...
               +--rw selector
               |     ...
               +--rw phb-profile?            string]]></artwork>
          </figure>
        </section>
      </section>

      <section title="NRP monitoring">
        <t>The NRP model can be used to track and monitor operational status
        and resource usage of NRPs.</t>

        <figure title="NRP Monitoring YANG subtree structure">
          <artwork><![CDATA[  augment /nw:networks/nw:network/nw:network-types:
    +--rw nrp!  
  augment /nw:networks/nw:network/nw:node:
    +--ro nrp
       +--ro nrp-aware-dp-id
             ...
  augment /nw:networks/nw:network/nt:link:
    +--ro nrp
       +--ro link-partition-type?   identityref
       +--ro bandwidth-value?       uint64
       +--ro nrp-aware-dp-id
       |     ...
       +--ro statistics
             ...
  augment /nw:networks/nw:network/nw:node:
    +--ro nrps* [nrp-id]
       +--ro nrp-id    uint32
       +--ro nrp
             ...
  augment /nw:networks/nw:network/nt:link:
    +--ro nrps* [nrp-id]
       +--ro nrp-id                 uint32
       +--ro link-partition-type?   identityref
       +--ro bandwidth-value?       uint64
       +--ro nrp-aware-dp-id
             ...]]></artwork>
        </figure>

        <t/>
      </section>

      <section title="NRP Device Model Description">
        <t>The device-specific NRP model is defined in module
        'ietf-nrp-device' as shown in <xref target="nrp-device"/>, which
        augments NRP YANG data model in <xref target="nrp"/> and adds
        interface attributes, including resource reservation, NRP selector,
        and PHB profile, that are specific to an NRP device.</t>

        <t>Figure below shows the tree diagram of the device NRP YANG model
        defined in modules 'ietf-nrp-device.yang'.</t>

        <figure title="NRP Device YANG subtree high-level structure">
          <artwork><![CDATA[module: ietf-nrp-device
  augment /nw:networks/nrp:nrp-policies/nrp:nrp-policy:
    +--rw interfaces
       +--rw interface* [interface]
          +--rw interface               if:interface-ref
          +--rw resource-reservation
          |  +--rw (max-bw-type)?
          |     +--:(bw-value)
          |     |     ...
          |     +--:(bw-percentage)
          |           ...
          +--rw selector
          |  +--rw ipv4
          |  |  +--rw destination-prefix*   inet:ipv4-prefix
          |  +--rw ipv6
          |  |  +--rw (selector-type)?
          |  |        ...
          |  +--rw mpls
          |  |  +--rw (selector-type)?
          |  |        ...
          |  +--rw acl-ref*   nrp-acl-ref
          +--rw phb-profile?            string]]></artwork>
        </figure>
      </section>
    </section>

    <section title="NRP Yang Module">
      <t>The 'ietf-nrp' module uses types defined in <xref
      target="RFC8345"/>.</t>

      <figure anchor="nrp" title="NRP data model YANG module">
        <artwork><![CDATA[<CODE BEGINS> file "ietf-nrp@2023-04-07.yang"
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)";
  }
  import ietf-topology-filter {
    prefix topo-filt;
    reference
      "draft-bestbar-teas-yang-topology-filter: YANG Data Model
       for Topology Filter";
  }

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

     Editor:   Bo Wu
            <mailto:lana.wubo@huawei.com>

     Editor:   Dhruv Dhody
            <mailto:dhruv.ietf@gmail.com>

     Editor:   Vishnu Pavan Beeram
               <mailto:vbeeram@juniper.net>

     Editor:   Tarek Saad
               <mailto:tsaad.net@gmail.com>

     Editor:   Shaofu Peng
               <mailto:peng.shaofu@zte.com.cn>";
  description
    "This YANG module defines a network data module for
     NRP(Network Resource Partition).

     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-04-07 {
    description
      "This is the initial version of NRP YANG model.";
    reference
      "RFC XXX: A YANG Data Model for Network Resource Partition";
  }

  /*
   * I D E N T I T I E S
   */

  identity nrp-partition-mode {
    description
      "Base identity for nrp partition type.";
  }

  identity nrp-control-plane-partition {
    base nrp-partition-mode;
    description
      "Identity for control plane partition.";
  }

  identity nrp-data-plane-partition {
    base nrp-partition-mode;
    description
      "Identity for data plane partition.";
  }

  identity nrp-hybrid-plane-partition {
    base nrp-partition-mode;
    description
      "Identity for both planes partition.";
  }

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

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

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

  /*
   * Identity:
   * MPLS Selector Label Position.
   */

  identity selector-mpls-label-position {
    description
      "Base identity for the position of the MPLS selector label.";
  }

  identity selector-mpls-label-position-top {
    base selector-mpls-label-position;
    description
      "MPLS selector label is at the top of the label stack.";
  }

  identity selector-mpls-label-position-bottom {
    base selector-mpls-label-position;
    description
      "MPLS selector label is either at the bottom or at a specific
       offset from the bottom of the label stack.";
  }

  identity selector-mpls-label-position-indicator {
    base selector-mpls-label-position;
    description
      "MPLS selector is preceded by a special purpose
       indicator label in the label stack.";
  }

  /*
   * T Y P E D E F S
   */

  typedef nrp-acl-ref {
    type leafref {
      path "/acl:acls/acl:acl/acl:name";
    }
    description
      "This type is used to reference an ACL.";
  }

  typedef nrp-topo-filter-ref {
    type leafref {
      path "/nw:networks/topo-filt:topology-filters/"
         + "topo-filt:topology-filter/topo-filt:name";
    }
    description
      "This type is used to reference a Topology Filter.";
  }

  /*
   * Grouping - NRP Resource Reservation
   */

  grouping nrp-resource-reservation {
    description
      "Grouping for NRP resource reservation.";
    container resource-reservation {
      description
        "Container for NRP resource reservation.";
      choice max-bw-type {
        description
          "Choice of maximum bandwidth specification.";
        case bw-value {
          leaf maximum-bandwidth {
            type uint64;
            description
              "The maximum bandwidth allocated to an NRP
               - specified as absolute value.";
          }
        }
        case bw-percentage {
          leaf maximum-bandwidth-percent {
            type rt-types:percentage;
            description
              "The maximum bandwidth allocated to an NRP
               - specified as percentage of link
               capacity.";
          }
        }
      }
    }
  }

  /*
   * G R O U P I N G S
   */
  /*
   * Grouping - MPLS selector label location specific fields
   */

  grouping nrp-selector-mpls-label-location {
    description
      "Grouping for MPLS FAS label location specific fields.";
    leaf label-position {
      type identityref {
        base selector-mpls-label-position;
      }
      description
        "MPLS selector label position.";
    }
    leaf label-position-offset {
      when "derived-from-or-self(../label-position,"
         + "'nrp:selector-mpls-label-position-bottom')" {
        description
          "MPLS label position offset is relevant only when the
           label-position is set to 'bottom'.";
      }
      type uint8;
      description
        "MPLS label position offset.";
    }
  }

  /*
   * Grouping - NRP Selector Configuration
   */

  grouping nrp-selector-config {
    description
      "Grouping for NRP selector configuration.";
    container selector {
      description
        "Container for NRP selector.";
      container ipv4 {
        description
          "Container for IPv4 NRP selector.";
        leaf-list destination-prefix {
          type inet:ipv4-prefix;
          description
            "Any prefix from the specified set of IPv4
             destination prefixes can be the selector.";
        }
      }
      container ipv6 {
        description
          "Container for IPv6 NRP selector.";
        choice selector-type {
          description
            "Choices for IPv6 selector type.";
          case dedicated {
            leaf ipv6-hbh-eh {
              type uint32;
              description
                "The selector value carried in Hop-by-Hop
                 Option of IPv6 extension header.";
            }
          }
          case srv6-sid-derived {
            leaf-list srv6-sid {
              type inet:ipv6-prefix;
              description
                "Any SID from the specified set of SRv6
                 SID can be the selector.";
            }
          }
          case ipv6-destination-derived {
            leaf-list destination-prefix {
              type inet:ipv6-prefix;
              description
                "Any prefix from the specified set of IPv6
                 destination prefixes can be the selector.";
            }
          }
        }
      }
      container mpls {
        description
          "Container for MPLS NRP selector.";
        choice selector-type {
          description
            "Choices for MPLS label specification.";
          case dedicated {
            leaf label {
              type rt-types:mpls-label;
              description
                "MPLS selector Label is explicitly
                 specified.";
            }
            uses nrp-selector-mpls-label-location;
          }
          case derived {
            leaf forwarding-label {
              type empty;
              description
                "MPLS selector Label is derived from
                 forwarding label.";
            }
          }
        }
      }
      leaf-list acl-ref {
        type nrp-acl-ref;
        description
          "Selection is done based on the specified list of ACLs.";
      }
    }
  }

  /*
   * Grouping - NRP QoS PHB profile 
   */

  grouping nrp-qos-phb-profile {
    description
      "Grouping for NRP QoS PHB profile.";
    leaf phb-profile {
      type string;
      description
        "PHB profile identifier.";
    }
  }

  /*
   * Grouping - NRP IGP congruent
   */

  grouping nrp-igp-congruent {
    description
      "Grouping for NRP IGP congruent attributes.";
    container igp-congruent {
      presence "indicates NRP IGP congruent";
      description
        "The presence of the container node indicates NRP IGP
         congruent.";
      leaf multi-topology-id {
        type uint32;
        description
          "Indicates the MT-id of the NRP IGP instance.";
      }
      leaf algo-id {
        type uint32;
        description
          "Indicates the algo-id of the NRP IGP instance.";
      }
      leaf sharing {
        type boolean;
        default "true";
        description
          "'true' if the the NRP IGP instance can be shared with
           other NRPs;
           'false' if the the NRP IGP instance is dedicated
           to this NRP.";
      }
    }
  }

  /*
   * Grouping - NRP Topology Filter 
   */

  grouping nrp-topology-filter {
    description
      "Grouping for NRP filter topology.";
    container filters {
      description
        "Container for filters.";
      list filter {
        key "filter-ref";
        description
          "List of filters.";
        leaf filter-ref {
          type nrp-topo-filter-ref;
          description
            "Reference to a specific topology filter from the
             list of global topology filters.";
        }
        uses nrp-resource-reservation;
        uses nrp-selector-config;
        uses nrp-qos-phb-profile;
      }
    }
  }

  /*
   * Grouping - NRP Select Topology
   */  

  grouping nrp-select-topology {
    description
      "NRP topology specified by selection.";
    container select {
      description
        "The container of NRP select topology.";
      list topology-group {
        key "group-id";
        description
          "List of groups for NRP topology elements (node or links)
           that share common attributes.";
        leaf group-id {
          type string;
          description
            "The NRP topology group identifier.";
        }
        container base-topology-ref {
          description
            "Container for the base topology reference.";
          uses nw:network-ref;
        }
        list links {
          key "link-ref";
          description
            "A list of links with common attributes";
          leaf link-ref {
            type leafref {
              path
                "/nw:networks/nw:network[nw:network-id=current()"
              + "/../../base-topology-ref/network-ref]"
              + "/nt:link/nt:link-id";
            }
            description
              "A reference to a link in the base topology.";
          }
        }
        uses nrp-resource-reservation;
        leaf link-partition-type {
          type identityref {
            base nrp-link-partition-type;
          }
          description
            "Indicates the resource reservation type of an NRP link.";
        }
        uses nrp-qos-phb-profile;
      }
    }
  }

  /*
   * Grouping - NRP Topology
   */    

  grouping nrp-topology {
    description
      "Grouping for NRP topology.";
    container topology {
      description
        "Container for NRP topology.";
      uses nrp-igp-congruent;
      choice topology-type {
        description
          "Choice of NRP topology type.";
        case selection {
          uses nrp-select-topology;
        }
        case filter {
          uses nrp-topology-filter;
        }
      }
    }
  }

  /*
   * Grouping - NRP Policy
   */  

  grouping nrp-pol {
    description
      "Grouping for NRP policies.";
    container nrp-policies {
      description
        "Container for nrp policies.";
      list nrp-policy {
        key "name";
        unique "nrp-id";
        description
          "List of NRP policies.";
        leaf name {
          type string;
          description
            "A string that uniquely identifies the NRP policy.";
        }
        leaf nrp-id {
          type uint32;
          description
            "A 32-bit ID that uniquely identifies the NRP
             created by the enforcement of this NRP policy.";
        }
        leaf mode {
          type identityref {
            base nrp-partition-mode;
          }
          default "nrp-hybrid-plane-partition";
          description
            "Indicates the resource partition mode of the NRP, such as
             control plane partition, data plane partition,
             or hybrid partition.";
        }
        uses nrp-resource-reservation;
        uses nrp-selector-config;
        uses nrp-qos-phb-profile;
        uses nrp-topology;
      }
    }
  }

  /*
   * Grouping - NRP Selector State
   */

  grouping nrp-selector-state {
    description
      "The grouping of NRP selector.";
    container selector {
      config false;
      description
        "The container of NRP selector.";
      leaf srv6 {
        type srv6-types:srv6-sid;
        description
          "Indicates the SRv6 SID value as the NRP selector.";
      }
      leaf sr-mpls {
        type rt-types:mpls-label;
        description
          "Indicates the SR MPLS ID value as the NRP selector.";
      }
    }
  }

  /*
   * Grouping - NRP node attributes
   */

  grouping nrp-node-attributes {
    description
      "NRP node scope attributes.";
    container nrp {
      config false;
      description
        "Containing NRP attributes.";
      uses nrp-selector-state;
    }
  }

  /*
   * Grouping - NRP Link Attributes
   */    

  grouping nrp-link-attributes {
    description
      "NRP link scope attributes.";
    leaf link-partition-type {
      type identityref {
        base nrp-link-partition-type;
      }
      config false;
      description
        "Indicates the resource partition type of an NRP link.";
    }
    leaf bandwidth-value {
      type uint64;
      units "bps";
      config false;
      description
        "Bandwidth allocation for the NRP as absolute value.";
    }
    uses nrp-selector-state;
  }

  /*
   * Grouping - NRP Bandwidth Metrics
   */      

  grouping nrp-bandwidth-metrics {
    description
      "Grouping for NRP bandwidth metrics.";
    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 nrp-bandwidth-metrics;
      uses te-packet-types:one-way-performance-metrics-packet;
    }
  }

  grouping nrp-topology-type {
    description
      "Identifies the topology type to be NRP";
    container nrp {
      presence "indicates NRP topology";
      description
        "The presence of the container node indicates NRP
         topology";
    }
  }

  /*
   * Augment - Network Resource Partition Policies.   
   */

  augment "/nw:networks" {
    description
      "Augment networks with network resource partition
       policies.";
    uses nrp-pol;
  }

  /*
   * Augment - NRP type.   
   */

  augment "/nw:networks/nw:network/nw:network-types" {
    description
      "Introduces new network type for NRP topology";
    uses nrp-topology-type;
  }

  /*
   * Augment - NRP node operational status.   
   */  

  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 - NRP link operational status.   
   */    

  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.";
    container nrp {
      config false;
      description
        "Containing NRP attributes.";
      uses nrp-link-attributes;
      uses nrp-statistics-per-link;
    }
  }

  /*
   * Augment - Native topology with node operational status.   
   */    

  augment "/nw:networks/nw:network/nw:node" {
    description
      "Augment node with NRP aware attributes.";
    list nrps {
      key "nrp-id";
      config false;
      description
        "List of NRPs.";
      leaf nrp-id {
        type uint32;
        description
          "NRP identifier";
      }
      uses nrp-node-attributes;
    }
  }

  /*
   * Augment - Native topology with link operational status.   
   */    

  augment "/nw:networks/nw:network/nt:link" {
    description
      "Augment link with NRP attributes.";
    list nrps {
      key "nrp-id";
      config false;
      description
        "List of NRPs.";
      leaf nrp-id {
        type uint32;
        description
          "NRP identifier";
      }
      uses nrp-link-attributes;
    }
  }
}
<CODE ENDS>
]]></artwork>
      </figure>
    </section>

    <section title="NRP Device YANG module">
      <t>The device NRP YANG module ('ietf-nrp-device') models augments the
      NRP YANG module ('ietf-nrp') and adds the attributes of NRP interfaces
      that are local to an NRP device.</t>

      <t>The device NRP YANG module imports the following module(s):
      ietf-interfaces defined in <xref target="RFC8343"/>, ietf-network
      defined in <xref target="RFC8345"/>, and NRP grouping defined in this
      document.</t>

      <figure anchor="nrp-device" title="NRP Device data model YANG module">
        <artwork><![CDATA[<CODE BEGINS> file "ietf-nrp-device@2023-07-24.yang"
module ietf-nrp-device {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-nrp-device";
  prefix nrp-dev;

  /* Import IETF Network module */

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

  /* Import IETF interface module */

  import ietf-interfaces {
    prefix if;
    reference
      "RFC8343: A YANG Data Model for Interface Management";
  }

  /* Import NRP module */

  import ietf-nrp {
    prefix nrp;
    reference
      "RFCXXXX: A YANG Data Model for Network Resource Partition";
  }

  organization
    "IETF Traffic Engineering Architecture and Signaling (TEAS)
     Working Group";
  contact
    "WG Web:   <https://tools.ietf.org/wg/teas/>
     WG List:  <mailto:teas@ietf.org>

     Editor:   Bo Wu
            <mailto:lana.wubo@huawei.com>

     Editor:   Dhruv Dhody
            <mailto:dhruv.ietf@gmail.com>

     Editor:   Vishnu Pavan Beeram
               <mailto:vbeeram@juniper.net>

     Editor:   Tarek Saad
               <mailto:tsaad.net@gmail.com>

     Editor:   Shaofu Peng
               <mailto:peng.shaofu@zte.com.cn>";
  description
    "This module defines a data model for NRP device configurations,
     state. The model fully conforms to the
     Network Management Datastore Architecture (NMDA).

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

  // RFC Ed.: replace XXXX with actual RFC number and remove this
  // note.
  // RFC Ed.: update the date below with the date of RFC publication
  // and remove this note.

  revision 2023-07-24 {
    description
      "Initial revision for the NRP device YANG module.";
    reference
      "RFCXXXX: A YANG Data Model for Network Resource Partition
       Device";
  }

  /* NRP device configuraiton */

  augment "/nw:networks/nrp:nrp-policies/nrp:nrp-policy" {
    description
      "NRP policy list.";
    /* NRP Interface Configuration Data */
    container interfaces {
      description
        "Configuration data model for NRP interfaces.";
      list interface {
        key "interface";
        description
          "NRP interfaces.";
        leaf interface {
          type if:interface-ref;
          description
            "NRP interface name.";
        }
        uses nrp:nrp-resource-reservation;
        uses nrp:nrp-selector-config;
        uses nrp:nrp-qos-phb-profile;
      }
    }
  }
}

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

    <section title="Security Considerations">
      <t>The YANG model 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 model 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.

   URI: urn:ietf:params:xml:ns:yang:ietf-nrp-device
   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
           Maintained by IANA: N
           Prefix: nrp
           Reference: RFC XXXX 

           Name: ietf-nrp-device
           Namespace: urn:ietf:params:xml:ns:yang:ietf-nrp-device
           Maintained by IANA: N
           Prefix: nrp-dev
           Reference: RFC XXXX 
]]></artwork>
      </figure>
    </section>

    <section title="Acknowledgments">
      <t>The authors would like to thank Krzysztof Szarkowicz, Jie Dong, Qin
      Wu, Yao Zhao, Zhenbing Li, Ying Cheng, Liyan Gong, and many others for
      their helpful comments and suggestions.</t>
    </section>

    <section anchor="Acknowledgements" title="Contributor">
      <t>The following individuals, authors of <xref
      target="I-D.bestbar-teas-yang-nrp-policy"/> and <xref
      target="I-D.wd-teas-nrp-yang"/>, contributed to this consolidated
      document: <figure>
          <artwork><![CDATA[   Xufeng Liu
   IBM Corporation
   Email: xufeng.liu.ietf@gmail.com

   Mohamed Boucadair
   Orange
   Email: mohamed.boucadair@orange.com

   Daniele Ceccarelli

   Bin Wen
   Comcast
   Email: Bin_Wen@cable.comcast.com

   Ran Chen
   ZTE Corporation
   Email: chen.ran@zte.com.cn

   Luis M. Contreras
   Telefonica
   Email: luismiguel.contrerasmurillo@telefonica.com

   Ying Cheng
   China Unicom
   Email: chengying10@chinaunicom.cn
   
   Liyan Gong
   China Mobile
   Email: gongliyan@chinamobile.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.6241'?>

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

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

      <?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'?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.I-D.ietf-teas-ietf-network-slices'?>

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

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

      <?rfc include='reference.I-D.ietf-teas-ns-ip-mpls'?>

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

      <?rfc include='reference.I-D.bestbar-teas-yang-nrp-policy'?>

      <?rfc include='reference.I-D.bestbar-teas-yang-topology-filter'?>

      <?rfc include='reference.I-D.wd-teas-nrp-yang'?>
    </references>

    <section title="An Example">
      <t>This section contains an example of an instance data tree in JSON
      encoding <xref target="RFC7951"/>. The example below instantiates an 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>An corresponding IGP congruent 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": {
    "nrp-policies": {
      "nrp-policy": [
        {
          "name": "NRP1",
          "nrp-id": "foo:nrp-example1",
          "mode": "nrp-hybrid-plane-partition",
          "resource-reservation": {
            "bw-value": "10000"
          },
          "selector": {
            "ipv6": {
              " ipv6-hbh-eh:": "100"
            }
          },
          "topology": {
            "igp-congruent": {
              "multi-topology-id": "2"
            },
            "select": {
              "topology-group": [
                {
                  "group-id": "access-group",
                  "base-topology-ref": {
                    "network-ref": "native-topology"
                  },
                  "link": [
                    {
                      "link-ref": "D1,1-2-1,D2,2-1-1"
                    },
                    {
                      "link-ref": "D2,2-1-1,D1,1-2-1"
                    },
                    {
                      "link-ref": "D1,1-3-1,D3,3-1-1"
                    },
                    {
                      "link-ref": "D3,3-1-1,D1,1-3-1"
                    },
                    {
                      "link-ref": "D2,2-3-1,D3,3-2-1"
                    },
                    {
                      "link-ref": "D3,3-2-1,D2,2-3-1"
                    }
                  ],
                  "link-partition-type": "virtual-sub-interface-partition"
                }
              ]
            }
          }
        }
      ]
    }
  }
}
]]></artwork>
      </figure>

      <t>In addition, an exampe of an NRP that supports the control plane
      partition mode is shown in the following figure.</t>

      <figure>
        <artwork><![CDATA[{
  "ietf-network:networks": {
    "nrp-policies": {
      "nrp-policy": [
        {
          "name": "NRP2",
          "nrp-id": "foo:nrp-example2",
          "mode": "nrp-control-plane-partition",
          "resource-reservation": {
            "bw-value": "10000"
          },
          "topology": {
            "filters": {
              "filter": [
                {
                  "filter-ref": "te-topology-filter1"
                }
              ]
            }
          }
        }
      ]
    }
  }
}]]></artwork>
      </figure>
    </section>

    <section title="NRP YANG Module Tree">
      <t/>

      <t><figure>
          <artwork><![CDATA[
module: ietf-nrp
  augment /nw:networks:
    +--rw nrp-policies
       +--rw nrp-policy* [name]
          +--rw name                    string
          +--rw nrp-id?                 uint32
          +--rw mode?                   identityref
          +--rw resource-reservation
          |  +--rw (max-bw-type)?
          |     +--:(bw-value)
          |     |  +--rw maximum-bandwidth?           uint64
          |     +--:(bw-percentage)
          |        +--rw maximum-bandwidth-percent?
          |                rt-types:percentage
          +--rw selector
          |  +--rw ipv4
          |  |  +--rw destination-prefix*   inet:ipv4-prefix
          |  +--rw ipv6
          |  |  +--rw (selector-type)?
          |  |     +--:(dedicated)
          |  |     |  +--rw ipv6-hbh-eh?          uint32
          |  |     +--:(srv6-sid-derived)
          |  |     |  +--rw srv6-sid*
          |  |     |          inet:ipv6-prefix
          |  |     +--:(ipv6-destination-derived)
          |  |        +--rw destination-prefix*
          |  |                inet:ipv6-prefix
          |  +--rw mpls
          |  |  +--rw (selector-type)?
          |  |     +--:(dedicated)
          |  |     |  +--rw label?
          |  |     |  |       rt-types:mpls-label
          |  |     |  +--rw label-position?          identityref
          |  |     |  +--rw label-position-offset?   uint8
          |  |     +--:(derived)
          |  |        +--rw forwarding-label?        empty
          |  +--rw acl-ref*   nrp-acl-ref
          +--rw phb-profile?            string
          +--rw topology
             +--rw igp-congruent!
             |  +--rw multi-topology-id?   uint32
             |  +--rw algo-id?             uint32
             |  +--rw sharing?             boolean
             +--rw (topology-type)?
                +--:(selection)
                |  +--rw select
                |     +--rw topology-group* [group-id]
                |        +--rw group-id                string
                |        +--rw base-topology-ref
                |        |  +--rw network-ref?   leafref
                |        +--rw links* [link-ref]
                |        |  +--rw link-ref    leafref
                |        +--rw resource-reservation
                |        |  +--rw (max-bw-type)?
                |        |     +--:(bw-value)
                |        |     |  +--rw maximum-bandwidth?
                |        |     |          uint64
                |        |     +--:(bw-percentage)
                |        |        +--rw maximum-bandwidth-percent?
                |        |                rt-types:percentage
                |        +--rw link-partition-type?
                |        |       identityref
                |        +--rw phb-profile?            string
                +--:(filter)
                   +--rw filters
                      +--rw filter* [filter-ref]
                         +--rw filter-ref
                         |       nrp-topo-filter-ref
                         +--rw resource-reservation
                         |  +--rw (max-bw-type)?
                         |     +--:(bw-value)
                         |     |  +--rw maximum-bandwidth?
                         |     |          uint64
                         |     +--:(bw-percentage)
                         |        +--rw maximum-bandwidth-percent?
                         |                rt-types:percentage
                         +--rw selector
                         |  +--rw ipv4
                         |  |  +--rw destination-prefix*
                         |  |          inet:ipv4-prefix
                         |  +--rw ipv6
                         |  |  +--rw (selector-type)?
                         |  |     +--:(dedicated)
                         |  |     |  +--rw ipv6-hbh-eh?
                         |  |     |          uint32
                         |  |     +--:(srv6-sid-derived)
                         |  |     |  +--rw srv6-sid*
                         |  |     |          inet:ipv6-prefix
                         |  |     +--:(ipv6-destination-derived)
                         |  |        +--rw destination-prefix*
                         |  |                inet:ipv6-prefix
                         |  +--rw mpls
                         |  |  +--rw (selector-type)?
                         |  |     +--:(dedicated)
                         |  |     |  +--rw label?
                         |  |     |  |       rt-types:mpls-label
                         |  |     |  +--rw label-position?
                         |  |     |  |       identityref
                         |  |     |  +--rw label-position-offset?
                         |  |     |          uint8
                         |  |     +--:(derived)
                         |  |        +--rw forwarding-label?
                         |  |                empty
                         |  +--rw acl-ref*   nrp-acl-ref
                         +--rw phb-profile?            string
  augment /nw:networks/nw:network/nw:network-types:
    +--rw nrp!
  augment /nw:networks/nw:network/nw:node:
    +--ro nrp
       +--ro selector
          +--ro srv6?      srv6-types:srv6-sid
          +--ro sr-mpls?   rt-types:mpls-label
  augment /nw:networks/nw:network/nt:link:
    +--ro nrp
       +--ro link-partition-type?   identityref
       +--ro bandwidth-value?       uint64
       +--ro selector
       |  +--ro srv6?      srv6-types:srv6-sid
       |  +--ro sr-mpls?   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
  augment /nw:networks/nw:network/nw:node:
    +--ro nrps* [nrp-id]
       +--ro nrp-id    uint32
       +--ro nrp
          +--ro selector
             +--ro srv6?      srv6-types:srv6-sid
             +--ro sr-mpls?   rt-types:mpls-label
  augment /nw:networks/nw:network/nt:link:
    +--ro nrps* [nrp-id]
       +--ro nrp-id                 uint32
       +--ro link-partition-type?   identityref
       +--ro bandwidth-value?       uint64
       +--ro selector
          +--ro srv6?      srv6-types:srv6-sid
          +--ro sr-mpls?   rt-types:mpls-label
<CODE ENDS>
]]></artwork>
        </figure></t>
    </section>

    <section title="NRP Device YANG Module Tree">
      <t/>

      <t><figure>
          <artwork><![CDATA[module: ietf-nrp-device
  augment /nw:networks/nrp:nrp-policies/nrp:nrp-policy:
    +--rw interfaces
       +--rw interface* [interface]
          +--rw interface               if:interface-ref
          +--rw resource-reservation
          |  +--rw (max-bw-type)?
          |     +--:(bw-value)
          |     |  +--rw maximum-bandwidth?           uint64
          |     +--:(bw-percentage)
          |        +--rw maximum-bandwidth-percent?   rt-types:percentage
          +--rw selector
          |  +--rw ipv4
          |  |  +--rw destination-prefix*   inet:ipv4-prefix
          |  +--rw ipv6
          |  |  +--rw (selector-type)?
          |  |     +--:(dedicated)
          |  |     |  +--rw ipv6-hbh-eh?          uint32
          |  |     +--:(srv6-sid-derived)
          |  |     |  +--rw srv6-sid*             inet:ipv6-prefix
          |  |     +--:(ipv6-destination-derived)
          |  |        +--rw destination-prefix*   inet:ipv6-prefix
          |  +--rw mpls
          |  |  +--rw (selector-type)?
          |  |     +--:(dedicated)
          |  |     |  +--rw label?                   rt-types:mpls-label
          |  |     |  +--rw label-position?          identityref
          |  |     |  +--rw label-position-offset?   uint8
          |  |     +--:(derived)
          |  |        +--rw forwarding-label?        empty
          |  +--rw acl-ref*   nrp-acl-ref
          +--rw phb-profile?            string

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