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

<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<rfc
      xmlns:xi="http://www.w3.org/2001/XInclude"
      category="std"
      docName="draft-ietf-idr-bgp-srmpls-elp-02"
      ipr="trust200902"
      obsoletes=""
      updates=""
      submissionType="IETF"
      xml:lang="en"
      tocInclude="true"
      tocDepth="4"
      symRefs="true"
      sortRefs="true"
      version="3">

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

 <front>


   <title abbrev="BGP Extension for ELP">BGP Extension for SR-MPLS Entropy Label Position</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-idr-bgp-srmpls-elp-02"/>


   <author fullname="Yao Liu" surname="Liu">
      <organization>ZTE</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

         <city>Nanjing</city>
          <region/>
          <code/>
          <country>China</country>
        </postal>
        <phone></phone>
        <email>liu.yao71@zte.com.cn</email>
        <!-- uri and facsimile elements may also be added -->
     </address>
    </author>	
	
	 <author fullname="Shaofu Peng" surname="Peng">
      <organization>ZTE</organization>
      <address>
        <postal>
          <street/>
          <!-- Reorder these if your country does things differently -->

         <city>Nanjing</city>
          <region/>
          <code/>
          <country>China</country>
        </postal>
        <phone></phone>
        <email>peng.shaofu@zte.com.cn</email>
        <!-- uri and facsimile elements may also be added -->
     </address>
    </author>	
    <date year="2024"/>

   <!-- Meta-data Declarations -->

   <area>Internet</area>
    <workgroup>IDR</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. -->

   <keyword>Entropy Label </keyword>
   <keyword>SR Policy</keyword>
   <keyword>SR-MPLS</keyword>
    <!-- Keywords will be incorporated into HTML output
        files in a meta tag but they have no effect on text or nroff
        output. If you submit your draft to the RFC Editor, the
        keywords will be used for the search engine. -->

   <abstract>
      <t>This document proposes extensions for BGP to indicate the entropy label position in the SR-MPLS label stack when delivering SR Policy via BGP.</t>
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>
<t>Segment Routing (SR) leverages the source routing paradigm. Segment Routing can be instantiated on MPLS data plane which is referred to as SR-MPLS <xref target="RFC8660"></xref>.  SR-MPLS leverages the MPLS label stack to construct the SR path. </t>
<t>
Entropy labels (ELs) <xref target="RFC6790"></xref> are used in the MPLS data plane to provide entropy for load-balancing.  The idea behind the entropy label is that the ingress router computes a hash based on several fields from a given packet and places the result in an additional label named "entropy label".  Then, this entropy label can be used as part of the hash keys used by an LSR.  Using the entropy label as part of the hash keys reduces the need for deep packet inspection in the LSR while keeping a good level of entropy in the load-balancing.  
</t>
<t>
<xref target="RFC8662"></xref> proposes to use entropy labels for SR-MPLS networks and multiple &lt;ELI, EL&gt;  pairs may be inserted in the SR-MPLS label stack.  The ingress node may decide the number and position of the ELI/ELs which need to be inserted into the label stack, that is termed as ELP (Entropy Label Position) in this document. 
But in some cases, the controller (e.g, PCE) can be used to perform the SR path computation as well as the Entropy Label Position, which is useful for inter-domain scenarios. 
</t>
<t>
<xref target="I-D.ietf-idr-sr-policy-safi"></xref> specifies the way to use BGP to distribute one or more of the candidate paths of an SR Policy to the headend of that policy.
</t>
<t>This document proposes extensions for BGP to indicate the ELP in the segment list when delivering SR Policy via BGP in SR-MPLS networks.</t>	  
    </section>
	
	<section numbered="true" toc="default">
	<name>Conventions used in this document</name>
	    <section numbered="true" toc="default">
        <name>Requirements Language</name>
		<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><xref target="RFC8174" format="default"></xref> when, and only when, they appear in all capitals, as shown here.</t>
	
      </section>
		<section numbered="true" toc="default">
        <name>Terminology and Acronyms</name>
<t>EL: Entropy Label</t>
<t>ELI: Entropy Label Indicator</t>
<t>ELC: Entropy Label Capability</t>
<t>ERLD: Entropy Readable Label Depth</t>
<t>ELP: Entropy Label Position</t>
<t>BMI: Base MPLS Imposition is the number of MPLS labels that can be imposed inclusive of all service/transport/special labels.</t>
<t>MSD: Maximum SID Depth</t>
<t>BMI-MSD: A type of MSD signals the BMI of a node.</t>
<t>ERLD-MSD: A type of MSD advertises the ERLD of a node.</t>
		
		</section>
	</section>
	
<section numbered="true" toc="default">
<name>Entropy Label Position in SR-MPLS with the Controller</name>	

	<t>As described in <xref target="RFC8662"></xref> section 7, ELI/EL placement is not an easy decision, multiple criteria may be taken into account.</t>
	<t>First is the BMI-MSD<xref target="RFC8491"/>, it defines the maximum number of labels that a particular node can impose on a packet, and it is a limit when the ingress node imposing ELI/EL pairs on the SR label stack. </t>
	<t>The Entropy Readable Label Depth(ERLD) <xref target="RFC8662"/> is another important parameter to consider when inserting an ELI/EL. The ERLD is defined as the number of labels a router can both read in an MPLS packet received on its incoming interface(s) and use in its load-balancing function. An ELI/EL pair must be within the ERLD of the LSR in order for the LSR to use the EL during load-balancing. It's necessary to get the ERLD of the nodes along the SR path to achieve efficient load-balancing. </t>
	<t>An implementation MAY try to evaluate if load-balancing is really expected at a particular node based on the segment type of its label, which also influences the ELP of a segment list. </t>
	<t>Other criteria includes maximizing number of LSRs that will load-balance, preference for a part of the path, and etc. Using which criteria and how to decide the ELP based on the criteria is a matter of implementation.</t> 
	<t>As shown in Figure 1, in the inter-domain scenario, a path from A to Z is required, a centralized controller performs the computation of the end-to-end path, along which traffic load-balancing is required. </t>
		<figure>
		<name>Entropy Labels in SR-MPLS Inter-Domain Scenario</name>
        <artwork align="center" name=""><![CDATA[
 ....................   ....................    .....................
 .                  .   .                  .    .                   .
 .+---+       +---+ .   . +---+      +---+ .    .+---+      +----+  .
 .| A |-------| B |------ | C |------| X |-------| Y |------| Z  |  .
 .+---+       +---+ .   . +---+      +---+ .    .+---+      +----+  .
 .     domain 1     .   .      domain 2    .    .     domain 3      .
 ....................   ....................    ..................... 
           ]]></artwork>
      </figure>
	<t>When the headend node in the first domain can't get the information of the nodes/SIDs in other domains, e.g, the ERLD of each node or the type of the SID bounded to a node/link, it's difficult for the headend node to decide the ELP of the segment list for the path.</t>
	<t>Performing the computation of the ELP by the controller is an alternate, since it's easier for the controller to get the required information along the segment list prescribed by itself. </t>
	<t>For example, the ERLD can be advertised as ERLD-MSD via IS-IS<xref target="RFC9088"/> and OSPF<xref target="RFC9089"/> within the domain, in each domain, one or more nodes are configured with BGP-LS so the controller can get the ERLD-MSD of all the nodes through BGP-LS<xref target="RFC9085"/>. The controller can acquire the BMI-MSD of the headend node or the Binding SID anchor node via BGP-LS<xref target="RFC8814"/> or PCEP<xref target="RFC8664"/>.</t>
	<t>Another benefit of utilizing the controller to calculate ELP is that if the criteria or calculation algorithm is changed, the corresponding modification only needs to be made on the controller instead of each headend node in the network.</t>
  
	<t>When the controller performs the computation of the the ELP for a segment list, the considerations for the placement of ELI/ELs introduced in <xref target="RFC8662"/> are still applicable. How the controller computes the ELP is out of scope of the document.</t>
	<t>After the ELP of an SR path is decided, the controller SHOULD inform the result to the headend node of the path, so the node knows where to insert the ELI/ELs when needed. Section 4 proposes the detailed extensions for BGP to carry this information.</t>	  

</section>	


	<section numbered="true" toc="default">
	<name>BGP Extensions for ELP in SR Policy</name>


<t>As defined in <xref target="I-D.ietf-idr-sr-policy-safi"></xref>, the SR Policy encoding structure is as follows:</t>

        <artwork align="center" name=""><![CDATA[
      SR Policy SAFI NLRI: <Distinguisher, Policy-Color, Endpoint>
      Attributes:
         Tunnel Encaps Attribute (23)
            Tunnel Type: SR Policy
                Binding SID
                Preference
                Priority
                Policy Name
                Explicit NULL Label Policy (ENLP)
                Segment List
                    Weight
                    Segment
                    Segment
                    ...
                ...
           ]]></artwork>	
		   
<t>This document defines a new ELP sub-TLV within Segment List sub-TLV. The ELP sub-TLV has the following format:</t>
        <artwork align="center" name=""><![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      |   Length      |         RESERVED              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>


<t>Where,</t>	
<t>Type: TBD.</t>		
<t>Length: Specifies the length of the value field (i.e., not including Type and Length fields) in terms of octets.  The value MUST be 2.</t>
<t>RESERVED: 2 octet of reserved bits. MUST be unset on transmission and MUST be ignored on receipt.</t>
<t>The ELP sub-TLV, when present, indicates that the &lt;ELI, EL&gt; label pair SHOULD be inserted at this position. It MAY appear multiple times in the Segment List sub-TLV.</t>
<t>The new SR Policy encoding structure with ELP sub-TLV is expressed as below:</t>
        <artwork align="center" name=""><![CDATA[
      SR Policy SAFI NLRI: <Distinguisher, Policy-Color, Endpoint>
      Attributes:
         Tunnel Encaps Attribute (23)
            Tunnel Type: SR Policy
                Binding SID
                Preference
                Priority
                Policy Name
                Explicit NULL Label Policy (ENLP)
                Segment List
                    Weight
                    Segment
                    Segment
                    ELP
                    Segment
                    ...
                    Segment
                    ELP
                    Segment
                    Segment
                    ...
                ...
           ]]></artwork>		

	</section>
		   
    <section numbered="true" toc="default">
        <name>Operation Considerations</name>
		
		<t>After obtaining the topolopy of the network and other necessary criterias for determining ELP, the controller calculates the path information of the SR Policy instance based on these information and builds it from the headend to the endpoint. And then the controller delivers the SR path information with the segment list as well as the EL insertion position information included to the headend, leveraging the BGP extension introduced in this document.</t>
<t>The &lt;ELI, EL&gt; label pair insertion is indicated at the segment list level. The following example shows how a headend node operates after the ELP sub-TLV is introduced. </t>		
<t>Node A receives an SR Policy NLRI with an Segment List sub-TLV from the controller. The Segment List sub-TLV contains multiple Segment sub-TLVs and ELP sub-TLVs, e.g, &lt;S1, S2, S3,ELP, S4, S5, S6, ELP&gt;, it indicates that if load-balancing is required, two &lt;ELI, EL&gt; pairs SHOULD be inserted into the label stack of the SR-TE forwarding entry, respectively after the Label for S3 and Label for S6.</t>		
<t> 
The value of EL is supplemented by the ingress node according to load-balancing function of the appropriate keys extracted from a given packet.
After inserting ELI/ELs, the label stack on the ingress node would be &lt;S1, S2, S3, ELI, EL, S4, S5, S6, ELI, EL&gt;.
</t>
<t>If the SR Policy is delivered without the ELP sub-TLV, the headend node MAY still insert ELI/ELs based on its own decision, as the legacy behavior of ELI/EL insertion defined in <xref target="RFC8662"></xref>, making it inconvenient for network operation and troubleshooting. So it is RECOMMENDED that at at least within the same SR policy, the behavior SHOULD be consistent, that is, either the headend node inserts the ELI/ELs based on the ELP sub-TLV received or it makes its own decision regardless of the existence of the ELP sub-TLV.</t>
<t>The Maximum SID Depth defines the maximum number of labels that a particular node can impose on a packet. When ELI/EL insertion is required, the number of segments and ELI/ELs to be inserted in the segment list SHOULD NOT exceed the BMI-MSD limit. In this case, depending on whether ELI/EL(s) are required to be inserted and whether the headend node has sufficient BMI-MSD, the segment list delivered by the controller to the headend MAY be different. And with the additional constraints on ELI/EL insertion, the number of valid paths may be reduced, in some cases there may be no available path. Whether the ELI/EL insertion should be considered when computing the SR policy MAY be based on the configuration or local policy on the controller, or some control plane mechanism between the headend and the controller MAY be used, the details are out of the scope of this document.</t>
			
	</section>		


	
<section numbered="true" toc="default">
	<name>IANA Considerations</name>
<t> This document defines a new sub-TLV in the registry "SR Policy List Sub-TLVs" <xref target="I-D.ietf-idr-sr-policy-safi"></xref> to be assigned by IANA:</t>
        <artwork align="center" name=""><![CDATA[
        Codepoint   Description                           Reference
        -------------------------------------------------------------
        TBD         ELP Sub-TLV                         This document
           ]]></artwork>
	</section>	

<section numbered="true" toc="default">
	<name>Security Considerations</name>
		<t>Procedures and protocol extensions defined in this document do not introduce any new security considerations beyond those already listed in <xref target="RFC8662"></xref> and <xref target="I-D.ietf-idr-sr-policy-safi"></xref>. </t>	
</section>	


<section numbered="true" toc="default">
	<name>Acknowledgement</name>
    <t>The authors would like to thank Ketan Talaulikar, Jie Dong and Nat Kao for their helpful review and comments.</t>
</section>		
	
  </middle>
  <!--  *****BACK MATTER ***** -->

 <back>

   <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
		<?rfc include="reference.RFC.2119.xml"?>
		<?rfc include="reference.RFC.8174.xml"?>		
 		<?rfc include="reference.RFC.6790.xml"?> 
		<?rfc include="reference.RFC.8662.xml"?>
 		<?rfc include="reference.I-D.ietf-idr-sr-policy-safi.xml"?> 
	  
      </references>
      <references>
        <name>Informative References</name>
		<?rfc include="reference.RFC.8491.xml"?>		
		<?rfc include="reference.RFC.8660.xml"?>
	    <?rfc include="reference.RFC.9088.xml"?>
	    <?rfc include="reference.RFC.9089.xml"?>			
	    <?rfc include="reference.RFC.8814.xml"?>
		<?rfc include="reference.RFC.8664.xml"?>
	    <?rfc include="reference.RFC.9085.xml"?>
      </references>
    </references>


 </back>
</rfc>
