<?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" ipr="trust200902" docName="draft-ietf-sfc-nsh-tlv-14">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<front>
	<title abbrev="NSH MD2 Context Headers">Network Service Header Metadata Type 2 Variable-Length Context Headers</title>
	
	      <author fullname="Yuehua Wei" initials="Yuehua" role="editor" surname="Wei">
      <organization>ZTE Corporation</organization>

      <address>
        <postal>

			<street>No.50, Software Avenue</street>
			
			<city>Nanjing</city>
			
			<region/>
			
			<code>210012</code>
			
			<country>China</country>

        </postal>     
        <email>wei.yuehua@zte.com.cn</email>
      </address>
    </author>
    
 	<author initials="U." surname="Elzur" fullname="Uri Elzur">
		<organization>Intel</organization>
		<address>
			<email>uri.elzur@intel.com</email>
		</address> 
	</author>

 	<author initials="S." surname="Majee" fullname="Sumandra Majee">
		<organization>Individual contributor</organization>
		<address>
			<email>Sum.majee@gmail.com</email>
		</address> 
	</author>
 	<author initials="C." surname="Pignataro" fullname="Carlos Pignataro">
		<organization>Cisco</organization>
		<address>
			<email>cpignata@cisco.com</email>
		</address> 
	</author>
 	<author initials="D." surname="Eastlake" fullname="Donald E. Eastlake">
		<organization>Futurewei Technologies</organization>
		<address>
			<email>d3e3e3@gmail.com</email>
		</address> 
	</author>    
    <date year="2022"/>

    <area>Routing</area>

    <workgroup>SFC</workgroup>

	
	<abstract>
	<t>
   Service Function Chaining (SFC) uses the Network Service Header (NSH) (RFC 8300) to steer and provide context Metadata (MD) with each packet. Such Metadata can be of various Types including MD Type 2 variable length context headers. This document specifies several such context headers that can be used within a service function path.
	 </t>
	</abstract>
</front>

<middle>
  <section anchor="intro" title="Introduction">
 <t>
   The Network Service Header (NSH) <xref target="RFC8300"/> is the
   Service Function Chaining (SFC) encapsulation that supports the SFC architecture <xref target="RFC7665"/>.  As such, the NSH provides following key elements:
   <list style="numbers">
   <t>Service Function Path (SFP) identification.</t>
   <t>Indication of location within a Service Function Path.</t>
   <t>Optional, per-packet metadata (fixed-length or variable-length).</t>
   </list>
 </t>
 <t>
    <xref target="RFC8300"/> further defines two metadata formats (MD Types): 1 and 2.  MD
   Type 1 defines the fixed-length, 16-octet long metadata, whereas MD Type 2
   defines a variable-length context format for metadata.  This document defines several common metadata context headers for use with NSH MD Type 2. These supplement the Subscriber Identity and Performance Policy MD Type 2 metadata context headers specified in <xref target="RFC8979"/>.
   </t>
   <t>
      This document does not address metadata usage, updating/chaining of
   metadata, or other SFP functions.  Those topics are described in <xref target="RFC8300"/>.
   </t>
   </section>
         
      <section title="Conventions used in this document">

         <section title="Terminology">

            <t>This document uses the terminology defined in the SFC Architecture <xref target="RFC7665"/> and the Network Service Header <xref target="RFC8300"/>.</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 anchor="nsh-t2-format-sec" title="NSH MD Type 2 format">
  <t>
   An NSH is composed of a 4-octet Base Header, a 4-octet Service Path
   Header and optional Context Headers.  The Base Header identifies the MD-Type
   in use:
             <figure align="center" anchor="nsh-base-hdr-fig" title="NSH Base Header">
          <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Ver|O|U|    TTL    |   Length  |U|U|U|U|MD Type| Next Protocol |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    ]]></artwork>
        </figure>
  Please refer to NSH <xref target="RFC8300"/> for a detailed header description.
</t>
<t>
   When the base header specifies MD Type = 0x2, zero or more Variable
   Length Context Headers MAY be added, immediately following the
   Service Path Header. <xref target="nsh-tlv-fig"/> below depicts the format of the Context Header
   as defined in Section 2.5.1 of <xref target="RFC8300"/>.
   <figure align="left" anchor="nsh-tlv-fig" title="NSH Variable-Length Context Headers">
   <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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |          Metadata Class       |      Type     |U|    Length   |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                   Variable-Length Metadata                    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
   </t>
</section>

<section anchor="nsh-tlvs-sec" title="NSH MD Type 2 Context Headers">

<t>
   <xref target="RFC8300"/> specifies Metadata Class 0x0000 as IETF Base NSH MD Class.  In this document, metadata types are defined for the IETF Base NSH MD Class.
            </t>
<section anchor="fwd-context-sec" title="Forwarding Context">
<t>
       This metadata context carries a network forwarding context, used for
       segregation and forwarding scope.  Forwarding context can take
       several forms depending on the network environment.  For example, VXLAN/VXLAN-GPE VNID, VRF identification, or VLAN.

	   
	   
		<figure align="left" anchor="fwd-context-fig1" title="Forwarding Context - 1(VLAN)">
				<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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |    Metadata Class = 0x0000    |  Type = TBA1  |U|  Length = 4 |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |CT=0x0 |             Reserved          |        VLAN ID        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    ]]></artwork>
		</figure>
		<figure align="left" anchor="fwd-context-fig2" title="Forwarding Context - 2(QinQ)">
				<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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |    Metadata Class = 0x0000    |  Type = TBA1  |U|  Length = 4 |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |CT=0x1 |Resv   |     Service VLAN ID   |    Customer VLAN ID   |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    ]]></artwork>
		</figure>	   
		<figure align="left" anchor="fwd-context-fig3" title="Forwarding Context - 3(MPLS VPN)">
				<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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |    Metadata Class = 0x0000    |  Type = TBA1  |U|  Length = 4 |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |CT=0x2 |   Reserved    |              MPLS VPN Label           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    ]]></artwork>
		</figure>

		<figure align="left" anchor="fwd-context-fig4" title="Forwarding Context - 4(VNI)">
				<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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |    Metadata Class = 0x0000    |  Type = TBA1  |U|  Length = 4 |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |CT=0x3 | Resv  |            Virtual Network Identifier         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    ]]></artwork>
		</figure>
		
        <figure align="left" anchor="fwd-context-fig5" title="Forwarding Context - 5(Session ID)">
			<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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |    Metadata Class = 0x0000    |  Type = TBA1  |U|  Length = 8 |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |CT=0x4 |             Reserved                                  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            Session ID                         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
       </t>
       <t>
       where:
       <list>
       <t>Context Type (CT) is four bits-long field that defines the length and the interpretation of the Forwarding Context field. Please see the IANA Considerations in <xref target="iana-fc-type"/>. This document defines these CT values:
			<list style="simbols">
			<t>0x0 - 12 bits VLAN identifier <xref target="IEEE.802.1Q_2018"/>. See <xref target='fwd-context-fig1'/>. </t>
			<t>0x1 - 24 bits double tagging identifiers. A service VLAN tag followed by a customer VLAN tag <xref target="IEEE.802.1Q_2018"/>. The two VLAN IDs are concatenated and appear in the same order that they appeared in the payload.
			See <xref target='fwd-context-fig2'/>.</t>	   
			<t>0x2 - 20 bits MPLS VPN label(<xref target="RFC3032"/>)(<xref target="RFC4364"/>). See <xref target='fwd-context-fig3'/>.</t>
			<t>0x3 - 24 bits virtual network identifier (VNI)<xref target="RFC8926"/>. See <xref target='fwd-context-fig4'/>. </t>
			<t>0x4 - 32 bits Session ID (<xref target="RFC3931"/>). This is called Key in GRE <xref target="RFC2890"/>. See <xref target='fwd-context-fig5'/>.	</t>
			</list>
			Reserved bits in the context fields MUST be sent as zero and ignored on receipt.
       </t>
       </list>
	 
       </t>
     </section>
 
	 
<section anchor="tenant-sec" title="Tenant Identifier">
<t>
       Tenant identification is often used for segregation within a
       multi-tenant environment.  Orchestration system-generated tenant
       IDs are an example of such data. This context header carries the value of the Tenant identifier. <xref target="OpenDaylight-VTN"/> Virtual Tenant Network (VTN) is an application that provides multi-tenant virtual network on an SDN controller.
        <figure align="left" anchor="tenant-fig" title="Tenant Identifier List">
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Metadata Class = 0x0000    |  Type = TBA2  |U| Length = var|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   ~                         Tenant ID                             ~
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
       </t>
	   
     <t>The fields are described as follows:
         <list>
         <t>Length: Indicates the length of the Tenant ID in octets (see Section 2.5.1 of <xref target="RFC8300"/>).</t>
         
         <t>Tenant ID: Represents an opaque value pointing to Orchestration system-generated tenant identifier. The structure and semantics of this field are specific to the operator's deployment across its operational domain, and are specified and assigned by an orchestration function. The specifics of that orchestration-based assignment are outside the scope of this document.</t>
	     </list>
	 </t>

</section>
  
     
    <section anchor="ingress-net-nodeid-sec" title="Ingress Network Node Information">
<t>
       This context header carries a Node ID of the ingress network node.
        <figure align="left" anchor="ingress-net-nodeid-fig" title="Ingress Network Node ID">
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Metadata Class = 0x0000    |  Type = TBA3  |U| Length = var|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   ~                        Node ID                                ~
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
       </t>
<t>
   The fields are described as follows:
   <list>
        <t>Length: Indicates the length of the Node ID in octets (see Section 2.5.1 of <xref target="RFC8300"/>).</t>
        
        <t>Node ID: Represents an opaque value of the ingress network node ID. The structure and semantics of this field are deployment specific. For example, Node ID may be a 4 octets IPv4 address Node ID, or a 16 octets IPv6 address Node ID, or a 6 octets MAC address, or 8 octets MAC address (EUI-64), etc.</t>
   </list>	   
</t>
</section>
	 
<section anchor="ingress-net-sitf-sec" title="Ingress Network Source Interface">
<t>This context identifies the ingress interface of the ingress network node. The l2vlan (135), l3ipvlan (136), ipForward (142), mpls (166) in <xref target="IANAifType"/> are examples of source interfaces.
<figure align="left" anchor="ingress-net-sitf-fig" title="Ingress Network Source Interface">
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Metadata Class = 0x0000    |  Type = TBA4  |U| Length = var|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   ~                     Source Interface                          ~
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
</t>
	<t>The fields are described as follows:
	<list>
	<t>Length: Indicates the length of the Source Interface in octets (see Section 2.5.1 of <xref target="RFC8300"/>).</t>
    <t>Source Interface: Represents an opaque value of identifier of the ingress interface of the ingress network node.</t>
	</list>
	</t>
</section>
	 
    <section anchor="flow-id-sec" title="Flow ID">
<t>
    Flow ID provides a field in the NSH MD Type 2 to label packets belonging to the same flow. For example, <xref target="RFC8200"/> defined IPv6 Flow Label as Flow ID, <xref target="RFC6790"/> defined an entropy label which is generated based on flow information in the MPLS network is another example of Flow ID. Absence of this field, or
    a value of zero denotes that packets have not been labeled.
</t>
<t>   
    <figure align="left" anchor="flow-id-ipv6-fig1" title="IPv6 Flow ID">
    <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Metadata Class = 0x0000    |  Type = TBA5  |U| Length = 4  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |CT=0x0 |   Reserved    |           IPv6 Flow ID                |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
    </figure>
</t>
<t>   
    <figure align="left" anchor="flow-id-mplse-fig2" title="MPLS entropy label">
    <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Metadata Class = 0x0000    |  Type = TBA5  |U| Length = 4  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |CT=0x1 |   Reserved    |        MPLS entropy label             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
    </figure>
</t>
<t>
   The fields are described as follows:
   <list>
		<t>Length: Indicates the length of the Flow ID in octets (see Section 2.5.1 of <xref target="RFC8300"/>). For example, IPv6 Flow Label in <xref target="RFC8200"/> is 20-bit long. An entropy label in the MPLS network in <xref target="RFC6790"/> is also 20-bit long. </t>

       <t>Context Type (CT) is four bits-long field that defines the length and the interpretation of the Flow ID field. Please see the IANA Considerations in <xref target="iana-tlv-flowid-type"/>. This document defines these CT values:
			<list style="simbols">
			<t>0x0 - 20 bits IPv6 Flow Label in <xref target="RFC8200"/>. See <xref target='flow-id-ipv6-fig1'/>. </t>
			<t>0x1 - 20 bits entropy label in the MPLS network in <xref target="RFC6790"/>. See <xref target='flow-id-mplse-fig2'/>.</t>	   
			</list>
			Reserved bits in the context fields MUST be sent as zero and ignored on receipt.
       </t>
   </list>	   
</t>
	   
	   
	   
</section>
       
        <section anchor="src-dst-group-sec" title="Source and/or Destination Groups">
<t>
       Intent-based systems can use this data to express the logical
       grouping of source and/or destination objects.
       <xref target="OpenStack"/> and <xref target="OpenDaylight"/> provide examples of such a
       system. Each is expressed as a 32-bit opaque object.
        <figure align="left" anchor="src-dst-group-fig" title="Source/Dest Groups">
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Metadata Class = 0x0000    |  Type = TBA6  |U|  Length=8   |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        Source Group                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        Dest Group                             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
        </figure>
       </t>   
<t>
If there is no group information specified for the source group or dest group field, the field MUST be sent as zero and ignored on receipt.
</t>	   
       </section>
       
       
<section anchor="policy-id-sec" title="Policy Identifier">
<t>
       Traffic handling policies are often referred to by a system-generated identifier, which
       is then used by the devices to look up the policy's content
       locally.  For example, this identifier could be an index to an
       array, a lookup key, a database Id.  The identifier allows
       enforcement agents or services to look up the content of their
       part of the policy. 
        <figure align="left" anchor="policy-id-fig" title="Policy ID">
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Metadata Class = 0x0000    |  Type = TBA7  |U|  Length=var |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   ~                     Policy ID                                 ~
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
       </t>
<t>
   The fields are described as follows:
   <list>
        <t>Length: Indicates the length of the Policy ID in octets (see Section 2.5.1 of <xref target="RFC8300"/>).</t>
        
        <t>Policy ID: Represents an opaque value of the Policy ID.</t>
   </list>	   
</t>
<t>
This policy identifier is a general policy ID, essentially a key to allow Service Functions to know which policies to apply to packets.  Those policies generally will not have much to do with performance, but rather with what specific 
treatment to apply. It may for example select a URL filter data set for a URL filter, or select a video transcoding policy in a transcoding SF. The Performance Policy Identifier in <xref target="RFC8979"/> is described there as having very specific use, and for example says that fully controlled SFPs would not use it. The Policy ID in this document is for cases not covered by <xref target="RFC8979"/>.
 
</t>

</section>
     
  </section>
  
 
 <section anchor="security-sec" title="Security Considerations">
<t>A misbehaving node from within the SFC-enabled domain may alter the content of the Context Headers, which may lead to service disruption. Such an attack is not unique to the Context Headers defined in this document. Measures discussed in Section 8 of <xref target="RFC8300"/> describes the general security considerations for protecting NSH. <xref target="I-D.ietf-sfc-nsh-integrity"/> specifies methods of protecting the integrity of the NSH metadata. If the NSH includes the MAC Context Header, the authentication of the packet MUST be verified before using any data. If the verification fails, the receiver MUST stop processing the variable length context headers and notify an operator.
</t> 
 
</section>
 
<section title="Acknowledgments">
	<t>
	The authors would like to thank Paul Quinn, Behcet Sarikaya, Dirk von Hugo, Mohamed Boucadair, Gregory Mirsky, and Joel Halpern for providing invaluable concepts and content for this document.
	</t>  
</section>

<section anchor="iana-tlv-class-reg-sec" title="IANA Considerations">
<section anchor="iana-tlv-class-context-type" title="MD Type 2 Context Types">
	<t>
	IANA is requested to assign the following types (<xref target="type-values-tbl"/>) from the "NSH IETF- Assigned Optional Variable-Length Metadata Types" registry available at <xref target="IANA-NSH-MD2"/>.
	</t>
		<texttable anchor="type-values-tbl" title="Type Values">
			<ttcol align="left">Value</ttcol>
			<ttcol align="center">Description</ttcol>
			<ttcol align="left">Reference</ttcol>
			<c>TBA1</c>
			<c>Forwarding Context</c>
			<c>This&nbsp;document</c>
			<c>TBA2</c>
			<c>Tenant Identifier</c>
			<c>This&nbsp;document</c>
			<c>TBA3</c>
			<c>Ingress Network NodeID</c>
			<c>This&nbsp;document</c>
			<c>TBA4</c>
			<c>Ingress Network Interface</c>
			<c>This&nbsp;document</c>
			<c>TBA5</c>
			<c>Flow ID</c>
			<c>This&nbsp;document</c>
			<c>TBA6</c>
			<c>Source and/or Destination Groups</c>
			<c>This&nbsp;document</c>
			<c>TBA7</c>
			<c>Policy Identifier</c>
			<c>This&nbsp;document</c>
		</texttable>
</section>
	
	<!-- Add forwarding context Type sub-registry -->
	<section anchor="iana-fc-type" title="Forwarding Context Types">	
		<t>IANA is requested to create a new sub-registry for "Forwarding Context" context types at <xref target="IANA-NSH-MD2"/> as follows:
		</t>
		
		<t>The Registration Policy is IETF Review</t>
		<texttable anchor="Forwarding-CT-iana-tbl" title="Forwarding Context Types">
			<ttcol align="left">Value</ttcol>
			<ttcol align="center">Forwarding Context Header Types</ttcol>
			<ttcol align="left">Reference</ttcol>
			<c>0x0</c>
			<c>12-bit VLAN identifier</c>
			<c>This&nbsp;document</c>
			<c>0x1</c>
			<c>24-bit double tagging identifiers</c>
			<c>This&nbsp;document</c>			
			<c>0x2</c>
			<c>20-bit MPLS VPN label</c>
			<c>This&nbsp;document</c>
			<c>0x3</c>
			<c>24-bit virtual network identifier (VNI)</c>
			<c>This&nbsp;document</c>
			<c>0x4</c>
			<c>32-bit Session ID</c>
			<c>This&nbsp;document</c>	
			<c>0x5-0xE</c>
			<c>Unassigned</c>
			<c></c>
			<c>0xF</c>
			<c>Reserved</c>
			<c>This&nbsp;document</c>				
			</texttable>	
	</section>
	<!-- end of	forwarding context Type sub-registry  -->

	
	<!-- Add flow id context Type sub-registry -->
	<section anchor="iana-tlv-flowid-type" title="Flow ID Context Types">	
		<t>IANA is requested to create a new sub-registry for "Flow ID Context" context types at <xref target="IANA-NSH-MD2"/> as follows:
		</t>
		
		<t>The Registration Policy is IETF Review</t>
		<texttable anchor="flow-id-CT-iana-tbl" title="Flow ID Context Types">
			<ttcol align="left">Value</ttcol>
			<ttcol align="center">Flow ID Context Header Types</ttcol>
			<ttcol align="left">Reference</ttcol>
			<c>0x0</c>
			<c>20-bit IPv6 Flow Label</c>
			<c>This&nbsp;document</c>
			<c>0x1</c>
			<c>20-bit entropy label in the MPLS network</c>
			<c>This&nbsp;document</c>			
			<c>0x2-0xE</c>
			<c>Unassigned</c>
			<c></c>
			<c>0xF</c>
			<c>Reserved</c>
			<c>This&nbsp;document</c>				
			</texttable>	
	</section>
	<!-- end of	flowid context Type sub-registry  -->
	

	
</section>
     
</middle>
  
<back>
    <references title="Normative References">
     
  
		<?rfc include="reference.RFC.2119"?>
		<?rfc include="reference.RFC.3931"?>
		<?rfc include="reference.RFC.8174"?>
		
		<?rfc include="reference.RFC.8300"?>
		<!--?rfc include="reference.RFC.3986"?-->   
		<?rfc include='reference.I-D.ietf-sfc-nsh-integrity'?>
        <reference anchor="IEEE.802.1Q_2018" target="http://ieeexplore.ieee.org/servlet/opac?punumber=8403925" >
		    <front>
             <title>IEEE Standard for Local and Metropolitan Area Networks--Bridges and Bridged Networks</title>
            <author>
              <organization>IEEE</organization>
            </author>
            <date month="July" year="2018"/>
			</front>
        </reference>
		<reference anchor="IANA-NSH-MD2" target="https://www.iana.org/assignments/nsh/nsh.xhtml#optional-variable-length-metadata-types">
        <front>
            <title>
				NSH IETF-Assigned Optional Variable-Length Metadata Types
            </title>
            <author>
                <organization>IANA</organization>
            </author>
            <date/>
        </front>
		</reference>
	
<!--	
		<reference anchor="IANA-NSH-MD4">
			<front>
				<title>NSH IETF-Assigned Optional Variable-Length Metadata Types</title>
				<author>
					<organization>IANA</organization>
				</author>
				<date/>
		</front>
			<format type="https://www.iana.org/assignments/nsh/nsh.xhtml#optional-variable-length-metadata-types"/>
		</reference>
-->	
    </references>
    
    <references title="Informative References">
		<?rfc include="reference.RFC.8200"?>
		<?rfc include="reference.RFC.6790"?>
		<?rfc include="reference.RFC.8979"?>
		<?rfc include="reference.RFC.2890"?>
		<?rfc include="reference.RFC.7665"?> 
        <?rfc include="reference.RFC.8926"?> 
		<?rfc include="reference.RFC.3032"?> 
        <?rfc include="reference.RFC.4364"?> 		
		
		<reference anchor="OpenDaylight-VTN" target="https://nexus.opendaylight.org/content/sites/site/org.opendaylight.docs/master/userguide/manuals/userguide/bk-user-guide/content/_vtn.html">
			<front>
				<title>OpenDaylight VTN</title>
				<author>
					<organization>OpenDaylight</organization>
				</author>
				<date year="2021"/>
			</front>
		</reference> 

		<reference anchor="IANAifType" target="https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib">
			<front>
				<title>IANAifType</title>
				<author>
					<organization>IANA</organization>
				</author>
				<date year="2021"/>
			</front>
		</reference> 

		<reference anchor="OpenStack" target="https://wiki.openstack.org/wiki/GroupBasedPolicy">
			<front>
				<title>Group Based Policy</title>
				<author>
					<organization>OpenStack</organization>
				</author>
				<date year="2021"/>
			</front>
			<!--<format type="https://wiki.openstack.org/wiki/GroupBasedPolicy"/>-->
		</reference> 

    
		<reference anchor="OpenDaylight"  target="https://docs.opendaylight.org/en/stable-fluorine/user-guide/group-based-policy-user-guide.html?highlight=group%20policy#">
			<front>
			<title>Group Based Policy</title>
			<author>
			<organization>OpenDaylight</organization>
			</author>
			<date year="2021"/>
			</front>
			<!--<format type="https://docs.opendaylight.org/en/stable-fluorine/user-guide/group-based-policy-user-guide.html?highlight=group%20policy#"/>-->
		</reference> 
		
	</references>	
 </back>
 </rfc>
