<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-pce-sid-algo-00" ipr="trust200902">
  <front>
    <title abbrev="SID Algorithm in PCEP">
    Carrying SID Algorithm information in PCE-based Networks.
    </title>

    <author fullname="Alex Tokar" initials="A." surname="Tokar">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>Eurovea Central 3.</street>
          <street>Pribinova 10</street>
          <city>Bratislava</city>
          <code>811 09</code>
          <country>Slovakia</country>
        </postal>
        <email>atokar@cisco.com</email>
      </address>
    </author>

    <author fullname="Samuel Sidor" initials="S." surname="Sidor">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>Eurovea Central 3.</street>
          <street>Pribinova 10</street>
          <city>Bratislava</city>
          <code>811 09</code>
          <country>Slovakia</country>
        </postal>
        <email>ssidor@cisco.com</email>
      </address>
    </author>
	
	<author fullname="Shaofu Peng" initials="S" surname="Peng">
	  <organization>ZTE Corporation</organization>
	  <address>
	    <postal>
	      <street>No.50 Software Avenue</street>
	      <city>Nanjing</city>
	      <region>Jiangsu</region>
	      <code>210012</code>
	      <country>China</country>
	    </postal>
	    <email>peng.shaofu@zte.com.cn</email>
	  </address>
	</author>

    <author fullname="Siva Sivabalan" initials="S." surname="Sivabalan">
      <organization>Ciena</organization>
      <address>
        <postal>
          <street>385 Terry Fox Drive</street>
          <city>Kanata</city>
          <region>Ontario</region>
          <code>K2K 0L1</code>
          <country>Canada</country>
        </postal>
        <email>msiva282@gmail.com</email>
      </address>
    </author>
		
	<author fullname="Tarek Saad" initials="T." surname="Saad">
      <organization>Juniper Networks</organization>
      <address>
        <email>tsaad@juniper.net</email>
      </address>
    </author>

    <author fullname="Shuping Peng" initials="S." surname="Peng">
      <organization>Huawei Technologies</organization>
       <address>
        <postal>
          <street>Huawei Campus, No. 156 Beiqing Rd.</street>
           <city>Beijing</city>
           <region/>
           <code>100095</code>
           <country>China</country>
        </postal>
         <phone/>
         <facsimile/>
         <email>pengshuping@huawei.com</email>
         <uri/>
      </address>
    </author>

    <author initials="M" surname="Negi" fullname="Mahendra Singh Negi">
      <organization>RtBrick Inc</organization>
      <address>
        <postal>
          <street/>
          <city>Bangalore</city>
          <region>Karnataka</region>
          <code/>
          <country>India</country>
        </postal>
        <email>mahend.ietf@gmail.com</email>
      </address>
    </author>

    <date day="22" month="February" year="2022" />

    <workgroup>PCE Working Group</workgroup>

    <abstract>

      <t>The Algorithm associated with a prefix Segment-ID (SID) defines the path computation Algorithm used by Interior Gateway Protocols (IGPs).  This information is available to controllers such as the Path Computation Element (PCE) via topology learning.  This document proposes an approach for informing headend routers regarding the Algorithm associated with each prefix SID used in PCE-computed paths, as well as signalling a specific SID algorithm as a constraint to the PCE.</t> 

    </abstract> 

    <note 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> <xref target="RFC8174"></xref> when,
      and only when, they appear in all capitals, as shown here.</t>
    </note>
  </front>
  <middle>
    <section anchor="Introduction" title="Introduction">

      <t>A PCE can compute SR-TE paths using SIDs with different Algorithms depending on the use-case, constraints, etc.  While this information is available on the PCE, there is no method of conveying this information to the headend router.</t>

      <t>Similarly, the headend can also compute SR-TE paths using different Algorithms, and this information also needs to be conveyed to the PCE for collection or troubleshooting purposes.  In addition, in the case of multiple (redundant) PCEs, when the headend receives a path from the primary PCE, it needs to be able to report the complete path information - including the Algorithm - to the backup PCE so that in HA scenarios, the backup PCE can verify the prefix SIDs appropriately.</t>

      <t>An operator may also want to constrain the path computed by the PCE to a specific SID Algorithm, for example, in order to only use SID Algorithms for a low-latency path.  A new TLV is introduced for this purpose.</t>

      <t>Refer to <xref target="RFC8665"/> and <xref target="RFC8667"/> for details about the prefix SID Algorithm.</t>

      <t>This document is extending:
	    <list style="symbols">
            <t>the SR PCE Capability Sub-TLV and the SR-ERO subobject - defined in <xref target="RFC8664"/></t>
            <t>the SRv6 PCE Capability sub-TLV and the SRv6-ERO subobject - defined in <xref target="I-D.ietf-pce-segment-routing-ipv6"/></t>
        </list>
	   A new TLV for signalling SID Algorithm constraint to the PCE is also introduced, to be carried inside the LSPA object, which is defined in <xref target="RFC5440"/>.</t>

      <t>The mechanisms described in this document are equally applicable to both SR-MPLS and SRv6.</t>

    </section>

    <section title="Terminology">
      <t>The following terminologies are used in this document:
	    <list style="hanging">
          <t hangText="ERO:"> Explicit Route Object</t>
          <t hangText="IGP:"> Interior Gateway Protocol</t>
          <t hangText="NAI:"> Node or Adjacency Identifier.</t>
          <t hangText="PCE:"> Path Computation Element</t>
          <t hangText="PCEP:"> Path Computation Element Protocol.</t>
          <t hangText="SID:"> Segment Identifier.</t>
          <t hangText="SR:"> Segment Routing.</t>
          <t hangText="SR-TE:"> Segment Routing Traffic Engineering.</t>
          <t hangText="LSP:"> Label Switched Path.</t>
          <t hangText="LSPA:"> Label Switched Path Attributes.</t>
        </list>
      </t>
    </section>

    <section anchor="OBJECT-FORMATS" title="Object Formats">
	  <section anchor="THE-OPEN-SUBOBJECT" title="OPEN Object">
	    <section anchor="SR-CAP-FLAG" title="SR PCE Capability Sub-TLV">
<t>A new flag S is proposed in the SR PCE Capability Sub-TLV introduced in Section 4.1.2 of <xref target="RFC8664"/> in Path Computation Element Communication Protocol (PCEP) to indicate support for SID Algorithm field in the SR-ERO subobject.</t>
<figure><artwork align="center" name="" type="" alt="">
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Type=26               |            Length=4           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Reserved              |   Flags |S|N|X|      MSD      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork></figure>
		</section>
		<section anchor="SRv6-CAP-FLAG" title="SRv6 PCE Capability sub-TLV">
<t>A new flag S is proposed in the SRv6 PCE Capability sub-TLV introduced in 4.1.1 of <xref target="I-D.ietf-pce-segment-routing-ipv6"/> in Path Computation Element Communication Protocol (PCEP) to indicate support for SID Algorithm field in the SRv6-ERO subobject.</t>
<figure><artwork>
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Type=TBD1          |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Reserved           |             Flags       |S|N|X|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   MSD-Type    | MSD-Value     |   MSD-Type    |   MSD-Value   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//                             ...                             //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   MSD-Type    | MSD-Value     |            Padding            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
</artwork></figure>
		</section>
      </section>

      <section anchor="SR-ERO-SUBOBJECT" title="SR-ERO Subobject">
        <t>The SR-ERO subobject encoding is extended with new flag "A" to indicate if the Algorithm field is included after other optional fields.</t>
<figure><artwork name="" type="" align="left" alt="">
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |L|   Type=36   |     Length    |  NT   |     Flags |A|V|F|S|C|M|
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                         SID (optional)                        |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  //                   NAI (variable, optional)                  //
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                  Reserved                     |  Algorithm    |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork></figure>
      </section>
	  <section anchor="SRv6-ERO-SUBOBJECT" title="SRv6-ERO Subobject">
        <t>The SRv6-ERO subobject encoding is extended with new flag "A" to indicate if the Algorithm field is included after other optional fields.</t>
<figure><artwork name="" type="" align="left" alt="">
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |L|   Type=TBD3 |     Length    |   NT  |    Flags    |A|V|T|F|S|
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |            Reserved           |        Endpoint Behavior      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                                                               |
  |                      SRv6 SID (optional)                      |
  |                           (128-bit)                           |
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  //                    NAI (variable, optional)                 //
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     SID Structure (optional)                  |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                  Reserved                     |  Algorithm    |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork></figure>
      </section>

      <section anchor="LSPA-OBJECT" title="LSPA Object">
        <t>A new TLV for the LSPA Object with TLV type=TBD3 is introduced to carry the SID Algorithm constraint.  This TLV SHOULD only be used when PST (Path Setup type) = SR or SRv6.</t>

        <t>The format of the SID Algorithm TLV is as follows:</t>
        <figure anchor="SID-ALGORITHM-TLV-FMT" title="SID Algorithm TLV Format">
          <artwork><![CDATA[
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |         Type=TBD3             |            Length=4           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |         Reserved              |   Flags     |L|   Algorithm   |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          ]]></artwork>
        </figure>

        <t>The code point for the TLV type is TBD3. The TLV length is 4 octets.</t>

        <t>The 32-bit value is formatted as follows.
          <list style="hanging">
            <t hangText="Reserved:"> MUST be set to zero by the sender and MUST be ignored by the receiver.</t>
            <t hangText="Flags:"> This document defines the following flag bits.  The other bits
              MUST be set to zero by the sender and MUST be ignored by the receiver.
              <list style="symbols">
                <t>L (Loose): If set to 1, the PCE MAY insert SIDs with a different Algorithm, but it MUST prefer the specified Algorithm whenever possible.</t>
              </list>
            </t>
            <t hangText="Algorithm:"> SID Algorithm the PCE MUST take into acount while computing a path for the LSP.</t>
          </list>
        </t>

      </section>

    </section>

    <section anchor="Operation" title="Operation">

      <section anchor="ERO-ENCODING" title="SR-ERO and SRv6-ERO Encoding">

        <t>PCEP speaker MAY set the A flag and include the Algorithm field in SR-ERO or SRv6-ERO subobject if the S flag was advertised by both PCEP speakers.</t>
	
	    <t>If PCEP peer receives SR-ERO subobject with the A flag set or with the SID Algorithm included, but the S flag was not advertised, then such PCEP message must be rejected with PCError as described in Section 7.2 of <xref target="RFC5440"/></t>

        <t>The Algorithm field MUST be included after optional SID, NAI or SID structure and length of SR-ERO or SRv6-ERO subobject MUST be increased with additional 4 bytes for Reserved and Algorithm field.</t>
      </section>

      <section anchor="SID-ALGORITHM-CONSTRAINT" title="SID Algorithm Constraint">

        <t>In order to signal a specific SID Algorithm constraint to the PCE, the headend MUST encode the SID ALGORITHM TLV inside the LSPA object.</t>

        <t>When the PCE receives a SID Algorithm constraint, it MUST only take prefix SIDs with the specified Algorithm into account during path computation.  However, if the L flag is set in the SID Algorithm TLV, the PCE MAY insert prefix SIDs with a different Algorithm in order to successfully compute a path.</t>

        <t>If the PCE is unable to find a path with the given SID Algorithm constraint, it MUST bring the LSP down.</t>

        <t>SID Algorithm does not replace the Objective Function defined in <xref target="RFC5541"/>. The SID Algorithm constraint acts as a filter, restricting which SIDs may be used as a result of the path computation function.</t>
      </section>

    </section>

    <section anchor="Security" title="Security Considerations">

      <t>No additional security measure is required.</t>

    </section>

    <section anchor="IANA" title="IANA Considerations">

      <section anchor="SR-CAPABILITY-FLAG" title="SR Capability Flag">

        <t>IANA maintains a sub-registry, named "SR Capability Flag Field", within the "Path Computation Element Protocol
   (PCEP) Numbers" registry to manage the Flags field of the SR-PCE-CAPABILITY TLV.  IANA is requested to
   make the following assignment:</t>
   
        <texttable anchor="SR-CAPABILITY-FLAG-value" style="none" suppress-title="true">
          <ttcol align="center" width='15%'>Value</ttcol>
          <ttcol align="left" width='30%'>Description </ttcol>
          <ttcol align="left" width='55%'>Reference </ttcol>
          <c></c><c>&nbsp;</c><c></c>
          <c>TBD1</c><c>SID Algorithm Capability</c><c>This document</c>
        </texttable>
	  </section>
	  
	  <section anchor="SRv6-CAPABILITY-FLAG" title="SRv6 PCE Capability Flag">

        <t>IANA was requested in <xref target="I-D.ietf-pce-segment-routing-ipv6"/> to create a sub-registry, named "SRv6 PCE Capability Flags", within the "Path Computation Element Protocol
   (PCEP) Numbers" registry to manage the Flags field of SRv6-PCE-CAPABILITY sub-TLV.  IANA is requested to
   make the following assignment:</t>
   
        <texttable anchor="SRv6-CAPABILITY-FLAG-value" style="none" suppress-title="true">
          <ttcol align="center" width='15%'>Value</ttcol>
          <ttcol align="left" width='30%'>Description </ttcol>
          <ttcol align="left" width='55%'>Reference </ttcol>
          <c></c><c>&nbsp;</c><c></c>
          <c>TBD2</c><c>SID Algorithm Capability</c><c>This document</c>
        </texttable>
	  </section>
	  
	  <section anchor="SR-ERO-FLAG" title="SR-ERO Flag">

        <t>IANA maintains a sub-registry, named "SR-ERO Flag Field", within the "Path Computation Element Protocol
   (PCEP) Numbers" registry to manage the Flags field of the SR-ERO Subobject.  IANA is requested to
   make the following assignment:</t>

        <texttable anchor="SR-ERO-FLAG-value" style="none" suppress-title="true">
          <ttcol align="center" width='15%'>Value</ttcol>
          <ttcol align="left" width='30%'>Description </ttcol>
          <ttcol align="left" width='55%'>Reference </ttcol>
          <c></c><c>&nbsp;</c><c></c>
          <c>TBD3</c><c>SID Algorithm Flag</c><c>This document</c>
        </texttable>
	  </section>
	  
	  <section anchor="SRv6-ERO-FLAG" title="SRv6-ERO Flag">

        <t>IANA was requested in <xref target="I-D.ietf-pce-segment-routing-ipv6"/>, named "SRv6-ERO Flag Field", within the "Path Computation Element Protocol
   (PCEP) Numbers" registry to manage the Flags field of the SRv6-ERO subobject.  IANA is requested to
   make the following assignment:</t>

        <texttable anchor="SRv6-ERO-FLAG-value" style="none" suppress-title="true">
          <ttcol align="center" width='15%'>Value</ttcol>
          <ttcol align="left" width='30%'>Description </ttcol>
          <ttcol align="left" width='55%'>Reference </ttcol>
          <c></c><c>&nbsp;</c><c></c>
          <c>TBD4</c><c>SID Algorithm Flag</c><c>This document</c>
        </texttable>
	  </section>

      <section anchor="TLV-Type" title="PCEP TLV Types">

        <t>IANA is requested to allocate a new TLV type for the new LSPA TLV specified in this document.</t>

        <texttable anchor="LSPA-TLV-type" style="none" suppress-title="true">
          <ttcol align="center" width='15%'>Value</ttcol>
          <ttcol align="left" width='30%'>Description </ttcol>
          <ttcol align="left" width='55%'>Reference </ttcol>
          <c></c><c>&nbsp;</c><c></c>
          <c>TBD5</c><c>SID Algorithm</c><c>This document</c>
        </texttable>

      </section>

    </section>

  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>
      <?rfc include="reference.RFC.5440"?>
	  <?rfc include="reference.RFC.5541"?>
      <?rfc include="reference.RFC.8174"?>
      <?rfc include="reference.RFC.8664"?>
      <?rfc include="reference.RFC.8665"?>
      <?rfc include="reference.RFC.8667"?>
	  <?rfc include="reference.I-D.ietf-pce-segment-routing-ipv6"?>
    </references>

<section title="Contributors">

<t><figure><artwork>
Mike Koldychev
Cisco Systems
Kanata, Ontario
Canada

Email: mkoldych@cisco.com
</artwork></figure></t>

</section> <!-- Contributors -->

  </back>

</rfc>
