<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2918 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2918.xml">
<!ENTITY RFC4111 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4111.xml">
<!ENTITY RFC4271 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY RFC4272 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4272.xml">
<!ENTITY RFC4360 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4360.xml">
<!ENTITY RFC4364 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4364.xml">
<!ENTITY RFC4760 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4760.xml">
<!ENTITY RFC5925 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5925.xml">
<!ENTITY RFC6811 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6811.xml">
<!ENTITY RFC7606 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7606.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8205 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8205.xml">
<!ENTITY RFC9012 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9012.xml">
<!ENTITY I-D.mhkk-dmm-srv6mup-architecture SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.mhkk-dmm-srv6mup-architecture.xml">
<!ENTITY I-D.ietf-dmm-srv6-mobile-uplane SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dmm-srv6-mobile-uplane.xml"> 
  ]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
<rfc category="std" ipr="trust200902" docName="draft-mpmz-bess-mup-safi-02">

  <front>

<title abbrev="BGP MUP SAFI">
BGP Extensions for the Mobile User Plane (MUP) SAFI </title>
  <author initials='T.' surname="Murakami" fullname='Tetsuya Murakami'>
    <organization>Arrcus, Inc.</organization>
    <address>
      <postal>
        <street>2077 Gateway Place, Suite 400</street>
        <city>San Jose</city> <region>CA</region> 
        <country>USA</country>
        <code>95110</code> 
       </postal>
       <email>tetsuya@arrcus.com</email>
    </address>
    </author>
  <author initials='K.' surname="Patel" fullname='Keyur Patel'>
    <organization>Arrcus, Inc.</organization>
    <address>
      <postal>
        <street>2077 Gateway Place, Suite 400</street>
        <city>San Jose</city> <region>CA</region> 
        <country>USA</country>
        <code>95110</code> 
       </postal>
       <email>keyur@arrcus.com</email>
    </address>
    </author>
  <author initials='S.' surname="Matsushima" fullname='Satoru Matsushima'>
    <organization>SoftBank</organization>
    <address>
      <postal>
        <street></street>
        <city></city> <region></region> 
        <country>Japan</country>
        <code></code> 
       </postal>
       <email>satoru.matsushima@g.softbank.co.jp</email>
    </address>
  </author>

    <author initials='J.' surname="Zhang" fullname='Jeffrey Zhang'>
    <organization>Juniper Networks</organization>
    <address>
      <postal>
        <street></street>
        <city></city> <region></region> 
        <country>USA</country>
        <code></code> 
       </postal>
       <email>zzhang@juniper.net</email>
    </address>
    </author>

    <author initials='S.' surname="Agrawal" fullname='Swadesh Agrawal'>
    <organization>Cisco Systems</organization>
    <address>
      <postal>
        <street></street>
        <city></city> <region></region> 
        <country>USA</country>
        <code></code> 
       </postal>
       <email>swaagraw@cisco.com</email>
    </address>
    </author>

    <author initials='D.' surname="Voyer" fullname='Daniel Voyer'>
    <organization>Bell Canada</organization>
    <address>
      <postal>
        <street></street>
        <city>Montreal</city> <region></region> 
        <country>Canada</country>
        <code></code> 
       </postal>
       <email>daniel.voyer@bell.ca</email>
    </address>
    </author>
    <date/>
    <area>Routing Area</area>
    <workgroup>BESS</workgroup>
  <abstract>
  
    <!-- No need 3GPP specific text here since this is Mobile architecture independent BGP container
    <t>
      5G User Plane uses N4 signaling between Session Mangagement Function
      (SMF) and User Plane Function (UPF), and N2 signaling between Access
      and Mobility Management Function (AMF) and Access Nodes (AN).  A
      traditional UPF device uses GTP tunnels between itself and ANs for data
      traffic to/from User Equipment (UEs).  The GTP tunnels are set up by
      the N4 and N2 signaling. UPFs also act as stitching points and handle
      GTP based forwarding with ANs and IP/MPLS based forwarding with tradional
      routers.
    </t>
    -->
    <t>
      This document defines a new SAFI known as a BGP Mobile User Plane (BGP-MUP)
      SAFI to support MUP Extensions and a extended community for BGP. This document
      also provides BGP
      signaling and procedures for the new SAFI to convert mobile session information
      into appropriate IP forwarding information. These extensions can be
      used by operators between a PE, and a Controller for
      integrating mobile user plane into BGP MUP network using the IP based
      routing. 
    </t>  

  </abstract>
</front>

<middle>
  <section title="Introduction">

    <!-- No need 3GPP specific text here since this is Mobile architecture independent BGP container
    <t>
      5G Control Plane uses N4 signaling between Session Mangagement Function
      (SMF) and User Plane Function (UPF), and N2 signaling between Access
      and Mobility Management Function (AMF) and Access Nodes (AN).  A
      traditional UPF device uses GTP tunnels between itself and ANs for data
      traffic to/from User Equipment (UEs).  The GTP tunnels are set up by
      the N4 and N2 signaling. UPFs also act as stitching points and handle
      GTP based forwarding with ANs and IP/MPLS based forwarding with tradional
      routers. It is possible to convert GTP based forwarding with BGP based fabrics that
      can do IP based forwarding.
    </t>
    -->

    <t>
      <xref target="I-D.mhkk-dmm-srv6mup-architecture"/> 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.
    </t>
    <t>
      This document defines a new SAFI known as a BGP Mobile User Plane (BGP-MUP)
      SAFI to support MUP Extensions for BGP. This draft also provides BGP
      signaling and procedures for the new SAFI to convert mobile session information
      into appropriate IP routing information. These extensions can be
      used by operators between the PE and a MUP Controller for
      integrating mobile user plane into Segment Routing network using the IP based
      routing information. These extensions also works
      with routing instances accomodationg two new wellknown segment types known as Interwork and Direct
      <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>.
      Finally, the BGP encoding and procedures defined in this document that uses
      SRv6 as the forwarding fabric follows the
      SRv6 MUP architecture defined in <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>.
      The BGP extensions to build networks that use forwarding mechanisms other than
      SRv6 (SRv6 MUP) are outside the scope of this document.
    </t>

    <section title="Requirements Notation">
      <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>

<section title="Terminology">
  <t>
   MUP:    Mobile User Plane
  </t>
  <t>
   MUP Segment:  Representation of mobile user plane segment
  </t>
  <t>
   PE:  Provider Edge node in an SR network
  </t>
  <t>
   MUP Controller:  Controller node for an SR network
  </t>
  <t>
   UE:     User Equipment, as per <xref target="TS.23501"/>
  </t>
  <t>
   gNodeB: 3GPP-compliant implementation of 5G-NR base station,
           as per <xref target="TS.23501"/>
  </t>
  <t>
   UPF: 3GPP-compliant implementation of User Plane Function,
           as per <xref target="TS.23501"/>
  </t>
  <t>
   TEID: Tunnel Endpoint Identifier,
           as per <xref target="TS.29281"/>
  </t>
</section>

<section title="BGP MUP Extensions">
  <section title="BGP MUP SAFI">
    <t>
      This draft defines a new BGP SAFI known as a BGP-MUP SAFI. The value of this SAFI
      is to be assigned by IANA from the Subsequent Address Family Identifiers (SAFI)
      registry. 
    </t>
    <t>
      This document also defines a new BGP NLRI known as the BGP-MUP NLRI. The
      following is the format of the BGP-MUP NLRI:
    </t>
    <t>
  <figure align="center">
    <artwork align="left"><![CDATA[ 
      +-----------------------------------+
      |    Architecture Type (1 octet)    |
      +-----------------------------------+
      |       Route Type (2 octets)       |
      +-----------------------------------+
      |         Length (1 octet)          |
      +-----------------------------------+
      |  Route Type specific (variable)   |
      +-----------------------------------+
                                                                                                        
      ]]></artwork>
  </figure>
    </t>
    <t>
      The Architecture Type field defines the encoding of the rest of BGP-MUP
      NLRI for a given Mobile User Plane architecture. This draft defines the
      following architecture type for BGP-MUP NLRI:
    </t>
    <t>
  <figure align="center">
    <artwork align="left"><![CDATA[ 
	+ 1 - 3gpp-5g;
      ]]></artwork>
  </figure>
    </t>
    <t>
      The Route Type field defines the encoding of the rest of BGP-MUP
      NLRI (Route Type specific BGP-MUP NLRI) for a given architecture type.
    </t>
    <t>
      The Length field indicates the length in octets of the Route Type
      specific field of the BGP-MUP NLRI.
    </t>
    <t>
      This document defines the following Route Types for BGP-MUP NLRI. 
    </t>
    <t>
  <figure align="center">
    <artwork align="left"><![CDATA[ 
	+ 1 - Interwork Segment Discovery route;
	+ 2 - Direct Segment Discovery route;
	+ 3 - Type 1 Session Transformed (ST) route;
	+ 4 - Type 2 Session Transformed (ST) route;
      ]]></artwork>
  </figure>
    </t>
    <t>
      These Route Types are applicable for the 3gpp-5G architecture type as per 
      <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>. Other new architectures
      can share them if it is applicable as well.
    </t>

    <t>
      The BGP-MUP NLRI is carried in BGP <xref target="RFC4271"/> using BGP
      Multiprotocol Extensions <xref target="RFC4760"/> with an Address Family Identifier
      (AFI) of 1 or 2 and a Subsequent AFI (SAFI) of BGP-MUP.  The NLRI
      field in the MP_REACH_NLRI/MP_UNREACH_NLRI attribute contains the
      BGP-MUP NLRI (encoded as specified above).  The value of the AFI
      field in the MP_REACH_NLRI/MP_UNREACH_NLRI attribute that carries the
      BGP-MUP NLRI determines whether the addresses carried in the 
      routes are IPv4 or IPv6 addresses (AFI 1
      indicates IPv4 addresses, AFI 2 indicates IPv6 addresses).
    </t>
    <t>
      In order for two BGP speakers to exchange BGP-MUP NLRIs,
      they must use a BGP Capabilities Advertisement to ensure that they
      both are capable of properly processing such an NLRI.  This is done
      as specified in <xref target="RFC4760"/>, by using capability code 1 (multiprotocol
      BGP) with an AFI of 1 or 2 and an SAFI of BGP-MUP.
    </t>
    <t>
      This document defines 4 Route Types for 3gpp-5G architecture type.
      Any other Route Types MUST be silently ignored upon a receipt if a
      BGP speaker supports only 3gpp-5G architecture type. An implementation MAY
      log an error when such Route Types are ignored. An implementation MAY
      considered retrieving any discarded Route Types by simply resetting
      the session or issuing a Route-REFRESH message <xref target="RFC2918"/>
      if the Route Refresh Capability is successfully negotiated.
    </t>
    <t>
      The following sections describes the format of the Route Type specific BGP-MUP
      NLRI for various Route Types defined in this document.
    </t>

    <section title="BGP Interwork Segment Discovery route">
      <t>
	A BGP Interwork Segment Discovery route Type specific BGP-MUP NLRI consist of
	the following:
      </t>
      <t>
	<figure align="center">
	  <artwork align="left"><![CDATA[ 
      +-----------------------------------+
      |           RD  (8 octets)          |
      +-----------------------------------+
      |       Prefix Length (1 octet)     |
      +-----------------------------------+
      |        Prefix (variable)          |
      +-----------------------------------+
      ]]></artwork>
    </figure>
      </t>
      <t>
        The Interwork Segment Discovery route Type NLRI consist of RD which is encoded
        as described in <xref target="RFC4364"/>. It also has an prefix associated with
        Interwork segment connected locally. For the purpose of BGP route key processing, 
        only the RD, Prefix Length and Prefix are considered to be part of the prefix in the NLRI.
      </t>
      <t>In 3GPP 5G specific case, a prefix used for a 
      N3 interface of the gNodeB connected locally MAY be used as this prefix.
      The prefix length of one octet indicating length of the prefix. If the
      AFI is IPv4, then the maximum value of the Prefix Length is 32 bits otherwise
      it is considered as a malformed NLRI. If the AFI is IPv6, then the maximum value of
      of the Prefix length is 128 bits otherwise it is considered as a malformed NLRI.
      A BGP speaker MUST handle such a malformed NLRI as a "Treat-as-withdraw"
      <xref target="RFC7606"/>. A BGP speaker
      MUST skip such NLRIs and continue processing of rest of the Update message.
      </t>
    </section>

    <section title="BGP Direct Segment Discovery route">
      <t>
	A BGP Direct Segment Discovery route Type specific BGP-MUP NLRI consist of
	the following:
      </t>
      <t>
	<figure align="center">
	  <artwork align="left"><![CDATA[ 
      +-----------------------------------+
      |           RD  (8 octets)          |
      +-----------------------------------+
      |        Address (4 or 16 octets)   |
      +-----------------------------------+
      ]]></artwork>
    </figure>
      </t>
      <t>
        The Direct Segment Discovery route Type NLRI consist of RD which is encoded
        as described in <xref target="RFC4364"/>. It also has an Address
        of originating BGP speaker. For the purpose of 
        BGP route key processing, only the RD and Address are considered to be part of 
        the prefix in the NLRI.
      </t>
      <t>
        If the AFI is IPv4 then the address length is 4 octets otherwise
        it is considered as a malformed NLRI. If the AFI is IPv6 then the address length is
        16 octets otherwise it is considered as a malformed NLRI.
        A BGP speaker MUST handle such a malformed NLRI as a "Treat-as-withdraw"
        <xref target="RFC7606"/>. A BGP speaker
        MUST skip such NLRIs and continue processing of rest of the Update message.
      </t>
    </section>

    <section title="BGP Type 1 Session Transformed (ST) Route">
      <t>
	A BGP Type 1 ST Route Type specific BGP-MUP NLRI consist of
	the following:
      </t>
      <t>
	<figure align="center">
	  <artwork align="left"><![CDATA[ 
      +-----------------------------------+
      |           RD  (8 octets)          |
      +-----------------------------------+
      |      Prefix Length (1 octet)      |
      +-----------------------------------+
      |         Prefix (variable)         |
      +-----------------------------------+
      | Architecture specific (variable)  |
      +-----------------------------------+
      ]]></artwork>
    </figure>
      </t>
      <t>
        The Type 1 ST Route Type NLRI consist of RD which is encoded                               
        as described in <xref target="RFC4364"/>. It also has Prefix
        length of one octet indicating length of the Prefix. For the purpose of 
        BGP route key processing, only the RD, Prefix Length and Prefix are considered to be part 
        of the prefix in the NLRI.
      </t>
      <t>
        In 3GPP 5G specific case, Prefix is the prefix allocated to a UE. If the
        AFI is IPv4, then the maximum value of the Prefix Length field is 32. 
        If the AFI is IPv6, then the maximum value of the Prefix Length field is 128.
        Any other length field is considered a a malformed NLRI.
        A BGP speaker MUST handle such a malformed NLRI as a "Treat-as-withdraw"
        <xref target="RFC7606"/>. A BGP speaker
        MUST skip such NLRIs and continue processing of rest of the Update message.
      </t>
      <t>
	The architecture specific encoding values will follow after the variable
	length Prefix.
      </t>
  
      <section title="3gpp-5g Specific BGP Type 1 ST Route">
	<t>
	  A BGP 3gpp-5g Type 1 ST Route Type specific BGP-MUP NLRI consist of
	  the following:
	</t>
	<t>
	  <figure align="center">
	    <artwork align="left"><![CDATA[ 
      +-----------------------------------+
      |          TEID (4 octets)          |
      +-----------------------------------+
      |          QFI (1 octet)            |
      +-----------------------------------+
      | Endpoint Address Length (1 octet) |
      +-----------------------------------+
      |    Endpoint Address (variable)    |
      +-----------------------------------+
      ]]></artwork>
      </figure>
	</t>
	<t>
	  The TEID has a fixed length of 4 octets. The TEID value of 0 is considered as
	  an invalid and a malformed TEID. A BGP speaker MUST handle such a malformed NLRI
	  as a "Treat-as-withdraw" <xref target="RFC7606"/>. A BGP speaker
	  MUST skip such NLRIs and continue processing of rest of the Update message.
	</t>
	<t>
	  The QFI has a fixed length of 1 octet.
	</t>
	<t>
	  The Endpoint Address Length has a fixed length of 1 octet. Endpoint Address
	  field contains of an IPv4 address, then the value of the Endpoint Address
	  Length field is 32. If the Endpoint Address field contains of an IPv6
	  Address, then the value of the Endpoint Address Length field is 128. Any other
	  value is considered as an invalid and a malformed Endpoint Address.
	  A BGP speaker MUST handle such a malformed NLRI
	  as a "Treat-as-withdraw" <xref target="RFC7606"/>. A BGP speaker
	  MUST skip such NLRIs and continue processing of rest of the Update message.
	</t>
	<t>
	  The NLRI architecture field MUST be encoded as shown above if a BGP 
	  speaker receives 3gpp-5g specific BGP Type 1 ST route. Otherwise 
	  the NLRI is considered as a malformed. A BGP speaker MUST
	  handle such a malformed NLRI as a "Treat-as-withdraw" <xref target="RFC7606"/>.
	  A BGP speaker MUST skip such NLRIs and continue processing of rest of
	  the Update message.
	</t>
      </section>
    </section>

    <section title="BGP Type 2 Session Transformed (ST) Route">
      <t>
	A BGP Type 2 ST Route Type specific BGP-MUP NLRI consist of
	the following:
      </t>
      <t>
	<figure align="center">
	  <artwork align="left"><![CDATA[ 
      +-----------------------------------+
      |           RD  (8 octets)          |
      +-----------------------------------+
      |      Endpoint Length (1 octet)    |
      +-----------------------------------+
      |      Endpoint Address (variable)  |
      +-----------------------------------+
      | Architecture specific Endpoint    |
      |         Identifier (variable)     |
      +-----------------------------------+
      ]]></artwork>
    </figure>
      </t>
      <t>
        The Type 2 ST Route Type NLRI consist of RD which is encoded
        as described in <xref target="RFC4364"/>. It also has Endpoint
        length of one octet indicating length of the Endpoint Address and the 
        Architecture specific Endpoint Identifier as per
	<xref target="I-D.mhkk-dmm-srv6mup-architecture"/>
        defines aggregation capability by the Type2 ST Route.
        If the AFI is IPv4 and the Endpoint Length is longer than 32 then the 
        Architecture specific endpoint Identifier field exists with the IPv4 Endpoint Address.
        If the AFI is IPv6 and the Endpoint Length is longer than 128 then the 
        Architecture specific endpoint Identifier field exists with
        then the IPv6 Endpoint Address. For the purpose of BGP route key processing, 
        only the RD, Endpoint Address and Architecture specific Endpoint Identifier 
        are considered to be part of the prefix in the NLRI.
      </t>
      <t>
        In 3GPP 5G specific case, the Endpoint Address is a N3 interface address of the UPF.
        If the AFI is IPv4, then the maximum Endpoint length is 64 otherwise
        it is considered as a malformed NLRI. If the AFI is IPv6, then the maximum Endpoint
        length is 160 otherwise it is considered as a malformed NLRI.
        A BGP speaker MUST handle such a malformed NLRI as a "Treat-as-withdraw"
        <xref target="RFC7606"/>. A BGP speaker
        MUST skip such NLRIs and continue processing of rest of the Update message.
      </t>
      <t>
        The architecture specific encoding values will follow after the variable
        length Prefix.
      </t>

      <section title="3gpp-5g Specific BGP Type 2 ST Route">
	<t>
	  A BGP 3gpp-5g Type 2 ST Route Type specific BGP-MUP NLRI consist of
	  the following:
	</t>
	<t>
	  <figure align="center">
	    <artwork align="left"><![CDATA[ 
      +-----------------------------------+
      |          TEID (0-4 octets)        |
      +-----------------------------------+
      ]]></artwork>
	  </figure>
	</t>
	<t>
	  The maximum length of TEID is 4 octets. The TEID value of 0 is considered as
	  an invalid and a malformed TEID. A BGP speaker MUST handle such a malformed NLRI
	  as a "Treat-as-withdraw" <xref target="RFC7606"/>. A BGP speaker
	  MUST skip such NLRIs and continue processing of rest of the Update message.
	</t>
	<t>
	  The NLRI architecture field MUST be encoded as shown above if a BGP 
	  speaker receives 3gpp-5g specific BGP Type 2 ST route. Otherwise 
	  the NLRI is considered as a malformed.  A BGP speaker MUST
	  handle such a malformed NLRI as a "Treat-as-withdraw"
	  <xref target="RFC7606"/>.  A BGP speaker
	  MUST skip such NLRIs and continue processing of rest of the Update message.
	</t>
      </section>
    </section>
</section>

<section title="BGP MUP Extended Community">
  <t>
    This document defines a new BGP Extended community known as
    BGP MUP Extended community as per <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>.
  </t>

  <t>
    This is a BGP MUP specific Extended Community, of an extended
   type, and is transitive across AS boundaries <xref target="RFC4360"/>.
  </t>

  <t>
    The Type value of this Extended community is set to MUP type, to be assigned
    by IANA from BGP Extended community transtive registry. The Sub-Type value
    is set to Direct-Type Segment Identifier type, to be assigned                     
    by IANA from BGP Extended community transtive registry. The value field of
    the community is set to the 6 bytes of configurable segment identifier value.
  </t>

  <t>
    The usage of this Extended community is described in the
    <xref target="Processing-Type2-ST-Routes"/> and
    <xref target="Generating-Type2-ST-Routes"/>
  </t>
</section>

<section anchor="MUP-Operation" title="Operation">
  <t>
    BGP speakers acting as a PE, and a MUP Controller MUST establish a
    BGP session to exchange BGP-MUP NLRIs for both, IPv4 and IPv6 AFIs. Once
    the session is established successfully, BGP speakers can exchange the
    Discovery routes as well as Session Transformed routes. This information
    is specific to a given routing instance. BGP-MUP SAFI is expected to
    work with routing instances accomodationg MUP segments. In 3GPP 5G specific case,
    the routing instances are depicted as N3RAN and N6DN 
    instances defined in <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>. The
    subsequent sections describes procedures of generating and processing of
    each route types.
  </t>

  <section anchor="Generating-DI-Routes" title="Generation of the Interwork Segment Discovery route">
    <t>
      The Interwork Segment Discovery route is generated by the PE when a routing instance
      accommodates an Interwork type MUP Segment, e.g., N3 interfaces or routes on RAN side
      in 3GPP 5G specific case. It generates route per
      each N3RAN IP prefix and stores the route in the routing instance of N3RAN.
      The IP prefix MAY include a gNodeB address which is connecting to the PE.
      The BGP AFI for BGP MP_REACH_NLRI attribute to carry the Discovery route is decided
      based on the AFI of the prefix. 
    </t>
    <t>
      When advertising the Interwork Segment Discovery route, a PE MUST attach the
      export BGP Route Target Extended Community of the associated routing instance.
    </t>
    <t>
      When advertising the Interwork Segment Discovery route, a PE MUST use the
      IPv6 address of the PE as the nexthop address in the MP_REACH_NLRI attribute.
    </t>
    <t>
      The Interwork Segment Discovery route update MUST have a prefix SID
      attribute which the SID consists of
      the PE locater followed by a function. In 3GPP 5G specific case,
      if the BGP AFI is IPv4, the function MUST be
      GTP4.E <xref target="I-D.ietf-dmm-srv6-mobile-uplane"/>, or MUST be GTP6.E
      <xref target="I-D.ietf-dmm-srv6-mobile-uplane"/> if the BGP AFI is IPv6.
    </t>
  </section>

  <section anchor="Withdrawing-DI-Routes" title="Withdrawal of the Interwork Segment Discovery route">
    <t>
      The Interwork Segment Discovery route is withdrawn by the PE when it
      detects that the MUP Segment no longer present for the N3RAN. 
      The BGP AFI for BGP MP_UNREACH_NLRI attribute to carry the Discovery route is decided
      based on the AFI of the prefix.
    </t>
    <t>
      When withdrawing the Interwork Segment Discovery route, a PE MUST attach the
      export BGP Route Target Extended Community of the associated routing instance.
    </t>
  </section>

  <section anchor="Processing-DI-Routes" title="Processing of the Interwork Segment Discovery routes">
    <t>
      A BGP speaker acting as a PE MAY keep the
      received MUP Interwork Segment Discovery routes advertised from
      other PEs. The receiving BGP speaker will perform the
      importing of the received MUP Interwork Segment Discovery routes in
      the configured routing instance based on the Route Target
      extended communities. The IP prefixes for the received segments
      are imported into the configured routing instance table.
      Thereby the receiving BGP speaker can provide network connectivity
      between the nodes that exist in the segments. A BGP speaker MAY
      discard the received Interwork Segment Discovery route if the speaker fails
      to import the route based on the Route Target extended communities.
    </t>
    <t>
      The BGP speaker receiving the Interwork Segment Discovery routes SHOULD ignore
      the nexthop in the MP_REACH_NLRI attribute. However, the receiving BGP speaker
      MUST ensure that the value of Address filed in the NLRI is
      an address of the originator of the locator value in the prefix SID attribute.
      The originator of the locator value can be resolved from the IPv6 IGP table.
      If the result of the match is not identical then the receiving BGP speaker
      MUST consider it as a malformed NLRI and the "Treat-as-withdraw procedure of
      <xref target="RFC7606"/> is applied. A BGP speaker
      MUST skip such NLRIs and continue processing of rest of the Update message.
    </t>
    <t>
      When a BGP speaker receives the Interwork Segment Dicovery routes with a
      MP_REACH_NLRI attribute without a prefix SID attribute, then it
      MUST be treated as if it contained a malformed prefix SID attribute and the
      "Treat-as-withdraw procedure of <xref target="RFC7606"/> is applied.
      A BGP speaker MUST skip such NLRIs and continue processing of rest of
      the Update message.
    </t>
    <t>
      When a BGP speaker receives an MP_UNREACH_NLRI attribute update message it MUST
      delete the withdrawn Interwork Segment Discovery route from the routing instance
      table where it was created.
    </t>
  </section>

  <section anchor="Generating-DD-Routes" title="Generation of the Direct Segment Discovery route">
    <t>
      The Direct Segment Discovery route is generated by the PE when a routing instance
      accommodates a Direct type MUP Segment, e.g., N6 interface or routes on DN side
      in 3GPP 5G specific case.
      It generates the Direct Segment Discovery route per each routing instance for the MUP Segment.
      The address in the BGP-MUP NLRI MUST be a unique PE identifier. The BGP AFI for 
      BGP MP_REACH_NLRI attribute to carry the Direct Segment Discovery route is decided 
      based on the AFI of the PE identifier
      <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>.
    </t>
    <t>
      When announcing the Direct Segment Discovery route, a PE MUST attach a
      BGP MUP Extended community of the associated routing instance. 
      The sub-type of the Extended community is Direct-Type Segment Identifier.
    </t>
    <t>
      When advertising the Direct Segment Discovery route, a PE MUST use the
      IPv6 address of the PE as the nexthop address in the MP_REACH_NLRI attribute.
    </t>
    <t>
      The Direct Segment Discovery route update MUST have a prefix SID attribute which the
      SID consists of
      the PE locator followed by a function. The function MAY be End.DT4/6 or End.DX4/6.
    </t>
  </section>

  <section anchor="Withdrawing-DD-Routes" title="Withdrawal of the Direct Segment Discovery route">
    <t>
      The Direct Segment Discovery route is withdrawn by the PE when it
      detects that the MUP Segment no longer present for the routing instance. 
      The BGP AFI for BGP MP_UNREACH_NLRI attribute to carry the Discovery route is decided
      based on the AFI of the PE identifier.
    </t>
    <t>
      When withdrawing the Direct Segment Discovery route, a BGP speaker MUST attach a
      BGP MUP Extended community of the associated routing instance.
    </t>
  </section>
      
  <section anchor="Processing-DD-Routes" title="Processing of the Direct Segment Discovery routes">
    <t>
      A BGP speaker acting as a PE MAY keep the
      received MUP Direct Segment Discovery routes advertised from
      other PEs.  The receiving BGP speaker will perform the
      importing of the received MUP Direct Segment Discovery routes in
      the configured routing instance based on the Route Target
      extended communities. The IP prefixes for the received segments
      are imported into the configured routing instance table.
      Thereby the receiving BGP speaker can provide network connectivity
      between the nodes that exist in the segments. A BGP speaker MAY
      discard the received Direct Segment Discovery route if the speaker fails
      to import the route based on the Route Target extended communities.
    </t>
    <t>
      The BGP speaker receiving the Direct Segment Discovery routes SHOULD ignore
      the nexthop in the MP_REACH_NLRI attribute. However, the receiving BGP speaker
      MUST ensure that the received nexthop value in the MP_REACH_NLRI attribute is
      identical to the originator of the locator value in the prefix SID attribute.
      The originator of the locator value can be resolved from the IPv6 IGP table.
      If the result of the match is not identical then the receiving BGP speaker
      MUST consider it as a malformed NLRI and the "Treat-as-withdraw procedure of
      <xref target="RFC7606"/> is applied. A BGP speaker
      MUST skip such NLRIs and continue processing of rest of the Update message.
    </t>
    <t>
      When a BGP speaker receives a MP_REACH_NLRI attribute update message
      with a Direct Segment Discovery route without a prefix SID attribute, than it
      MUST be treated as if it contained a malformed prefix SID attribute and the
      "Treat-as-withdraw procedure of <xref target="RFC7606"/> is applied.
      A BGP speaker MUST skip such NLRIs and continue processing of rest of
      the Update message.
    </t>
    <t>
      When a BGP speaker receives an MP_UNREACH_NLRI attribute update message it MUST
      delete the withdrawn Direct Segment Discovery route from the routing instance table
      where it was created.
    </t>
  </section>

  <section anchor="Generating-Type1-ST-Routes" title="Generation of the Type 1 ST Route">
    <t>
      A BGP speaker acting as a MUP Controller generates Type 1 ST route
      from corresponding session information through a northbound API as per
      <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>.
      The northbound API definition for ST1 route creation is out of scope of this document.
    </t>
    <t>
      In 3GPP 5G specific case, to compose a Type 1 ST route the controller 
      acquires UE address or prefix, Tunnel Endpoint address of GTP <xref target="TS.29281"/> tunnel, TEID, 
      and QFI for access side as input parameters from the northbound API. 
      The controller decides the RD of the Type 1 ST route based on operator policy.
    </t>
    <t>
      When advertising the Type 1 ST route, the controller SHOULD attach a
      Route Target Extended community which the PEs are importing into 
      the routing instance for the corresponding Direct segment.
    </t>
    <t>
      The MUP Controller MUST set the nexthop of the route to the address
      of the controller.
    </t>
    <t>
      The controller MUST announce this route using a AFI of the route and
      the SAFI of BGP-MUP to all other BGP speakers within the SRv6 domain.
    </t>
  </section>

  <section anchor="Withdrawing-Type1-ST-Routes" title="Withdrawing of the Type 1 ST Route">
    <t>
      A BGP speaker acting as a MUP Controller withdraws Type 1 ST route
      based on deletion of corresponding session information through a northbound API as per
      <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>.
      The northbound API definition for ST1 route withdraw is out of scope of this document.
    </t>
    <t>
      In 3GPP 5G specific case, to withdraw a Type 1 ST route the controller acquires
      the UE address or prefix, Tunnel Endpoint address of GTP<xref target="TS.29281"/> tunnel, TEID,and QFI for access side
      as input parameters from the northbound API. The controller MUST advertise the withdraws
      of the Type 1 ST route.
    </t>
    <t>
      When withdrawing the Type 1 ST route, the controller SHOULD attach the Route Target 
      Extended community which the PEs are importing into the routing instance accomodating 
      the corresponding Direct segment to the Route Target Extended community.
    </t>
  </section>

  <section anchor="Processing-Type1-ST-Routes" title="Processing of the Type 1 ST Route">
    <t>
      A BGP speaker acting as a PE MAY keep the
      received MUP Type 1 ST routes advertised from
      the MUP Controller.  The receiving BGP speaker will perform the
      importing of the received MUP Type 1 ST routes in
      the configured N6DN routing instance based on the Route Target
      extended communities. A BGP speaker MAY
      discard the received Type 1 ST route if the speaker fails
      to import the route based on the Route Target extended communities.
    </t>
    <t>
      In case of a BGP speaker receiving a Type 1 ST routes is a PE, 
      the PE SHOULD use the received Tunnel Endpoint Address in this NLRI 
      as a key to lookup the associated Interwork Segment Discovery route and extract 
      the locator and the function in the prefix SID attribute of the Interwork route.
    </t>
    <t>
      In 3GPP 5G specific case, the PE extracts TEID, QFI and Tunnel Endpoint address from
      the NLRI. Then the PE SHOULD generate the forwarding SID for GTP4/6.E
      based on the procedures mentioned in
      the <xref target="I-D.ietf-dmm-srv6-mobile-uplane"/>.
      If the PE cannot generate the prefix SID, then it SHOULD mark the
      received Type 1 ST route as an invalid route. The PE MAY hold such an
      invalid route until the route as a valid route upon successful generation of prefix SID. 
    </t>
    <t>
      The PE receiving Type 1 ST routes SHOULD ignore the received
      nexthop in the MP_REACH_NLRI attribute. 
    </t>
    <t>
      The PE receiving Type 1 ST routes in MP_UNREACH_NLRI attribute MUST
      delete all the routes from the associated routing instance.
    </t>
  </section>

  <section anchor="Generating-Type2-ST-Routes" title="Generation of the Type 2 ST Route">
    <t>
      A BGP speaker acting as a MUP Controller generates Type 2 ST route
      from corresponding session information through a northbound API, or pre-defined 
      configuration as per <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>.
      The northbound API definition for ST2 route creation is out of scope of this document.
    </t>
    <t>
      In 3GPP 5G specific case, to compose a Type 2 ST route the controller 
      acquires the Endpoint consists of Endpoint address of GTP <xref target="TS.29281"/>
      tunnel and TEID  
      for core side with the effective length of the Endpoint as input parameters. 
      The controller decides the RD of the Type 2 ST route based on operator policy.
   </t>
    <t>
      When advertising the Type 2 ST route, the controller SHOULD attach a
      BGP MUP Extended community corresponding to the Direct segment.
      The sub-type of the Extended community is Direct-Type Segment Identifier. This
      Segment Identifier is generated from the information received through a northbound
      API, or a pre-defined configuration as per <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>.
      The northbound API definition for receving this information is out of scope of this document.
    </t>
    <t>
      The controller MUST also attach a Route Target Extended community of the
      routing instances in the PE accomodating the corresponding Interwork segment.
    </t>
    <t>
      The controller MUST set the nexthop of the route to the address
      of the MUP Controller.
    </t>
  </section>

  <section anchor="Withdrawing-Type2-ST-Routes" title="Withdrawing of the Type 2 ST Route">
    <t>
      A BGP speaker acting as a MUP Controller withdraws Type 2 ST route
      based on deletion of corresponding session information through a northbound API as per
      <xref target="I-D.mhkk-dmm-srv6mup-architecture"/>.
      The northbound API definition for ST2 route withdraw is out of scope of this document.
    </t>
    <t>
      In 3GPP 5G specific case, to withdraw a Type 2 ST route the controller acquires
      the Endpoint consists of Endpoint address of GTP <xref target="TS.29281"/> tunnel and TEID
      for core side with the effective length of the Endpoint as input parameters.
      The controller MUST advertise the withdraws of the Type 2 ST route.
    </t>
    <t>
      When withdrawing the Type 2 ST route, the controller SHOULD attach the
      BGP MUP Extended community corresponding to the Direct segment, and the Route Target 
      Extended community which the PEs are importing into the routing instance accomodating 
      the corresponding Interwork segment to the Route Target Extended community.
    </t>
  </section>

  <section anchor="Processing-Type2-ST-Routes" title="Processing of the Type 2 ST Route">
    <t>
      A BGP speaker acting as a PE MAY keep the
      received MUP Type 2 ST routes advertised from
      the MUP Controller.  The receiving BGP speaker will perform the
      importing of the received MUP Type 2 ST routes in
      the configured N3RAN routing instance based on the Route Target
      extended communities. A BGP speaker MAY
      discard the received Type 2 ST route if the speaker fails
      to import the route based on the Route Target extended communities.
    </t>
    <t>
      The BGP speaker receiving the Type 2 ST routes SHOULD ignore the received
      nexthop in the MP_REACH_NLRI attribute. 
    </t>
    <t>
      A PE receiving the Type 2 ST routes in a MP_REACH_NLRI attribute
      without a BGP MUP Extended community SHOULD consider the route as a malformed
      route. The PE MUST handle such a malformed NLRI as a "Treat-as-withdraw"
      <xref target="RFC7606"/>. 
    </t>
    <t>
      The PE receiving Type 2 ST route with a BGP MUP Extended Community should
      extract the received segment identifier from the community. The segment
      identifier is used to resolve an appropriate Direct segment routing instance.
    </t>
  </section>
</section>
</section>

<section title="Security Considerations">                        
<t>
  The mechanisms described in this document could reuse the existing
  BGP security mechanisms <xref target="RFC4271"/> <xref target="RFC4272"/>.
  The security model and threats specific to Provider Provisioned VPNs,
  including L3VPNs, are discussed in <xref target="RFC4111"/>.
  The method defined in <xref target="RFC5925"/>
  SHOULD be used where authentication of BGP control packets is needed.
</t>
<t>
  The PEs and MUP Controller SHOULD NOT establish BGP sessions with other BGP speakers
  in the domains which are not trusted without any explicit configuration or an
  operator intervention. Usage of procedures defined in <xref target="RFC5925"/> 
  SHOULD be enforced at such boundaries to ensure the proper authentication of
  BGP control packets.
</t>
<t>
  Furthermore, <xref target="RFC5925"/> will not help to keep the BGP messages private.
  To protect the BGP messages exchanged between BGP speakers from eavesdrop, 
  establishing BGP sessions over encrypted paths SHOULD be considered.
</t>
<t>
  PEs SHOULD impose an upper bound on number
  of routes they should store to protect their control plane load. For example,
  BGP implementations MAY provide a configuration knob to impose an
  upper bound on Type 1 ST Routes. 
</t>
</section>

<section title="IANA Considerations">
  <t>                                                                             
    This document defines a new BGP SAFI known as a       
    BGP-MUP SAFI. IANA is requested to assign the value for
    the new SAFI from the Subsequent Address Family
    Identifiers (SAFI) registry.
  </t>
  <t>
    This document defines a new Architecture Type for a BGP-MUP
    SAFI. IANA is requested to create a new Architecture Type NLRI
    registry for BGP-MUP SAFI. Furthermore, IANA is also requested
    to assign values for the
    following Architecture Types from the newly created
    BGP-MUP Architecture Type NLRI registry:
  </t>
  <t>
    <figure align="center">
      <artwork align="left"><![CDATA[ 
      + 1 - 3gpp-5g;
      ]]></artwork>
    </figure>
  </t>
  <t>
    This document defines new NLRIs for a BGP-MUP SAFI. IANA
    is requested to create a new NLRI registry for BGP-MUP SAFI.
    Furthermore, IANA is also requested to assign values for the
    following NLRIs from the newly created BGP-MUP NLRI registry:
  </t>
  <t>
    <figure align="center">
      <artwork align="left"><![CDATA[ 
      + 1 - Discovery Internetwork route;
      + 2 - Direct Segment Discovery route;
      + 3 - Type 1 Session Transformed (ST) route;
      + 4 - Type 2 Session Transformed (ST)  route;
      ]]></artwork>
    </figure>
  </t>
  <t>
    This document defines a new BGP Extended Community called "SRv6
    MUP Extended Community". This Community is of an extended type 
    and is transitive.  IANA is requested to assign the Type and
    the Sub-Type value for this Community from the Transitive
    Extended Community registry.
  </t>
</section>

<section anchor="Contribution" title="Contributors">
<t>
   In addition to the authors listed on the front page, the following
   individuals have also made significant contributions to the draft:
</t>

<t>
  <figure align="center">
    <artwork align="left"><![CDATA[ 
    Katsuhiro Horiba
    SoftBank
    Email: katsuhiro.horiba@g.softbank.co.jp
    ]]></artwork>
  </figure>
</t>

<t>
    <figure align="center">
    <artwork align="left"><![CDATA[ 
    Yuya Kawakami
    SoftBank
    Email: yuya.kawakami01@g.softbank.co.jp
    ]]></artwork>
  </figure>
</t>

<t>
  <figure align="center">
    <artwork align="left"><![CDATA[ 
    Kalyani Rajaraman
    Arrcus, Inc.
    Email: kalyanir@arrcus.com
    ]]></artwork>
  </figure>
</t>

</section>
</middle>

<?rfc needLines="20"?>
<back>
<references title="Normative References">
  &RFC2119;
  &RFC2918;
  &RFC4271;
  &RFC4272;
  &RFC4360;
  &RFC4760;
  &RFC7606;
  &RFC8174;
  &RFC9012;
  &I-D.mhkk-dmm-srv6mup-architecture;
</references>

<references title="Informative References">
  &RFC4111;
  &RFC4364;
  &RFC5925;
  &RFC6811;
  &RFC8205;
  &I-D.ietf-dmm-srv6-mobile-uplane;
  <reference anchor="TS.23501" target="http://www.3gpp.org/ftp/Specs/html-info/23501.htm">
      <front>
          <title>System architecture for the 5G System (5GS)</title>
          <author>
              <organization>3GPP</organization>
          </author>
          <date day="24" month="September" year="2021"/>
      </front>
      <seriesInfo name="3GPP TS" value="23.501 17.2.0" />
  </reference>
  <reference anchor="TS.29281">
    <front>
        <title>General Packet Radio System (GPRS) Tunnelling Protocol User Plane (GTPv1-U)</title>
        <author surname="3GPP" fullname="3GPP">
        </author>
        <date month="September" year="2020" />
    </front>
    <seriesInfo name="3GPP TS 29.281" value="16.1.0" />
 </reference>

</references>

<?rfc needLines="100"?>
</back>

</rfc>
