<?xml version="1.0" encoding="utf-8"?>

<!-- updated by Sarah 01/03/24 -->

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.3 (Ruby 3.0.2) -->

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" 
ipr="trust200902" 
number="9545"
docName="draft-ietf-spring-mpls-path-segment-22" 
obsoletes="" 
updates=""
category="std" 
consensus="true" 
submissionType="IETF" 
tocDepth="3" 
xml:lang="en" 
tocInclude="true" 
sortRefs="true" 
symRefs="true" 
version="3">

  <front>
    <title abbrev="PSID in SR-MPLS">Path Segment Identifier in MPLS-Based Segment Routing Networks</title>
    <seriesInfo name="RFC" value="9545"/>
    <author initials="W." surname="Cheng" fullname="Weiqiang Cheng" role="editor">
      <organization>China Mobile</organization>
      <address>
        <email>chengweiqiang@chinamobile.com</email>
      </address>
    </author>
    <author initials="H." surname="Li" fullname="Han Li">
      <organization>China Mobile</organization>
      <address>
        <email>lihan@chinamobile.com</email>
      </address>
    </author>
    <author initials="C." surname="Li" fullname="Cheng Li" role="editor">
      <organization>Huawei Technologies</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>c.l@huawei.com</email>
      </address>
    </author>
    <author initials="R." surname="Gandhi" fullname="Rakesh Gandhi">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <country>Canada</country>
        </postal>
        <email>rgandhi@cisco.com</email>
      </address>
    </author>
    <author initials="R." surname="Zigler" fullname="Royi Zigler">
      <organization>Broadcom</organization>
      <address>
        <email>royi.zigler@broadcom.com</email>
      </address>
    </author>

    <date year="2024" month="February"/>

    <area>rtg</area>
    <workgroup>spring</workgroup>

<keyword>Performance Measurement</keyword>
<keyword>Bidirectional SR Path</keyword>
<keyword>End-to-End Path Protection</keyword>
<keyword>SR Path Segment</keyword>
<keyword>Path Segment</keyword>

    <abstract>
      <t>A Segment Routing (SR) path is identified by an SR segment list. A
      subset of segments from the segment list cannot be leveraged to
      distinguish one SR path from another as they may be partially
      congruent. SR path identification is a prerequisite for various
      use cases such as performance measurement and end-to-end 1+1 path
      protection.</t>
      <t>In an SR over MPLS (SR-MPLS) data plane, an egress node cannot determine
      on which SR path a packet traversed the network from the label stack
      because the segment identifiers are removed from the label stack as the
      packet transits the network.</t>
      <t>This document defines a Path Segment Identifier (PSID) to identify an SR
      path on the egress node of the path.</t>
    </abstract>
  </front>
  <middle>


<section anchor="introduction">
      <name>Introduction</name>
      <t>Segment Routing (SR) <xref target="RFC8402"/> leverages the source-routing paradigm to steer packets from a source node through a controlled set of instructions, called "segments", by prepending the packet with an SR header. In SR with the MPLS data plane <xref target="RFC8660"/>, the SR header is instantiated through a label stack.</t>
      <t>In an SR-MPLS network, when a packet is transmitted along an SR path, the labels in the MPLS label stack will be swapped or popped. The result of this is that no label or only the last label may be left in the MPLS label stack when the packet reaches the egress node. Thus, the egress node cannot use the SR label stack to determine along which SR path the packet came.</t>
      <t>However, identifying a path on the egress node is a prerequisite for various use cases in SR-MPLS networks, such as performance measurement (<xref target="psid-for-pm"/>), bidirectional paths (<xref target="psid-for-bpath"/>), and end-to-end 1+1 path protection (a Live-Live case) (<xref target="psid-for-protection"/>).</t>
      <t>Therefore, this document defines a new segment type, referred to herein as a "Path Segment". A Path Segment is defined to uniquely identify an SR path on the egress node of the path. It <bcp14>MAY</bcp14> be used by the egress node for path identification. Note that per-path state will be maintained in the egress node due to the requirements in the aforementioned use cases, though in normal cases, the per-path state will be maintained in the ingress node only.</t>
      <section anchor="requirements-language">
        <name>Requirements Language</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>


</section>
      <section anchor="abbreviations-and-terms">
        <name>Abbreviations and Terms</name>
<dl>
          <dt>MPLS:</dt><dd>Multiprotocol Label Switching</dd>
          <dt>PSID:</dt><dd>Path Segment Identifier</dd>
          <dt>SID:</dt><dd>Segment Identifier</dd>
          <dt>SR:</dt><dd>Segment Routing</dd>
          <dt>SR-MPLS:</dt><dd>SR over MPLS</dd>
          <dt>SR path:</dt><dd>A path described by a segment list.</dd>
          <dt>Sub-Path:</dt><dd>A part of a path, which contains a subset of
          the nodes and links of the path.</dd>
	</dl>
      </section>
    </section>
    <section anchor="path-segment">
      <name>Path Segment</name>
      <t>A Path Segment is a local segment <xref target="RFC8402"/> that uniquely identifies an SR path on the egress node. A Path Segment Identifier (PSID) is a single label that is assigned from the Segment Routing Local Block (SRLB) <xref target="RFC8402"/> of the egress node of an SR path.</t>
      <t>A PSID is used to identify a segment list. However, one PSID can be used to identify multiple segment lists in some use cases if needed. For example, one single PSID <bcp14>MAY</bcp14> be used to identify some or all segment lists in a candidate path or an SR policy if an operator would like to aggregate these segment lists in operation.</t>
      <t>When a PSID is used, the PSID can be inserted at the ingress node and <bcp14>MUST</bcp14> immediately follow the last label of the SR path; in other words, it must be inserted after the routing segment (adjacency, node, or prefix segment) that is pointing to the egress node of the SR path. Therefore, a PSID will not be the top label in the label stack when received on an intermediate node of the associated path, but it can be the top label in the label stack on the penultimate node.</t>
      <t>The value of the TTL field in the MPLS label stack entry containing a PSID can be set to any value except 0. If a PSID is the bottom label, the S bit <bcp14>MUST</bcp14> be set, and if the PSID is NOT the bottom label, the S bit <bcp14>MUST</bcp14> be 0.</t>
      <t>The egress node <bcp14>MUST</bcp14> pop the PSID. The egress node <bcp14>MAY</bcp14> use the PSID for further processing. For example, when performance measurement is enabled on the SR path, it can trigger packet counting or timestamping.</t>
      <t>The addition of the PSID will require the egress to read and process the PSID label in addition to the regular processing. This additional processing may have an impact on forwarding performance. Behavior relating to the use of explicit null directly preceding the PSID is undefined in this document.</t>
      <t>A Generic Associated Channel Label (GAL) <bcp14>MAY</bcp14> be used for Operations, Administration, and Maintenance (OAM) in MPLS networks. As per <xref target="RFC5586"/>, when a GAL is used, the Associated Channel Header (ACH) appears immediately after the bottom of the label stack.</t>
      <t>The SR path computation needs to know the Maximum SID Depth (MSD) that can be imposed at the ingress node of a given SR path <xref target="RFC8664"/>. This ensures that the SID stack depth of a computed path does not exceed the number of SIDs the node is capable of imposing. As per <xref target="RFC8491"/>, the MSD signals the total number of MPLS labels that can be imposed, where the total number of MPLS labels includes the PSID.</t>
      <t>An example label stack with a PSID is shown in <xref target="figure1"/>:</t>
      <figure anchor="figure1">
        <name>Label Stack with a PSID</name>
        <artwork><![CDATA[
            +--------------------+
            |       ...          |
            +--------------------+
            |      Label 1       |
            +--------------------+
            |      Label 2       |
            +--------------------+
            |       ...          |
            +--------------------+
            |      Label n       |
            +--------------------+
            |        PSID        |
            +--------------------+
            ~       Payload      ~
            +--------------------+
]]></artwork>
      </figure>
      <t>Where:</t>
      <ul spacing="normal">
        <li>
          <t>The Labels 1 to n are the segment label stack used to direct how
to steer the packets along the SR path.</t>
        </li>
        <li>
          <t>The PSID identifies the SR path in the context of the egress node of the SR path.</t>
        </li>
      </ul>
      <t>The signaling of the PSID between the egress node, the ingress node, and possibly a centralized controller is out of the scope of this document.</t>
      <section anchor="equal-cost-multipathecmp-considerations">
        <name>Equal-Cost Multipath (ECMP) Considerations</name>
        <t>If an Entropy Label (EL) is also used on the egress node, as per <xref target="RFC6790"/>, the EL and Entropy Label Indicator (ELI) would be placed before the tunnel label; hence, they do not interfere with the PSID, which is placed below.</t>
        <t>It is worthy to note that in the case of ECMP, with or without the use of an EL, the SR packets may be forwarded over multiple paths. In this case, the SID list cannot directly reflect the actual forwarding path and the PSID can only identify the SID list rather than the actual forwarding path.</t>
        <t>Also, similar to a Synonymous Flow Label (SFL) <xref target="RFC8957"/>, the introduction of a PSID to an existing flow may cause that flow to take a different path through the network under the conditions of ECMP. In turn, this may invalidate certain uses of the PSID, such as performance measurement applications. Therefore, the considerations of SFLs as per <xref section="5" sectionFormat="of" target="RFC8957"/> also apply to PSIDs in implementation.</t>
      </section>
    </section>
    <section anchor="use-cases">
      <name>Use Cases</name>
      <t>This section describes use cases that can leverage the PSID. The content is for informative purposes, and the detailed solutions might be defined in other documents in the future.</t>
      <section anchor="psid-for-pm">
        <name>PSID for Performance Measurement</name>
        <t>As defined in <xref target="RFC7799"/>, performance measurement can
be classified into Passive, Active, and Hybrid measurements. Since a PSID is encoded in the SR-MPLS label stack, as shown in <xref target="figure1"/>,
existing implementations on the egress node can leverage a PSID for
measuring packet counts.</t>
        <t>For Passive performance measurement, path identification at the
measuring points is the prerequisite. A PSID can be used by the
measuring points (e.g., the ingress and egress nodes of the SR path or a
centralized controller) to correlate the packet counts and timestamps
from the ingress and egress nodes for a specific SR path; then, packet
loss and delay can be calculated for the end-to-end path, respectively.</t>
        <t>Furthermore, a PSID can also be used for:</t>
        <ul spacing="normal">
          <li>
            <t>Active performance measurement for
an SR path in SR-MPLS networks for collecting packet counters and
timestamps from the egress node using probe messages.</t>
          </li>
          <li>
            <t>In situ OAM <xref target="RFC9197"/> for SR-MPLS to identify
the SR path associated with the in situ data fields in the data packets
on the egress node.</t>
          </li>
          <li>
            <t>In-band performance measurement for SR-MPLS to identify
the SR path associated with the collected performance metrics.</t>
          </li>
        </ul>
      </section>
      <section anchor="psid-for-bpath">
        <name>PSID for Bidirectional SR Paths</name>
        <t>In some scenarios (e.g., mobile backhaul transport networks),
there are requirements to support bidirectional paths <xref target="RFC6965"/>, and the path is
normally treated as a single entity. Forward and reverse directions of the path
have the same fate; for example, failure in one direction will result in
switching traffic at both directions. MPLS supports this by introducing
the concepts of a co-routed bidirectional Label Switched Path (LSP) and an associated bidirectional
LSP <xref target="RFC5654"/>.</t>
        <t>In the current SR architecture, an SR path is a unidirectional path
<xref target="RFC8402"/>.
In order to support bidirectional SR paths, a straightforward way is
to bind two unidirectional SR paths to a single bidirectional SR
path. PSIDs can be used to identify and correlate the
traffic for the two unidirectional SR paths at both ends of the
bidirectional path.</t>
        <t>The mechanism of constructing bidirectional paths using a PSID is out of the scope of this document and has been described in several documents, such as <xref target="I-D.ietf-pce-sr-bidir-path"/> and <xref target="I-D.ietf-idr-sr-policy-path-segment"/>.</t>
      </section>
      <section anchor="psid-for-protection">
        <name>PSID for End-to-End Path Protection</name>
        <t>For end-to-end 1+1 path protection (i.e., a Live-Live case), the egress
node of the path needs to know the set of paths that constitute the
primary and the secondaries in order to select the primary path packets
for onward transmission and to discard the packets from the secondaries <xref target="RFC4426"/>.</t>
        <t>To do this in SR, each SR path needs a path identifier
that is unique at the egress node. For SR-MPLS, this can be the Path
Segment label allocated by the egress node.</t>
        <t>The detailed solution of using a PSID in end-to-end 1+1 path protection is out of the scope of this document.</t>
      </section>
      <section anchor="psid-nesting">
        <name>Nesting of PSIDs</name>
        <t>A Binding SID (BSID) <xref target="RFC8402"/> can be used for SID list
compression. With a BSID, an end-to-end SR path in a trusted domain can be split into several
sub-paths, where each sub-path is identified by a BSID. Then, an end-to-end SR
path can be identified by a list of BSIDs; therefore, it can provide
better scalability.</t>
        <t>A BSID and a PSID can be combined to achieve both sub-path and
end-to-end path monitoring. A reference model for such a combination (<xref target="figure2"/>) shows
an end-to-end path (A-&gt;D) in a trusted domain that spans three subdomains
(the Access, Aggregation, and Core domains) and consists of three sub-paths,
one in each subdomain (sub-path (A-&gt;B), sub-path (B-&gt;C), and
sub-path (C-&gt;D)).</t>
        <t>The SID list of a sub-path can be expressed as &lt;SID1, SID2, ..., SIDn, s-PSID&gt;, where the s-PSID is the PSID of the sub-path. Each sub-path is associated with a BSID and an s-PSID.</t>
        <t>The SID list of the end-to-end path can be expressed as &lt;BSID1, BSID2, ..., BSIDn, e-PSID&gt;, where the e-PSID is the PSID of the end-to-end path.</t>
        <t><xref target="figure2"/> shows the details of the label stacks when a PSID and a BSID are
used to support both sub-path and end-to-end path monitoring in a
	multi-domain scenario.</t>
        <figure anchor="figure2">
          <name>Nesting of PSIDs</name>
          <artwork><![CDATA[
         /--------\       /--------\       /--------\
       /            \   /            \   /            \
     A{    Access    }B{  Aggregation }C{     Core     }D
       \            /   \            /   \            /
         \--------/       \--------/       \--------/
       sub-path(A->B)    sub-path(B->C)   sub-path(C->D)
    |<--------------->|<-------------->|<-------------->|
                          E2E Path(A->D)
    |<------------------------------------------------->|

 +-------------+
 ~A->B sub-path~
 +-------------+  +-------------+
 |s-PSID(A->B) |  ~B->C sub-path~
 +-------------+  +-------------+  +-------------+
 | BSID(B->C)  |  |s-PSID(B->C) |  ~C->D sub-path~
 +-------------+  +-------------+  +-------------+
 | BSID(C->D)  |  | BSID(C->D)  |  |s-PSID(C->D) | 
 +-------------+  +-------------+  +-------------+  +------------+
 |e-PSID(A->D) |  |e-PSID(A->D) |  |e-PSID(A->D) |  |e-PSID(A->D)|
 +-------------+  +-------------+  +-------------+  +------------+
]]></artwork>
        </figure>
      </section>
    </section>
    <section anchor="Security">
      <name>Security Considerations</name>
      <t>A PSID in SR-MPLS is a local label similar to other labels and segments, such as a VPN label, defined in MPLS and SR-MPLS. The data plane processing of a PSID is a local implementation of an ingress node or an egress node, which follows the same logic of an existing MPLS data plane. As per the definition of a PSID, only the egress node and the ingress node of the associated path will learn the information of a PSID. The intermediate nodes of this path will not learn it.</t>
      <t>A PSID may be used on an ingress node that is not the ingress of the associated path if the associated label stack with the PSID is part of a deeper label stack that represents a longer path. For example, the case described in <xref target="psid-nesting"/> and the related BSID are not used while the original label stack of a sub-path is inserted as a part of the whole label stack. In this case, the PSID must be distributed in a trusted domain under the considerations defined in <xref section="8.1" sectionFormat="of" target="RFC8402"/>.</t>
      <t>A PSID is used within an SR-MPLS trusted domain <xref target="RFC8402"/> and must not leak outside the domain; therefore, no new security threats are introduced compared to current SR-MPLS. As per <xref target="RFC8402"/>, SR domain boundary routers <bcp14>MUST</bcp14> filter any external traffic destined
   to a label associated with a segment within the trusted domain; this applies to a PSID as well. Other security considerations of SR-MPLS described in <xref section="8.1" sectionFormat="of" target="RFC8402"/> apply to this document.</t>
      <t>The distribution of a PSID from an egress node to an ingress node is performed within an SR-trusted domain, and it is out of the scope of this document. The details of the mechanism and related security considerations will be described in other documents.</t>
    </section>

    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>

  <back>
    <displayreference target="I-D.ietf-pce-sr-bidir-path" to="BIDIR-PATH"/>
    <displayreference target="I-D.ietf-idr-sr-policy-path-segment" to="SR-EXTENSIONS"/>

    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>

	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8660.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      </references>

      <references anchor="sec-informative-references">
        <name>Informative References</name>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4426.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5586.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5654.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6790.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6965.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8664.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7799.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8957.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8491.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9197.xml"/>      
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pce-sr-bidir-path.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-sr-policy-path-segment.xml"/>

      </references>
    </references>

<section numbered="false" anchor="Acknowledgements">
      <name>Acknowledgements</name>
      <t>The authors would like to thank <contact fullname="Adrian Farrel"/>, <contact
      fullname="Stewart Bryant"/>, <contact fullname="Shuangping
      Zhan"/>, <contact fullname="Alexander
      Vainshtein"/>, <contact fullname="Andrew
      G. Malis"/>, <contact fullname="Ketan
      Talaulikar"/>, <contact fullname="Shraddha
      Hegde"/>, <contact fullname="Xinyue Zhang"/>, <contact
      fullname="Loa Andersson"/>, and <contact fullname="Bruno Decraene"/> for their
      review, suggestions, comments, and contributions to this document.</t>
      <t>The authors would like to acknowledge the contribution from <contact fullname="Alexander
Vainshtein"/> on "Nesting of PSIDs" (<xref target="psid-nesting"/>).</t>
    </section>

    <section anchor="contributors" numbered="false" toc="include" removeInRFC="false">
      <name>Contributors</name>
<t>The following people have substantially contributed to this document.</t>
      <contact initials="M." surname="Chen" fullname="Mach(Guoyi) Chen">
        <organization>Huawei Technologies Co., Ltd.</organization>
        <address>
          <email>mach.chen@huawei.com</email>
        </address>
      </contact>
      <contact initials="L." surname="Wang" fullname="Lei Wang">
        <organization>China Mobile</organization>
        <address>
          <email>wangleiyj@chinamobile.com</email>
        </address>
      </contact>
      <contact initials="A." surname="Liu" fullname="Aihua Liu">
        <organization>ZTE Corp.</organization>
        <address>
          <email>liu.aihua@zte.com.cn</email>
        </address>
      </contact>
      <contact initials="G." surname="Mirsky" fullname="Greg Mirsky">
        <organization>ZTE Corp.</organization>
        <address>
          <email>gregimirsky@gmail.com</email>
        </address>
      </contact>
      <contact initials="G. S." surname="Mishra" fullname="Gyan S. Mishra">
        <organization>Verizon Inc.</organization>
        <address>
          <email>gyan.s.mishra@verizon.com</email>
        </address>
      </contact>
    </section>
  </back>
</rfc>
