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

<!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-liu-mpls-mna-sr-service-metadata-01"
      ipr="trust200902"
      obsoletes=""
      updates=""
      submissionType="IETF"
      xml:lang="en"
      tocInclude="true"
      tocDepth="4"
      symRefs="true"
      sortRefs="true"
      version="3">

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

 <front>

   <title abbrev="MNA for Metadata">MNA for Metadata in SR-MPLS Service Programming</title>
    <seriesInfo name="Internet-Draft" value="draft-liu-mpls-mna-sr-service-metadata-01"/>
   <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>
 
    <date year="2025"/>

   <!-- Meta-data Declarations -->

   <area>RTG</area>
    <workgroup>MPLS</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>MNA</keyword>
   <keyword>SR</keyword>
   <keyword>metadata</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 defines MPLS Network Action(MNA) encoding to carry metadata in SR service programming with SR-MPLS data plane. </t>
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>
	  <t><xref target="I-D.ietf-spring-sr-service-programming"></xref> defines data plane functionality required to implement service segments and achieve service programming in SR-enabled MPLS and IPv6 networks. Metadata<xref target="RFC7665" format="default"></xref> provides contextual information about the data packets which traverse a programmed service path.</t>
	<t>However, there's yet no standard method to carry service metadata with the SR-MPLS data plane, which make the solution for service programming in SR-MPLS incomplete</t>
	<t>MPLS Network Action (MNA) <xref target="I-D.ietf-mpls-mna-fwk"></xref> is used to indicate action for Label Switched Paths (LSPs) and/or MPLS packets, and to transfer data needed for the action. <xref target="I-D.ietf-mpls-mna-hdr"></xref> defines the MNA sub-stack solution for carrying Network Action Indicators and Ancillary Data in the label stack.</t>
<t>This document defines MPLS Network Action(MNA) encoding to carry metadata in SR service programming with SR-MPLS data plane.</t>

	  </section>

<section numbered="true" toc="default">
        <name>Terminology</name>
<section numbered="true" toc="default">
        <name>Acronyms</name>
<t>HBH: Hop-By-Hop</t>
<t>I2E: Ingress-To-Egress</t>
<t>IHS: Ingress-To-Egress (I2E), Hop-By-Hop (HBH) or Select Scope</t>
<t>ISD: In-Stack Data</t>
<t>PSD: Post-Stack Data</t>
<t>PSH: Post-Stack Header</t>
<t>LSE: Label Stack Entry</t>
<t>MPLS: Multiprotocol Label Switching</t>
<t>MNA: MPLS Network Action</t>
	  </section>		
	  <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>	  
	  
<section numbered="true" toc="default">
        <name>MPLS Network Action ISD encoding for Metadata in SR-MPLS Service Programming</name>
		<t>The metadata in SR-MPLS Service Programming is placed as part of the ISD block in an MPLS label stack according to the MNA encoding principles defined in <xref target="I-D.ietf-mpls-mna-hdr"></xref>. Two types of metadata for SR-MPLS service programming are defined: fixed-length service metadata and variable-length service metadata.</t>
		
		<section numbered="true" toc="default">
        <name>Fixed-Length Service Metadata</name>		
			<t>The format of fixed-length service metadata is shown as follows,</t>		
			<artwork align="center" name="Fixed-Length Service Metadata"><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               MNA Label               | TC  |S|    TTL        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Opcode = TBA1 |   Service Metadata    |R|IHS|S|U| NASL  | NAL |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|                       Service Metadata    |S|               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|                       Service Metadata    |S|               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|                       Service Metadata    |S|               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>	

<t>Where:</t>
		<ul spacing="normal">
        <li>The MNA Label is defined in <xref target="I-D.ietf-mpls-mna-hdr"></xref>.</li>
		<li>S: the Bottom of Stack field [RFC3032].</li>
		<li>Opcode: TBA1, indicating the fixed-length service metadata.</li>
		<li>R,IHS and U fields are set as specified in <xref target="I-D.ietf-mpls-mna-hdr"></xref>.</li>
		<li>NASL: The Network Action Sub-Stack Length (NASL) as specified in <xref target="I-D.ietf-mpls-mna-hdr"></xref>. The value is 3.</li>
		<li>NAL: Network Action Length as specified in <xref target="I-D.ietf-mpls-mna-hdr"></xref>. The number of extra LSEs used for Service metadata encoding. The value is 3.</li>
		<li>Service Metadata: 102-bit field to carry metadata. No assumption is made by this document on the structure or the content of the carried metadata.</li>
		</ul>		   
		   
      </section>	
	  
	<section numbered="true" toc="default">
        <name>Variable-Length Service Metadata</name>
		<t>It should be noticed that although it is called "variable-length", the length of this service metadata MUST NOT be changed on the fly.</t>		
		<t>The format of variable-length service metadata is shown as follows,</t>			
		  <artwork align="center" name="Variable-Length Service Metadata"><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               MNA Label               | TC  |S|    TTL        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Opcode = TBA2 |  MD Class |   Type    |R|IHS|S|U| NASL  | NAL |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~1|                     Service Metadata      |S|               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>		

<t>Where:</t>
		<ul spacing="normal">
        <li>The MNA Label is defined in <xref target="I-D.ietf-mpls-mna-hdr"></xref>.</li>
		<li>S: the Bottom of Stack field [RFC3032].</li>
		<li>Opcode: TBA2, indicating the variable-length service metadata.</li>
		<li>R,IHS and U fields are set as specified in <xref target="I-D.ietf-mpls-mna-hdr"></xref>.</li>
		<li>NASL: The Network Action Sub-Stack Length (NASL) as specified in <xref target="I-D.ietf-mpls-mna-hdr"></xref>. </li>
		<li>NAL: Network Action Length as specified in <xref target="I-D.ietf-mpls-mna-hdr"></xref>. The number of extra LSEs used for Service metadata encoding.</li>
		 <li>Metadata Class (MD Class): Defines the scope of the Type field to provide a hierarchical namespace. </li>
		 <li>Type: Indicates the explicit type of metadata being carried.  The definition of the Type is the responsibility of the MD Class owner.</li>
		<li>Service Metadata: The field length depends on the value of NAL.</li>
		</ul>			   
		   
      </section>			
	
		
      </section>	

<section numbered="true" toc="default">
        <name>Post-Stack MNA Encoding for Metadata in SR-MPLS Service Programming</name>

		<t>The presence of Post-Stack Header is indicated in an In-Stack Network Action Sub-stack as defined in <xref target="I-D.ietf-mpls-mna-ps-hdr"></xref> and is shown as below.</t>
		<artwork align="center" name="An Example of In-Stack Network Action Sub-Stack with Post-Stack Header Carrying Metadata"><![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |               MNA Label               | TC  |S|  TTL          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  Opcode     |      Data               |P|IHS|S|U| NASL  | NAL |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Label                  | TC  |1|  TTL          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                   Post-Stack Service Metadata                 ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
 ~                 Optional Payload + Padding                    ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]></artwork>	
	
		<ul spacing="normal">
        <li>The MNA Label is defined in <xref target="I-D.ietf-mpls-mna-hdr"></xref>.</li>
		<li>P flag is set as specified in <xref target="I-D.ietf-mpls-mna-ps-hdr"></xref></li>
		<li>The IHS scope field defined in <xref target="I-D.ietf-mpls-mna-hdr"></xref> is used to indicate that I2E or HBH or Select processing is required for the Network Action and Ancillary Data.</li>
		<li>S: the Bottom of Stack field [RFC3032].</li>
		<li>U: set as specified in <xref target="I-D.ietf-mpls-mna-hdr"></xref>.</li>
		<li>NASL: The Network Action Sub-Stack Length (NASL) as specified in <xref target="I-D.ietf-mpls-mna-hdr"></xref>. </li>
		<li>NAL: Network Action Length as specified in <xref target="I-D.ietf-mpls-mna-hdr"></xref>. The value is 0.</li>
		<li>Opcode: TBA3, In-Stack Network Action for the service metadata in PSH.</li>
		<li>Data (10 bits, next to the Opcode field) in the LSE contains the offset for PSH for this In-Stack Network Action in 4-octets units after BOS LSE to the start of the corresponding Post-Stack Network Action Opcode. Due to the Post-Stack Header type top-header, minimum value for the offset is 1 (i.e, 4-octets).</li>
		<li>Post-Stack Service Metadata: the service metadata carried in PSH, see section 4.1 and section 4.2. </li>		
		</ul>
		

<section numbered="true" toc="default">
        <name>Post-Stack Fixed-Length Metadata in SR-MPLS Service Programming</name>
		
<t>The encoding of the post-stack variable-length service metadata is shown as follows,</t>		
<artwork align="center" name="Post-Stack Fixed-Length Metadata">		
<![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                     Post-Stack MNA Header                     |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
 |MNA-PS-OP    |R|R|   PS-NAL    |     Service Metadata          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 |                      Service Metadata                         |
 |                                                               | 
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|		
            ]]></artwork>

<t>Where:</t>
		<ul spacing="normal">
        <li>Post-Stack MNA Header: the top-level header for all the Post-Stack Network Actions that are encoded as defined in  <xref target="I-D.ietf-mpls-mna-ps-hdr"></xref>.</li>
		<li>MNA-PS-OP: TBA4 for post-stack fixed -length service metadata.</li>
		<li>R (2 bits): Reserved bits.</li>
		<li>PS-NAL (7 bits): Post-Stack Network Action Length in 4-octet units as  in  <xref target="I-D.ietf-mpls-mna-ps-hdr"></xref>. This excludes the first 4-octets starting PS-MNA-OP. The value is 3.</li>
		<li>Service Metadata: 14-byte field carrying the service metadata. No assumption is made by this document on the structure or the content of the carried metadata.</li>
		</ul>	
			
</section>
	
<section numbered="true" toc="default">
        <name>Post-Stack Variable-Length Metadata in SR-MPLS Service Programming</name>
		
		<t>The encoding of the post-stack variable-length service metadata is shown as follows,</t>	
<artwork align="center" name="Post-Stack Variable-Length Metadata">		
<![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                     Post-Stack MNA Header                     |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
 |MNA-PS-OP    |R|R|   PS-NAL    |   MD Class    |     Type      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                      Service Metadata                         ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|		
            ]]></artwork>

<t>Where:</t>
		<ul spacing="normal">
        <li>Post-Stack MNA Header: the top-level header for all the Post-Stack Network Actions that are encoded as defined in  <xref target="I-D.ietf-mpls-mna-ps-hdr"></xref>.</li>
		<li>MNA-PS-OP: TBA5 for post-stack variable-length service metadata.</li>
		<li>R (2 bits): Reserved bits.</li>
		<li>PS-NAL (7 bits): Post-Stack Network Action Length in 4-octet units as  in  <xref target="I-D.ietf-mpls-mna-ps-hdr"></xref>. This excludes the first 4-octets starting PS-MNA-OP.</li>
		<li>Metadata Class (MD Class): Defines the scope of the Type field to provide a hierarchical namespace. </li>
		<li>Type: Indicates the explicit type of metadata being carried.  The definition of the Type is the responsibility of the MD Class owner.</li>	
		<li>Service Metadata:  Metadata for SR-MPLS Service Programming, the length of field depends in the value of PS-NAL.</li>
		</ul>	
		
</section>	  
	  

</section>
	  
<section numbered="true" toc="default">
	<name>IANA Considerations</name>
	
	<section numbered="true" toc="default">
	<name>In-Stack MPLS Network Action Opcodes</name>	
		<t>IANA is requested to assign codepoints from its Network Action Opcodes registry (creation requested in <xref target="I-D.ietf-mpls-mna-hdr"></xref>) as specified in Table 1.</t>
		
		  <artwork align="center" name=""><![CDATA[
+------+--------------------------------+-------------+
|Opcode|              Name              |  Reference  | 
|      |                                |             |
+------+--------------------------------+-------------+
| TBA1 | In-Stack Network Action for    |             |
|      | Fixed-Length Service Metadata  |This document|
|      |            in ISD              |             |
+------+--------------------------------+-------------+
| TBA2 | In-Stack Network Action for    |             |
|      |Variable-Length Service Metadata|This document|
|      |            in ISD              |             |	 
+------+--------------------------------+-------------+
| TBA3 | In-Stack Network Action for    |This document|
|      |  Service Metadata in PSH       |             |
+------+--------------------------------+-------------+		 
      ]]></artwork>
	</section>
	<section numbered="true" toc="default">	
	<name>Post-Stack MPLS Network Action Opcodes</name>			
		<t>IANA is requested to assign codepoints for the Post-Stack Network Action for the post-stack service metadata from the Post-Stack Network Action Opcodes registry (to be created by in <xref target="I-D.ietf-mpls-mna-hdr"></xref>).</t>

		  <artwork align="center" name=""><![CDATA[
+------+--------------------------------+-------------+
|Opcode|              Name              |  Reference  | 
|      |                                |             |
+------+--------------------------------+-------------+
| TBA4 | Post-Stack Network Action for  |This document|
|      | Fixed-Length Service Metadata  |             |
+------+--------------------------------+-------------+
| TBA5 | Post-Stack Network Action for  |This document|
|      |Variable-Length Service Metadata|             |
+------+--------------------------------+-------------+ 
           ]]></artwork>
	
	</section>


	</section>
	
<section numbered="true" toc="default">
	<name>Security Considerations</name>
<t>Security considerations discussed in  <xref target="I-D.ietf-mpls-mna-fwk"></xref>, <xref target="I-D.ietf-mpls-mna-hdr"></xref>, <xref target="I-D.ietf-mpls-mna-ps-hdr"></xref> and <xref target="I-D.ietf-spring-sr-service-programming"></xref> apply to this document.</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.I-D.ietf-mpls-mna-fwk.xml'?>
		<?rfc include='reference.I-D.ietf-mpls-mna-hdr.xml'?>
		<?rfc include='reference.I-D.ietf-mpls-mna-ps-hdr.xml'?>
		<?rfc include='reference.I-D.ietf-spring-sr-service-programming.xml'?>		
      </references>
      <references>
        <name>Informative References</name>
		<?rfc include="reference.RFC.7665.xml"?>
		<?rfc include="reference.RFC.8300.xml"?>	
      </references>
    </references>


 </back>
</rfc>
