<?xml version="1.0" encoding="iso-8859-1" ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<rfc category="std" ipr="trust200902" docName="draft-ietf-mpls-inband-pm-encapsulation-05" consensus="true" submissionType="IETF">

<front>
  <title abbrev="Encap for MPLS PM with AMM"> Encapsulation For MPLS Performance Measurement with Alternate Marking Method </title>

  <author fullname="Weiqiang Cheng" initials="W" surname="Cheng">
      <organization>China Mobile</organization>
     <address>
       <postal>
         <street></street>

         <!-- Reorder these if your country does things differently -->

         <city>Beijing</city>

         <region></region>

         <code></code>

         <country>China</country>
       </postal>

       <phone></phone>

       <email>chengweiqiang@chinamobile.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
    </author>

  <author fullname="Xiao Min" initials="X" surname="Min" role="editor">
      <organization>ZTE Corp.</organization>
     <address>
       <postal>
         <street></street>

         <!-- Reorder these if your country does things differently -->

         <city>Nanjing</city>

         <region></region>

         <code></code>

         <country>China</country>
       </postal>

       <phone></phone>

       <email>xiao.min2@zte.com.cn</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
    </author>

  <author fullname="Tianran Zhou" initials="T" surname="Zhou">
      <organization>Huawei</organization>
     <address>
       <postal>
         <street></street>

         <!-- Reorder these if your country does things differently -->

         <city>Beijing</city>

         <region></region>

         <code></code>

         <country>China</country>
       </postal>

       <phone></phone>

       <email>zhoutianran@huawei.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
    </author>
	
  <author fullname="Ximing Dong" initials="X" surname="Dong">
      <organization>FiberHome</organization>
     <address>
       <postal>
         <street></street>

         <!-- Reorder these if your country does things differently -->

         <city>Wuhan</city>

         <region></region>

         <code></code>

         <country>China</country>
       </postal>

       <phone></phone>

       <email>dxm@fiberhome.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
    </author>
	
  <author fullname="Yoav Peleg" initials="Y" surname="Peleg">
      <organization>Broadcom</organization>
     <address>
       <postal>
         <street></street>

         <!-- Reorder these if your country does things differently -->

         <city></city>

         <region></region>

         <code></code>

         <country>United States of America</country>
       </postal>

       <phone></phone>

       <email>yoav.peleg@broadcom.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
    </author>

    <date year="2023"/>
  
    <area>Routing</area>
    <workgroup>MPLS Working Group</workgroup>

    <keyword>Request for Comments</keyword>
    <keyword>RFC</keyword>
    <keyword>Internet Draft</keyword>
    <keyword>I-D</keyword>

    <abstract>
   <t> This document defines the encapsulation for MPLS performance measurement with alternate marking 
   method, which performs flow-based packet loss, delay, and jitter measurements on MPLS live traffic.</t>
     </abstract>
    
</front>
  
<middle>

  <section title="Introduction">

   <t> <xref target="RFC9341"/> describes a performance measurement method, which can be used to measure packet 
   loss, delay, and jitter on live traffic. Since this method is based on marking consecutive batches of packets, 
   it's referred to as Alternate-Marking Method. <xref target="RFC8372"/> describes the desired capabilities for 
   MPLS flow identification, intended for in-band performance monitoring of MPLS flows.</t>
   
   <t> This document defines the encapsulation for MPLS performance measurement with alternate marking method, 
   which performs flow-based packet loss, delay, and jitter measurements on MPLS live traffic. The encapsulation 
   defined in this document supports performance monitoring at the intermediate nodes, as well as MPLS flow 
   identification at both transport and service layers.</t>
   
   <t> This document employs an encapsulation method, other than Synonymous Flow Label (SFL), to achieve MPLS flow 
   identification. The method described in this document is complementary to the SFL method <xref target="RFC8957"/> 
   <xref target="I-D.ietf-mpls-sfl-control"/>, the former mainly aims at hop-by-hop processing and the latter mainly 
   aims at edge-to-edge processing. Different sets of MPLS flows may use different methods.</t>
   
   <t> The method described in this document is also complementary to the In-situ OAM method <xref target="RFC9197"/> 
   <xref target="RFC9326"/>, the former doesn't introduce any new header whereas the latter introduces a new In-situ 
   OAM header. Furthermore, the former requires the network nodes to collect the data used for performance measurement, 
   while the latter requires the network nodes to collect the data used for operational and telemetry information collection. 
   An MPLS flow may apply both of the two methods concurrently.</t>
   
   <section title="Conventions Used in This Document">
   
    <section title="Abbreviations">
    <t> ACL: Access Control List</t>
    <t> BoS: Bottom of Stack</t>
    <t> cSPL: Composite Special Purpose Label</t>
    <t> ECMP: Equal-Cost Multipath</t>
    <t> ELC: Entropy Label Capability</t>
    <t> ERLD: Entropy Readable Label Depth</t>
    <t> eSPL: Extended Special Purpose Label</t>
    <t> FL: Flow-ID Label</t>
    <t> FLC: Flow-ID Label Capability</t>
    <t> FLI: Flow-ID Label Indicator</t>
    <t> FRLD: Flow-ID Readable Label Depth</t>
    <t> LSP: Label Switched Path</t>
    <t> MPLS: Multi-Protocol Label Switching</t>
    <t> NMS: Network Management System</t>
    <t> PHP: Penultimate Hop Popping</t>
    <t> PM: Performance Measurement</t>
    <t> PW: PseudoWire</t>
    <t> SFL: Synonymous Flow Label</t>
    <t> SID: Segment ID</t>
    <t> SR: Segment Routing</t>
    <t> TC: Traffic Class</t>
    <t> TTL: Time to Live</t>
    <t> VC: Virtual Channel</t>
    <t> VPN: Virtual Private Network</t>
    <t> XL: Extension Label</t>
    </section>
       
    <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>

  <section title="Flow-based PM Encapsulation in MPLS">

	<t> Flow-based MPLS performance measurement encapsulation with alternate marking method has the 
	following format:</t>
	 
     <figure anchor="Figure_1" title="Flow-based PM Encapsulation in MPLS">
     <artwork align="left"><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Extension Label (15)         |  TC |S|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Flow-ID Label Indicator (TBA1)    |  TC |S|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Flow-ID Label             |L|D|T|S|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ]]></artwork>
     </figure>
        
    <t>
	The Flow-ID Label Indicator (FLI) is an Extended Special Purpose Label (eSPL), which is combined with the Extension 
	Label (XL, value 15) to form a Composite Special Purpose Label (cSPL), as defined in <xref target="RFC9017"/>. The 
	FLI is defined in this document as value TBA1. 
	</t>
    <t>
	The Traffic Class (TC) and Time To Live (TTL) <xref target="RFC3032"/> for the XL and FLI SHOULD follow the same 
	field values of that label immediately preceding the XL. Otherwise, the TC and TTL for the XL and FLI MAY be different 
	values if it is known that the XL will not be exposed as the top label at any point along the LSP. The Bottom of Stack 
	(BoS) bit <xref target="RFC3032"/> for the XL and FLI MUST be zero.
	</t>
    <t>
	The Flow-ID Label (FL) is used as an MPLS flow identification <xref target="RFC8372"/>, its value MUST be unique 
	within the administrative domain. Flow-ID values can be allocated by an external NMS/controller, based on measurement 
	object instance such as LSP or PW. There is a one-to-one mapping between Flow-ID and flow. The specific method 
	on how to allocate the Flow-ID values is described in Section 4.
	</t>
    <t>
	The FL can be placed at either the bottom or the middle of the MPLS label stack, and the FL MAY appear multiple 
	times in a label stack. Section 2.1 of this document provides several examples to illustrate how to apply FL in a 
	label stack. The TTL for the FL MUST be zero to ensure that it is not used inadvertently for forwarding. The BoS bit 
	for the FL depends on whether the FL is placed at the bottom of the MPLS label stack.
	</t>
    <t>
	Besides the flow identification, a color-marking field is also necessary for alternate marking method. To achieve 
	the purpose of coloring the MPLS traffic, as well as the distinction between hop-by-hop measurement and edge-to-edge 
	measurement, the TC for the FL is defined as follows:
    <list style="symbols">
    <t>
	L(oss) bit is used for coloring the MPLS packets for loss measurement.
    </t>
    <t>
	D(elay) bit is used for coloring the MPLS packets for delay/jitter measurement.
    </t>
    <t>
    T(ype) bit is used to indicate the measurement type. When T bit is set to 1, that means edge-to-edge performance 
	measurement. When T bit is set to 0, that means hop-by-hop performance measurement.
    </t>
    </list>
	</t>
	 
	<section title="Examples for Applying Flow-ID Label in a label stack">
		 
    <t> Three examples on different layout of Flow-ID label (4 octets) are illustrated as follows:</t>
	
    <t> (1) Layout of Flow-ID label when applied to MPLS transport.</t>
		 
     <figure anchor="Figure_2" title="Applying Flow-ID to MPLS transport">
     <artwork align="center"><![CDATA[
+----------------------+
|          LSP         |
|         Label        |
+----------------------+ <--+
|       Extension      |    |
|         Label        |    |
+----------------------+    |--- cSPL
|     Flow-ID Label    |    |
|       Indicator      |    |
+----------------------+ <--+
|        Flow-ID       |
|         Label        |
+----------------------+
|      Application     |
|         Label        |
+----------------------+ <= Bottom of stack
|                      |
|        Payload       |
|                      |
+----------------------+
     ]]></artwork>
     </figure>
	 
     <t> Note that here if the penultimate hop popping (PHP) is in use, the PHP LSR that recognizes the cSPL MAY choose 
	 not to pop the cSPL and the following Flow-ID label, otherwise the egress LSR would be excluded from the performance 
	 measurement.</t>
	 
     <t> Also note that in other examples of applying Flow-ID to MPLS transport, one LSP label can be substituted by multiple 
	 SID labels in the case of using SR Policy, and the combination of cSPL and Flow-ID label can be placed between SID labels, 
	 as specified in Section 5.</t>
        
    <t> (2) Layout of Flow-ID label when applied to MPLS service.</t>
		 
     <figure anchor="Figure_3" title="Applying Flow-ID to MPLS service">
     <artwork align="center"><![CDATA[
+----------------------+
|          LSP         |
|         Label        |
+----------------------+
|      Application     |
|         Label        |
+----------------------+ <--+
|       Extension      |    |
|         Label        |    |
+----------------------+    |--- cSPL
|     Flow-ID Label    |    |
|       Indicator      |    |
+----------------------+ <--+
|        Flow-ID       |
|         Label        |
+----------------------+ <= Bottom of stack
|                      |
|        Payload       |
|                      |
+----------------------+
     ]]></artwork>
     </figure>
	 
     <t> Note that here the application label can be MPLS PW label, MPLS Ethernet VPN label or MPLS IP VPN label, and 
	 it's also called VC label as defined in <xref target="RFC4026"/>.</t>
        
    <t> (3) Layout of Flow-ID label when applied to both MPLS transport and MPLS service.</t>
		 
     <figure anchor="Figure_4" title="Applying Flow-ID to both MPLS transport and MPLS service">
     <artwork align="center"><![CDATA[
+----------------------+
|          LSP         |
|         Label        |
+----------------------+ <--+
|       Extension      |    |
|         Label        |    |
+----------------------+    |--- cSPL
|     Flow-ID Label    |    |
|       Indicator      |    |
+----------------------+ <--+
|        Flow-ID       |
|         Label        |
+----------------------+
|      Application     |
|         Label        |
+----------------------+ <--+
|       Extension      |    |
|         Label        |    |
+----------------------+    |--- cSPL
|     Flow-ID Label    |    |
|       Indicator      |    |
+----------------------+ <--+
|        Flow-ID       |
|         Label        |
+----------------------+ <= Bottom of stack
|                      |
|        Payload       |
|                      |
+----------------------+
     ]]></artwork>
     </figure>
	
     <t> Note that for this example the two Flow-ID values appearing in a label stack MUST be different, that 
	 is to say, the Flow-ID label applied to MPLS transport and the Flow-ID label applied to MPLS service share the same 
	 value space. Also note that the two Flow-ID label values are independent from each other, e.g., two packets can 
	 belong to the same VPN flow but two different LSP flows, or two packets can belong to two different VPN flows 
	 but the same LSP flow.</t>
	 
    </section>
  </section> 

  <section title="Procedures of Encapsulation, Look-up and Decapsulation"> 
  
    <t>
    The procedures for Flow-ID label encapsulation, look-up and decapsulation are summarized as follows:
    <list style="symbols">
    <t>
    The ingress node inserts the XL, FLI and FL into the MPLS label stack. At the same time, the ingress node sets the 
	Flow-ID value, the two color-marking bits and the T bit, as defined in Section 2.
    </t>
    <t>
    If the hop-by-hop measurement is applied, i.e., the T bit is set to 0, then whether the transit node or the egress 
	node is the processing node. If the edge-to-edge measurement is applied, i.e., the T bit is set to 1, then only the 
	egress node is the processing node. The processing node looks up the FL with the help of the XL and FLI, and exports 
	the collected data, such as the Flow-ID, block counters and timestamps, to an external NMS/controller, referring to 
	the alternate marking method. Note that while looking up the Flow-ID label, the transit node needs to perform 
	some deep packet inspection beyond the label (at the top of the label stack) used to take forwarding decisions.
    </t>
    <t>
    The processing node may also pop the XL, FLI and FL from the MPLS label stack. The egress node pops the whole MPLS 
	label stack, and this document doesn't introduce any new process to the decapsulated packet.
    </t>
    </list>
    </t>
  
  </section>
  
  <section title="Procedures of Flow-ID allocation"> 
  
    <t>
    There are two ways of allocating Flow-ID, one way is to allocate Flow-ID by manual trigger from the network 
	operator, and the other way is to allocate Flow-ID by automatic trigger from the ingress node. Details are as follows:
    <list style="symbols">
    <t>
    In the case of manual trigger, the network operator would manually input the characteristics (e.g. IP five 
	tuples and IP DSCP) of the measured flow, then the NMS/controller would generate one or two 
	Flow-IDs based on the input from the network operator, and provision the ingress node with the characteristics 
	of the measured flow and the corresponding allocated Flow-ID(s).
    </t>
    <t>
    In the case of automatic trigger, the ingress node would identify the flow entering the measured path, 
	export the characteristics of the identified flow to the NMS/controller by IPFIX <xref target="RFC7011"/>, 
	then the NMS/controller would generate one or two Flow-IDs based on the characteristics exported from the ingress node, 
	and provision the ingress node with the characteristics of the identified flow and the corresponding allocated Flow-ID(s).
    </t>
    </list>
    </t>
    <t>
    The policy pre-configured at the NMS/controller decides whether one Flow-ID or two Flow-IDs would be generated. 
	If the performance measurement on MPLS service is enabled, then one Flow-ID applied to MPLS service would be generated; 
	If the performance measurement on MPLS transport is enabled, then one Flow-ID applied to MPLS transport would be generated; 
	If both of them are enabled, then two Flow-IDs respectively applied to MPLS service and MPLS transport would be generated, 
	in this case, the transit node needs to look up both of the two Flow-IDs by default, and that can be changed by configuration 
	to, e.g., look up only the Flow-ID applied to MPLS transport.
    </t>
    <t>
    Whether using manual trigger or automatic trigger, the NMS/controller MUST guarantee every generated Flow-ID is unique 
	within the administrative domain and MUST NOT have a value in the reserved label space (0-15) <xref target="RFC3032"/>.
    </t>
  
  </section>
  
  <section title="FLC and FRLD Considerations">
  
  <t> Analogous to the Entropy Label Capability (ELC) defined in Section 5 of <xref target="RFC6790"/> and the 
  Entropy Readable Label Depth (ERLD) defined in Section 4 of <xref target="RFC8662"/>, the Flow-ID Label 
  Capability (FLC) and the Flow-ID Readable Label Depth (FRLD) are defined in this document. Both FLC and FRLD have 
  the similar semantics with the ELC and ERLD to a router, except that the Flow-ID is used in its flow identification 
  function while the Entropy is used in its load-balancing function.</t>
  
  <t> The ingress node MUST insert each FL at an appropriate depth, which ensures the node to which the 
  FL is exposed has the FLC. The ingress node SHOULD insert each FL within an appropriate FRLD, which is the 
  minimum FRLD of all the on-path nodes that need to read and use the FL in question. How the ingress node knows 
  the FLC and FRLD of all the on-path nodes is outside the scope of this document, whereas 
  <xref target="I-D.xzc-lsr-mpls-flc-frld"/> provides a method to achieve that.</t>
  
  <t> When the SR paths are used for transport, the label stack grows as the number of on-path segments increases, if 
  the number of on-path segments is high, that may become a challenge for the FL to be placed within an 
  appropriate FRLD. In order to overcome this potential challenge, an implementation MAY provide flexibility to 
  the ingress node to place FL between SID labels, i.e., multiple identical FLs at different depths MAY be 
  interleaved with SID labels, when that happens a sophisticated network planning may be needed and it's beyond 
  the scope of this document.</t>
   
  </section>
  
  <section title="Equal-Cost Multipath Considerations">
  
  <t> Analogous to what's described in Section 5 of <xref target="RFC8957"/>, under conditions of Equal-Cost Multipath 
  (ECMP), the introduction of the FL may lead to the same problem as caused by the SFL, and the two solutions proposed 
  for SFL would also apply here.</t>
   
  </section>
  
  <section title="Security Considerations">
  <t> This document introduces the performance measurement domain that is the scope of a Flow-ID label. 
  The Flow-ID Label Indicator and Flow-ID label MUST NOT be signaled and distributed outside one performance 
  measurement domain. Improper configuration so that the Flow-ID label being passed from one domain to another 
  would likely result in potential Flow-ID conflicts.</t>

  <t> To prevent packets carrying Flow-ID label from leaking from one domain to another, the domain boundary 
  nodes SHOULD deploy some policies (e.g., ACL) to filter out the packets.  Specifically, in the sending edge, 
  the domain boundary node SHOULD filter out the packets that carry the Flow-ID Label Indicator and are sent 
  to other domain; in the receiving edge, the domain boundary node SHOULD drop the packets that carry the 
  Flow-ID Label Indicator and are from other domains.</t>
  </section>
  
  <section title="IANA Considerations"> 
  <t> In the Special-Purpose MPLS Label Values registry, a new Extended Special-Purpose MPLS Label Value for 
  the Flow-ID Label Indicator is requested from IANA as follows:</t>
     <texttable anchor="Table_1" title="New Extended Special-Purpose MPLS Label Value for Flow-ID Label Indicator">

         <ttcol align="left">Extended Special-Purpose MPLS Label Value</ttcol>

         <ttcol align="left">Description</ttcol>
		 
         <ttcol align="left">Semantics Definition</ttcol>

         <ttcol align="left">Reference</ttcol>

         <c>TBA1</c>

         <c>Flow-ID Label Indicator</c>

         <c>Section 2</c>

         <c>This Document</c>

     </texttable>
  </section>

  <section title="Acknowledgements">
  <t> The authors would like to acknowledge Loa Andersson, Tarek Saad, Stewart Bryant, Rakesh Gandhi, Greg Mirsky, 
  Aihua Liu, Shuangping Zhan, Ming Ke, and Wei He for their careful review and very helpful comments.</t>
  <t> The authors would like to acknowledge Italo Busi and Chandrasekar Ramachandran for their insightful MPLS-RT 
  review and very helpful comments.</t>
  </section> 

  <section title="Contributors">   
  <t>Minxue Wang<br/>China Mobile<br/>Email: wangminxue@chinamobile.com</t>    
  <t>Wen Ye<br/>China Mobile<br/>Email: yewen@chinamobile.com</t>    
  </section>   
  
</middle>
  
<back>

    <references title="Normative References">
     <?rfc include="reference.RFC.2119"?>
     <?rfc include="reference.RFC.8174"?>
     <?rfc include="reference.RFC.3032"?>
     <?rfc include="reference.RFC.9017"?>
     <?rfc include="reference.RFC.9341"?>
    </references>
	
    <references title="Informative References">
     <?rfc include="reference.RFC.4026"?>
     <?rfc include="reference.RFC.7011"?>
     <?rfc include="reference.RFC.8372"?>
     <?rfc include="reference.RFC.6790"?>
     <?rfc include="reference.RFC.8662"?>
     <?rfc include="reference.RFC.8957"?>
     <?rfc include="reference.RFC.9197"?>
     <?rfc include="reference.RFC.9326"?>
     <?rfc include="reference.I-D.ietf-mpls-sfl-control"?>
     <?rfc include="reference.I-D.xzc-lsr-mpls-flc-frld"?>
    </references>

</back>
</rfc>