<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema validation and schema-aware editing -->
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  consensus="true"
  docName="draft-mahesh-bess-srv6-mup-yang-03"
  ipr="trust200902"
  obsoletes=""
  submissionType="IETF"
  updates=""
  xml:lang="en"
  version="3">

  <front>
    <title abbrev="SRv6 MUP YANG Model">A YANG Data Model for SRv6 Mobile User Plane</title>
    <seriesInfo name="Internet-Draft" value="draft-mahesh-bess-srv6-mup-yang-03"/>
   
    <author fullname="Mahesh Jethanandani" initials="M." role="editor" surname="Jethanandani">
      <organization>Arrcus, Inc</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country/>
        </postal>        
        <phone/>
        <email>mjethanandani@gmail.com</email>  
        <uri/>
      </address>
    </author>
    <author fullname="Tetsuya Murakami" initials="T." surname="Murakami">
      <organization>Arrcus, Inc</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country/>
        </postal>        
        <phone/>
        <email>tetsuya@arrcus.com</email>  
        <uri/>
      </address>
    </author>
    <author fullname="Kalyani Rajaram" initials="K." surname="Rajaram">
      <organization>Arrcus, Inc</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country/>
        </postal>
        <phone/>
        <email>kalyanir@arrcus.com</email>
        <uri/>
      </address>
    </author>
    <author fullname="Satoru Matsushima" initials="S." surname="Matsushima">
      <organization>SoftBank</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country/>
        </postal>
        <phone/>
        <email>satoru.matsushima@g.softbank.co.jp</email>
        <uri/>
      </address>
    </author>
   
    <date/>
    <area>Routing</area>
    <workgroup>Spring</workgroup>
    <keyword>srv6</keyword>
    <keyword>yang</keyword>

    <abstract>
      <t>This document defines a YANG data model for configuration
      and management of Mobile User Plane (MUP) in a SRv6 network.</t>
    </abstract>
  </front>

  <middle>
    
    <section>
      <name>Introduction</name>
      <t>In mobile networks, mobility systems provide connectivity
      over a wireless link to stationary and non-stationary nodes.
      The user-plane establishes a tunnel between the mobile node
      and its anchor node over IP-based backhaul and core networks.
      </t>

      <t>When SRv6 is applied to mobile networks, it enables a
      source routing architecture, where operators get to explicitly
      specify a route for the packets to traverse both to and from a
      mobile node. The SRv6 Endpoint nodes serve as mobile user-plane
      anchors.</t>

      <t><xref target="I-D.mhkk-dmm-srv6mup-architecture">Segment
      Routing IPv6 Mobile User Plane Architecture For Distributed
      Mobility Management</xref>, defines the Segment Routing IPv6
      Mobile User Plane (SRv6 MUP) architecture for Distributed
      Mobility Management. As part of the architecture, the document
      defines a new SRv6 segment type called as a MUP Segment, new
      routing information that can carried within BGP, and advertised
      from a PE and a MUP Controller. <xref
      target="I-D.mpmz-bess-mup-safi">BGP Extensions for Mobile User
      Plane (MUP) SAFI</xref> further defines a new Subsequent Address
      Family Indicator (SAFI) for the BGP Mobile User Plane (BGP-MUP)
      to support MUP extensions for BGP.</t>
      
      <t>This document defines a <xref target="RFC7950">YANG 1.1
      </xref> data model for BGP-MUP. The model conforms to the <xref
      target="RFC8342">NMDA</xref> architecture.</t>

      <section>
	<name>Requirements Language</name>
	<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
	"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT
	RECOMMENDED", "MAY", and "OPTIONAL" in this document are to 
	be interpreted as described in BCP 14 <xref 
	target="RFC2119"/> <xref target="RFC8174"/> when, and 
	only when, they appear in all capitals, as shown here.</t>
      </section>
      <section>
	<name>Note to RFC Editors</name>
        <t>This document uses several placeholder values throughout
        the document. Please replace them as follows and remove this
        note before publication.</t>

        <t>RFC XXXX, where XXXX is the number assigned to this
        document at the time of publication.</t>

        <t>2023-10-16 with the actual date of the publication of this
        document.</t>
      </section>
    </section>

    <section>
      <name>Terminology</name>
      <t>
	This document references terms defined in other documents.  In
	particular, it imports definitions for the following terms
	from <xref target="RFC8402">Segment Routing
	Architecture</xref>.
      </t>

      <ul>
	<li>Active Segment</li>
	<li>BGP-Prefix Segment</li>
	<li>Segment</li>
        <li>SRv6</li>
	<li>Segment Routing domain (SR domain)</li>
      </ul>
	
      <section>
	<name>Acronyms</name>
	<t>This document uses a few acronyms. Some of them are defined
	here for reference.</t>
	<table>
	  <name>Acronyms</name>
          <thead>
            <!-- [REPLACE/DELETE] a table header is optional -->
            <tr><th>Acronym</th><th>Definition</th></tr>
          </thead>
          <tbody>
            <tr><td>MUP</td><td>Mobile User Plane</td></tr>
	    <tr><td>RD</td><td>Route Distinguisher</td></tr>
	    <tr><td>RT</td><td>Route Target</td></tr>
	    <tr><td>SAFI</td><td>Subsequent Address Family
	    Indicator</td></tr>
            <tr><td>SR</td><td>Segment Routing</td></tr>
            <tr><td>SRv6</td><td>Segment Routing over v6</td></tr>
            <tr><td>VRF</td><td>Virtual Routing and
            Forwarding</td></tr>
          </tbody>
	</table>
      </section>
    </section>

    <section>
      <name>Tree Diagram</name>
      <t>An abridged version of the tree diagram is shown here.
      Annotations used in the diagram are defined in <xref
      target="RFC8340">YANG Tree Diagrams </xref>.</t>
      <figure>
	<name>Tree Diagram for SRv6 YANG Model</name>
        <artwork><![CDATA[
module: ietf-mup

  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi:
    +--rw ipv4-mup
    |  +--rw rts
    |  |  +--rw rt* [name]
    |  |        ...
    |  +--rw routing-table-limit
    |  |  +--rw routes* [type]
    |  |        ...
    |  +--rw segment* [type]
    |  |  +--rw type            identityref
    |  |  +--rw locator?        leafref
    |  |  +--rw entry*          union
    |  |  +--rw mup-ext-comm*   mup-ext-community-type
    |  +--rw architecture-type?     identityref
    +--rw ipv6-mup
       +--rw rts
       |  +--rw rt* [name]
       |        ...
       +--rw routing-table-limit
       |  +--rw routes* [type]
       |        ...
       +--rw segment* [type]
       |  +--rw type            identityref
       |  +--rw locator?        leafref
       |  +--rw entry*          union
       |  +--rw mup-ext-comm*   mup-ext-community-type
       +--rw architecture-type?     identityref
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi/bgp:ipv4-unicast:
    +--rw rts
       +--rw rt* [name]
          +--rw name             identityref
          +--rw route-policy?    leafref
          +--rw route-targets
                ...
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi/bgp:ipv6-unicast:
    +--rw rts
       +--rw rt* [name]
          +--rw name             identityref
          +--rw route-policy?    leafref
          +--rw route-targets
                ...
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi/bgp:l3vpn-ipv4-unicast:
    +--rw rts
       +--rw rt* [name]
          +--rw name             identityref
          +--rw route-policy?    leafref
          +--rw route-targets
                ...
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi/bgp:l3vpn-ipv6-unicast:
    +--rw rts
       +--rw rt* [name]
          +--rw name             identityref
          +--rw route-policy?    leafref
          +--rw route-targets
                ...
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:neighbors
            /bgp:neighbor/bgp:afi-safis/bgp:afi-safi:
    +--rw ipv4-mup!
    +--rw ipv6-mup!
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:neighbors
            /bgp:neighbor/bgp:statistics:
    +--ro isd-sent?             yang:zero-based-counter32
    +--ro isd-received?         yang:zero-based-counter32
    +--ro dsd-sent?             yang:zero-based-counter32
    +--ro dsd-received?         yang:zero-based-counter32
    +--ro type-1-st-sent?       yang:zero-based-counter32
    +--ro type-1-st-received?   yang:zero-based-counter32
    +--ro type-2-st-sent?       yang:zero-based-counter32
    +--ro type-2-st-received?   yang:zero-based-counter32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global:
    +--rw srv6
       +--rw locator?                 leafref
       +--ro sid-manager-connected?   boolean
       +--ro locator-registered?      boolean
       +--ro micro-segment-enabled?   boolean
       +--rw sid-allocation-mode?     identityref
       +--rw mobile
          +--rw encapsulation
          |     ...
          +--rw decapsulations
                ...
  augment /ni:network-instances/ni:network-instance/ni:ni-type:
    +--:(mup)
       +--rw mup
          +--rw rd
                ...
  augment /rt-pol:routing-policy/rt-pol:policy-definitions
            /rt-pol:policy-definition/rt-pol:statements
            /rt-pol:statement/rt-pol:conditions/bp:bgp-conditions:
    +--rw match-mup
       +--rw route-type?   identityref
  augment /rt-pol:routing-policy/rt-pol:policy-definitions
            /rt-pol:policy-definition/rt-pol:statements
            /rt-pol:statement/rt-pol:actions:
    +--rw mup-actions
       +--rw accept-route?   boolean

]]></artwork>
      </figure>

    </section>
    <section>
      <name>YANG Model</name>
      <t>The YANG model is divided into two parts. The first and the
      main part of the model augments the BGP model in <xref
      target="I-D.ietf-idr-bgp-model"> YANG Model for Border Gateway
      Protocol (BGP-4)</xref> for the BGP configuration, while the
      second part augments the Network Instance YANG model in <xref
      target="RFC8529">YANG Data Model for Network Instances</xref> to
      add in configuration related to MUP at a VRF level, e.g., Route
      Distinguisher (RD).
      </t>

      <t>This model defines two new SAFIs called 'ipv4-mup' and
      'ipv6-mup'. The BGP model is augmented at a global, and at a
      neighbor level to add MUP configuration. In addition, containers
      for AFI/SAFI of type 'ipv4-unicast', 'ipv6-unicast',
      'l3vpn-ipv4-unicast', and 'l3vpn-ipv6-unicast' are augmented to
      add Route Targets (RT). Finally, the Network Instance model is
      augmented to add VRF specific configuration for the MUP
      segments.</t>
      
      <t>The model imports <xref target="RFC6991">Common YANG Data
      Types </xref>, <xref target="RFC8294">Common YANG Data Types for
      the Routing Area</xref>, <xref target="RFC8343">A YANG Data
      Model for Interface Management</xref>, <xref target="RFC8349">A
      YANG Data Model for Routing Management(NMDA Version)</xref>,
      <xref target="RFC8529">YANG Data Model for Network
      Instances</xref>, <xref target="RFC9067">A YANG Data Model for
      Routing Policy</xref>, <xref target="RFC9020">YANG Data Model
      for Segment Routing</xref>, <xref target="RFC9067">A YANG Data
      Model for Routing Policy</xref>, <xref
      target="I-D.ietf-spring-srv6-yang">YANG Data Model for SRv6 Base
      and Static</xref>, and <xref target="I-D.ietf-idr-bgp-model">BGP
      Model for Service Provider Network</xref>.
      </t>
      
      <figure>
        <name>YANG Model for Mobile User Plane</name>
          <artwork><![CDATA[
<CODE BEGINS> file "ietf-mup@2023-10-16.yang"
module ietf-mup {
  yang-version "1.1";
  namespace "urn:ietf:params:xml:ns:yang:ietf-mup";
  prefix "ietf-mup";

  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 6991: Common YANG Data Types.";
  }
  import ietf-inet-types {
    prefix inet;
    reference
      "RFC 6991: Common YANG Data Types.";
  }
  import ietf-interfaces {
    prefix if;
    reference
      "RFC 8343: YANG Data Model for Interface Management.";
  }
  import ietf-routing {
    prefix rt;
    reference
      "RFC 8349, A YANG Data Model for Routing Management
       (NMDA Version).";
  }
  import ietf-routing-types {
    prefix rt-types;
    reference
      "RFC 8294: Common YANG Data Types for the Routing Area.";
  }
  import ietf-routing-policy {
    prefix rt-pol;
    reference
      "RFC 9067: A YANG Data Model for Routing Policy.";
  }
  import ietf-network-instance {
    prefix ni;
    reference
      "RFC 8529: YANG Data Model for Network Instance.";
  }
  import ietf-bgp {
    prefix bgp;
    reference
      "I-D.ietf-idr-bgp-model: YANG Data Model for Border
                               Gateway Protocol 4 (BGP-4).";
  }
  import iana-bgp-types {
    prefix bt;
    reference
      "I-D.ietf-idr-bgp-model:  YANG Data Model for Border
                                Gateway Protocol 4 (BGP-4).";
  }
  import ietf-bgp-policy {
    prefix bp;
    reference
      "I-D.ietf-idr-bgp-model:  YANG Data Model for Border
                                Gateway Protocol 4 (BGP-4).";
  }
  import ietf-segment-routing {
    prefix sr;
    reference
      "RFC 9020: YANG Data Model for Segment Routing.";
  }
  import ietf-srv6-base {
    prefix srv6;
    reference
      "I-D.ietf-spring-srv6-yang: YANG Data Model for SRv6 Base
                                  and Static.";
  }

  organization
    "IETF BESS Working Group";

  contact
    "WG Web:   <https://datatracker.ietf.org/wg/bess/about>
     WG List:  <bess@ietf.org>

     Editor: Mahesh Jethanandani (mjethanandani at gmail dot com)
     Author:  Tetsuya Murakami (tetsuya at arrcus dot com)";

  description
    "This module augments the BGP YANG model to add support for
     configuration in mobile networks.

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

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
     NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT 
     RECOMMENDED', 'MAY', and 'OPTIONAL' in this document are to
     be interpreted as described in BCP 14 (RFC 2119) (RFC 8174)
     when, and only when, they appear in all capitals, as shown
     here.";

  revision "2023-10-16" {
    description
      "Initial Version.";
    reference
      "RFC XXXX, A YANG Model for BGP configuration in mobile 
       networks.";
  }

 /*
  * Identities
  */
  identity sid-allocation-mode {
    description
      "Base identity to be used to express types of SRv6 segment ID
       allocation strategies.";
  }

  identity sid-per-nexthop {
    base sid-allocation-mode;
    description
      "A segment ID is allocated per nexthop entry in the RIB.";
  }

  identity instance-sid {
    base sid-allocation-mode;
    description
      "A single segment ID is used.";
  }

  /*
   * Typedefs
   */
  typedef mup-ext-community-type {
    type string {
      // (ASN):(local-part)
      pattern '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' +
              '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
              '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]' +
              '{2}|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8]' +
              '[0-9]{5}|429[0-3][0-9]{6}|4[0-1][0-9]{7}|[1-3][0-9]' +
              '{9}|[1-9][0-9]{1,8}|[0-9])';
    }
    description
      "A type definition utilised to define the extended community
       in routes of Mobile User Plane (MUP) SAFI. The above pattern
       is a placeholder regex, till such time that a format for it has
       been defined.";
  }

  /*
   * Identities
   */
  identity ipv4-mup {
    base bt:afi-safi-type;
    description
      "AFI/SAFI for Mobile User Plane (AFI,SAFI = 1, 85)";
    reference
      "RFC XXXX: A YANG Model for BGP configuration of Mobile
                 User Plane (MUP).";
  }

  identity ipv6-mup {
    base bt:afi-safi-type;
    description
      "AFI/SAFI for Mobile User Plane (AFI,SAFI = 2, 85)";
    reference
      "RFC XXXX: A YANG Model for BGP configuration of Mobile
                 User Plane (MUP).";
  }

  identity architecture-type {
    description
      "Base identity for Architecture Type.";
    reference
      "I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
                               User Plane (MUP) SAFI.";
  }

  identity three-gpp-5g {
    base architecture-type;
    description
      "The Architecture Type for BGP-MUP NLRI.";
    reference
      "I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
                               User Plane (MUP) SAFI.";
  }

  identity route-type {
    description
      "Base identity for Route Type.";
    reference
      "I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
                               User Plane (MUP) SAFI.";
  }

  identity segment-type {
    description
      "Base identity for Segment Type.";
   reference
      "I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
                               User Plane (MUP) SAFI.";
  }

  identity isd {
    base route-type;
    base segment-type;
    description
      "The Interwork Segment Discovery Route Type.";
    reference
      "I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
                               User Plane (MUP) SAFI.";
  }

  identity dsd {
    base route-type;
    base segment-type;
    description
      "The Direct Segment Discovery Route Type.";
    reference
      "I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
                               User Plane (MUP) SAFI.";
  }

  identity type-1-st {
    base route-type;
    description
      "Type 1 Session Transformed (ST) Route Type.";
    reference
      "I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
                               User Plane (MUP) SAFI.";
  }

  identity type-2-st {
    base route-type;
    description
      "Type 2 Session Transformed (ST) Route Type.";
    reference
      "I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
                               User Plane (MUP) SAFI.";
  }

  /*
   * Groupings
   */
  grouping rts {
    description
      "Grouping for configuration of route targets for AFI/SAFIs.";

    container rts {
      description
        "Container for configuration of Route Targets for address
         family list.";

      list rt {
        key "name";
        description
          "List of route targets for a given afi-safi type.";

        leaf name {
          type identityref {
            base bt:afi-safi-type;
          }
          must "derived-from-or-self(., 'ipv4-mup')  or " +
               "derived-from-or-self(., 'ipv6-mup')" {
            error-message
              "Only ipv4-mup or ipv6-mup are supported.";
          }
          description
            "Name of the AFI/SAFI type.";
        }

        leaf route-policy {
          type leafref {
            path "/rt-pol:routing-policy" +
                 "/rt-pol:policy-definitions/" +
                 "rt-pol:policy-definition/rt-pol:name";
            require-instance true;
          }
          description
            "Reference to the route policy containing set of
             route-targets.";
        }

        container route-targets {
          description
            "Route Targets for a network instance.";

          list route-target {
            key "target type";

            description
              "List of route targets.";

            leaf target {
              type rt-types:route-target;
              description
                "A Route Target is an 8-octet BGP extended community
                 initially identifying a set of sites in a BGP VPN
                 (RFC 4364).  However, it has since taken on a more
                 general role in BGP route filtering.  A Route Target
                 consists of two or three fields: a 2-octet Type
                 field, an administrator field, and, optionally, an
                 assigned number field.

                 According to the data formats for types 0, 1, 2, and
                 6 as defined in RFC 4360, RFC 5668, and RFC 7432,
                 the encoding pattern is defined as:

                 0:2-octet-asn:4-octet-number
                 1:4-octet-ipv4addr:2-octet-number
                 2:4-octet-asn:2-octet-number
                 6:6-octet-mac-address

                 Additionally, a generic pattern is defined for future
                 Route Target types:

                 2-octet-other-hex-number:6-octet-hex-number

                 Some valid examples are 0:100:100, 1:1.1.1.1:100,
                 2:1234567890:203, and 6:26:00:08:92:78:00.";
            }

            leaf type {
              type rt-types:route-target-type;
              description
                "Reference to route-target type.";
            }

          }
        }
      }
    }
  }

  grouping bgp-mup {
    description
      "BGP-MUP NLRI configuration.";

    uses rts;

    container routing-table-limit {
      description
        "The routing-table limit command sets a limit on the maximum
         number of routes imported that the IPv4 or IPv6 address
         family of a MUP instance can support.

         By default, there is no limit on the maximum number of
         routes that the IPv4 or IPv6 address family of a MUP
         instance can support, but the total number of private
         network and public network routes on a device cannot
         exceed the allowed maximum number of unicast routes.";

      list routes {
        key "type";
        description
          "List of routes that need to be limited by type.";

        leaf type {
          type identityref {
            base route-type;
          }
          description
            "The type of route on which a limit is being placed.";
        }

        leaf number {
          type uint32 {
            range "1..max";
          }
          description
            "Specifies the maximum number of routes supported by a
             MUP instance. ";
        }

        choice action {
          description
            "Choice of actions to take.";

          leaf percent {
            type rt-types:percentage;
            description
              "Specifies the percentage of the maximum number of
               routes. When the maximum number of routes that join
               the MUP instance is up to the value
               (number*percent)/100, the system prompts alarms.
               The MUP routes can be still added to the routing
               table, but after the number of routes reaches number,
               the subsequent routes are dropped.";
          }

          leaf simple {
            type boolean;
            description
              "Indicates that when MUP routes exceed number, routes
               can still be added into the routing table, but the
               system prompts alarms.
             
               However, after the total number of VPN routes and
               network public routes reaches the unicast route limit
               specified in the License, the subsequent routes
               are dropped.";
          }
        }
      }
    }

    list segment {
      key "type";
      description
        "List of segments.";

      leaf type {
        type identityref {
          base segment-type;
        }
        description
          "Type of segment.";
      }

      leaf locator {
        type leafref {
          path "/rt:routing/sr:segment-routing/srv6:srv6" +
               "/srv6:locators/srv6:locator/srv6:name";
        }
        must "derived-from-or-self(../type, 'isd')";
        description
          "Reference to locator in the 'default' VRF
           configuration.";
      }

      leaf-list entry {
        type union {
          type inet:ip-prefix;
          type if:interface-ref;
          type enumeration {
            enum router-ip {
              description
                "Entry is of type router-ip.";
            }
          }
        }
        description
          "MUP entries.";
      }

      leaf-list mup-ext-comm {
        type mup-ext-community-type;
        must "derived-from-or-self(../type, 'dsd')";
        description
          "MUP extended community type.";
      }
    }
          
    leaf architecture-type {
      type identityref {
        base architecture-type;
      }
      description
        "Encoding of the rest of BGP-MUP NLRI for a given
         MUP architecture.";
    }
  }
  
  /* 
   * BGP configuration
   */
  augment "/rt:routing/rt:control-plane-protocols" +
          "/rt:control-plane-protocol/bgp:bgp/bgp:global" +
          "/bgp:afi-safis/bgp:afi-safi" {
    description
      "Augmentation of the BGP model to add BGP-MUP.";

    container ipv4-mup {
      when "derived-from-or-self (../../bgp:afi-safi/bgp:name, 
           'ipv4-mup')" {
        description
          "This configuration applies only if the identity is
           IPv4 MUP.";
      }

      uses bgp-mup;
      description
        "IPv4 MUP configuration and management.";
    }

    container ipv6-mup {
      when "derived-from-or-self (../../bgp:afi-safi/bgp:name,
           'ipv6-mup')" {
        description
          "This configuration applies only if the identity is
           IPv6 MUP.";
      }

      uses bgp-mup;
      description
        "IPv6 MUP configuration and management.";
    }
  }

  augment "/rt:routing/rt:control-plane-protocols" +
          "/rt:control-plane-protocol/bgp:bgp/bgp:global" +
          "/bgp:afi-safis/bgp:afi-safi/bgp:ipv4-unicast" {
    description
      "Augmentation of the BGP model to add RT for ipv4-unicast.";

    uses rts;
  }

  augment "/rt:routing/rt:control-plane-protocols" +
          "/rt:control-plane-protocol/bgp:bgp/bgp:global" +
          "/bgp:afi-safis/bgp:afi-safi/bgp:ipv6-unicast" {
    description
      "Augmentation of the BGP model to add RT for ipv6-unicast.";

    uses rts;
  }

  augment "/rt:routing/rt:control-plane-protocols" +
          "/rt:control-plane-protocol/bgp:bgp/bgp:global" +
          "/bgp:afi-safis/bgp:afi-safi/bgp:l3vpn-ipv4-unicast" {
    description
      "Augmentation of the BGP model to add RT for
       l3vpn-ipv4-unicast.";

    uses rts;
  }

  augment "/rt:routing/rt:control-plane-protocols" +
          "/rt:control-plane-protocol/bgp:bgp/bgp:global" +
          "/bgp:afi-safis/bgp:afi-safi/bgp:l3vpn-ipv6-unicast" {
    description
      "Augmentation of the BGP model to add RT for
       l3vpn-ipv6-unicast.";

    uses rts;
  }

  augment "/rt:routing/rt:control-plane-protocols" +
          "/rt:control-plane-protocol/bgp:bgp/bgp:neighbors" +
          "/bgp:neighbor/bgp:afi-safis/bgp:afi-safi" {
    description
      "Augmentation of the BGP model to add BGP-MUP.";

    container ipv4-mup {
      when "derived-from-or-self(../../bgp:afi-safi/bgp:name,         
            'ipv4-mup')" {
        description
          "This configuration applies only if the identity is
           IPv4 MUP.";
      }
      presence "Presence container for IPv4 MUP.";
      description
        "IPv4 MUP configuration and management on a per neighbor
         basis.";
    }

    container ipv6-mup {
      when "derived-from-or-self(../../bgp:afi-safi/bgp:name,
            'ipv6-mup')" {
        description
          "This configuration applies only if the identity is
           IPv6 MUP.";
      }
      presence "Presence container for IPv6 MUP.";
      description
        "IPv6 MUP configuration and management on a per neighbor
         basis.";
    }
  }

  augment "/rt:routing/rt:control-plane-protocols" +
          "/rt:control-plane-protocol/bgp:bgp/bgp:neighbors" +
          "/bgp:neighbor/bgp:statistics" {
    description
      "Augmentation of the BGP per-neighbor statistics to add
       BGP-MUP specific counters.";

    leaf isd-sent {
      type yang:zero-based-counter32;
      description
        "Total number of BGP Interwork Segment Discovery routes sent
         per neighbor.";
    }

    leaf isd-received {
      type yang:zero-based-counter32;
      description
        "Total number of BGP Interwork Segment Discovery routes
         received per neighbor.";
    }

    leaf dsd-sent {
      type yang:zero-based-counter32;
      description
        "Total number of BGP Direct Segment Discovery routes sent
         per neighbor.";
    }

    leaf dsd-received {
      type yang:zero-based-counter32;
      description
        "Total number of BGP Direct Segment Discovery routes
         received per neighbor.";
    }

    leaf type-1-st-sent {
      type yang:zero-based-counter32;
      description
        "Total number of BGP Type 1 Session Transformed routes sent
         per neighbor.";
    }

    leaf type-1-st-received {
      type yang:zero-based-counter32;
      description
        "Total number of BGP Type 1 Session Transformed routes
         received per neighbor.";
    }

    leaf type-2-st-sent {
      type yang:zero-based-counter32;
      description
        "Total number of BGP Type 2 Session Transformed routes sent
         per neighbor.";
    }

    leaf type-2-st-received {
      type yang:zero-based-counter32;
      description
        "Total number of BGP Type 2 Session Transformed routes
         received per neighbor.";
    }
  }

  augment "/rt:routing/rt:control-plane-protocols" +
          "/rt:control-plane-protocol/bgp:bgp/bgp:global" {
    description
      "Augmentation of the BGP model to add SRv6 mobile
       configuration.";

    container srv6 {
      description
        "Container to define SRv6 MUP configuration.";

      leaf locator {
        type leafref {
          path "/rt:routing/sr:segment-routing/srv6:srv6" +
               "/srv6:locators/srv6:locator/srv6:name";
        }
        description
         "Reference to the locator configured.";
      }

      leaf sid-manager-connected {
        type boolean;
        config false;
        description
          "Is the connection with segment ID manager active?";
      }

      leaf locator-registered {
        type boolean;
        config false;
        description
          "Is the locator name registered?";
      }

      leaf micro-segment-enabled {
        type boolean;
        config false;
        description
          "Is the locator enabled for micro-segment behavior?";
      }

      leaf sid-allocation-mode {
        type identityref {
          base sid-allocation-mode;
        }
        must "boolean((../mobile/encapsulation/locator) or " +
             "(../mobile/decapsulations/decapsulation/locator) or " +
             "(../locator))" {
          error-message
            "SRv6 locator name must be configured";
        }
        description
          "The segment ID allocation mode to be used for L3 entries
           in the network instance";
      }

      container mobile {
        description
          "MUP configuration.";

        container encapsulation {
          description
            "Encapsulation configuration for mobile data.";

          leaf locator {
            type leafref {
              path "../../../locator";
            }
            description
              "Encapsulation specific locator.";
          }

        }

        container decapsulations {
          description
            "Container for all SRv6 mobile decapsulation
             configurations";

          list decapsulation {
            key "id";

            description
              "SRv6 mobile decapsulation config";

            leaf id {
              type uint16 {
                range "1..100";
              }
              description
                "SRv6 mobile decapsulation entry id";
            }

            leaf locator {
              type leafref {
                path "../../../../locator";
              }
              description
                "Encapsulation specific locator.";
            }

            container mup-ext-communities {
              description
                "MUP extended communities configuration.";

              leaf-list mup-ext-community {
                type mup-ext-community-type;
                description
                  "List of MUP extended communities.";
              }
            }
          }
        }
      }
    }
  }

  /*
   * Network Instance configuration.
   */
  augment "/ni:network-instances/ni:network-instance/ni:ni-type" {
     description
       "Augment network instance for per VRF MUP parameters";

     case mup {
      container mup {
        description
          "Configuration of MUP specific parameters";

        container rd {
          description
            "Route distinguisher parameters.";
          
          leaf rd {
            type union {
              type rt-types:route-distinguisher;
              type enumeration {
                enum auto {
                  description
                    "Route distinguisher is assigned automatically.";
                }
              }
            }
            description
              "Route distinguisher value.";
            reference
              "RFC 4364: BGP/MPLS IP Virtual Private Networks
                         (VPNs).";
          }

          leaf auto-rd {
            type rt-types:route-distinguisher;
            config false;
            description
              "Automatically assigned RD value when rd is configured
               as 'auto'.";
          }
        }
      }
    }
  }

  augment "/rt-pol:routing-policy/rt-pol:policy-definitions/" +
          "rt-pol:policy-definition/rt-pol:statements/" +
          "rt-pol:statement/rt-pol:conditions/bp:bgp-conditions" {
    description
      "BGP policy conditions added to routing policy module.";

    container match-mup {
      description
        "Top-level container for MUP specific policy conditions.";

      leaf route-type {
        type identityref {
          base route-type;
        }
        description
          "Route type to match with.";
      }
    }
  }

  augment "/rt-pol:routing-policy/rt-pol:policy-definitions/" +
          "rt-pol:policy-definition/rt-pol:statements/" +
          "rt-pol:statement/rt-pol:actions" {
    description
      "MUP policy actions added to routing policy module.";

    container mup-actions {
      description
        "Container for adding MUP specific actions.";

      leaf accept-route {
        type boolean;
        default false;
        description
          "Accept this route.";
      }
    }
  }
}
<CODE ENDS>

]]></artwork>
        <!-- [CHECK] markers="true" means that the rendered file will have <CODE BEGINS> and <CODE ENDS> added -->
      </figure>
    </section>   
    
    <section anchor="IANA">
      <name>IANA Considerations</name>

      <t>This memo registers the following namespace URIs in the IETF
      XML in the "IETF XML Registry" <xref target="RFC3688"
      format="default" sectionFormat="of"
      derivedContent="RFC3688"/>:</t>

      <dl newline="false" spacing="compact" indent="3">
        <dt>URI:</dt>
        <dd>urn:ietf:params:xml:ns:yang:ietf-mup</dd>
        <dt>Registrant Contact:</dt>
        <dd>The IESG.</dd>
        <dt>XML:</dt>
        <dd>N/A; the requested URI is an XML namespace.</dd>
      </dl>

      <t indent="0">This document registers the following YANG modules
      in the "YANG Module Names" registry <xref target="RFC6020"
      format="default" sectionFormat="of"
      derivedContent="RFC6020"/>:</t>

      <dl newline="false" spacing="compact" indent="3">
        <dt>Name:</dt>
        <dd>ietf-mup</dd>
        <dt>Namespace:</dt>
        <dd>urn:ietf:params:xml:ns:yang:ietf-mup</dd>
        <dt>Prefix:</dt>
        <dd>srv6-mob</dd>
        <dt>Reference:</dt>
        <dd>RFC XXXX</dd>
      </dl>
    </section>
    
    <section anchor="Security">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a guide. -->
      <name>Security Considerations</name>
      <t>The YANG module specified in this document defines a schema
      for data that is designed to be accessed via network management
      protocols such as <xref target="RFC6241">NETCONF</xref> or <xref
      target="RFC8040">RESTCONF</xref>. The lowest NETCONF layer is
      the secure transport layer, and the mandatory-to-implement
      secure transport is <xref target="RFC6242">Secure Shell
      (SSH)</xref>. The lowest RESTCONF layer is HTTPS, and the
      mandatory-to-implement secure transport is <xref
      target="RFC8446">TLS</xref>.</t>

      <t>The <xref target="RFC8341">Network Configuration Access
      Control Model (NACM)</xref> 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. These are the
      subtrees and data nodes and their sensitivity/vulnerability:</t>

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

      <t>Some of the RPC operations in this YANG module may be
      considered sensitive or vulnerable in some network
      environments. It is thus important to control access to these
      operations. These are the operations and their
      sensitivity/vulnerability:</t>

    </section>
    
    <!-- NOTE: The Acknowledgements and Contributors sections are at the end of this template -->
  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.3688.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.6020.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.6241.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.6242.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.6991.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.7950.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8040.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8294.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8340.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8341.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8342.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8343.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8349.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8402.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8446.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8529.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9020.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9067.xml"/>
	<?rfc include='reference.I-D.ietf-idr-bgp-model.xml'?>
	<?rfc include='reference.I-D.ietf-spring-srv6-yang.xml'?>
	<?rfc include='reference.I-D.mpmz-bess-mup-safi.xml'?>
	<?rfc include='reference.I-D.mhkk-dmm-srv6mup-architecture.xml'?>
      </references>
 
      <references>
        <name>Informative References</name>
      </references>
    </references>
    
    <section>
      <name>Complete Tree Diagram</name>
      <t>Here is a complete tree diagram for the configuration and
      operational part of the model.</t>
      <figure>
	<name>Complete tree diagram</name>
        <artwork><![CDATA[
module: ietf-mup

  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi:
    +--rw ipv4-mup
    |  +--rw rts
    |  |  +--rw rt* [name]
    |  |     +--rw name             identityref
    |  |     +--rw route-policy?    leafref
    |  |     +--rw route-targets
    |  |        +--rw route-target* [target type]
    |  |           +--rw target    rt-types:route-target
    |  |           +--rw type      rt-types:route-target-type
    |  +--rw routing-table-limit
    |  |  +--rw routes* [type]
    |  |     +--rw type             identityref
    |  |     +--rw number?          uint32
    |  |     +--rw (action)?
    |  |        +--:(percent)
    |  |        |  +--rw percent?   rt-types:percentage
    |  |        +--:(simple)
    |  |           +--rw simple?    boolean
    |  +--rw segment* [type]
    |  |  +--rw type            identityref
    |  |  +--rw locator?        leafref
    |  |  +--rw entry*          union
    |  |  +--rw mup-ext-comm*   mup-ext-community-type
    |  +--rw architecture-type?     identityref
    +--rw ipv6-mup
       +--rw rts
       |  +--rw rt* [name]
       |     +--rw name             identityref
       |     +--rw route-policy?    leafref
       |     +--rw route-targets
       |        +--rw route-target* [target type]
       |           +--rw target    rt-types:route-target
       |           +--rw type      rt-types:route-target-type
       +--rw routing-table-limit
       |  +--rw routes* [type]
       |     +--rw type             identityref
       |     +--rw number?          uint32
       |     +--rw (action)?
       |        +--:(percent)
       |        |  +--rw percent?   rt-types:percentage
       |        +--:(simple)
       |           +--rw simple?    boolean
       +--rw segment* [type]
       |  +--rw type            identityref
       |  +--rw locator?        leafref
       |  +--rw entry*          union
       |  +--rw mup-ext-comm*   mup-ext-community-type
       +--rw architecture-type?     identityref
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi/bgp:ipv4-unicast:
    +--rw rts
       +--rw rt* [name]
          +--rw name             identityref
          +--rw route-policy?    leafref
          +--rw route-targets
             +--rw route-target* [target type]
                +--rw target    rt-types:route-target
                +--rw type      rt-types:route-target-type
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi/bgp:ipv6-unicast:
    +--rw rts
       +--rw rt* [name]
          +--rw name             identityref
          +--rw route-policy?    leafref
          +--rw route-targets
             +--rw route-target* [target type]
                +--rw target    rt-types:route-target
                +--rw type      rt-types:route-target-type
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi/bgp:l3vpn-ipv4-unicast:
    +--rw rts
       +--rw rt* [name]
          +--rw name             identityref
          +--rw route-policy?    leafref
          +--rw route-targets
             +--rw route-target* [target type]
                +--rw target    rt-types:route-target
                +--rw type      rt-types:route-target-type
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global
            /bgp:afi-safis/bgp:afi-safi/bgp:l3vpn-ipv6-unicast:
    +--rw rts
       +--rw rt* [name]
          +--rw name             identityref
          +--rw route-policy?    leafref
          +--rw route-targets
             +--rw route-target* [target type]
                +--rw target    rt-types:route-target
                +--rw type      rt-types:route-target-type
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:neighbors
            /bgp:neighbor/bgp:afi-safis/bgp:afi-safi:
    +--rw ipv4-mup!
    +--rw ipv6-mup!
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:neighbors
            /bgp:neighbor/bgp:statistics:
    +--ro isd-sent?             yang:zero-based-counter32
    +--ro isd-received?         yang:zero-based-counter32
    +--ro dsd-sent?             yang:zero-based-counter32
    +--ro dsd-received?         yang:zero-based-counter32
    +--ro type-1-st-sent?       yang:zero-based-counter32
    +--ro type-1-st-received?   yang:zero-based-counter32
    +--ro type-2-st-sent?       yang:zero-based-counter32
    +--ro type-2-st-received?   yang:zero-based-counter32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/bgp:bgp/bgp:global:
    +--rw srv6
       +--rw locator?                 leafref
       +--ro sid-manager-connected?   boolean
       +--ro locator-registered?      boolean
       +--ro micro-segment-enabled?   boolean
       +--rw sid-allocation-mode?     identityref
       +--rw mobile
          +--rw encapsulation
          |  +--rw locator?   -> ../../../locator
          +--rw decapsulations
             +--rw decapsulation* [id]
                +--rw id                     uint16
                +--rw locator?               -> ../../../../locator
                +--rw mup-ext-communities
                   +--rw mup-ext-community*   mup-ext-community-type
  augment /ni:network-instances/ni:network-instance/ni:ni-type:
    +--:(mup)
       +--rw mup
          +--rw rd
             +--rw rd?        union
             +--ro auto-rd?   rt-types:route-distinguisher
  augment /rt-pol:routing-policy/rt-pol:policy-definitions
            /rt-pol:policy-definition/rt-pol:statements
            /rt-pol:statement/rt-pol:conditions/bp:bgp-conditions:
    +--rw match-mup
       +--rw route-type?   identityref
  augment /rt-pol:routing-policy/rt-pol:policy-definitions
            /rt-pol:policy-definition/rt-pol:statements
            /rt-pol:statement/rt-pol:actions:
    +--rw mup-actions
       +--rw accept-route?   boolean

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

    <section>
      <name>Configuration examples</name>
      <t>This section documents some example configurations for MUP.</t>
      <section>
	<name>MUP configuration under BGP</name>
	<figure>
	  <name>MUP configuration under BGP</name>
          <artwork><![CDATA[
<!--
    This example shows a MUP configuration, with routing policy
    configured for route target.

draft-ietf-spring-srv6-yang defines srv6 locators
under /routing/segment-routing/srv6 path, instead of 
putting them under BGP.
-->

<?xml version="1.0" encoding="UTF-8"?>
<routing-policy xmlns="urn:ietf:params:xml:ns:yang:ietf-routing-policy">
  <policy-definitions>
    <policy-definition>
      <name>route-target-policy</name>
      <statements>
        <statement>
          <name>10</name>
          <conditions>
            <bgp-conditions xmlns="urn:ietf:params:xml:ns:yang:ietf-bgp-policy">
	      <match-mup xmlns="urn:ietf:params:xml:ns:yang:ietf-mup">
		<route-type>type-1-st</route-type>
	      </match-mup>
	    </bgp-conditions>
	  </conditions>
	  <actions xmlns="urn:ietf:params:xml:ns:yang:ietf-routing-policy">
	    <bgp-actions xmlns="urn:ietf:params:xml:ns:yang:ietf-bgp-policy">
	      <set-ext-community>
		<communities>route-target:100:5000</communities>
		<options>add</options>
	      </set-ext-community>
	    </bgp-actions>
	    <mup-actions xmlns="urn:ietf:params:xml:ns:yang:ietf-mup">
	      <accept-route>true</accept-route>
	    </mup-actions>
	  </actions>
	</statement>
      </statements>
    </policy-definition>
  </policy-definitions>
</routing-policy>

<routing
    xmlns="urn:ietf:params:xml:ns:yang:ietf-routing"
    xmlns:bt="urn:ietf:params:xml:ns:yang:iana-bgp-types"
    xmlns:mup="urn:ietf:params:xml:ns:yang:ietf-mup"
    xmlns:srv6="urn:ietf:params:xml:ns:yang:ietf-srv6-base">
  <segment-routing
      xmlns="urn:ietf:params:xml:ns:yang:ietf-segment-routing">
    <srv6
	xmlns="urn:ietf:params:xml:ns:yang:ietf-srv6-base">
      <locators>
	<locator>
	  <name>mup-gw-1</name>
	  <prefix>
	    <address>bead:1000::</address>
	    <length>32</length>
	  </prefix>
	</locator>
	<locator>
	  <name>mup-gw-2</name>
	  <prefix>
	    <address>bead:1010::</address>
	    <length>32</length>
	  </prefix>
	</locator>
      </locators>
    </srv6>
  </segment-routing>
  <control-plane-protocols>
    <control-plane-protocol>
      <type
	  xmlns:bgp="urn:ietf:params:xml:ns:yang:ietf-bgp">bgp:bgp</type>
      <name>b1</name>
      <bgp
          xmlns="urn:ietf:params:xml:ns:yang:ietf-bgp">
        <global>
          <as>64496</as>
	  <identifier>11.11.11.11</identifier>
          <afi-safis>
            <afi-safi>
	      <name
		  xmlns:mup="urn:ietf:params:xml:ns:yang:ietf-mup">mup:ipv4-mup</name>
	      <ipv4-mup xmlns="urn:ietf:params:xml:ns:yang:ietf-mup">
		<rts>
		  <rt>
		    <name>ipv4-mup</name>
		    <route-policy>route-target-policy</route-policy>
		    <route-targets>
		      <route-target>
			<target>100:4000</target>
			<type>import</type>
		      </route-target>
		    </route-targets>
		  </rt>
		</rts>
	      </ipv4-mup>
            </afi-safi>
          </afi-safis>
        </global>
        <neighbors>
	  <neighbor>
	    <remote-address>33.33.33.33</remote-address>
	    <afi-safis>
	      <afi-safi>
		<name
		    xmlns:mup="urn:ietf:params:xml:ns:yang:ietf-mup">mup:ipv4-mup</name>
	      </afi-safi>
	    </afi-safis>
	  </neighbor>
	</neighbors>
      </bgp>
    </control-plane-protocol>
  </control-plane-protocols>
</routing>

]]></artwork>
	</figure>
      </section>
      <section>
	<name>Example MUP configuration of SRv6.</name>
	<figure>
	  <name>Example MUP configuration in BGP for SRv6</name>
          <artwork><![CDATA[
<!--
    This example shows a MUP configuration.
-->

<?xml version="1.0" encoding="UTF-8"?>
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
            xmlns:ipv4="urn:ietf:params:xml:ns:yang:ietf-ip"
	    xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
  <interface>
    <name>loopback0</name>
    <type>ianaift:softwareLoopback</type>
    <ipv4
	xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
	<ip>11.11.11.11</ip>
	<prefix-length>32</prefix-length>
      </address>
    </ipv4>
  </interface>
  <interface>
    <name>swp10</name>
    <type>ianaift:ethernetCsmacd</type>
    <ipv4
	xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
	<ip>20.1.1.1</ip>
	<prefix-length>24</prefix-length>
      </address>
    </ipv4>
  </interface>
</interfaces>


<routing
    xmlns="urn:ietf:params:xml:ns:yang:ietf-routing"
    xmlns:bt="urn:ietf:params:xml:ns:yang:ietf-bgp-types"
    xmlns:mup="urn:ietf:params:xml:ns:yang:ietf-mup"
    xmlns:srv6="urn:ietf:params:xml:ns:yang:ietf-srv6-base">
  <segment-routing
      xmlns="urn:ietf:params:xml:ns:yang:ietf-segment-routing">
    <srv6
	xmlns="urn:ietf:params:xml:ns:yang:ietf-srv6-base">
      <locators>
	<locator>
	  <name>mup-gw-1</name>
	  <prefix>
	    <!-- draft-ietf-spring-srv6-yang defines address
                 as ip-address instead of ip-prefix, which
                 would allow this to be specified the following
                 address as bead:1000::/48.
	    -->
	    <address>bead:1000::</address>
	    <!-- draft-ietf-spring-srv6-yang defines length
                 to be prefix length, instead of sid allocation
                 length. Additionally, it puts a constraint of
                 range as 32..98, which means this value cannot
                 be 16.
	    -->
	    <length>32</length>
	  </prefix>
	</locator>
	<locator>
	  <name>mup-gw-2</name>
	  <prefix>
	    <address>bead:1010::</address>
	    <length>32</length>
	  </prefix>
	</locator>
      </locators>
    </srv6>
  </segment-routing>    
  <control-plane-protocols>
    <control-plane-protocol>
      <type
	  xmlns:bgp="urn:ietf:params:xml:ns:yang:ietf-bgp">bgp:bgp</type>
      <name>b1</name>
      <bgp
	  xmlns="urn:ietf:params:xml:ns:yang:ietf-bgp">
        <global>
          <as>64496</as>
	  <identifier>11.11.11.11</identifier>
	  <!-- draft-ietf-idr-bgp-yang does not define
               route-distinguisher at a global level.

	       draft-ietf-sprint-ipv6-yang does not define a
               way to reference a srv6 locator from within a
               BGP instance.

              Additionally, it does not allow a SID allocation
              mode for something like 'instance-sid' or
              'prefix-sid'
	  -->
	  <afi-safis>
	    <afi-safi>
	      <name
		  xmlns:mup="urn:ietf:params:xml:ns:yang:ietf-mup">mup:ipv4-mup</name>
	    </afi-safi>
	  </afi-safis>
        </global>
        <neighbors>
	  <neighbor>
	    <remote-address>33.33.33.33</remote-address>
	    <afi-safis>
	      <afi-safi>
		<name
		    xmlns:mup="urn:ietf:params:xml:ns:yang:ietf-mup">mup:ipv4-mup</name>
	      </afi-safi>
	    </afi-safis>
	  </neighbor>
	</neighbors>
      </bgp>
    </control-plane-protocol>
  </control-plane-protocols>
</routing>

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

      <section>
	<name>Example MUP configuration for RT.</name>
	<figure>
	  <name>Example MUP configuration in BGP for RT</name>
          <artwork><![CDATA[
<!--
    This example shows a MUP configuration.
-->

<?xml version="1.0" encoding="UTF-8"?>
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
 	    xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
  <interface>
    <name>loopback0</name>
    <type>ianaift:softwareLoopback</type>
    <ipv4
	xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
	<ip>11.11.11.11</ip>
	<prefix-length>32</prefix-length>
      </address>
    </ipv4>
  </interface>
  <interface>
    <name>swp10</name>
    <type>ianaift:ethernetCsmacd</type>
    <ipv4
	xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
	<ip>20.1.1.1</ip>
	<prefix-length>24</prefix-length>
      </address>
    </ipv4>
  </interface>
</interfaces>

<routing
    xmlns="urn:ietf:params:xml:ns:yang:ietf-routing"
    xmlns:bt="urn:ietf:params:xml:ns:yang:ietf-bgp-types"
    xmlns:mup="urn:ietf:params:xml:ns:yang:ietf-mup"
    xmlns:srv6="urn:ietf:params:xml:ns:yang:ietf-srv6-base">
  <segment-routing
      xmlns="urn:ietf:params:xml:ns:yang:ietf-segment-routing">
    <srv6
	xmlns="urn:ietf:params:xml:ns:yang:ietf-srv6-base">
      <locators>
	<locator>
	  <name>mup-gw-1</name>
	  <prefix>
	    <!-- draft-ietf-spring-srv6-yang defines address
                 as ip-address instead of ip-prefix, which
                 would allow this to be specified the following
                 address as bead:1000::/48.
	    -->
	    <address>bead:1000::</address>
	    <length>32</length>
	  </prefix>
	</locator>
	<locator>
	  <name>mup-gw-2</name>
	  <prefix>
	    <!-- draft-ietf-spring-srv6-yang defines address
                 as ip-address instead of ip-prefix, which
                 would allow this to be specified the following
                 address as bead:1000::/48.
	    -->
	    <address>bead:1010::</address>
	    <length>32</length>
	  </prefix>
	</locator>
      </locators>
    </srv6>
  </segment-routing>
  <control-plane-protocols>
    <control-plane-protocol>
      <type
	  xmlns:bgp="urn:ietf:params:xml:ns:yang:ietf-bgp">bgp:bgp</type>
      <name>b1</name>
      <bgp
	  xmlns="urn:ietf:params:xml:ns:yang:ietf-bgp">
        <global>
	  <as>64496</as>
	  <identifier>11.11.11.11</identifier>
	  <!--
	      draft-ietf-spring-ipv6-yang does not define a
	      way to reference a srv6 locator from within a
	      BGP instance.

              Cannot configure RD in IETF models as RD is configured
              at a NI level, and configuring anything at the NI level
              requires support of schema mount which most tools do not
              support.
	  -->
	  <srv6
	      xmlns="urn:ietf:params:xml:ns:yang:ietf-mup">
	    <locator>mup-gw-1</locator>
	    <sid-allocation-mode>instance-sid</sid-allocation-mode>
	  </srv6>
	  <afi-safis>
	    <afi-safi>
	      <name
		  xmlns:mup="urn:ietf:params:xml:ns:yang:ietf-mup">mup:ipv4-mup</name>
	      <ipv4-mup
		  xmlns="urn:ietf:params:xml:ns:yang:ietf-mup">
		<rts>
		  <rt>
		    <name>ipv4-mup</name>
		    <route-targets>
		      <route-target>
			<target>100:6000</target>
			<type>import</type>
		      </route-target>
		      <route-target>
			<target>100:4000</target>
			<type>export</type>
		      </route-target>
		    </route-targets>
		  </rt>
		</rts>
		<segment>
		  <type>isd</type>
		  <locator>mup-gw-2</locator>
		  <entry>swp10</entry>
		</segment>
	      </ipv4-mup>
	    </afi-safi>
	  </afi-safis>
        </global>
      </bgp>
    </control-plane-protocol>
  </control-plane-protocols>
</routing>

]]></artwork>
	</figure>
      </section>
    </section>
    <section anchor="Acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>TBA</t>
    </section>
    
    <section anchor="Contributors" numbered="false">
      <!-- [REPLACE/DELETE] a Contributors section is optional -->
      <name>Contributors</name>
      <t>Thanks to all of the contributors.</t>
      <!-- [CHECK] it is optional to add a <contact> record for some or all contributors -->
    </section>
    
 </back>
</rfc>
