<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" category="std" consensus="yes" number="0000" ipr="trust200902" obsoletes="" updates="" xml:lang="en" tocInclude="true" symRefs="true" sortRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 2.32.0 -->
  <front>
    <title abbrev="SR-MPLS over IP">MPLS Segment Routing over IP</title>
    <seriesInfo name="RFC" value="0000"/>
    <author fullname="Xiaohu Xu" initials="X." surname="Xu">
      <organization>Alibaba, Inc</organization>
      <address>
        <email>xiaohu.xxh@alibaba-inc.com</email>
      </address>
    </author>
    <author fullname="Stewart Bryant" initials="S." surname="Bryant ">
      <organization>Futurewei Technologies</organization>
      <address>
        <email>stewart.bryant@gmail.com</email>
      </address>
    </author>
    <author fullname="Adrian Farrel" initials="A." surname="Farrel ">
      <organization>Old Dog Consulting</organization>
      <address>
        <email>adrian@olddog.co.uk</email>
      </address>
    </author>
    <author fullname="Syed Hassan" initials="S." surname="Hassan">
      <organization>Cisco</organization>
      <address>
        <email>shassan@cisco.com</email>
      </address>
    </author>
    <author fullname="Wim Henderickx" initials="W" surname="Henderickx">
      <organization>Nokia</organization>
      <address>
        <email>wim.henderickx@nokia.com</email>
      </address>
    </author>
    <!-- [rfced] Should Zhenbin Li's organization be changed from "Huawei" to
"Futurewei Technologies" as per Stewart Bryant's request?
-->
    <author fullname="Zhenbin Li" initials="Z." surname="Li">
      <organization>Huawei</organization>
      <address>
        <email>lizhenbin@huawei.com</email>
      </address>
    </author>
    <date year="2019" month="August"/>
    <!-- [rfced] Please insert any keywords (beyond those that appear in                  
the title) for use on https://www.rfc-editor.org/search. -->
    <keyword>example</keyword>
    <!-- [rfced] FYI: We have updated the following sentence to avoid the need for
a double hyphen. Please let us know if this changes the intended meaning
(avoids "data-plane-based source-routing paradigm").

Original:
   MPLS Segment Routing (SR-MPLS) is an MPLS data plane-based source
   routing paradigm in which the sender of a packet is...

Updated:
   MPLS Segment Routing (SR-MPLS) is a source-routing paradigm based on
   the MPLS data plane in which the sender of a packet is...  
-->
    <abstract>
      <t>MPLS Segment Routing (SR-MPLS) is a source-routing paradigm based on
      the MPLS data plane in which the sender of a packet is allowed to partially
      or completely specify the route the packet takes through the network by
      imposing stacked MPLS labels on the packet. SR-MPLS can be leveraged to
      realize a source-routing mechanism across MPLS, IPv4, and IPv6 data
      planes by using an MPLS label stack as a source-routing instruction set
      while making no changes to SR-MPLS specifications and interworking with
      SR-MPLS implementations.</t>
      <t>This document describes how SR-MPLS-capable routers and IP-only
      routers can seamlessly coexist and interoperate through the use of
      SR-MPLS label stacks and IP encapsulation/tunneling such as MPLS-in-UDP
      as defined in RFC 7510.</t>
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>
      <t>MPLS Segment Routing (SR-MPLS) <xref target="RFCYYYY" format="default"/> is a
      source-routing paradigm based on the MPLS data plane in which the sender of a packet
      is allowed to partially or completely specify the route the packet takes
      through the network by imposing stacked MPLS labels on the packet.
      SR-MPLS uses an MPLS label stack to encode a source-routing instruction
      set. This can be used to realize a source-routing mechanism that can
      operate across MPLS, IPv4, and IPv6 data planes. This approach makes no
      changes to SR-MPLS specifications and allows interworking with SR-MPLS
      implementations. More specifically, the source-routing instruction set
      information contained in a source-routed packet could be uniformly
      encoded as an MPLS label stack no matter whether the underlay is IPv4,
      IPv6 (including Segment Routing for IPv6 (SRv6) [RFC8354]), or MPLS.</t>
      <t>This document describes how SR-MPLS-capable routers and IP-only
      routers can seamlessly coexist and interoperate through the use of
      SR-MPLS label stacks and IP encapsulation/tunneling such as MPLS-in-UDP
      <xref target="RFC7510" format="default"/>.</t>
      <t><xref target="usecases" format="default"/> describes various use cases for the
      tunneling SR-MPLS over IP. <xref target="procs" format="default"/> describes a typical
      application scenario and how the packet forwarding happens.</t>
      <section anchor="Abbreviations_Terminology" numbered="true" toc="default">
        <name>Terminology</name>
        <t>This memo makes use of the terms defined in <xref target="RFC3031" format="default"/> and <xref target="RFCYYYY" format="default"/>.</t>
        <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" format="default"/> <xref target="RFC8174" format="default"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
      </section>
    </section>
    <section anchor="usecases" numbered="true" toc="default">
      <name>Use Cases</name>
      <t>Tunneling SR-MPLS using IPv4 and/or IPv6 (including SRv6) tunnels is
      useful at least in the use cases listed below. In all cases, this can be
      enabled using an IP tunneling mechanism such as MPLS-in-UDP as described
      in <xref target="RFC7510" format="default"/>. The tunnel selected MUST have its remote
      end-point (destination) address equal to the address of the next
      node capable of SR-MPLS identified as being on the SR path (i.e., the
      egress of the active segment). The local end-point (source) address is
      set to an address of the encapsulating node. <xref target="RFC7510" format="default"/>
      gives further advice on how to set the source address if the UDP
      zero-checksum mode is used with MPLS-in-UDP. Using UDP as the
      encapsulation may be particularly beneficial because it is agnostic of
      the underlying transport.</t>
      <ul spacing="normal">
        <li>
          <t>Incremental deployment of the SR-MPLS technology may be
          facilitated by tunneling SR-MPLS packets across parts of a network
          that are not SR-MPLS as shown in <xref target="islandsFig" format="default"/>. This
          demonstrates how islands of SR-MPLS may be connected across a legacy
          network. It may be particularly useful for joining sites (such as
          data centers).

          </t>
          <figure anchor="islandsFig">
            <name>SR-MPLS in UDP to Tunnel between SR-MPLS Sites</name>
            <artwork name="" type="" align="left" alt=""><![CDATA[  
                   ________________________
    _______       (                        )       _______
   (       )     (        IP Network        )     (       )
  ( SR-MPLS )   (                            )   ( SR-MPLS )
 (  Network  ) (                              ) (  Network  )
(         --------                          --------         )
(        | Border |    SR-in-UDP Tunnel    | Border |        )
(        | Router |========================| Router |        )
(        |   R1   |                        |   R2   |        )
(         --------                          --------         )
 (           ) (                              ) (           )
  (         )   (                            )   (         )
   (_______)     (                          )     (_______)
                  (________________________)
            ]]></artwork>
          </figure>
        </li>
        <li>If the encoding of entropy <xref target="RFC6790" format="default"/> is desired,
          IP-tunneling mechanisms that allow the encoding of entropy, such as
          MPLS-in-UDP encapsulation <xref target="RFC7510" format="default"/> where the source
          port of the UDP header is used as an entropy field, may be used to
          maximize the utilization of ECMP and/or Link Aggregation Groups
          (LAGs), especially when it is difficult to make use of the
          entropy-label mechanism. This is to be contrasted with <xref target="RFC4023" format="default"/> where MPLS-in-IP does not provide for an entropy
          mechanism. Refer to <xref target="RFCZZZZ" format="default"/>) for more
          discussion about using entropy labels in SR-MPLS.</li>
        <li>
          <t>Tunneling MPLS over IP provides a technology that enables SR in
          an IPv4 and/or IPv6 network where the routers do not support SRv6
          capabilities <xref target="IPV6-SEGMENT" format="default"/>
          and where MPLS forwarding is not an option. This is shown in <xref target="transitionFig" format="default"/>. </t>
          <figure anchor="transitionFig">
            <name>SR-MPLS Enabled within an IP Network</name>
            <artwork name="" type="" align="left" alt=""><![CDATA[


                 __________________________________
              __(           IP Network             )__
           __(                                        )__
          (               --        --        --         )
     --------   --   --  |SR|  --  |SR|  --  |SR|  --   --------
    | Ingress| |IR| |IR| |  | |IR| |  | |IR| |  | |IR| | Egress |
--->| Router |===========|  |======|  |======|  |======| Router |--->
    |   SR   | |  | |  | |  | |  | |  | |  | |  | |  | |   SR   |
     --------   --   --  |  |  --  |  |  --  |  |  --   --------
          (__             --        --        --       __)
             (__                                    __)
                (__________________________________)

   Key:
     IR : IP-only Router
     SR : SR-MPLS-capable Router
     == : SR-MPLS in UDP Tunnel


            ]]></artwork>
          </figure>
        </li>
      </ul>
    </section>
    <section anchor="procs" numbered="true" toc="default">
      <name>Procedures of SR-MPLS over IP</name>
      <t>This section describes the construction of forwarding information
      base (FIB) entries and the forwarding behavior that allow the deployment
      of SR-MPLS when some routers in the network are IP only (i.e., do not
      support SR-MPLS). Note that the examples in Sections <xref target="fibeg" format="counter"/> and <xref target="fwd" format="counter"/> assume that
      OSPF or IS-IS is enabled; in fact, other mechanisms of discovery and
      advertisement could be used including other routing protocols (such as
      BGP) or a central controller.</t>
      <section anchor="fib" numbered="true" toc="default">
        <name>Forwarding Entry Construction</name>
        <t>This subsection describes how to construct the forwarding
        information base (FIB) entry on an SR-MPLS-capable router when some or
        all of the next hops along the shortest path towards a prefix Segment
        Identifier (prefix-SID) are IP-only routers. <xref target="fibeg" format="default"/>
        provides a concrete example of how the process applies when using OSPF
        or IS-IS.</t>
        <t>Consider router A that receives a labeled packet with top label
        L(E) that corresponds to the prefix-SID SID(E) of prefix P(E)
        advertised by router E. Suppose the i-th next-hop router (termed NHi)
        along the shortest path from router A toward SID(E) is not SR-MPLS
        capable while both routers A and E are SR-MPLS capable. The following
        processing steps apply:</t>
        <ul spacing="normal">
          <li>Router E is SR-MPLS capable, so it advertises a Segment Routing
            Global Block (SRGB). The SRGB is defined in <xref target="RFC8402" format="default"/>.
            There are a number of ways that the advertisement can be achieved
            including IGPs, BGP, and configuration/management protocols. For
            example, see <xref target="DATACENTER-GATEWAY" format="default"/>.</li>
          <li>When Router E advertises the prefix-SID SID(E) of prefix P(E),
            it MUST also advertise the encapsulation endpoint and the tunnel
            type of any tunnel used to reach E. This information is flooded
            domain wide.</li>
          <li>If A and E are in different routing domains, then the information MUST
            be flooded into both domains. How this is achieved depends on the
            advertisement mechanism being used. The objective is that router A
            knows the characteristics of router E that originated the
            advertisement of SID(E).</li>
          <li>
            <t>Router A programs the FIB entry for prefix P(E) corresponding
            to the SID(E) according to whether a pop or swap action is advertised
            for the prefix. The resulting action may be:
            </t>
            <ul spacing="normal">
              <li>pop the top label</li>
              <li>swap the top label to a value equal to SID(E) plus the
                  lower bound of the SRGB of E</li>
            </ul>
          </li>
        </ul>
        <t>Once constructed, the FIB can be used by a router to tell it how to
        process packets. It encapsulates the packets according to the
        appropriate encapsulation advertised for the segment and then sends
        the packets towards the next hop NHi.</t>
        <!-- [rfced] In the following sentence, was "working" intended
instead of "worked"?

Original:
   This section is non-normative and provides a worked example of how a FIB
   might be constructed using...

Perhaps:
   This section is non-normative and provides a working example of how a
   FIB might be constructed using...
-->
        <section anchor="fibeg" numbered="true" toc="default">
          <name>FIB Construction Example</name>
          <t>This section is non-normative and provides a worked example of how
          a FIB might be constructed using OSPF and IS-IS extensions. It is based
          on the process described in <xref target="fib" format="default"/>.</t>
          <ul spacing="normal">
            <li>Router E is SR-MPLS capable, so it advertises a Segment Routing
              Global Block (SRGB) using
              <xref target="RFCBBBB" format="default"/> or
              <xref target="RFCAAAA" format="default"/>.</li>
            <li>When Router E advertises the prefix-SID SID(E) of prefix P(E),
              it also advertises the encapsulation endpoint and the tunnel
              type of any tunnel used to reach E using
              <xref target="ISIS-ENCAP" format="default"/> or
              <xref target="OSPF-ROUTER" format="default"/>.</li>
            <!-- [rfced] This document references the IS-IS Tunnel Encapsulation sub-TLV,
but its cited reference only mentions the "Tunnel Encapsulation Type sub-TLV",
"Encapsulation Capability sub-TLV", and "Tunnel Encapsulation Attribute
sub-TLV".  Are all of these broadly encompassed by "IS-IS Tunnel Encapsulation sub-TLV",
or should this be updated?

Original:
    *  The OSPF Tunnel Encapsulation TLV [OSPF-ROUTER] or the IS-IS
       Tunnel Encapsulation sub-TLV [ISIS-ENCAP] is flooded domain-
       wide.
-->
            <li>
              <t>If A and E are in different domains, then the information is
              flooded into both domains and any intervening domains.
              </t>
              <ul spacing="normal">
                <li>The OSPF Tunnel Encapsulations TLV
                  <xref target="OSPF-ROUTER" format="default"/> or the IS-IS
                  Tunnel Encapsulation sub-TLV
                  <xref target="ISIS-ENCAP" format="default"/> is flooded
                  domain wide.</li>
                <li>The OSPF SID/Label Range TLV
                  <xref target="RFCBBBB" format="default"/> or
                  the IS-IS SR-Capabilities sub-TLV
                  <xref target="RFCAAAA" format="default"/> is
                  advertised domain wide so that router A knows the
                  characteristics of router E.</li>
                <li>
                  <t>When router E advertises the prefix P(E):
                  </t>
                  <ul spacing="normal">
                    <li>If router E is running IS-IS, it uses the extended
                      reachability TLV (TLVs 135, 235, 236, 237) and associates
                      the IPv4/IPv6 or IPv4/IPv6 source router ID sub-TLV(s)
                      <xref target="RFC7794" format="default"/>.</li>
                    <li>If router E is running OSPF, it uses the OSPFv2 Extended
                      Prefix Opaque Link-State Advertisement (LSA) <xref target="RFC7684" format="default"/> and sets the
                      flooding scope to Autonomous System (AS) wide.</li>
                  </ul>
                </li>
                <!-- [rfced] Should we change instances of "IS-IS capability TLV" to match the IANA title of TLV
242, "IS-IS Router CAPABILITY TLV"?

Original:
   The "S" bit (flooding scope) of the IS-IS capability TLV (TLV 242) is set
   to "1". 
-->
                <!-- [rfced] Should we change instances of "IPv6 TE router-ID sub-TLV" to
match the IANA title of TLV 12, "IPv6 TE Router ID", or is it used broadly
enough to not need identical titling?

Original:
   ...it sets the "router-ID" field to a valid value or includes an IPV6 TE
   router-ID sub-TLV (TLV 12) 
-->
                <li>If router E is running IS-IS and advertises the IS-IS
                  capability TLV (TLV 242) <xref target="RFC7981" format="default"/>, it sets the
                  "router-ID" field to a valid value or includes an IPv6
                  TE router-ID sub-TLV (TLV 12), or it does both. The "S" bit
                  (flooding scope) of the IS-IS capability TLV (TLV 242) is set
                  to "1".</li>
              </ul>
            </li>
            <!-- [rfced] FYI: We have expanded NP flag and P flag to No-PHP and Persistent,
respectively. Please let us know if this is not correct. 

Original: 
   If the NP flag in OSPF or the P flag in
   ISIS is clear:

Updated:
   If the No-PHP (NP) flag in OSPF or the Persistent (P) flag in
   IS-IS is clear:
-->
            <li>
              <t>Router A programs the FIB entry for prefix P(E) corresponding
              to the SID(E) according to whether a pop or swap action is advertised
              for the prefix as follows:
              </t>
              <ul spacing="normal">
                <li>
                  <t>If the No-PHP (NP) flag in OSPF or the Persistent (P) flag in IS-IS is clear:
                  </t>
                  <ul empty="true" spacing="normal">
                    <li>pop the top label</li>
                  </ul>
                </li>
                <li>
                  <t>If the No-PHP (NP) flag in OSPF or the Persistent (P) flag in IS-IS is set:
                  </t>
                  <ul empty="true" spacing="normal">
                    <li>swap the top label to a value equal to SID(E) plus the
                      lower bound of the SRGB of E</li>
                  </ul>
                </li>
              </ul>
            </li>
          </ul>
          <t>When forwarding the packet according to the constructed FIB entry, the
          router encapsulates the packet according to the encapsulation as advertised
          using the mechanisms described in <xref target="ISIS-ENCAP" format="default"/>
          or <xref target="OSPF-ROUTER" format="default"/>. It then sends the
          packets towards the next hop NHi.</t>
          <t>Note that <xref target="RFC7510" format="default"/> specifies the use of port number 6635
          to indicate that the payload of a UDP packet is MPLS, and port number 6636 for
          MPLS-in-UDP utilizing DTLS. However, <xref target="ISIS-ENCAP" format="default"/>
          and <xref target="OSPF-ROUTER" format="default"/> provide dynamic protocol
          mechanisms to configure the use of any Dynamic Port for a tunnel that uses UDP
          encapsulation. Nothing in this document prevents the use of an IGP or any other
          mechanism to negotiate the use of a Dynamic Port when UDP encapsulation is used
          for SR-MPLS, but if no such mechanism is used, then the port numbers specified in
          <xref target="RFC7510" format="default"/> are used.</t>
        </section>
      </section>
      <section anchor="fwd" numbered="true" toc="default">
        <name>Packet-Forwarding Procedures</name>
        <t><xref target="RFC7510" format="default"/> specifies an IP-based encapsulation for
        MPLS, i.e., MPLS-in-UDP. This approach is applicable where IP-based
        encapsulation for MPLS is required and further fine-grained load
        balancing of MPLS packets over IP networks over Equal-Cost Multipath
        (ECMP) and/or Link Aggregation Groups (LAGs) is also required. This
        section provides details about the forwarding procedure when
        UDP encapsulation is adopted for SR-MPLS over IP. Other encapsulation
        and tunneling mechanisms can be applied using similar techniques,
        but for clarity, this section uses UDP encapsulation as the exemplar.</t>
        <t>Nodes that are SR-MPLS capable can process SR-MPLS packets. Not all
        of the nodes in an SR-MPLS domain are SR-MPLS capable. Some nodes may
        be "legacy routers" that cannot handle SR-MPLS packets but can forward
        IP packets. A node capable of SR-MPLS MAY advertise its capabilities
        using the IGP as described in <xref target="procs" format="default"/>. There are six
        types of nodes in an SR-MPLS domain: </t>
        <ul spacing="normal">
          <li>Domain ingress nodes that receive packets and encapsulate them
            for transmission across the domain. Those packets may be any
            payload protocol including native IP packets or packets that are
            already MPLS encapsulated.</li>
          <li>Legacy transit nodes that are IP routers but that are not
            SR-MPLS capable (i.e., are not able to perform segment
            routing).</li>
          <li>Transit nodes that are SR-MPLS capable but that are not
            identified by a SID in the SID stack.</li>
          <li>Transit nodes that are SR-MPLS capable and need to perform
            SR-MPLS routing because they are identified by a SID in the SID
            stack.</li>
          <li>The penultimate node capable of SR-MPLS on the path that processes
            the last SID on the stack on behalf of the domain egress node.</li>
          <li>The domain egress node that forwards the payload packet for
            ultimate delivery.</li>
        </ul>
        <section anchor="phpfwd" numbered="true" toc="default">
          <name>Packet Forwarding with Penultimate Hop Popping</name>
          <t>The description in this section assumes that the label associated
          with each prefix-SID is advertised by the owner of the prefix-SID as
          a Penultimate Hop Popping (PHP) label. That is, if one of the IGP
          flooding mechanisms is used, the NP flag in OSPF or the P flag in
          IS-IS associated with the prefix-SID is not set.</t>
          <figure anchor="phpfwdeg">
            <name>Packet-Forwarding Example with PHP</name>
            <artwork align="center" name="" type="" alt=""><![CDATA[
 +-----+       +-----+       +-----+       +-----+       +-----+
 |  A  +-------+  B  +-------+  C  +-------+  D  +-------+  H  |
 +-----+       +--+--+       +--+--+       +--+--+       +-----+
                  |             |             |
                  |             |             |
               +--+--+       +--+--+       +--+--+
               |  E  +-------+  F  +-------+  G  |
               +-----+       +-----+       +-----+


      +--------+
      |IP(A->E)|
      +--------+                 +--------+        +--------+
      |  UDP   |                 |IP(E->G)|        |IP(G->H)|
      +--------+                 +--------+        +--------+
      |  L(G)  |                 |  UDP   |        |  UDP   |
      +--------+                 +--------+        +--------+
      |  L(H)  |                 |  L(H)  |        |Exp Null|
      +--------+                 +--------+        +--------+
      | Packet |     --->        | Packet |  --->  | Packet |
      +--------+                 +--------+        +--------+
            ]]></artwork>
          </figure>
          <t>In the example shown in <xref target="phpfwdeg" format="default"/>, assume that
          routers A, E, G, and H are capable of SR-MPLS while the remaining
          routers (B, C, D, and F) are only capable of forwarding IP packets.
          Routers A, E, G, and H advertise their Segment Routing related
          information, such as via IS-IS or OSPF.</t>
          <t>Now assume that router A (the Domain ingress) wants to send a
          packet to router H (the Domain egress) via the explicit path
          {E-&gt;G-&gt;H}. Router A will impose an MPLS label stack on the
          packet that corresponds to that explicit path. Since the next hop
          toward router E is only IP capable (B is a legacy transit node),
          router A replaces the top label (that indicated router E) with a
          UDP-based tunnel for MPLS (i.e., MPLS-over-UDP <xref target="RFC7510" format="default"/>) to router E and then sends the packet. In other
          words, router A pops the top label and then encapsulates the MPLS
          packet in a UDP tunnel to router E.</t>
          <t>When the IP-encapsulated MPLS packet arrives at router E (which
          is a transit node capable of SR-MPLS), router E strips the IP-based
          tunnel header and then processes the decapsulated MPLS packet. The top
          label indicates that the packet must be forwarded toward router G.
          Since the next hop toward router G is only IP capable, router E
          replaces the current top label with an MPLS-over-UDP tunnel toward
          router G and sends it out. That is, router E pops the top label and
          then encapsulates the MPLS packet in a UDP tunnel to router G.</t>
          <t>When the packet arrives at router G, router G will strip the
          IP-based tunnel header and then process the decapsulated MPLS
          packet. The top label indicates that the packet must be forwarded
          toward router H. Since the next hop toward router H is only
          IP capable (D is a legacy transit router), router G would replace
          the current top label with an MPLS-over-UDP tunnel toward router H
          and send it out. However, since router G reaches the bottom of the
          label stack (G is the penultimate node capable of SR-MPLS on the path),
          this would leave the original packet that router A wanted to send to
          router H encapsulated in UDP as if it was MPLS (i.e., with a UDP
          header and destination port indicating MPLS) even though the
          original packet could have been any protocol. That is, the final
          SR-MPLS has been popped exposing the payload packet.</t>
          <t>To handle this, when a router (here it is router G) pops the
          final SR-MPLS label, it inserts an explicit null label <xref target="RFC3032" format="default"/> before encapsulating the packet in an
          MPLS-over-UDP tunnel toward router H and sending it out. That is,
          router G pops the top label, discovers it has reached the bottom of
          stack, pushes an explicit null label, and then encapsulates the MPLS
          packet in a UDP tunnel to router H.</t>
        </section>
        <section anchor="nophpfwd" numbered="true" toc="default">
          <name>Packet Forwarding without Penultimate Hop Popping</name>
          <t><xref target="nophpfwdeg" format="default"/> demonstrates the packet walk in the
          case where the label associated with each prefix-SID advertised by
          the owner of the prefix-SID is not a Penultimate Hop Popping (PHP)
          label (e.g., the NP flag in OSPF or the P flag in IS-IS
          associated with the prefix-SID is set). Apart from the PHP function,
          the roles of the routers are unchanged from <xref target="phpfwd" format="default"/>.</t>
          <figure anchor="nophpfwdeg">
            <name>Packet-Forwarding Example without PHP</name>
            <artwork align="center" name="" type="" alt=""><![CDATA[
 +-----+       +-----+       +-----+        +-----+        +-----+
 |  A  +-------+  B  +-------+  C  +--------+  D  +--------+  H  |
 +-----+       +--+--+       +--+--+        +--+--+        +-----+
                  |             |              |
                  |             |              |
               +--+--+       +--+--+        +--+--+
               |  E  +-------+  F  +--------+  G  |
               +-----+       +-----+        +-----+

      +--------+
      |IP(A->E)|
      +--------+                 +--------+
      |  UDP   |                 |IP(E->G)|
      +--------+                 +--------+        +--------+
      |  L(E)  |                 |  UDP   |        |IP(G->H)|
      +--------+                 +--------+        +--------+
      |  L(G)  |                 |  L(G)  |        |  UDP   |
      +--------+                 +--------+        +--------+
      |  L(H)  |                 |  L(H)  |        |  L(H)  |
      +--------+                 +--------+        +--------+
      | Packet |     --->        | Packet |  --->  | Packet |
      +--------+                 +--------+        +--------+
            ]]></artwork>
          </figure>
          <t>As can be seen from the figure, the SR-MPLS label for each
          segment is left in place until the end of the segment where it is
          popped and the next instruction is processed.</t>
        </section>
        <section anchor="addnlfwd" numbered="true" toc="default">
          <name>Additional Forwarding Procedures</name>
          <dl newline="false" spacing="normal">
            <dt>Non-MPLS Interfaces:</dt>
            <dd>Although the description in
              the previous two sections is based on the use of prefix-SIDs,
              tunneling SR-MPLS packets is useful when the top label of a
              received SR-MPLS packet indicates an adjacency-SID and the
              corresponding adjacent node to that adjacency-SID is not capable
              of MPLS forwarding but can still process SR-MPLS packets. In
              this scenario, the top label would be replaced by an IP tunnel
              toward that adjacent node and then forwarded over the
              corresponding link indicated by the adjacency-SID.</dd>
            <dt>When to Use IP-Based Tunnels:</dt>
            <dd>The description in
              the previous two sections is based on the assumption that
              an MPLS-over-UDP tunnel is used when the next hop towards the next
              segment is not MPLS enabled. However, even in the case where the
              next hop towards the next segment is MPLS capable, an
              MPLS-over-UDP tunnel towards the next segment could still be
              used instead due to local policies. For instance, in the example
              as described in <xref target="nophpfwdeg" format="default"/>, assume F is now a
	      transit node capable of SR-MPLS while all the other assumptions
              remain unchanged; since F is not identified by a SID in the stack
              and an MPLS-over-UDP tunnel is preferred to an MPLS LSP
              according to local policies, router E replaces the current
              top label with an MPLS-over-UDP tunnel toward router G and sends
              it out. (Note that if an MPLS LSP was preferred, the packet
              would be forwarded as native SR-MPLS.)</dd>
            <dt>IP Header Fields:</dt>
            <dd>When encapsulating an MPLS
              packet in UDP, the resulting packet is further encapsulated in
              IP for transmission. IPv4 or IPv6 may be used according to the
              capabilities of the network. The address fields are set as
              described in <xref target="usecases" format="default"/>. The other IP header
              fields (such as the ECN field <xref target="RFC6040" format="default"/>, the
              Differentiated Services Code Point (DSCP) <xref target="RFC2983" format="default"/>, or IPv6 Flow Label) on each UDP-encapsulated
              segment SHOULD be configurable according to the operator's
              policy; they may be copied from the header of the incoming
              packet; they may be promoted from the header of the payload
              packet; they may be set according to instructions programmed to
              be associated with the SID; or they may be configured dependent
              on the outgoing interface and payload. The Time-To-Live (TTL) field setting in
              the encapsulating packet header is handled as described in
              [RFC7510], which refers to [RFC4023].</dd>
            <dt>Entropy and ECMP:</dt>
            <dd>When encapsulating an MPLS
              packet with an IP tunnel header that is capable of encoding
              entropy (such as <xref target="RFC7510" format="default"/>), the corresponding
              entropy field (the source port in the case of a UDP tunnel) MAY
              be filled with an entropy value that is generated by the
              encapsulator to uniquely identify a flow. However, what
              constitutes a flow is locally determined by the encapsulator. For
              instance, if the MPLS label stack contains at least one entropy
              label and the encapsulator is capable of reading that entropy
              label, the entropy label value could be directly copied to the
              source port of the UDP header. Otherwise, the encapsulator may
              have to perform a hash on the whole label stack or the five-tuple
              of the SR-MPLS payload if the payload is determined as an IP packet.
              To avoid reperforming the hash or hunting for the entropy label
              each time the packet is encapsulated in a UDP tunnel, it MAY be
              desirable that the entropy value contained in the incoming
              packet (i.e., the UDP source port value) is retained when
              stripping the UDP header and is reused as the entropy value of
              the outgoing packet.</dd>
            <dt>Congestion Considerations:</dt>
            <dd>Section 5 of
              <xref target="RFC7510" format="default"/> provides a detailed analysis of the
              implications of congestion in MPLS-over-UDP systems and builds
              on Section 3.1.3 of <xref target="RFC8085" format="default"/>, which describes
              the congestion implications of UDP tunnels. All of those
              considerations apply to SR-MPLS-over-UDP tunnels as described
              in this document. In particular, it should be noted that the
              traffic carried in SR-MPLS flows is likely to be IP traffic.</dd>
          </dl>
        </section>
      </section>
    </section>
    <section anchor="IANA" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>The security consideration of <xref target="RFC8354" format="default"/> (which redirects
      the reader to <xref target="RFC5095" format="default"/>) and <xref target="RFC7510" format="default"/>
      apply. DTLS <xref target="RFC6347" format="default"/> SHOULD be used where security is
      needed on an MPLS-SR-over-UDP segment including when the IP segment crosses
      the public Internet or some other untrusted environment. <xref target="RFC8402" format="default"/>
      provides security considerations for Segment Routing, and Section 8.1 of that
      document is particularly applicable to SR-MPLS.</t>
      <t>It is difficult for an attacker to pass a raw MPLS-encoded packet
      into a network, and operators have considerable experience in excluding
      such packets at the network boundaries, for example, by excluding all
      packets that are revealed to be carrying an MPLS packet as the payload
      of IP tunnels. Further discussion of MPLS security is found in
      <xref target="RFC5920" format="default"/>.</t>
      <t>It is easy for a network ingress node to detect any attempt to smuggle an IP
      packet into the network since it would see that the UDP destination port
      was set to MPLS, and such filtering SHOULD be applied. If, however, the
      mechanisms described in <xref target="RFCBBBB" format="default"/>
      or <xref target="RFCAAAA" format="default"/> are applied,
      a wider variety of UDP port numbers might be in use making port filtering
      harder.</t>
      <t>SR packets not having a destination address terminating in the network
      would be transparently carried and would pose no different security risk to
      the network under consideration than any other traffic.</t>
      <t>Where control-plane techniques are used (as described in <xref target="procs" format="default"/>), it is important that these protocols are adequately
      secured for the environment in which they are run as discussed in
      <xref target="RFC6862" format="default"/> and <xref target="RFC5920" format="default"/>.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3031.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3032.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4023.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5095.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6040.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6347.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7510.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7684.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7794.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7981.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml"/>
        <!-- <?rfc include="reference.I-D.ietf-spring-segment-routing-mpls"?>; companion document RFC YYYY-->
        <reference anchor="RFCYYYY">
          <front>
            <title>Segment Routing with MPLS data plane</title>
            <seriesInfo name="DOI" value="10.17487/RFCYYYY"/>
            <seriesInfo name="RFC" value="YYYY"/>
            <author initials="A" surname="Bashandy" fullname="Ahmed Bashandy">
              <organization/>
            </author>
            <author initials="C" surname="Filsfils" fullname="Clarence Filsfils">
              <organization/>
            </author>
            <author initials="S" surname="Previdi" fullname="Stefano Previdi">
              <organization/>
            </author>
            <author initials="B" surname="Decraene" fullname="Bruno Decraene">
              <organization/>
            </author>
            <author initials="S" surname="Litkowski" fullname="Stephane Litkowski">
              <organization/>
            </author>
            <author initials="R" surname="Shakir" fullname="Rob Shakir">
              <organization/>
            </author>
            <date month="August" year="2019"/>
          </front>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2983.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5920.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6790.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6862.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8085.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8354.xml"/>
        <!-- <?rfc include="reference.I-D.ietf-bess-datacenter-gateway"?>; I-D Exists -->
        <reference anchor="DATACENTER-GATEWAY">
          <front>
            <title>Gateway Auto-Discovery and Route Advertisement for Segment Routing Enabled Domain Interconnection</title>
            <seriesInfo name="Work in Progress," value="draft-ietf-bess-datacenter-gateway-02"/>
            <author initials="A" surname="Farrel" fullname="Adrian Farrel">
              <organization/>
            </author>
            <author initials="J" surname="Drake" fullname="John Drake">
              <organization/>
            </author>
            <author initials="E" surname="Rosen" fullname="Eric Rosen">
              <organization/>
            </author>
            <author initials="K" surname="Patel" fullname="Keyur Patel">
              <organization/>
            </author>
            <author initials="L" surname="Jalil" fullname="Luay Jalil">
              <organization/>
            </author>
            <date month="February" year="2019"/>
          </front>
        </reference>
        <!-- <?rfc include="reference.I-D.ietf-ospf-segment-routing-extensions"?>; RFC Ed Queue -->
        <reference anchor="RFCBBBB">
          <front>
            <title>OSPF Extensions for Segment Routing</title>
            <seriesInfo name="DOI" value="10.17487/RFCBBBB"/>
            <seriesInfo name="RFC" value="BBBB"/>
            <author initials="P" surname="Psenak" fullname="Peter Psenak" role="editor">
              <organization/>
            </author>
            <author initials="S" surname="Previdi" fullname="Stefano Previdi" role="editor">
              <organization/>
            </author>
            <author initials="C" surname="Filsfils" fullname="Clarence Filsfils">
              <organization/>
            </author>
            <author initials="H" surname="Gredler" fullname="Hannes Gredler">
              <organization/>
            </author>
            <author initials="R" surname="Shakir" fullname="Rob Shakir">
              <organization/>
            </author>
            <author initials="W" surname="Henderickx" fullname="Wim Henderickx">
              <organization/>
            </author>
            <author initials="J" surname="Tantsura" fullname="Jeff Tantsura">
              <organization/>
            </author>
            <date month="August" year="2019"/>
          </front>
        </reference>
        <!-- <?rfc include="reference.I-D.ietf-isis-segment-routing-extensions"?>; RFC Ed Queue -->
        <reference anchor="RFCAAAA">
          <front>
            <title>IS-IS Extensions for Segment Routing</title>
            <seriesInfo name="DOI" value="10.17487/RFCAAAA"/>
            <seriesInfo name="RFC" value="AAAA"/>
            <author initials="S" surname="Previdi" fullname="Stefano Previdi" role="editor">
              <organization/>
            </author>
            <author initials="L" surname="Ginsberg" fullname="Les Ginsberg" role="editor">
              <organization/>
            </author>
            <author initials="C" surname="Filsfils" fullname="Clarence Filsfils">
              <organization/>
            </author>
            <author initials="A" surname="Bashandy" fullname="Ahmed Bashandy">
              <organization/>
            </author>
            <author initials="H" surname="Gredler" fullname="Hannes Gredler">
              <organization/>
            </author>
            <author initials="B" surname="Decraene" fullname="Bruno Decraene">
              <organization/>
            </author>
            <date month="August" year="2019"/>
          </front>
        </reference>
        <!-- <?rfc include="reference.I-D.ietf-ospf-encapsulation-cap"?>; RFC Ed Queue -->
        <reference anchor="OSPF-ROUTER">
          <front>
            <title>The Tunnel Encapsulations OSPF Router Information</title>
            <seriesInfo name="Work in Progress," value="draft-ietf-ospf-encapsulation-cap-09"/>
            <author initials="X" surname="Xu" fullname="Xiaohu Xu" role="editor">
              <organization/>
            </author>
            <author initials="B" surname="Decraene" fullname="Bruno Decraene" role="editor">
              <organization/>
            </author>
            <author initials="R" surname="Raszuk" fullname="Robert Raszuk">
              <organization/>
            </author>
            <author initials="L" surname="Contreras" fullname="Luis Contreras">
              <organization/>
            </author>
            <author initials="L" surname="Jalil" fullname="Luay Jalil">
              <organization/>
            </author>
            <date month="October" year="2017"/>
          </front>
        </reference>
        <!-- <?rfc include="reference.I-D.ietf-isis-encapsulation-cap"?>; Expired -->
        <reference anchor="ISIS-ENCAP">
          <front>
            <title>Advertising Tunnelling Capability in IS-IS</title>
            <seriesInfo name="Work in Progress," value="draft-ietf-isis-encapsulation-cap-01"/>
            <author initials="X" surname="Xu" fullname="Xiaohu Xu" role="editor">
              <organization/>
            </author>
            <author initials="B" surname="Decraene" fullname="Bruno Decraene">
              <organization/>
            </author>
            <author initials="R" surname="Raszuk" fullname="Robert Raszuk">
              <organization/>
            </author>
            <author initials="U" surname="Chunduri" fullname="Uma Chunduri">
              <organization/>
            </author>
            <author initials="L" surname="Contreras" fullname="Luis Contreras">
              <organization/>
            </author>
            <author initials="L" surname="Jalil" fullname="Luay Jalil">
              <organization/>
            </author>
            <date month="April" year="2017"/>
          </front>
        </reference>
        <!-- <?rfc include="reference.I-D.ietf-mpls-spring-entropy-label"?>; RFC Ed Queue -->
        <reference anchor="RFCZZZZ">
          <front>
            <title>Entropy label for SPRING tunnels</title>
            <seriesInfo name="DOI" value="10.17487/RFCZZZZ"/>
            <seriesInfo name="RFC" value="ZZZZ"/>
            <author initials="S" surname="Kini" fullname="Sriganesh Kini">
              <organization/>
            </author>
            <author initials="K" surname="Kompella" fullname="Kireeti Kompella">
              <organization/>
            </author>
            <author initials="S" surname="Sivabalan" fullname="Siva Sivabalan">
              <organization/>
            </author>
            <author initials="S" surname="Litkowski" fullname="Stephane Litkowski">
              <organization/>
            </author>
            <author initials="R" surname="Shakir" fullname="Rob Shakir">
              <organization/>
            </author>
            <author initials="J" surname="Tantsura" fullname="Jeff Tantsura">
              <organization/>
            </author>
            <date month="August" year="2019"/>
          </front>
        </reference>
        <!-- <?rfc include="reference.I-D.ietf-6man-segment-routing-header"?>; AD Evaluation::Revised I-D Needed for 2 days -->
        <reference anchor="IPV6-SEGMENT">
          <front>
            <title>IPv6 Segment Routing Header (SRH)</title>
            <seriesInfo name="Work in Progress," value="draft-ietf-6man-segment-routing-header-21"/>
            <author initials="C" surname="Filsfils" fullname="Clarence Filsfils" role="editor">
              <organization/>
            </author>
            <author initials="D" surname="Dukes" fullname="Darren Dukes" role="editor">
              <organization/>
            </author>
            <author initials="S" surname="Previdi" fullname="Stefano Previdi">
              <organization/>
            </author>
            <author initials="J" surname="Leddy" fullname="John Leddy">
              <organization/>
            </author>
            <author initials="S" surname="Matsushima" fullname="Satoru Matsushima">
              <organization/>
            </author>
            <author initials="d" surname="daniel.voyer@bell.ca" fullname="daniel.voyer@bell.ca">
              <organization/>
            </author>
            <date month="June" year="2019"/>
          </front>
        </reference>
      </references>
    </references>
    <section anchor="Acknowledgements" numbered="false" toc="default">
      <name>Acknowledgements</name>
      <t>Thanks to Joel Halpern, Bruno Decraene, Loa Andersson,
      Ron Bonica, Eric Rosen, Jim Guichard, Gunter Van De Velde,
      Andy Malis, Robert Sparks, and Al Morton for their insightful
      comments on this document.</t>
      <t>Additional thanks to Mirja Kuehlewind, Alvaro Retana, Spencer Dawkins,
      Benjamin Kaduk, Martin Vigoureux, Suresh Krishnan, and Eric Vyncke
      for careful reviews and resulting comments.</t>
    </section>
    <section numbered="false" toc="default">
      <name>Contributors</name>
      <artwork name="" type="" align="left" alt=""><![CDATA[Ahmed Bashandy
Email: abashandy.ietf@gmail.com

Clarence Filsfils
Cisco
Email: cfilsfil@cisco.com

John Drake
Juniper
Email: jdrake@juniper.net

Shaowen Ma
Mellanox Technologies
Email: mashaowen@gmail.com

Mach(Guoyi) Chen
Huawei
Email: mach.chen@huawei.com

Hamid Assarpour
Broadcom
Email:hamid.assarpour@broadcom.com

Robert Raszuk
Bloomberg LP
Email: robert@raszuk.net

Uma Chunduri
Huawei
Email: uma.chunduri@gmail.com

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

Luay Jalil
Verizon
Email: luay.jalil@verizon.com

Gunter Van De Velde
Nokia
Email: gunter.van_de_velde@nokia.com

Tal Mizrahi
Marvell
Email: talmi@marvell.com

Jeff Tantsura
Apstra, Inc.
Email: jefftant.ietf@gmail.com

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