<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="3"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="info" docName="draft-song-mpls-eh-indicator-05" ipr="trust200902">
  <front>
    <title abbrev="MPLS Extension Header Indicator">
         Options for MPLS Extension Header Indicator</title>

    <author fullname="Haoyu Song" initials="H." role="editor" surname="Song">
      <organization>Futurewei Technologies</organization>
      <address>
        <postal>
          <street>2330 Central Expressway</street>
          <city>Santa Clara</city>
          <country>USA</country>
        </postal>
        <email>haoyu.song@futurewei.com</email>
      </address>
    </author>


    <author fullname="Zhenbin Li" initials="Z." surname="Li">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>156 Beiqing Road</street>
          <city>Beijing, 100095</city>
          <country>P.R. China</country>
        </postal>
        <email>lizhenbin@huawei.com</email>
      </address>
    </author>

    <author fullname="Tianran Zhou" initials="T." surname="Zhou">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>156 Beiqing Road</street>
          <city>Beijing, 100095</city>
          <country>P.R. China</country>
        </postal>
        <email>zhoutianran@huawei.com</email>
      </address>
    </author>

    <author fullname="Loa Andersson" initials="L." surname="Andersson">
      <organization>Bronze Dragon Consulting</organization>
      <address>
        <postal>
          <street> </street>
          <city>Stockholm</city>
          <country>Sweden</country>
        </postal>
	<email>loa@pi.nu</email>
      </address>
    </author>

    <date day="27" month="June" year="2022"/>

    <area>RTG</area>

    <workgroup>MPLS</workgroup>
    
    <!---->

    <keyword>MPLS, Extension Header</keyword>

    <abstract>
	    <t>This document enumerates and describes the candidate schemes that can be used to indicate the presence of the MPLS extension header(s) following the MPLS label stack. The similar schemes are also applicable for indicating the potential in-stack extensions. After a careful evaluation of these options by comparing their pros and cons, it is expected that one should be chosen as the final standard scheme for MPLS extension indicator. </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 title="Introduction">
	    <t> The document <xref target="I-D.song-mpls-extension-header"></xref> presents the motivation, specification, and use cases of MPLS Extension Header (EH). An indicator is needed in the MPLS label stack to indicate the presence of the extension header(s).
		Multiple options are possible for this purpose. As the discussion progresses, more options could emerge. </t>

	    <t> In this document, we propound three categories of methods which can be further partitioned into five unique schemes. Four of them use explicit data plane encoding to indicate the EH and the last one implies the EH through control plane configuration. This document details and compares these schemes, in order to foster further discussions until a final decision is made. </t>   	

		<t> The similar schemes are also applicable for indicating the potential in-stack MPLS extensions which are under discussion currently. </t>

    </section>

    <section title="Dedicated Extension Header Label">

       <t> A straightforward method is to directly encode an Extension Header Label (EHL) in the MPLS label stack. Two derived schemes are as follows. </t>	    

       <section title="Special Purpose Label">

	   <t>A new special purpose label, EHL, can be used to indicate EHs. As specified in <xref target="RFC7274"></xref>, so far eight 
	      special purpose label values are still left unsigned by IANA (which are 4 to 6 and 8 to 12).
	      This single label scheme is elegant but arguably demands a scarce resource. We cannot rule out the possibility of
              requiring more than one label value to differentiate EH classes (e.g., Hop-by-Hop, End-to-End, or both). If this happens, it can only aggravate the situation.</t>

	   <t>Another benefit of this scheme is that an EHL can potentially be located anywhere in an MPLS
	      label stack. It is easier and quicker for a router to figure out the existence of extension header(s) if the EHL is close to or at the top of the label stack. 
	      However, if there are legacy devices which can reach the EHL but do not recognize it in a network, then for backward compatibility, 
	      the EHL must be located at the bottom of the stack (i.e., only the MPLS tunnel ends and EHL-aware nodes will look up and process it). </t>

	   <t>The format of an EHL is the same as an MPLS label. The first 20-bit label value will be assigned
	      by IANA. The BoS bit is used to indicate the location of the label. The other fields, CoS and TTL, currently have no use in the context of EHL. However, these two fields can potentially be used to encode other information. If such code points are open for other purpose, it will make the single EHL idea more compelling. E.g., the EH category and/or other information, if needed, can be encoded in these fields, so that only one special label value is needed.</t>
		  
		
	    <t>The following figure shows a potential scheme in which one bit from the CoS field ('H') is used to indicate the presence of HbH EHs in the packet. If 'H' bit is 0, it means no HbH EH follows so a P-router will not need to check the EH. The last 8 bits can be used to find the location of the extension headers (i.e., the first byte after the MPLS label stack). This information can help to avoid the scan of the label stack in case the extension headers need to be accessed.</t>
		
		<t><figure anchor="figure_6" title="Special EHL with EH Category Encoding">
         <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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                EHL (TBD)              |H|   |S|    Offset     |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	 ]]></artwork>
	</figure></t>

         <t>Note that the Cos/TTL fields can be encoded to include more information. For example, in addition to indicate the EH, it can also indicate the presence of some other label-based services (e.g., EL). If we want to explore such possibilities, we have 11 bits in total at our disposal.</t>
	
      </section>	    


      <section title="Extension Label plus an Extended Special Purpose Label">

	   <t><xref target="RFC7274"></xref> specifies the Extension Label (XL) with the value of 15. 
	      An extended special purpose label (ESPL) following XL can be used as EHL. A large number of ESPL values are available for allocation. 
	      The XL+EHL scheme eases the concern on the reserved label space at the cost of one more label in the label stack.</t>

           <t>Except for the fact that one more label is needed, The XL+EHL scheme shares the same property as the single special purpose EHL scheme.</t>    


      </section>

    </section>   

    <section title="Generic Associated Channel Extension">

      <t>The similar "header extension" requirement for MPLS has led to some proposals before. A special <xref target="RFC5586"> 
	 Generic Associated Channel Label (GAL)</xref> with the value of 13 has been assigned to support the identification of an 
         Associated Channel Header (ACH). We can extend this existing mechanism to encode the MPLS EH indicator.</t>  

      <section title="GAL and Associated Channel Header">


	    <t>The ACH is located below the bottom label. It has a 16-bit Channel Type field which provides abundant space to 
	     encode the MPLS EH indicator. This scheme has the same header overhead as the XL+EHL scheme.
	     The format is depicted in <xref target="figure_2"></xref>.</t> 


 <t><figure anchor="figure_2" title="Associated Channel Header as Extension Header Indicator ">
         <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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                GAL (13)               | EXP |1|      TTL      |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |0 0 0 1|Version|   Reserved    |  Extension Header Indicator   |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     |                     HEH and EH(s)                             |
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
	</figure></t>


	    <t>GAL has several applications already yet its heritage also has several limitations.
	       The GAL must be located at the bottom of a label stack for its chief use cases such as MPLS-TP.
	       So a router needs to search the entire label stack for the BoS bit and check if the corresponding label is GAL.  
	       This can impact the performance when the label stack is deep.
	       A more serious concern is that <xref target="RFC5586"></xref> states that GAL+ACH MUST NOT be used to transport user traffic and an ACH is supposed
	       to be followed by a non-service payload.</t>

            <t>None of these is insurmountable but it does require an overhaul of the existing RFC in order to extend the usage of GAL.</t> 

      </section>

      <section title="GAL and a Different Nibble Value">

	      <t>To avoid changing the established semantics of ACH, a variation can be used. ACH starts with a nibble value "0001". 
		 A different nibble value may be used to redefine the remaining part of the word. 
		 The idea has been exploited by <xref target="I-D.guichard-sfc-mpls-metadata"></xref> to 
		 define a Metadata Channel Header (MCH) with the leading nibble value "0000".
		 Similarly, we can use another nibble value (e.g., "0010") to define a new header, namely the MPLS Extension Header Indicator (EHI).</t>

	      <t>The format of the GAL and EHI is depicted in <xref target="figure_3"></xref>.</t>

 <t><figure anchor="figure_3" title="Extension Header Indicator 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                GAL (13)               | EXP |1|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0 0 1 0|Version|   Reserved    |  Extension Header Class       |<-EHI
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                     HEH and EH(s)                             |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
	</figure></t>

	<t> The Extension Header Class field in EHI is used to differentiate the extension headers. Potentially there are three classes: Hop-by-Hop (HbH), End-to-End (E2E), or
		both. If finally we decide to not differentiate the extension headers, we have the opportunity to merge the HEH 
		(see <xref target="I-D.song-mpls-extension-header"></xref> for details) into EHI, so we can reduce the header overhead by 
		four bytes. The header format is depicted in <xref target="figure_5"></xref>.</t>


 <t><figure anchor="figure_5" title="Merge HEH to EHI">
         <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                GAL (13)               | EXP |1|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0 0 1 0|     EHCNT     |       EHTLEN          |      NH       |<-HEH
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                           EH(s)                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
	</figure></t>

	 	
       </section>      
 
    </section>
	
	<section title="Extend/Re-purpose MPLS Entropy Label">
	
		<t>Instead of introducing a new SPL as the EH indicator, we can piggyback the indicator in some existing SPL to avoid claiming extra SPL resource and save a label overhead. The best candidate is the entropy label (EL) <xref target="RFC6790"></xref>. If we can make EL default for every MPLS packet, we can encode the EH indicator in the unused ELI/EL label fields such as CoS and TTL.</t>    
	
	
		<t>In <xref target="figure_7"></xref> we show a possible encoding method, in which the first bit of the CoS field in ELI is used to indicate the presence of EH and the TTL field in ELI can be used to indicate the location of the EH. Note that the CoS field of the EL can also be used to encode other information, if necessary.</t>
		
<t><figure anchor="figure_7" title="Special EHL with EH Category Encoding">
         <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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                ELI (7)                |I|   |S|    Offset     |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                 EL                    |     |S|       0       |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	 
	 ]]></artwork>
</figure></t>
	</section>

    <section title="Configured FEC Labels">

        <t>It is also possible to use FEC labels to indicate the presence of extension headers. An FEC label has the same forwarding semantics as the original label, but it
		also means that one or more extension headers exist below the label stack.</t>
        
	<t>Although this approach avoids the need of new header encoding standards,
	   it introduces a good deal of complexity into the control plane. Since every label needs an FEC label to indicate EH, this scheme also significantly reduces the
	   available label space. Another issue is that this solution may not work for incremental deployment where some legacy routers cannot understand and apply the FEC
	   labels for EH. Moreover, this configuration-based solution certainly makes the cross-domain interoperability more difficult. 
	   Hence, this is the least preferred option. We only include it here for the completeness of the discussion. 
	</t>  

    </section>
    
	

	
    <section anchor="summary" title="Summary">

	    <t> Evidenced by the existing and emerging use cases, MPLS networks need a standard way to support extension headers. 
		    In <xref target="figure_4"></xref>, we summarize the potential schemes that allow MPLS packets to carry extension headers and 
		    list the main pros and cons for each scheme.</t>

 <t><figure anchor="figure_4" title="Potential Schemes for MPLS Extension Headers">
         <artwork><![CDATA[

   +---+---------------------------+---------------------------------+  
   |No.|    Description            |       Pros and Cons             |
   +---+---------------------------+---------------------------------+  
   | 1 | Special purpose EHL       |+ Single label                   |
   |   |                           |+ Location freedom               |
   |   |                           |- Need standard extension        |
   |   |                           |- Use scarce resource            |
   +---+---------------------------+---------------------------------+ 
   | 2 | XL(15) + EHL              |+ Location freedom               |
   |   |                           |+ Established mechanism          |
   |   |                           |+ Abundant resource              |
   |   |                           |- One extra label than Option 1  |
   |   |                           |- Need standard extension        |
   +---+---------------------------+---------------------------------+
   | 3 | GAL + ACH with channel    |+ Reuse existing mechanism       |
   |   | type extension            |+ Abundant resource              |
   |   |                           |- Label location limitation      | 
   |   |                           |- One more word than Option 1    | 
   |   |                           |- Not for user traffic           |
   |   |                           |- Need standard extension/update |
   +---+---------------------------+---------------------------------+  
   | 4 | GAL + another nibble value|+ No change to ACH semantics     |
   |   | to indicate EHs (e.g.,    |+ Potential overhead saving      |  
   |   | "0010")                   |- Label location limitation      |
   |   |                           |- Hack scarce resource (nibble)  |
   |   |                           |- Need standard extension        |
   +---+---------------------------+---------------------------------+
   | 5 | Extend ELI/EL             |+ No need for new label          |
   |   |                           |- Need standard update           |
   |   |                           |- Need to make EL mandatory      |
   |   |                           |- One extra label than Option 1  |   
   +---+---------------------------+---------------------------------+ 
   | 6 | FEC label as EH indicator |+ No need for header standard    |
   |   |                           |- Complex control plane          |
   |   |                           |- Cross-domain interoperability  |
   |   |                           |- Label space issue              |
   |   |                           |- Not for incremental deployment |
   +---+---------------------------+---------------------------------+
   
]]></artwork>
	</figure></t>

	<t>Basically we have three groups of solutions. The scheme 1 and 2 introduce new labels, the scheme 3, 4, and 5 extend the existing solutions, and the scheme 6 relies on the control plane. Through comprehensive considerations on the pros and cons of each scheme, 
	we expect a working group consensus can be reached to pick the final winner. </t>

    </section>

    
    <section title="Considerations of EHI">
         <t> The existence of Extension Headers will make the ECMP based on inner IP packet header impossible or harder. If legacy routers need to conduct this kind of 
		 ECMP, the process either fails or generates unexpected results. EH-aware routers can do this kind of ECMP but they need to skip all the EHs in order to 
		 access the inner packet header which may not be efficient (we make provision in HEH to help accelerate this process). In this case, the Entropy Label (EL) is preferred for ECMP. The Entropy Label Indicator (ELI) and 
	         EL should be put in front of the EHI to avoid confusing the legacy routers.</t> 
    </section>


    <section anchor="Security" title="Security Considerations">
      <t>TBD</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>If the EHL approach is adopted to indicate the presence of MPLS extension header(s), this document requests IANA to assign one or more new 
         Special-Purpose MPLS Label Values from the Special-Purpose
         Multiprotocol Label Switching (MPLS) Label Values Registry of "Extension Header Label (EHL)".</t>
    </section>
    
    <section anchor="Contributors" title="Contributors">
      <t>
        The other contributors of this document are listed as follows.
      </t><t>
      <list style="symbols">
	      <t>James Guichard</t>	      
	      <t>Stewart Bryant</t>	      
		  <t>Bruno Decraene</t>
      </list>	  	
      </t>
    </section>

    <section anchor="Acknowledgments" title="Acknowledgments">
      <t>TBD.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.RFC.2119'?>
      <?rfc include='reference.RFC.8174'?>
      <?rfc include='reference.RFC.7274'?>
      <?rfc include='reference.RFC.5586'?>
	  <?rfc include='reference.RFC.6790'?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.I-D.song-mpls-extension-header'?>
      <?rfc include='reference.I-D.guichard-sfc-mpls-metadata'?>
    </references>
  </back>
</rfc>
