<?xml version="1.0" encoding="US-ASCII"?>

<?xml-model href="rfc7991bis.rnc"?>

<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> --> 
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->

<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->

<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->

<rfc category="std"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    docName="draft-ali-pce-sr-policy-msd-consideration-02"
    consensus="true"
    submissionType="IETF"
    ipr="trust200902"
    tocInclude="true"
    tocDepth="4"
    symRefs="true"
    sortRefs="true">

 <!-- ***** FRONT MATTER ***** -->

 <front>
   <!-- The abbreviated title is used in the page header - it is only necessary if the 
        full title is longer than 39 characters -->
    <title abbrev="SR MSDs">
	    MSD Consideration in Path Computation Element Communication Protocol (PCEP) </title>
    <seriesInfo name="Internet-Draft" value="draft-ali-pce-sr-policy-msd-consideration-02"/>

   <author fullname="Zafar Ali" initials="Z." surname="Ali">
     <organization>Cisco Systems, Inc.</organization>
     <address>
       <email>zali@cisco.com</email>
     </address>
   </author>

   <author fullname="Yao Liu" initials="Y." surname="Liu">
     <organization>ZTE Corporation</organization>
     <address>
       <email>liu.yao71@zte.com.cn</email>
     </address>
   </author>

   <author fullname="Andrew Stone" initials="A." surname="Stone">
     <organization>Nokia</organization>
     <address>
       <email>andrew.stone@nokia.com</email>
     </address>
   </author>
  
    <author fullname="Diego Achaval" initials="D." surname="Achaval">
     <organization>Nokia</organization>
     <address>
       <email>diego.achaval@nokia.com</email>
     </address>
   </author>
   
    <author fullname="Samuel Sidor" initials="S." surname="Sidor">
     <organization>Cisco Systems, Inc.</organization>
     <address>
       <email>ssidor@cisco.com</email>
     </address>
   </author>
               
   <date/>

   <!-- Meta-data Declarations -->
   <area>Routing</area>
   <workgroup>PCE Working Group</workgroup>

   <!-- WG name at the upperleft corner of the doc,
        IETF is fine for individual submissions. 
	 If this element is not present, the default is "Network Working Group",
        which is used by the RFC Editor as a nod to the history of the IETF. -->


   <abstract>
<t> Segment Routing (SR) allows a node to steer a packet flow along any
   path.  SR Policy is an ordered list of segments (i.e.,
   instructions) that represent a source-routed policy. 
   The packets steered into an SR Policy carry
   an ordered list of segments associated with that SR Policy.
   An SR Policy can be instantiated SR-MPLS and SRv6 data planes. 
</t>

<t> Maximum SID Depth (MSD) is first introduced for SR-MPLS to indicate 
    the number of SIDs supported by a node or a link on a node. 
    This concept is further extended for SRv6 with more types of MSD. 
    MSD may become one of the limitations that need to be considered 
    when computing an SR-TE path for PCE.
</t>

<t> This draft specifies some MSD considerations PCE needs to take into 
    account when computing an SR-TE path.
</t>
   
   </abstract>

 </front>

 <middle>

  <section anchor="intro" title="Introduction">
  <t> 
  Segment Routing (SR) <xref target="RFC8402"/> allows a node to steer a packet flow along any path.  
  A Segment Routing Policy (SR Policy) <xref target="RFC8402"/> is an ordered list of 
  segments that represent a source-routed policy. 
  The headend node is said to steer a flow into an SR Policy.  
  The packets steered into an SR Policy have an ordered list of segments associated 
  with that SR Policy written into them. 
  Segment Routing Policy Architecture <xref target="RFC9256"/> updates <xref target="RFC8402"/> as 
  it details the concepts of SR Policy and steering into an SR Policy. 
  An SR Policy can be instantiated SR-MPLS and SRv6 data planes.
  </t>

  <t>
  The concept of Maximum SID Depth (MSD) <xref target="RFC8491"/> is first introduced 
  for SR-MPLS to express the number of SIDs supported by a node or a 
  link on a node, and the Base MPLS Imposition MSD is defined to 
  indicate the number of MPLS labels that can be imposed by a router. 
  And the concept is further extended for SRv6 with more types of MSD 
  defined in <xref target="RFC9352"/>.
  </t>

  <t>
  MSD may become one of the limitations that need to be considered when 
  computing an SR-TE path for PCE.
  </t>

  <t>
  For SR-MPLS, <xref target="RFC8664"/> defines the SR-PCE-CAPABILITY sub-TLV. 
  PCEP speakers use this sub-TLV to exchange information about their SR 
  capability, including MSD, which indicates that a PCC is capable of 
  imposing on a packet. <xref target="RFC8664"/> also specifies MSD considerations 
  PCE needs to take into account when computing the number of SIDs in 
  an SR-TE path. Specifically, it mandates that once an SR-capable 
  PCEP session is established with a non-zero MSD value, the 
  corresponding PCE MUST NOT send SR-TE paths with a number of SIDs 
  exceeding that MSD value.
  </t>

  <t>
  Similarly, for SRv6, <xref target="RFC9603"/> specifies that a PCE MUST NOT send 
  SRv6 paths that exceed the SRv6 MSD capabilities of the PCC.
  </t>

  <t>
  However, the limitation of MSD could be loosened to allow one more SID 
  in the SID list that is sent by the PCE in the following scenarios:
  </t>

  <ul>
    <li>
    When the first SID in an SR Policy SID list is an adjacency SID 
    attached by the headend, for SR-MPLS, the top adjacency SID is not 
    imposed on the packet, for SRv6, the implementation can also 
    choose not to include the top adjacency SID in the SRH.
    </li>
    <li>
    For SRv6, when a reduced SRH <xref target="RFC8754"/> is used, the first segment 
    of the related SR Policy is not imposed in the reduced SRH.
    </li>
  </ul>

  <t>
  Moreover, not all of the SRv6 MSDs defined in <xref target="RFC9352"/> are about the 
  limitation/capability of the head-end node (i.e, PCC), thus some of 
  these SRv6 MSDs are not always necessary restrictions to be followed 
  when sending an SRv6 path to the PCC.
  </t>

  <t>
  This document specifies a procedure for optimizing the number of SIDs 
  in an SR-TE path that PCE can compute when the first SID in the SR 
  Policy SID list is not imposed on the packet in the above scenarios.
  </t>

  <t>
  This document also analyzes the impact of different SRv6 MSDs when 
  PCE sends SR-TE paths to the PCC.
  </t>

  </section> 

  <section anchor="terminology" title="Terminology">
     <t>
         The following terminology is used in this document:
     </t>
     <t>MSD: Maximum SID Depth</t>
     <t>PCC: Path Computation Client</t>
     <t>PCE: Path Computation Element</t>
     <t>PCEP: Path Computation Element Communication Protocol</t>
     <t>SID: Segment Identifier</t>
     <t>SR: Segment Routing</t>
     <t>SR-TE: Segment Routing Traffic Engineering</t>

     <section 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 title="PCEP Extensions for SR-MPLS">

  <section title="New flag in SR-PCE-CAPABILITY sub-TLV">
	 <t>
	 This section proposes a new A-flag (Adjacency SID exclusion for MSD 
	 consideration flag) in the SR-PCE-CAPABILITY sub-TLV defined in 
	 <xref target="RFC8664"/>. The bit position for the flag in the SR PCE Capability 
	 Flag Field registry is to be defined by IANA.
	 </t>
	 
	 <t> 
	 A (Adjacency SID exclusion for MSD consideration flag) - 1 bit (Bit Position TBD1): 
    <ul>
       <li> 
       If set to 1, it indicates support for the A-flag by the PCEP peer.  
        </li>
       </ul>
	</t>
  
	 </section> 

	 <section title="Operation">
	 <t>
	 <xref target="RFC8664"/> mandates that once an SR-capable PCEP session is 
	 established with a non-zero MSD value, the corresponding PCE MUST NOT 
	 send SR-TE paths with a number of SIDs exceeding that MSD value.
	 </t>

	 <t>
	 The following procedure MUST only be applied if both the PCE and PCC 
	 have advertised support for the capability by setting the A-flag in 
	 their respective SR-PCE-CAPABILITY sub-TLVs <xref target="RFC8664"/>. Under these 
	 conditions, if the first SID in an SR-MPLS TE path is an adjacency 
	 SID, the PCE MUST NOT send SR-TE paths with a number of SIDs 
	 exceeding that (MSD+1) value.
	 </t>
	 </section>

	 </section> 

	 <section title="Considerations for SRv6 MSDs">
	 <t>
	 <xref target="RFC9603"/> defines the SRv6-PCE-CAPABILITY sub-TLV under the PATH-
	 SETUP-TYPE-CAPABILITY TLV in the OPEN object. PCEP speakers use this 
	 sub-TLV to exchange information about their SRv6 capability. And the 
	 SRv6 MSD information advertised via SRv6-PCE-Capability sub-TLV 
	 conveys the SRv6 capabilities of the PCEP speaker.
	 </t>

	 <t>
	 As in <xref target="RFC9603"/> section 4.1.1, optional (MSD-Type,MSD-Value) pairs 
	 are carried in the SRv6-PCE-CAPABILITY sub-TLV, the SRv6 MSD types 
	 are as per <xref target="RFC9352"/>, i.e, Maximum Segments Left MSD, Maximum End Pop 
	 MSD, Maximum H.Encaps MSD, Maximum End D MSD:
	 </t>

	 <ul>
	    <li>
	    For Maximum H.Encaps MSD, which indicates the maximum number of 
	    SIDs that can be added to the segment list of an SRH as part of 
	    the "H.Encaps" behavior, if Maximum H.Encaps MSD is n, actually 
	    the PCE can send n+1 SIDs when the first SID is not in the SRH 
	    (i.e., when the reduced SRH is used or when the PCC does not 
	    impose the first adjacency SID).
	    </li>
	    <li>
	    For Maximum Segments Left MSD, when reduced SRH is used, it is not 
	    affected since Maximum Segments Left MSD indicates the maximum 
	    value of the "Segments Left" field <xref target="RFC8754"/> in the SRH, and it is 
	    not related with whether the first SID is in the SRH.
	    </li>
	    <li>
	    For Maximum End Pop MSD Type, it signals the maximum number of 
	    SIDs in the SRH to which the router can apply "Penultimate Segment 
	    Pop (PSP)" as the penultimate SR Segment Endpoint Node or 
	    "Ultimate Segment Pop (USP) " as the ultimate SR Segment Endpoint 
	    Node, as defined in "Flavors" (Section 4.16 of <xref target="RFC8986"/>). So 
	    usually this limitation does not apply for the head-end 
	    node(acting as a PCC), unless the head-end nodes is also the 
	    penultimate or the ultimate node in the same SID-list.
	    </li>
	    <li>
	    For Maximum End D MSD, it specifies the maximum number of SIDs 
	    present in an SRH when performing decapsulation(e.g, End.DX6, 
	    End.DT4, End.DT46, End with USD, and End.X with USD <xref target="RFC8986"/>). 
	    Similar with Maximum End Pop MSD, the head-end node of an SRv6 
	    path normally would not perform decapsulation.
	    </li>
	 </ul>

	 <t>
	 To conclude, when appears in the SRv6-PCE-CAPABILITY sub-TLV, the 
	 Maximum End Pop MSD and Maximum End D MSD only indicates the 
	 limitation when the PCC node acts as the penultimate or ultimate SR 
	 Segment Endpoint Node. So the Maximum End Pop MSD or Maximum End D 
	 MSD is not considered by PCE when sending the SRv6 path to PCC/ head-
	 end node. The limitation of Maximum H.Encaps MSD could be loosened 
	 when the first SID is not in the SRH.
	 </t>
	 </section>

	 <section title="PCEP Extensions for SRv6">

	 <section title="A-Flag in SRv6-PCE-CAPABILITY sub-TLV">
	 <t>
	 This section proposes a new A-flag (Adjacency SID exclusion for MSD 
	 consideration flag) in the SRv6-PCE-CAPABILITY sub-TLV defined in 
	 <xref target="RFC9603"/>. The bit position for the flag in the SRv6 Capability Flag 
	 Field registry is to be defined by IANA.
	 </t>

	 <t>
	 A (Adjacency SID exclusion for MSD consideration flag) - 1 bit (Bit Position TBD1): 
    <ul>
       <li> 
       If set to 1, it indicates support for the A-flag by the PCEP peer.  
        </li>
       </ul>
	 </t>
	 </section>

	 <section title="R-Flag in SRv6-PCE-CAPABILITY sub-TLV">
	 <t>
	 This section proposes an R-Flag (Reduced SRH for MSD consideration 
	 flag) in the SRv6-PCE-CAPABILITY sub-TLV defined in <xref target="RFC9603"/>. The 
	 bit position for the flag in the SRv6 Capability Flag Field registry 
	 is to be defined by IANA.
	 </t>

	 <t>
	 R-flag (Reduced SRH for MSD consideration flag) - 1 bit (Bit Position TBD2): 
    <ul>
       <li> 
       If set to 1, it indicates support for the R-flag by the PCEP peer.  
        </li>
       </ul>
	 </t>
	 </section>

	 <section title="Operation">
	 <t>
	 <xref target="RFC9603"/> specifies that a PCE MUST NOT send SRv6 paths that exceed 
	 the SRv6 MSD capabilities of the PCC.
	 </t>

	 <t>
	 For the A-Flag, when both the PCE and PCC have advertised support for 
	 the capability by setting the A-flag in their respective SRv6-PCE-
	 CAPABILITY sub-TLVs <xref target="RFC9603"/>, under these conditions, if the first 
	 SID in an SRv6-TE path is an adjacency SID attached with the headend 
	 node, the PCE MUST NOT send SR-TE paths with a number of SIDs 
	 exceeding that (Maximum H.Encaps MSD+1) value.
	 </t>

	 <t>
	 For the R-Flag, when both the PCE and PCC have advertised support for 
	 the capability by setting the R-flag in their respective SRv6-PCE-
	 CAPABILITY sub-TLVs <xref target="RFC9603"/>, the PCE MUST NOT send SR-TE paths with 
	 a number of SIDs exceeding the (Maximum H.Encaps MSD+1) value.
	 </t>

	 <t>
	 (To be discussed) If both the A-Flag and R-Flag are set in the 
	 respective SRv6-PCE-CAPABILITY sub-TLVs <xref target="RFC9603"/> of PCE and PCC, the 
	 PCE MUST NOT send SR-TE paths with a number of SIDs exceeding the 
	 (Maximum H.Encaps MSD+1) value, since A-Flag and R-Flag are both 
	 about omitting the first SID in the SID list.
	 </t>
	 </section>

	 </section>

	 <section title="Backward compatibility">
	 <t>
	 The proposed procedure is backward compatible with <xref target="RFC8664"/> and 
	 <xref target="RFC9603"/> as it requires both PCE and PCC to support the optimization 
	 capabilities during the PCEP initialization phase by setting the 
	 corresponding new flag in the SR-PCE-CAPABILITY or SRv6-PCE-
	 CAPABILITY sub-TLV in the Open message. Specifically, if at least 
	 one PCEP peer is not capable of supporting the new flags, the PCE 
	 MUST NOT send SR-TE paths with a number of SIDs exceeding that MSD 
	 capability.
	 </t>
	 </section> 
     
    <section title="Security Considerations">
	 <t>
	 Security considerations in <xref target="RFC8664"/> and <xref target="RFC9603"/> apply to this 
	 document.
	 </t>
    </section>

    <section anchor="iana" title="IANA Considerations">
	 <t>
	 This document requests IANA to assign the following flags in the 
	 "SRv6 Capability Flag Field" registry.
	 </t>

	 <figure>
	   <artwork><![CDATA[
      Bit     Description                         Reference
     --------------------------------------------------------
      TBD1   Adjacency SID exclusion for        [this document]
                  MSD consideration (A-Flag)
      TBD2   Reduced SRH for MSD
                  consideration (R-Flag)             [this document]
]]></artwork>
	 </figure>
    </section>


</middle>

 <!--  *****BACK MATTER ***** -->

<back>
    <!-- References split into informative and normative -->
    <references title="Normative References">
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8402.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8664.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9256.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9603.xml"/>
    </references>

    <references title="Informative References">
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8491.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8754.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8986.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9352.xml"/>
    </references>
    
</back>
</rfc>
