<?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 RFC5668 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5668.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.ietf-dmm-mup-architecture SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dmm-mup-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-ietf-bess-mup-safi-01">

  <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>Cisco Systems</organization>
    <address>
      <postal>
        <street></street>
        <city>Montreal</city> <region></region> 
        <country>Canada</country>
        <code></code> 
       </postal>
       <email>davoyer@cisco.com</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.ietf-dmm-mup-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.ietf-dmm-mup-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.ietf-dmm-mup-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.ietf-dmm-mup-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)    |
      +-----------------------------------+
      |  Source Address Length (1 octet)  |
      +-----------------------------------+
      |     Source Address (variable)     |
      +-----------------------------------+
      |            TLVs (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 Source Address Length has a fixed length of 1 octet. Source Address
	  Length is 0 bytes then the Source address is not carried within the NLRI. A BGP
	  speaker MAY have a local configuration for using a Source address. The exact
	  mechanism of local configuration is outside the scope of this document.
	  Source Address field contains of an IPv4 address, then the value of the Source Address
	  Length field is 32. If the Source Address field contains of an IPv6
	  Address, then the value of the Source 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>
	  Optional TLVs may follow after the Source Address field.  To
	  determine their presence, compute the number of remaining octets by
	  subtracting, from the Length field in the MUP NLRI common header,
	  the offset of the end of the Source Address measured from the start
	  of the Route Type specific field.  Based on this value:
	  <list style="hanging" hangIndent="9">
	    <t hangText="- &lt; 0:">the mandatory fields exceed the declared Length; the NLRI is
	    malformed; MUST be treated as Treat-as-withdraw.</t>
	    <t hangText="- 0:">no TLVs are present.</t>
	    <t hangText="- 1:">encoding is invalid (a valid TLV requires at minimum a Type
	    byte and a Length byte); MUST be treated as Treat-as-withdraw.</t>
	    <t hangText="- &gt;= 2:">one or more TLVs are present.  Parse TLVs one by one per
	    <xref target="TLV-Format"/>; unknown TLV types MUST be ignored for local
	    processing and MUST be propagated unchanged when re-advertising
	    the route to other BGP peers; any TLV parsing error MUST result
	    in Treat-as-withdraw; TLVs are not part of the NLRI key for
	    route processing.</t>
	  </list>
	</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.ietf-dmm-mup-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)        |
      +-----------------------------------+
      |            TLVs (variable)        |
      +-----------------------------------+
      ]]></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 Endpoint Length MUST NOT extend beyond the TEID field.  The TEID
	  length is zero or more bytes as determined by the Endpoint Length
	  value.
	</t>
	<t>
	  Optional TLVs may follow after the TEID.  To determine their
	  presence, compute the number of remaining octets by subtracting,
	  from the Length field in the MUP NLRI common header, the offset of
	  the end of TEID measured from the start of the Route Type specific
	  field.  Based on this value:
	  <list style="hanging" hangIndent="9">
	    <t hangText="- &lt; 0:">the mandatory fields exceed the declared Length; the NLRI is
	    malformed; MUST be treated as Treat-as-withdraw.</t>
	    <t hangText="- 0:">no TLVs are present.</t>
	    <t hangText="- 1:">encoding is invalid (a valid TLV requires at minimum a Type
	    byte and a Length byte); MUST be treated as Treat-as-withdraw.</t>
	    <t hangText="- &gt;= 2:">one or more TLVs are present.  Parse TLVs one by one per
	    <xref target="TLV-Format"/>; unknown TLV types MUST be ignored for local
	    processing and MUST be propagated unchanged when re-advertising
	    the route to other BGP peers; any TLV parsing error MUST result
	    in Treat-as-withdraw; TLVs are not part of the NLRI key for
	    route processing.</t>
	  </list>
	</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 anchor="TLV-Format" title="TLV Format for ST Routes">
      <t>
        All TLVs have the following format:
      </t>
      <t>
	<figure align="center">
	  <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |    Value (variable)          //
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
	</figure>
      </t>
      <t>
        Both Type and Length fields are one byte long.  The Length field
        indicates the length in octets of the Value field.
      </t>
      <t>
        Each TLV definition specifies which route types it is applicable to.
        A TLV received in a route type for which it is not applicable MUST be
        ignored.
      </t>
      <t>
        Currently 3 TLV types are defined:
      </t>

      <section title="3gpp-5g Session Parameters TLV">
	<t>
	  This TLV carries the TEID and QFI identifying the 3gpp-5g session
	  associated with the Interwork Endpoint.  The TLV has the following
	  format:
	</t>
	<figure align="center">
	  <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |        1      |       5       |             TEID              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    TEID (cont')               |      QFI      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
	</figure>
	<t>Where:</t>
	<t>
	  <list style="hanging" hangIndent="16">
	    <t hangText="Type:">1</t>
	    <t hangText="Length:">5</t>
	    <t hangText="Applicable to:">ST2</t>
	    <t hangText="TEID:">Tunnel Endpoint Identifier.  Fixed length of 4 octets.</t>
	    <t hangText="QFI:">QoS Flow Identifier.  Fixed length of 1 octet.</t>
	  </list>
	</t>
      </section>

      <section title="Interwork Endpoint TLV">
	<t>
	  This TLV carries the address of the interwork-side endpoint, used to
	  look up the ISD route.  It identifies the interwork-side endpoint,
	  distinct from the mandatory Endpoint Address in the ST2 route which
	  identifies the direct-side endpoint.  The TLV has the following
	  format:
	</t>
	<figure align="center">
	  <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |        2      |    4 or 16    |         Address              //
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
	</figure>
	<t>Where:</t>
	<t>
	  <list style="hanging" hangIndent="16">
	    <t hangText="Type:">2</t>
	    <t hangText="Length:">4 or 16</t>
	    <t hangText="Applicable to:">ST2</t>
	    <t hangText="Address:">IPv4 or IPv6 address.</t>
	  </list>
	</t>
      </section>

      <section title="Source Address TLV">
	<t>
	  This TLV carries the source address for the outgoing SRv6 and GTP
	  encapsulation at the PE.  When the source address is IPv4, an
	  implementation MAY use a configured IPv6 prefix to construct the
	  IPv6 address used in the SRv6 header.  The TLV has the following
	  format:
	</t>
	<figure align="center">
	  <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |        3      |    4 or 16    |         Address              //
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
	</figure>
	<t>Where:</t>
	<t>
	  <list style="hanging" hangIndent="16">
	    <t hangText="Type:">3</t>
	    <t hangText="Length:">4 or 16</t>
	    <t hangText="Applicable to:">ST2</t>
	    <t hangText="Address:">IPv4 or IPv6 address.</t>
	  </list>
	</t>
      </section>
    </section>

</section>

<section title="BGP MUP Extended Community">
  <t>
    This document defines a BGP Extended Community known as the BGP MUP
    Extended Community as per <xref target="I-D.ietf-dmm-mup-architecture"/>.
    This Community is transitive across AS boundaries <xref target="RFC4360"/>.
    The Type value is 0x0c, to be assigned by IANA from the BGP Transitive
    Extended Community Types registry.
  </t>
  <t>
    The Sub-Type byte distinguishes both the value format and the semantic of
    the community.  Sub-Types 0x00, 0x01, and 0x02 identify a Direct Segment.
    Sub-Types 0x03, 0x04, and 0x05 identify an Interwork Segment.  Within each
    group, the three sub-type values correspond to the 2-octet AS, IPv4 address,
    and 4-octet AS value formats respectively, following the conventions of
    <xref target="RFC4360"/> and <xref target="RFC5668"/>.
  </t>
  <t>
    The usage of this Extended Community is described in
    <xref target="Generating-DI-Routes"/>,
    <xref target="Generating-Type2-ST-Routes"/>, and
    <xref target="Processing-Type2-ST-Routes"/>.
  </t>

  <section title="2-Octet AS Specific MUP Extended Community">
    <t>
      The 2-octet AS specific MUP Extended Community has the following format:
    </t>
    <figure align="center">
      <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     0x0c      |   Sub-Type    |    Global Administrator       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Local Administrator                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
    </figure>
    <t>Where:</t>
    <t>
      <list style="hanging" hangIndent="24">
        <t hangText="Sub-Type:">0x00 (Direct Segment) or 0x03 (Interwork Segment)</t>
        <t hangText="Global Administrator:">2 octets.  A 2-octet AS number.</t>
        <t hangText="Local Administrator:">4 octets.  Defined by the organization
        holding the AS number.</t>
      </list>
    </t>
  </section>

  <section title="IPv4 Address Specific MUP Extended Community">
    <t>
      The IPv4 address specific MUP Extended Community has the following format:
    </t>
    <figure align="center">
      <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     0x0c      |   Sub-Type    |    Global Administrator       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Global Administrator (cont.)  |    Local Administrator        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
    </figure>
    <t>Where:</t>
    <t>
      <list style="hanging" hangIndent="24">
        <t hangText="Sub-Type:">0x01 (Direct Segment) or 0x04 (Interwork Segment)</t>
        <t hangText="Global Administrator:">4 octets.  An IPv4 unicast address.</t>
        <t hangText="Local Administrator:">2 octets.  Defined by the organization
        holding the IPv4 address.</t>
      </list>
    </t>
  </section>

  <section title="4-Octet AS Specific MUP Extended Community">
    <t>
      The 4-octet AS specific MUP Extended Community has the following format:
    </t>
    <figure align="center">
      <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     0x0c      |   Sub-Type    |    Global Administrator       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Global Administrator (cont.)  |    Local Administrator        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork>
    </figure>
    <t>Where:</t>
    <t>
      <list style="hanging" hangIndent="24">
        <t hangText="Sub-Type:">0x02 (Direct Segment) or 0x05 (Interwork Segment)</t>
        <t hangText="Global Administrator:">4 octets.  A 4-octet AS number.</t>
        <t hangText="Local Administrator:">2 octets.  Defined by the organization
        holding the AS number.</t>
      </list>
    </t>
  </section>
</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.ietf-dmm-mup-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 an Interwork Segment Discovery route for a non-default
      Interwork Segment, the PE SHOULD attach an Interwork Segment type BGP MUP
      Extended Community identifying the Interwork Segment.  An ISD route without
      a BGP MUP Extended Community represents the default Interwork Segment.
    </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.ietf-dmm-mup-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.ietf-dmm-mup-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. Controller
      also acquires optionally the associated Source Address. 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.ietf-dmm-mup-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. Controller                        
      also acquires optionally Source Address. 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, Tunnel Endpoint address
      and the Source address if it is present from
      the NLRI. A PE MAY use a locally configured Source address in an event if the
      Source address is not present in Type 1 ST route. The Source address is used as
      the source address in the SRv6 Header.
      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. If the PE
      does not have a Source address for the given route, then the PE MAY
      hold such an invalid route until it is withdrawn. Similarly, 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. In an event where
      the received Type 1 ST route in MP_UNREACH_NLRI attribute does not have a Source
      address a receiving PE MUST delete all the matching Type 1 ST Routes with different
      Source addresses.
    </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.ietf-dmm-mup-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>
      The controller MUST attach a Route Target Extended Community of the routing
      instances in the PE accommodating the corresponding Interwork Segment.
    </t>
    <t>
      When advertising the Type 2 ST route for a Direct Segment, the controller
      SHOULD attach a Direct Segment type BGP MUP Extended Community.  The community
      value is generated from the information received through a northbound API or a
      pre-defined configuration as per <xref target="I-D.ietf-dmm-mup-architecture"/>.
      The northbound API definition for receiving this information is out of scope of
      this document.
    </t>
    <t>
      When advertising the Type 2 ST route for a specific Interwork Segment, the
      controller SHOULD attach an Interwork Segment type BGP MUP Extended Community
      identifying the Interwork Segment.  If the destination endpoint on the Interwork
      Segment differs from the Endpoint Address in the ST2 NLRI, the controller SHOULD
      also attach an Interwork Endpoint TLV carrying the destination endpoint address.
    </t>
    <t>
      A Type 2 ST route without a BGP MUP Extended Community indicates the default
      Interwork Segment as the destination.
    </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.ietf-dmm-mup-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 same
      BGP MUP Extended Community that was attached when the route was advertised,
      together with the Route Target Extended Community of the corresponding routing
      instance.
    </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 a Type 2 ST route with a Direct Segment type BGP MUP Extended
      Community MUST resolve the route using the DSD routes matching that community.
      DSD routes MUST NOT be used to resolve Type 2 ST routes that do not carry a
      Direct Segment type BGP MUP Extended Community.
    </t>
    <t>
      A PE receiving a Type 2 ST route with an Interwork Segment type BGP MUP
      Extended Community MUST resolve the route using ISD routes that carry a
      matching Interwork Segment type BGP MUP Extended Community.
    </t>
    <t>
      A PE receiving a Type 2 ST route without a BGP MUP Extended Community MUST
      resolve the route using ISD routes for the default Interwork Segment, i.e.,
      ISD routes that carry no BGP MUP Extended Community.
    </t>
    <t>
      When resolving a Type 2 ST route via ISD routes, the destination endpoint
      used for the ISD lookup is determined as follows: if the ST2 route carries
      an Interwork Endpoint TLV, the address in that TLV is used as the destination
      endpoint; otherwise, the Endpoint Address in the ST2 NLRI is used.
    </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 known as the BGP MUP
    Extended Community.  This Community is transitive.  IANA is requested to
    assign the value 0x0c from the BGP Transitive Extended Community Types
    registry, and to create a new "BGP MUP Extended Community Sub-Types"
    registry with the following initial values:
  </t>
  <t>
    <figure align="center">
      <artwork align="left"><![CDATA[
      + 0x00 - Direct Segment, 2-Octet AS Specific;
      + 0x01 - Direct Segment, IPv4 Address Specific;
      + 0x02 - Direct Segment, 4-Octet AS Specific;
      + 0x03 - Interwork Segment, 2-Octet AS Specific;
      + 0x04 - Interwork Segment, IPv4 Address Specific;
      + 0x05 - Interwork Segment, 4-Octet AS Specific;
      ]]></artwork>
    </figure>
  </t>
  <t>
    This document defines TLV types for use in ST1 and ST2 routes.
    IANA is requested to create a new "BGP MUP SAFI TLV Types" registry
    and assign values for the following TLV types:
  </t>
  <t>
    <figure align="center">
      <artwork align="left"><![CDATA[
      + 1 - 3gpp-5g Session Parameters;
      + 2 - Interwork Endpoint;
      + 3 - Source Address;
      ]]></artwork>
    </figure>
  </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
    Email: kalyanir@yahoo.com
    ]]></artwork>
  </figure>
</t>

</section>
</middle>

<?rfc needLines="20"?>
<back>
<references title="Normative References">
  &RFC2119;
  &RFC2918;
  &RFC4271;
  &RFC4272;
  &RFC4360;
  &RFC5668;
  &RFC4760;
  &RFC7606;
  &RFC8174;
  &I-D.ietf-dmm-mup-architecture;
</references>

<references title="Informative References">
  &RFC4111;
  &RFC4364;
  &RFC5925;
  &RFC6811;
  &RFC8205;
  &RFC9012;
  &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>
