<?xml version="1.0" encoding="US-ASCII"?>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     category="std" docName="draft-ietf-spring-srv6-mpls-interworking-00"
     ipr="trust200902"
     submissionType="IETF">
  <front>
    <title>SRv6 and MPLS interworking</title>

    <author fullname="Swadesh Agrawal" initials="S." role="editor" surname="Agrawal">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

        <email>swaagraw@cisco.com</email>
      </address>
    </author>

    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

        <email>cfilsfil@cisco.com</email>
      </address>
    </author>
    
    <author fullname="Daniel Voyer" initials="D." surname="Voyer">
      <organization>Bell Canada</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country>Canada</country>
        </postal>

        <email>daniel.voyer@bell.ca</email>
      </address>
    </author>

    <author fullname="Gaurav dawra" initials="G." surname="Dawra">
      <organization>LinkedIn</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country>USA</country>
        </postal>

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

    <author fullname="Zhenbin Li" initials="Z." surname="Li">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

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

        <email>lizhenbin@huawei.com</email>
      </address>
    </author>
    
    <author fullname="Shraddha Hegde" initials="S." surname="Hegde">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country></country>
        </postal>

        <email>shraddha@juniper.net</email>
      </address>
    </author>

    <date year=""/>

    <area>Routing</area>

    <workgroup>SPRING</workgroup>

    <keyword>interworking</keyword>

    <keyword>Segment Routing</keyword>

    <abstract>
      <t>This document describes SRv6 and MPLS/SR-MPLS interworking procedures. 
      Interworking problem is generalized into various interworking scenarios. 
      These scenarios are stitched either by transport interworking or service 
      interworking. New SRv6 behaviors are defined for the purpose. These new 
      behaviors and MPLS labels stitch end to end path across different data plane.</t>

    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>The incremental deployment of SRv6 into existing networks require SRv6 to
      interwork and co-exist with SR-MPLS/MPLS. This document introduces interworking 
      scenarios and building blocks for solutions to inter connect them.</t>
      
      <t>This document assumes SR-MPLS-IPv4 for MPLS domains but the design equally works 
      for SR-MPLS-IPv6, LDP-IPv4/IPv6 and RSVP-TE-MPLS label binding protocols.
      </t>
      
      <section anchor="REQ" title="Requirements Language">
        <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 anchor="IWSCENARIOS" title="Interworking(IW) scenarios">
      <t>A multi-domain network (<xref target="REFERENCETOPOLOGY"/>) can be 
      generalized as a central domain C with many leaf domains around it. 
      Specifically, the document looks at a service flow from an ingress PE in an 
      ingress leaf domain (LI), through the C domain and up to an egress PE of 
      the egress leaf domain (LE). Each domain runs its own IGP instance. 
      A domain has a single data plane type applicable both for its overlay 
      and its underlay.</t>
      
      <figure anchor="REFERENCETOPOLOGY" title="Reference multi-domain 
        network topology"><artwork><![CDATA[                                       
          +-----+                +-----+  RD:V/v via 10   +-----+
   .......|S-RR1|<...............|S-RR2|<.................|S-RR3| <..
   :      +-----+                +-----+                  +-----+   :             
   :                                                                :
   :                                                                : 
+--:-------------------+----------------------+---------------------:-+
|  :      | 2 |        |        | 5 |         |         | 8 |       : |
|  :      +---+        |        +---+         |         +---+       : |
|  :                   |                      |                     : |
|  :                   |                      |                     : |
|  :                   |                      |                     : |
|----+    IGP1       +---+        IGP2      +---+      IGP3      +----|    
| 1  |               | 4 |                  | 7 |                | 10 |
|----+               +---+                  +---+                +----|
|                      |                      |                       |
|                      |                      |                       |
|                      |                      |                       |
|         +---+        |        +---+         |         +---+         |
|         | 3 |        |        | 6 |         |         | 9 |         |
+----------------------+----------------------+-----------------------+
iPE                   iBR                    eBR                     ePE

<----------LI---------><----------C----------><-----------LE---------->       
          ]]></artwork>
        </figure>
      
      <t>There are various SRv6 and SR-MPLS-IPv4 interworking scenarios possible.</t>
      <t>Below scenarios cover various cascading of SRv6 and MPLS networks, e.g., 
        SR-MPLS-IPv4 &lt;-&gt; SRv6 &lt;-&gt; SR-MPLS-IPv4 &lt;-&gt; SRv6 &lt;-&gt; 
        SR-MPLS-IPv4 etc, though not all combinations are described for brevity.
      </t>
      
      <section title="IW scenarios">
        
        <section anchor="TransportIW" title="Transport IW">
          <t>Provider edge devices run MPLS based <xref target="RFC4364"/> or 
          SRv6 Service SID based <xref target="RFC9252"/> BGP L3(e.g.VPN) or 
          L2(e.g.EVPN) services through service Route Reflectors. Service endpoint 
          signaling through borders routers and corresponding forwarding state 
          provide interworking over intermediate transport domain. 
            <list style="symbols">
       		<t>SRv6 over MPLS (6oM)
       		  <list style="symbols">
       		  <t>LI and LE domains are SRv6 data plane, C is MPLS data plane</t>
       		  <t>L3/L2 BGP SRv6 services <xref target="RFC9252"/> extend
       		  between PEs. The ingress PE encapsulates the payload in an outer IPv6 
       		  header where the SRv6 Service SID is the last segment or 
       		  destination address(DA).</t>
       		  <t>Transport IW border nodes forward SRv6 encapsulated traffic destined to 
       		  egress PE over MPLS C domain.</t>
       		  </list>
       		</t>
			<t>MPLS over SRv6 (Mo6)
			  <list style="symbols">
       		  <t>LI and LE domains are MPLS data plane, C is SRv6 data plane</t>
       		  <t>L3/L2 BGP MPLS services <xref target="RFC4364"/>, <xref target="RFC7432"/>.
       		  The ingress PE encapsulates the payload in an MPLS service label and 
       		  sends it through MPLS LSP to egress PE.</t>
       		  <t>Transport IW nodes forward encapsulated label stack to egress PE over 
       		  SRv6 C domain.</t>
       		  </list>
			</t>
			</list>
		  </t>
		  <t>Note: Easiest and most probable deployment is ships in the night i.e. 
		  supporting dual stack and IPv4 MPLS in each domain.</t>
		</section>
		<section  anchor="ServiceIW" title="Service IW">
		  <t>L3/L2 service signaling discontinuity i.e. SRv6 service SID based PE 
		  interworks with BGP MPLS based PE for service connectivity. L3/L2 service 
		  BGP signaling and forwarding state provide interworking over intermediate domain.
		
		    <list style="symbols">  	
			<t>SRv6 to MPLS(6toM): The ingress PE encapsulates the payload 
			in an outer IPv6 header where the destination address is the SRv6 
			Service SID<xref target="RFC9252"/>. Payload is 
			delivered to egress PE with MPLS service label<xref target="RFC4364"/> 
			that it advertised with service prefixes.
            </t>
			<t>MPLS to SRv6 (Mto6): The ingress PE encapsulates the payload 
			in an MPLS service label. Payload is delivered to egress PE with IPv6 header 
			with destination address as SRv6 service SID that it advertised with 
			service prefixes.
			</t>
		    </list>
          </t>
        </section>  
      </section>  
    </section>
    
   <section title="Terminology">
        <t>The following terms used within this document are defined in 
        <xref target="RFC8402"/>: Segment Routing, SR-MPLS, SRv6, SR Domain, 
        Segment ID (SID), SRv6 SID, Prefix-SID.</t>
        
        <t>Domain: Without loss of the generality, domain is assumed to be instantiated 
        by a single IGP instance or a network within IGP if there is clear 
        separation of data plane.</t>
 
        <t>Node k has a classic IPv6 loopback address Ak::1/128.</t>
         
        <t>A SID at node k with locator block B and function F is represented by B:k:F::
        </t>

      	<t>A SID list is represented as &lt;S1, S2, S3&gt; where S1 is the first SID
        to visit, S2 is the second SID to visit and S3 is the last SID to
        visit along the SR path.</t>

        <t>(SA,DA) (S3, S2, S1; SL) represents an IPv6 packet with:</t>

        <t>IPv6 header with source address SA, destination addresses DA and
        SRH as next-header</t>

        <t>SRH with SID list &lt;S1, S2, S3&gt; with SegmentsLeft = SL</t>

        <t>Note the difference between the &lt;&gt; and () symbols: &lt;S1, S2, S3&gt;
        represents a SID list where S1 is the first SID and S3 is the last
        SID to traverse.  (S3, S2, S1; SL) represents the same SID list but
        encoded in the SRH format where the rightmost SID in the SRH is the
        first SID and the leftmost SID in the SRH is the last SID.  When
        referring to an SR policy in a high-level use-case, it is simpler
        to use the &lt;S1, S2, S3&gt; notation.  When referring to an
        illustration of the detailed packet behavior, the (S3, S2, S1; SL)
        notation is more convenient.</t>
    </section>
    
    <section anchor="SRv6SIDBehavior" title="SRv6 SID behavior">
      <t>This document introduces a new SRv6 SID behavior. This behavior is executed
      on border routers between the SRv6 and MPLS domain.</t>
        
        <section anchor="ENDDTM" title="End.DTM">
          <t>The "Endpoint with decapsulation and MPLS table lookup" behavior.</t>
	      <t>The End.DTM SID MUST be the last segment in a SR Policy, and a SID 
	      instance is associated with an MPLS table.</t>
	      <t>When N receives a packet destined to S and S is a local End.DTM SID,
	      N does:</t>
	      <figure><artwork><![CDATA[
S01. When an SRH is processed {
S02.   If (Segments Left != 0) {
S03.      Send an ICMP Parameter Problem to the Source Address,
          Code 0 (Erroneous header field encountered),
          Pointer set to the Segments Left field,
          interrupt packet processing and discard the packet.
S04.   }
S05.   Proceed to process the next header in the packet
S06. }
             
When processing the Upper-layer header of a packet matching a FIB
entry locally instantiated as an End.DTM SID, N does:

S01. If (Upper-Layer Header type == 137(MPLS) ) {
S02.    Remove the outer IPv6 Header with all its extension headers
S03.    Set the packet's associated FIB table to T
S04.    Submit the packet to the MPLS FIB lookup for
        transmission according to the lookup result.
S05. } Else {
S06.    Process as per RFC8986 section 4.1.1
S07. }
             ]]></artwork>
          </figure>
             
        </section>
        
        <section anchor="ENDDPM" title="End.DPM">
          <t>The "Endpoint with decapsulation and MPLS label push" behavior.</t>
	      <t>The End.DPM SID MUST be the last segment and a SID 
	      instance is associated with label stack.</t>
	      <t>When N receives a packet destined to S and S is a local End.DPM SID,
	      N does:</t>
	      <figure><artwork><![CDATA[
S01. When an SRH is processed {
S02.   If (Segments Left != 0) {
S03.      Send an ICMP Parameter Problem to the Source Address,
          Code 0 (Erroneous header field encountered),
          Pointer set to the Segments Left field,
          interrupt packet processing and discard the packet.
S04.   }
S05.   Proceed to process the next header in the packet
S06. }
             
When processing the Upper-layer header of a packet matching a FIB
entry locally instantiated as an End.DPM SID, N does:

S01. Remove the outer IPv6 Header with all its extension headers
S02. Push the MPLS label stack associated with S
S03. Submit the packet to the MPLS engine for transmission
             ]]></artwork>
          </figure>
        </section>
    </section>

    <section anchor="SRv6HeadEndbehavior" title="SRv6 Policy Headend Behaviors">
      <section title="H.Encaps.M: H.Encaps applied to MPLS label stack">
        <t>The H.Encaps.M behavior encapsulates a received MPLS Label stack
        <xref target="RFC3032"/> packet in an IPv6 header with an SRH. 
        Together MPLS label stack and its payload becomes the payload of 
        the new IPv6 packet. The Next Header field of the SRH MUST be set 
        to 137 <xref target="RFC4023"/>.</t> 
      </section>
        
      <section title="H.Encaps.M.Red: H.Encaps.Red applied to MPLS label stack">
        <t>The H.Encaps.M.Red behavior is an optimization of the H.Encaps.M 
        behavior. H.Encaps.M.Red reduces the length of the SRH by excluding 
        the first SID in the SRH of the pushed IPv6 header. The first SID is 
        only placed in the Destination Address field of the pushed IPv6 header.
        The push of the SRH MAY be omitted when the SRv6 Policy only contains 
        one segment and there is no need to use any flag, tag or TLV. In such 
        case, the Next Header field of the IPv6 header MUST be set to 137 
        <xref target="RFC4023"/>.</t>
      </section>  
    </section>
    
    <section anchor="InterconnectingBindingSIDs" title="Interconnecting Binding SIDs">
      <t>Binding Segment (BSID) is bound to SR policy <xref target="RFC8402"/>. Further 
      an SR-MPLS label can be bound to an SRv6 Policy and an SRv6 SID can be bound to 
      an SR-MPLS Policy. The IW SR-PCE solution <xref target="SRPCEODN"/> leverage these 
      BSIDs as segments of SR policy on headend domain to represent intermediate domain 
      of different dataplane type. In summary, an intermediate domain of different data 
      plane type is represented by BSID of ingress domain data plane type in SID list.</t>
    </section>
    
    
    <section title="Interworking Procedures">
      <t><xref target="REFERENCETOPOLOGY"/> shows reference multi-domain 
      network topology and <xref target="IWSCENARIOS"/> its description. The 
      procedure in this section are illustrated using the topology.</t> 
       
      <t>Following is assumed for data plane support of various nodes:
        <list style="symbols">
        <t>Nodes 2,3,5,6,8,9 are provider(P) routers which need to support 
        single data plane type.</t>
        <t>1 and 10 are PEs. They support single data plane type in overlay and underlay.
        </t>
        <t>Border routers 4 and 7 need to support both the SRv6 and SR-MPLS-IPv4 
        data plane.</t>
        </list>
      </t>
       
      <t>A VPN route is advertised via service RRs (S-RR) between an egress PE(node 10) 
      and an ingress PE (node 1).</t>
      <t>For illustrations, the SRGB range starts from 16000 and prefix SID of a node 
      is 16000 plus node number</t>
      
      <section title="Transport IW">
        <t>As described in <xref target="TransportIW"/>, transport IW requires:
          <list style="symbols"> 
          <t>For 6oM, tunnel traffic destined to SRv6 Service SID of egress PE over 
          MPLS C domain.</t>
          <t>For Mo6, tunnel MPLS label stack bound to IPv4 loopback address of 
          egress PE over SRv6 C domain.</t> 
          </list>
        </t>
        <t>This draft enhances two well-known solutions to achieve above:
          <list style="symbols">
          <t>An SR-PCE <xref target="RFC8664"/> multi-domain On Demand Next-hop (ODN) 
          SR policy <xref target="RFC9256"/> stitching 
          end to end across different data plane domains using 
          interconnecting binding SIDs. These procedures can be used 
          when overlay prefixes are signaled with a color extended community 
          <xref target="RFC9012"/>.
          </t>
          <t>BGP Inter-Domain routing procedures advertising PE locator or IPv4 Loopback
          address for best effort or intent aware end to end connectivity.
          </t>
          </list>
        </t>
        
        <section anchor="SRPCEODN" title="SR-PCE multi-domain On Demand Nexthop">
          <t>This procedure provides a best-effort path as well as a path that satisfies 
          the intent (e.g. low latency), across multiple domains. Service routes 
          (VPN/EVPN) are received on ingress PE with color extended community from 
          egress PE. A Color is a 32-bit numerical value that associates an SR Policy 
          with an intent <xref target="RFC9256"/>. 
          Ingress PE does not know how to compute the traffic engineered path through 
          the multi-domain network to egress PE and requests SR-PCE for it. The SR-PCE 
          is aware of interworking requirement at border nodes as its fed with BGP-LS 
          topological information from each domain. It programs intermediate domain 
          data plane specific policy on border nodes for the given intent and 
          represents it in end to end path SID list on ingress PE leveraging 
          <xref target="InterconnectingBindingSIDs"/>.</t>
          
          <t>Below sections describe 6oM and Mo6 IW with SR-PCE</t>
        
          <section title="6oM">
            <t>Service prefix (e.g. VPN or EVPN) is received on head-end (node 1)
            with color extended community (C1) from egress PE (node 10) with
            SRv6 service SID. The PCE computes (C1,10) path via node 2, 5 and 8. 
            It programs an SR policy at border node 4 with segment list node 5 and 7 
            bounded to an End.BM BSID 
            <xref target="RFC8986"/>. SR-PCE responds
            back to node 1 with SRv6 segments along required SLA including End.BM 
            at node 4 to traverse SR-MPLS-IPv4 C domain.</t>
            
            <t>For example, SR-PCE create SR-MPLS policy (C1,7) at node 4 with 
            segments &lt;16005,16007>. It is bound to End.BM behavior with 
            SRv6 BSID as B:4:BM-C1-7::</t>
            
            <t>The data plane operations for the above-mentioned interworking example
            are:
              <list style="nummbers">
              <t>Node 1 performs SRv6 function H.Encaps.Red with VPN service SID
              and SRv6 Policy (C1,10):
              <vspace blankLines="0" />
              Packet leaving node 1 IPv6 ((A:1::, B:2:E::) (B:10::DT4, B:8:E::,
              B:4:BM-C1-7:: ; SL=3))</t>

              <t>Node 2 performs End function
              <vspace blankLines="0" />
              Packet leaving node 2 IPv6 ((A:1::, B:4:BM-C1-7::) (B:10::DT4,
              B:8:E::, B:4:BM-C1-7:: ; SL=2))</t>

              <t>Node 4(border rout4er) performs End.BM function
              <vspace blankLines="0" />
              Packet leaving node 4 MPLS (16005,16007,2)((A:1::, B:8:E::)
              (B:10::DT4, B:8:E::, B:4:BM-C1-7-:: ; SL=1)).</t>
              
              <t>Node 7 performs a native IPv6 lookup on due PHP behavior for 16007
              <vspace blankLines="0" />
              Packet leaving node 7 IPv6 ((A:1::, B:8:E::) (B:10::DT4, B:8:E::,
              B:4:BM-C1-7:: ; SL=1))</t>

              <t>Node 8 performs End(PSP) function
              <vspace blankLines="0" />
              Packet leaving node 8 IPv6 ((A:1::, B:10::DT4))</t>

              <t>Node 10 performs End.DT function and lookups IP in VRF and send
              traffic to CE.</t>
              </list>
            </t>
          </section>
          
          <section title="Mo6">
            <t>Refer <xref target="TransportIW"/> for Mo6 scenario.
            MPLS Service prefix (e.g. VPN or EVPN) is received on head-end(node 1)
            with color extended community(C1) from egress PE(node 10). The PCE computes 
            color-aware C1 path via node 2, 5 and 8. It programs a SRv6 policy bound to 
            MPLS BSID at border node 4 with SRv6 segment list along required color-aware 
            path with last segment of behavior End.DTM <xref target="ENDDTM"/>. 
            SR-PCE responds back to node 1 with MPLS segment list including MPLS BSID 
            of SRv6 policy at node 4 to traverse SRv6 core domain.</t>
          
            <t>For example, SR-PCE create SRv6 policy (C1,7) at node 4 with segments 
            &lt;B:5:E::,B:7:DTM::>. It is bound to MPLS BSID 24407.</t>
          
            <t>The data plan operations for the above-mentioned interworking example
            are:
              <list style="numbers">

              <t>Node 1 performs MPLS label stack encapsulation with VPN label and 
              SR-MPLS Policy (C1,10):
              <vspace blankLines="0" />
              Packet leaving node 1 towards 2 (Note: PHP of node 2 prefix SID): 
              MPLS packet (16004,24407,16008,16010,vpn_label)</t>
              <t>Node 2 forwards traffic towards 4 (PHP of 16004)
              <vspace blankLines="0" />
              Packet leaving node 2 
              MPLS packet (24407,16008,16010,vpn_label)</t>
            
              <t>Node 4 steers MPLS traffic into SRv6 policy bound to 24407
              <vspace blankLines="0" />
              Packet leaving node 4 
              IPv6(A:4::, B:5:E::) (B:7:DTM:: ; SL=1)NH=137) MPLS((16008,16010,vpn_label)</t>
            
              <t>Node 7 receive IPv6 packet with DA=B:7:DTM::. It performs DTM behavior 
              to remove IPv6 header and perform 16008 lookup in MPLS table. 
              <vspace blankLines="0" />
              Packet leaves node 7 towards node 8(PHP of 16008)
              MPLS packet (16010,vpn_label)</t>
              <t>Node 8 forwards traffic towards 10 (PHP of 16010)
              <vspace blankLines="0" />
              Packet leaving node 8
              MPLS packet (vpn_label)</t>

              <t>Node 10 performs vpn_label lookup and send traffic to CE.</t>
              </list>
            </t>  
          </section>
        </section>
        
        <section title="BGP inter domain routing procedures">
          <t>Procedures described below build upon BGP Label Unicast (BGP-LU) 
          <xref target="I-D.ietf-mpls-seamless-mpls"/> and <xref target="RFC4798"/> to 
          advertise transport reachability for PE IPv4 loopbacks or SRv6 locators 
          across a multi-domain network. The procedures leverage existing SAFIs (
          for example, BGP-LU(AFI=1 or 2 and SAFI=4) and IPv6 (SAFI=1,AFI=2)). 
          Nexthop self on border routers provide independence of intra domain tunnel 
          technology in different domains.
          </t>
          
          <t>The sections below describe 6oM and Mo6 IW with BGP procedures for 
          best effort paths to a locator or loopback prefix. The procedures are 
          equally applicable to intent aware paths, i.e., locator assigned for a 
          given intent, for instance from an IGP-FlexAlgo. They are also applicable 
          to color-aware routes <xref target="I-D.ietf-idr-bgp-car"/> recursing over 
          intent aware intra-domain paths.</t>
          
          <section title="6oM">
            <t>Refer <xref target="TransportIW"/> for 6oM scenario.
            SRv6 based L3/L2 BGP services are signaled with SRv6 Service SID 
            allocated from egress PE locator prefix and with no BGP Color Extended 
            community. Ingress PE learns the service routes and need 
            to resolve SRv6 Service SID over egress PE locator or its summary. Below
            describes propagation of locators or its summary to create end to end 
            underlay path.
              <list style="symbols">
              <t>Egress border router learns LE domain PE locators through IGP and 
              redistribute in BGP. Alternatively, locator is originated by egress PE in 
              the BGP IPv6 unicast address family (AFI=2,SAFI=1) to border nodes.</t>
              <t>Egress border router uses <xref target="RFC4798"/> 6PE procedure and 
              advertise these locator in BGP-LU [AFI=2,SAFI=4] with locally allocated 
              label or IPv6 Explicit NULL to ingress border router with IPv4 next hop. 
              Next hop has SR MPLS IPv4 LSP paths built in C domain. Note: Egress border 
              router may advertise summary prefix covering all PE locators in LE domain.</t>
              <t>Ingress border router advertise these remote locators or its summary in 
              LI domain. Options to advertise are: 
                <list style="symbols">
                <t>To ingress PE in BGP IPv6 address family (AFI=2,SAFI=1) with SRv6 
                transport SID of local End behavior in Prefix-SID attribute TLV type 5
                <xref target="RFC9252"/>. This option will result in additional 
                SRv6 encapsulation at ingress PE.</t>
                <t>BGP hop by hop routing model to each of P and PE routers through 
                infrastructure route reflector. This option will avoid additional SRv6 
                transport SID encapsulation.</t>
                <t>Leak remote locators or their summary in LI IGP 
                (Typically on transport ABR only infrastructure prefixes are present 
                in BGP. If that is not the case, proper filters need to be configured 
                for such leaking into IGP).
                </t>
                 </list>
              </t>   
              <t>Ingress PE learn remote locators or their summary with or without
              SRv6 SID encapsulation. When learnt with SRv6 SID, it builds the packet
              encapsulation that contains the SRv6 Service SID and SRv6 transport SID 
              in the SID list and tunnels traffic to ingress border node in LI domain
              (P routers (node 2 and 3) does not need remote prefix). When learnt without
              SRv6 SID, the packet encapsulation contains the SRv6 Service SID and 
              forwarded hop by hop based on remote locator IPv6 prefix lookup.</t>
              </list>
            </t>
            <t>Example to advertise node 10 locator to node 1 with SRv6 SID encapsulation:
      <figure anchor="REFERENCETOPOLOGYSNIP" title="SNIPPET of Reference multi-domain 
        network topology"><artwork><![CDATA[                                       

|  :                   |                      |                     : |
|----+    IGP1       +---+        IGP2      +---+      IGP3      +----|    
| 1  |               | 4 |                  | 7 |                | 10 |
|----+               +---+                  +---+                +----|

+----------------------+----------------------+-----------------------+
iPE                   iBR                    eBR                     ePE

<----------LI---------><----------C----------><-----------LE---------->       
          ]]></artwork>
        </figure>
              <list style="numbers">
              <t>Routing Protocol(RP) @10:
                <list style="symbols">
                <t>In ISIS advertise locator B:10::/48</t> 
                <t>BGP (AFI=1,SAFI=128) originates a VPN route RD:V/v via B:10::1 and 
                Prefix-SID attribute B:10:DT4::. This route is advertised to service RR.</t>
                </list>
              </t>
              <t>RP @ 7:
                <list style="symbols">
                <t>ISIS redistribute B:10::/48 into BGP</t>
                <t>BGP Originates B:10::/48 in (AFI=2,SAFI=4) with next hop node 7 and 
                IPv6 Explicit Null label among border routers.</t>
                </list>
              </t>  
              <t>RP @ 4:
                <list style="symbols">
                <t>BGP learns B:10::/48 with next hop node 7 and outgoing label.</t>
                <t>BGP advertise B:10::/48 in (AFI=2,SAFI=1) with next hop B:4::1 and 
                Prefix-SID attribute tlv type 5 carrying local End behavior 
                function B:4:END:: to node 1</t>
                </list>
              </t>  
              <t>RP @ 1:
                <list style="symbols">
                <t>BGP learns B:10::/48 via B:4::1 and Prefix-SID attribute TLV type 
                5 with SRv6 SID B:4:END::</t>
                <t>BGP AFI=1,SAFI=128 learn service prefix RD:V/v, next hop B:10::1 and 
                PrefixSID attribute TLV type 5 with SRv6 SID B:10:DT4</t>
                </list>
              </t>
              </list>    
            </t>
            <t> FIB state</t>
            <figure><artwork><![CDATA[
@1: IPv4 VRF V/v => H.Encaps.red <B:4:END::, B:10:DT4::> 
                                         with SRH, SRH.NH=IPv4
@4: IPv6 Table: B:4:END:: => Update DA with B:10:DT4::,
                                         set IPv6.NH=IPv4, pop the SRH
@4: IPv6 Table: B:10::/48 => push MPLS label 2 (Explicit NULL), 
                                         push MPLS Label 16007
@7: MPLS label 2 => pop and lookup next IPv6 DA
@7: IPv6 Table B:10::/48 => forward via ISIS path to 10
@10: IPv6 Table B:10:DT4:: => pop the outer header and lookup 
                                         the inner IPv4 DA in the VRF
              ]]></artwork>
            </figure>
          </section>
          
          <section title="Mo6">
            <t>Refer <xref target="TransportIW"/> for Mo6 scenario.
            MPLS based L3/L2 BGP services are signaled with IPv4 next-hop of egress PE 
            through Service RRs with no color extended community. Ingress PE need 
            labelled reachability to remote PE IPv4 loopback address advertised as 
            next hop with service routes.</t>
            <t>BGP-LU <xref target="RFC8277"/> advertise IPv4 PE 
            loopbacks. Next hop self is performed on the border routers.</t>
            <t>Following are options and protocol extensions 
            to tunnel IPv4 PE loopback LSP through SRv6 C domain</t>
            <section title="Tunnel BGP-LU LSP across SRv6 C domain">
              <t>Intuitive solution for an MPLS-minded operator
                <list style="symbols">
                <t>Existing BGP-LU label cross-connect on border routers for each PE 
                IPv4 loopback address.</t>
                <t>The lookups at the ingress border router are based on BGP-LU 
                label as usual</t>
                <t>Just the SR-MPLS IGP label to next hop is replaced by an 
                IPv6 tunnel with DA = SRv6 SID associated with DTM behavior in C domain.</t>
                <t>Ingress border router forwarding perform 3107 label swap and 
                H.Encaps.M with DA = SRv6 SID associated with DTM behavior</t>
                <t>Similar to MPLS-over-IP</t>
                </list>
              </t>
              
              <t>Existing BGP-LU updates between border routers need to signal 
              SRv6 SID associated with DTM behavior. 
              <xref target="I-D.agrawal-bess-bgp-srv6-mpls-interworking"/>
              proposes "SRv6 tunnel for label route" TLV of the BGP Prefix-SID Attribute 
              to signal SRv6 SID to tunnel MPLS packet with label in NLRI at the top of 
              its label stack through SRv6/IPv6 domain. Below describes the control plane 
              and corresponding FIB state to achieve such tunneling: 
              </t>
              <t>Control plane example
                 <list style="numbers">
                 <t>Routing Protocol(RP) @10:
                    <list style="symbols">
                    <t>ISIS originates its IPv4 PE loopback with Node SID 16010</t>
                    <t>BGP AFI=1,SAFI=4 originate IPv4 loopback address with next hop 
                    node 10 and optionally label index=10 in Label-Index TLV of 
                    Prefix-SID attribute.</t>
                    <t>BGP AFI=1,SAFI=128 originates a VPN route RD:V/v next hop node 10. 
                    This route is advertised to service RR.</t>
                    </list>
                 </t>
                 <t>RP @ 7:
                    <list style="symbols">
                    <t>ISIS v6, advertise locator B:7::/48 in C domain</t>
                    <t>BGP learns node 10 IPv4 loopback address with outgoing label.
                    It allocates local label (based on label index if present) and 
                    programs label swap to outgoing label and MPLS LSP to next hop.</t>
                    <t>BGP AFI=1,SAFI=4 advertise IPv4 loopback address of node 10 
                    to node 4. NLRI label is set to local label and SRv6 SID B:7:DTM::
                    carried in SRv6 SID Information Sub-TLV of 
                    "SRv6 tunnel for label route" TLV in Prefix-Sid attribute. If received, 
                    label index=10 in Label-Index TLV of Prefix-SID attribute is also
                    signaled.</t>
                    </list>
                 </t>  
                 <t>RP @ 4:
                    <list style="symbols">
                    <t>ISIS v4 originates its IPv4 loopback with prefix SID 16004
                    in LI domain.</t>
                    <t> BGP learns node10 IPv4 loopback address from node 7 with 
                    outgoing label. It allocate local label (based on label index 
                    if present) and programs label swap and H.Encaps.M.red with 
                    IPv6 header destination address as SRv6 SID received in 
                    "SRv6 tunnel for label route" TLV of Prefix-Sid attribute i.e. B:7:DTM::.
                    </t>
                    <t>BGP AFI=1,SAFI=4 advertise IPv4 Loopback address of node 10 to 
                    node 1. NLRI label is set to local label and do not signal 
                    "SRv6 tunnel for label route" TLV in Prefix-SID attribute.</t>
                    </list>
                 </t>  
                 <t>RP @ 1:
                    <list style="symbols">
                    <t>BGP learns IPv4 loopback address of node 10 from node 4 with 
                    outgoing label. It programs route to push outgoing label and 
                    MPLS LSP to next hop i.e. node 4</t>
                    <t>BGP AFI=1,SAFI=128 learn service prefix RD:V/v, next hop 
                    IPv4 loopback address of node 10 and service label.</t> 
                    </list>
                 </t>
                 </list>
                </t>  
              <t>Forwarding state at different nodes:</t>
                <figure><artwork><![CDATA[
@1: IPv4 VRF: V/v => out label=vpn_label, next hop=IPv4 address of node 10
@1: IPv4 table: IPv4 address of node 10 => out label=16010, next hop=node4
@1: IPv4 table: IPv4 address of node 4 => out label=16004, next hop=interface to reach 2
@4: MPLS Table: 16010 => out label=16010, H.Encaps.M.red with DA=B:7:DTM::
@4: IPv6 table: B:7::/48 => next hop=interface to reach 5
@7: SRv6 My SID table: B:7:DTM:: => decaps IPv6 header and lookup top label.
@7: MPLS table: 16010 => out label=16010, next hop=interface to reach 8
@10: MPLS table: vpn label => pop label and lookup the inner IPv4 DA in the VRF

                  ]]></artwork>
                </figure>
              <t>During transition when MPLS data plane is still enabled in C domain, an 
              ABR that does not understand "SRv6 tunnel for label route" TLV in 
              BGP Prefix-SID Attribute or based on operator configured local policy 
              can continue MPLS encapsulation using label in NLRI and LSP to next hop. 
              </t>
            </section>
            
            <section title="Label and SRv6 SID translation per BGP LU route">
              <t>For each PE IPv4 loopback address, existing BGP-LU label cross-connect 
              on area border router is replaced by label to SRv6 SID cross-connect 
              or vice versa. In effect, it creates a translation between from 3107 
              label to SRv6 SID at ingress of SRv6 domain and SRv6 SID to 3107 label on
              egress.</t>
              <t>
                <list style="symbols">
                <t>For each BGP-LU route (IPv4 loopback address of PE) received 
                from LE domain on egress border router, allocate SRv6 SID of DPM behavior 
                bound to the PE address. Lookup of SRv6 SID result in decapsulation of 
                IPv6 header and push of BGP-LU outgoing label and MPLS LSP to next hop.
                </t>
                <t>Advertise BGP route to PE address with SRv6 SID to ingress 
                border router.</t>
                <t>Ingress border router allocate local label and advertise to LI domain.
                </t>
                <t>The lookups at the ingress border router are based on BGP-LU
                label as usual. Lookup results SRv6 SID of DPM behavior signaled by 
                egress border node. Decap BGP-LU label and perform H.Encaps.M with 
                DA = SRv6 SID.</t>
                </list>
              </t>
              <t>Section 2.2 of 
              <xref target="I-D.agrawal-bess-bgp-srv6-mpls-interworking"/> 
              describes how existing BGP advertisement can signal SRv6 SID associated 
              with DPM behavior from egress to ingress border router.</t>
            </section>
          </section>
        </section>
      </section>
      
      <section title="Service IW">
        <t>As described in <xref target="ServiceIW"/> Service IW need BGP SRv6 
        based L2/L3 PE interworking with BGP MPLS based L2/L3 PE.</t>
        <t>There are a number of different ways of handling this scenario as 
        detailed below.</t>
        
        <section title="Gateway Interworking">
          <t>Gateway is IW role that which supports both BGP SRv6 based L2/L3 services 
          and BGP MPLS based L2/L3 services for a service instance
          (e.g. L3 VRF, EVPN EVI). It terminates service encapsulation and 
          perform L2/L3 destination lookup in service instance. This is similar to 
          inter-as option A on the single node instead of back to back VRF interfaces 
          between ABRs/ASBRs.</t>
          
          <t>
            <list style="symbols">
            <t>A border router between SRv6 domain and SR-MPLS-IPv4 domain is  
            suitable for Gateway role.</t>
            <t>Transport reachability to SRv6 PE and gateway locators in SRv6 domain
            or MPLS LSP to PE/gateway IPv4 Loopbacks can be exchanged in IGP or 
            through mechanism detailed in <xref target="TransportIW"/>.</t>  
            <t>Gateway exchange BGP L2/L3 service prefix with SRv6 based Service PEs 
            via set of service RRs. This session will learn/advertise L3/L2 service 
            prefixes with SRv6 service SID in prefix SID attribute 
            <xref target="RFC9252"/>.</t>
            <t>Gateway exchange BGP L2/L3 service prefix with MPLS based Service 
            PEs via set of distinct service RRs. This session will learn/advertise 
            L3/L2 service prefixes with service labels <xref target="RFC4364"/> 
            <xref target="RFC7432"/>.</t>
            <t>L2/L3 prefix received from a domain is locally installed in service 
            instance and re advertised to other domain with modified service 
            encapsulation information.</t>
            <t>Prefix learned with SRv6 service SID from SRv6 PE is installed 
            in service instance with instruction to perform H.Encaps. 
            It is advertised to MPLS service PE with service label. 
            When gateway receives traffic with service label from MPLS service PE, 
            it perform destination lookup in service instance. Lookup result in
            instruction to perform H.Encaps with DA being SRv6 Service SID learnt 
            with prefix from SRv6 PE.</t>
            <t>Prefix learned with MPLS service label from MPLS service PE is 
            installed in service instance with instruction to perform service label 
            encapsulation and send to MPLS LSP to nexthop. It is advertised to SRv6 
            service PE with SRv6 service SID of behavior (e.g. DT4/DT6/DT2U) 
            <xref target="RFC8986"/>. When gateway 
            receives traffic with SRv6 Service SID as DA of IPv6 header from 
            SRv6 service PE, it perform destination lookup in service instance 
            after decaps of IPv6 header. Lookup result in instruction to push 
            service label and send it to nexthop.</t>
            </list>
            <figure title="Gateway IW">
              <artwork><![CDATA[
                                    
        +-------------------+                             +-------------------+
        |   ....|S-RR|....  |                             |  ....|S-RR|.....  |
        |   :   +----+   :  |                             |  :   +----+    :  |
        |   :            :  |                             |  :             :  |
        |----+          +-------------------------------------+          +----|
        |PE1 |          |             IW border node          |          | PE2|
        |----+          | VPN Label<->L2/L3 lookup<->SRv6 SID |          +----|     
        |               |                                     |               |    
        |               +-------------------------------------+               |     
        |      MPLS         |                             |       SRv6        |  
        +-------------------+                             +-------------------+
        <------MPLS VPN----->                             <------SRv6 VPN----->
              ]]></artwork>
            </figure>
          </t>
          <t>Couple of border routers can act as gateway for redundancy. It can scale 
          horizontally by distributing service instance among them.</t>
        </section>
        <section title="Translation between Service labels and SRv6 service SIDs">
          <t>This is similar to inter-as option B procedures described in 
          <xref target="RFC4364"/> just that service label cross-connect 
          on border router is replaced with service label to SRv6 service SID or 
          vice verse translation on IW node.
            <list style="symbols">
          	<t>IW node does not need service instance like VRF or EVI.</t> 
            <t>IW node exchange BGP L2/L3 service prefix with SRv6 based Service PEs 
            via set of service RRs. This BGP session will learn/advertise L3/L2 service 
            prefixes with SRv6 service SID in prefix SID attribute 
            <xref target="RFC9252"/>.</t>
            <t>IW node exchange BGP L2/L3 service prefix with MPLS based service 
            PEs via set of distinct service RRs. This BGP session will learn/advertise 
            L3/L2 service prefixes with service labels <xref target="RFC4364"/> 
            <xref target="RFC7432"/>.</t>
            <t>IW node allocates SRv6 SID of behavior End.DPM that result in pushing 
            service label and MPLS label stack to service nexthop for BGP L2/L3 service 
            learnt from MPLS PE. It advertises the service to SRv6 domain.
            </t>
            <t>IW node allocates service label that results in H.Encaps with IPv6 header DA
            set to SRv6 SID signaled in BGP L2/L3 service learnt from SRv6 PE. 
            Advertises the service to MPLS domain with allocated service label.
            </t>
            </list>
            <figure title="Service translation">
              <artwork><![CDATA[
                                    
        +-------------------+                             +-------------------+
        |   ....|S-RR|....  |                             |  ....|S-RR|.....  |
        |   :   +----+   :  |                             |  :   +----+    :  |
        |   :            :  |                             |  :             :  |
        |----+          +-------------------------------------+          +----|
        |PE1 |          |             IW border node          |          | PE2|
        |----+          |          VPN Label -> SRv6 SID      |          +----|     
        |               | VPN label, LSP PE1 <- SRv6 SID      |               |    
        |               +-------------------------------------+               |     
        |      MPLS         |                             |       SRv6        |  
        +-------------------+                             +-------------------+
        <------MPLS VPN----->                             <------SRv6 VPN----->
              ]]></artwork>
            </figure>
          </t>  
          <t>Certain L2 service specific information (eg. control word) translation 
          is out of the scope. It will be covered in separate document.</t>
        </section>
      </section>
    </section>
    
    <section title="Migration and co-existence">
      <t>In addition, the draft also addresses migration and coexistence of 
        the SRv6 and SR-MPLS-IPv4. Co-existence means a network that supports 
        both SRv6 and MPLS in a given domain. This may be a transient state when 
        brownfield SR-MPLS-IPv4 network upgrades to SRv6 (migration) or permanent 
        state when some devices are not capable of SRv6 but supports native IPv6 
        and SR-MPLS-IPv4.</t>
      <t>These procedures would be detailed in a future revision</t>
    </section>
    
    <section title="Availability">
      <t>
        <list style="symbols">
        <t>Failure within domain are taken care by existing FRR 
        mechanisms <xref target="I-D.ietf-rtgwg-segment-routing-ti-lfa"/>.</t>
        <t>Procedures listed in <xref target="RFC9256"/> 
        provides protection in SR-PCE multi-domain On Demand Nexthop (ODN) SR policy based 
        approach.</t>
        <t>Convergence on failure of border routers can be achieved by well known methods
        for BGP inter domain routing approach:
          <list style="symbols">
          <t>BGP Add Path provide diverse path visibility</t>
          <t>BGP backup path pre-programming</t>
          <t>Sub-second convergence on border router failure notified by local IGP.</t>
          </list>
        </t>
        </list>
      </t>  
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <section title="SRv6 Endpoint Behaviors">
        <t>This document introduces a new SRv6 Endpoint behaviors "End.DTM" and "End.DPM". 
        IANA is requested to assign identifier value in the 
        "SRv6 Endpoint Behaviors" sub-registry under "Segment Routing Parameters" 
        registry.
        <figure>
            <artwork><![CDATA[+-------------+--------+-------------------------+------------------+    
| Value       |  Hex   |    Endpoint behavior    |    Reference     |
+-------------+--------+-------------------------+------------------+
| 73          | 0x0049 |    End.DTM              | <this document>  |
+-------------+--------+-------------------------+------------------+
| TBD         |  TBD   |    End.DPM              | <this document>  |
+-------------+--------+-------------------------+------------------+]]></artwork>
          </figure>
        </t>
      </section>
    </section>

    <section anchor="Security" title="Security Considerations">
    </section>
    
    <section anchor="Contributors">
    <name> Contributors </name>
      <figure>
        <artwork><![CDATA[Zafar Ali
Cisco Systems
Email: zali@cisco.com
        ]]></artwork>
      </figure>

      <figure>
        <artwork><![CDATA[Srihari Sangli
Juniper Networks
Email: ssangli@juniper.net
        ]]></artwork>
      </figure>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to acknowledge Kamran Raza, Dhananjaya Rao, 
      Stephane Litkowski, Pablo Camarillo, Ketan Talaulikar, Jorge Rabadan,
      Bruno Decraene for their comments and review.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
       <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
       
       <?rfc include='reference.RFC.8174.xml'?>
       
       <?rfc include='reference.RFC.4364.xml'?>
       
       <?rfc include='reference.RFC.7432.xml'?>
       
       <?rfc include='reference.RFC.3032.xml'?>
       
       <?rfc include='reference.RFC.4023.xml'?>
       
       <?rfc include='reference.RFC.8664.xml'?>
       
       <?rfc include='reference.RFC.8402.xml'?>
       
       <?rfc include='reference.RFC.8277.xml'?>
       
       <?rfc include='reference.RFC.9252.xml'?>
       
       <?rfc include='reference.RFC.9256.xml'?>
       
       <?rfc include='reference.RFC.4798.xml'?>
       
       <?rfc include='reference.I-D.agrawal-bess-bgp-srv6-mpls-interworking.xml'?>
       
       <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-bgp-car.xml"/>       
       
              
       <?rfc include='reference.RFC.8986.xml'?>
    </references>
    <references title="Informative References">
        <?rfc include='reference.RFC.9012.xml'?> 
        
        <?rfc include='reference.I-D.ietf-mpls-seamless-mpls.xml'?>
        
        <?rfc include='reference.I-D.ietf-rtgwg-segment-routing-ti-lfa.xml'?>
    </references>
  </back>
</rfc>
