<?xml version="1.0" encoding="US-ASCII"?>
<!-- 
#
#       draft-NSH-00.xml
#
#
#    Paul Quinn
#    paulq@cisco.com
#    June 11, 2013
#
#
#
-->


<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC0768 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.0768.xml">
<!ENTITY RFC0791 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.0791.xml">
<!ENTITY RFC2784 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2784.xml">
<!ENTITY RFC6071 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6071.xml">
<!ENTITY RFC8126 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml">
<!ENTITY RFC7498 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7498.xml">
<!ENTITY RFC1191 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1191.xml">    
<!ENTITY RFC6830 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6830.xml">
<!ENTITY RFC7665 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7665.xml">
<!ENTITY RFC1981 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1981.xml">    
<!ENTITY RFC7325 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7325.xml">    
<!ENTITY RFC2827 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2827.xml">    
]>


<rfc category="std" ipr="trust200902" docName="draft-ietf-sfc-nsh-17">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="no" ?>

  <front>
 
    <title>Network Service Header (NSH)</title>
 
       <author fullname="Paul Quinn" initials="P." surname="Quinn" role="editor">
      <organization abbrev="Cisco">Cisco Systems, Inc.</organization>
      <address>
        <email>paulq@cisco.com</email>
      </address>
    </author>
    
      <author fullname="Uri Elzur" initials="U." surname="Elzur" role="editor">
      <organization>Intel</organization>
      <address>
        <email>uri.elzur@intel.com</email>
      </address>
    </author>
 
       <author fullname="Carlos Pignataro" initials="C." surname="Pignataro" role="editor">
      <organization abbrev="Cisco">Cisco Systems, Inc.</organization>
      <address>
        <email>cpignata@cisco.com</email>
      </address>
    </author>

 
    
    <date />


   <area>Routing</area>

   <workgroup>Service Function Chaining</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. -->


    <abstract>
     <t>

   This document describes a Network Service Header (NSH) inserted onto
   packets or frames to realize service function paths.
   NSH also provides a mechanism for metadata exchange along the
   instantiated service paths.  NSH is the SFC encapsulation 
   required to support the Service Function Chaining (SFC) 
   architecture (defined in RFC7665).

     </t>
    </abstract>
    


</front>
    
    
<middle>

    <section title="Introduction" toc="default">
    <t>
   Service functions are widely deployed and essential in many networks.
   These service functions provide a range of features such as security,
   WAN acceleration, and server load balancing.  Service functions may
   be instantiated at different points in the network infrastructure
   such as the wide area network, data center, campus, and so forth.
    </t>
    <t>
   Prior to development of the SFC architecture <xref target="RFC7665" /> and the protocol specified 
   in this document, current service function deployment models have been relatively static,
   and bound to topology for insertion and policy selection.
   Furthermore, they do not adapt well to elastic service environments
   enabled by virtualization.
    </t>
    <t>
   New data center network and cloud architectures require more flexible
   service function deployment models.  Additionally, the transition to
   virtual platforms requires an agile service insertion model that
   supports dynamic and elastic service delivery; the movement of service functions
   and application workloads in the network and the ability to easily
   bind service policy to granular information such as per-subscriber
   state and steer traffic to the requisite service function(s) are necessary.  
    </t>
    <t>
   Network Service Header (NSH) 
   defines a new service plane protocol specifically for the creation of dynamic service 
   chains and is composed of the following elements:    </t>
    <t><list style="numbers">
        <t>
        Service Function Path identification.
        </t>
        <t>
        Indication of location within a Service Function Path. 
        </t>
        <t>
        Optional, per packet metadata (fixed length or variable).
        </t>        
        </list></t>
        
        
<t>
NSH is designed to be easy to implement across a range of devices,
   both physical and virtual, including hardware platforms.
</t><t>
   An NSH-aware control plane is outside the scope of this document.
     </t>
<t>
<xref target="RFC7665" /> provides an overview of a
   service chaining architecture that clearly defines the roles of the
   various elements and the scope of a service function chaining
   encapsulation.  NSH is the SFC encapsulation referenced in <xref target="RFC7665" />.


</t>
  
<!--- </section>
-->

 <section title="Requirements Language">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
        target="RFC2119">RFC 2119</xref>.</t>


</section>



    <section title="Definition of Terms" anchor="terms">
    
   <t><list style="hanging">
        <t hangText="Byte:">
           All references to "bytes" in this document refer to
           8-bit bytes, or octets.

        </t>

        <t hangText="Classification:">
            Defined in <xref target="RFC7665"></xref>.
        </t>

        <t hangText="Classifier:">
            Defined in <xref target="RFC7665"></xref>.
            </t>
                    
    <t hangText="Metadata:">
            Defined in <xref target="RFC7665"></xref>.
            </t>

    <t hangText="Network Locator:">
        dataplane address, typically IPv4 or IPv6, used to send and receive network traffic.     
        </t>

         <t hangText="Network Node/Element:">
            Device that forwards packets or frames based on an outer header (i.e., transport) information.  
        </t>

        <t hangText="Network Overlay:">
           Logical network built on top of existing network
      (the underlay).  Packets are encapsulated or tunneled to create
      the overlay network topology.

        </t>


         <t hangText="NSH-aware">
                    SFC-encapsulation-aware, or SFC-aware <xref target="RFC7665"></xref>.
        </t>

            
    <t hangText="Service Classifier:">
           Logical entity providing classification function.  Since they are logical, 
        classifiers may be co-resident with SFC elements such as SFs or SFFs.  Service classifiers perform
        classification and
      impose NSH. The initial classifier imposes the initial NSH and sends the NSH 
      packet to the first SFF in the path.  Non-initial (i.e.
      subsequent) classification can occur as needed and can alter, or
      create a new service path.  
       </t>                
                    
         <t hangText="Service Function (SF):"> 
                    Defined in <xref target="RFC7665"></xref>.
        </t>        

    
        <t hangText="Service Function Chain (SFC):">
                    Defined in <xref target="RFC7665"></xref>.
        </t>


        <t hangText="Service Function Forwarder (SFF):">
                    Defined in <xref target="RFC7665"></xref>.
        </t>
        
        <t hangText="Service Function Path (SFP):">
                    Defined in <xref target="RFC7665"></xref>.

        </t>
      
        <t hangText="SFC Proxy:"> 
               Defined in <xref target="RFC7665"></xref>.
        </t>

 
    </list></t>
    </section>
    
    
     <section title="Problem Space" anchor="problem">
      <t>
         NSH addresses several limitations associated
   with service function deployments.  <xref target="RFC7498"></xref> provides 
a comprehensive review of those issues.

      </t>
    
  </section>


    <section title="NSH-based Service Chaining">
    <t>
          NSH creates a dedicated service plane, more specifically, NSH
   enables:

    </t>
    <t><list style="numbers">
    <t>
    Topological Independence: Service forwarding occurs within the
       service plane, the underlying network
       topology does not require modification.  NSH provides an 
       identifier used to select the network overlay for network forwarding. 
    </t>
    
    <t>
    Service Chaining: NSH enables service chaining per <xref target="RFC7665" />. NSH contains path identification information
       needed to realize a service path.  Furthermore, NSH provides the
       ability to monitor and troubleshoot a service chain, end-to-end
       via service-specific OAM messages.  NSH fields can be used by
       administrators (via, for example, a traffic analyzer) to verify
       (account, ensure correct chaining, provide reports, etc.) the
       path specifics of packets being forwarded along a service path.

    </t>
    
    <t>
    NSH provides a mechanism to carry shared
       metadata between participating entities and service functions.
       The semantics of the shared metadata is communicated via a control plane, which 
       is outside the scope of this document, to participating nodes.  <xref target="I-D.ietf-sfc-control-plane"></xref> provides an example of such in Section 3.3.
       Examples of metadata include classification information used for
       policy enforcement and network context for forwarding post
       service delivery.  Sharing the metadata allows service functions 
    to share initial and intermediate classification results with downstream service 
    functions saving re-classification, where enough information was enclosed.
    </t>
    
    <t>
    NSH offers a common and standards-based header for service chaining to all network and service nodes.
    </t>
    
    <t>
    Transport Agnostic: NSH is transport-independent. An appropriate (for a given deployment) 
    network transport protocol can be used to transport NSH-encapsulated traffic.
    This transport may form an 
       overlay network and if an existing overlay
       topology provides the required service path connectivity, that
       existing overlay may be used.
    </t>


    </list></t>

    </section>
</section>


 
 <section title="Network Service Header" anchor="NSH">
 
 
      <t>
   NSH contains service path information and
   optionally metadata that are added to a packet or frame and used to
   create a service plane.  An outer transport header is imposed, on
NSH and the original packet/frame, for network forwarding.
     </t>
    
    <t>
       A Service Classifier adds NSH.  NSH is removed by
   the last SFF in the service chain or by an SF that consumes the packet.

    </t>

 <section title="Network Service Header Format" anchor="nshformat">

    <t>
       NSH is composed of a 4-byte
       Base Header, a 4-byte Service Path
   Header and optional Context Headers, as shown in <xref target="stack" /> below.


    </t>
            <figure title="Network Service Header" anchor="stack">
              <artwork align="center">
 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Base Header                                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Service Path Header                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                Context Header(s)                              ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              </artwork>
          </figure>
    <t>
    Base header: provides information about the service header and the payload protocol.
    </t>
    <t>
    Service Path Header: provides path identification and location within a service path.
    </t>
    <t>
  Context header: carries metadata (i.e., context data) along a service path.
    </t>

</section>


<section title="NSH Base Header" anchor="base">
<t>
<xref target="baseheader" /> depicts the NSH base header:
</t>

            <figure title="NSH Base Header" anchor="baseheader">
              <artwork align="center">
 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>

    <t>
    Base Header Field Descriptions:
    </t>
    
    <t>
    Version: The version field is used to ensure backward compatibility
   going forward with future NSH specification updates. It MUST be set to 0x0 by the sender, in this 
   first revision of NSH.
   Given the widespread implementation of existing hardware that uses the 
   first nibble after an MPLS label stack for ECMP decision processing, this document 
   reserves version 01b and this value MUST NOT  be used in future versions of the protocol.   
   Please see <xref target="RFC7325"></xref> for further discussion of MPLS-related forwarding
   requirements.

    </t>


    <t>
  O bit: Setting this bit indicates an Operations, Administration, and
   Maintenance (OAM) packet. The actual format and processing of
   SFC OAM packets is outside the scope of this specification
   (see for example  <xref target="I-D.ietf-sfc-oam-framework"></xref> for one approach).
            <vspace blankLines="1" /> 
  The O bit MUST be set for OAM packets and MUST NOT be set for non-OAM
   packets. The O bit MUST NOT be modified along the SFP.
            <vspace blankLines="1" /> 
  SF/SFF/SFC Proxy/Classifier implementations that do not support SFC
   OAM procedures SHOULD discard packets with O bit set, but MAY
   support a configurable parameter to enable forwarding received SFC
   OAM packets unmodified to the next element in the chain. Forwarding OAM 
   packets unmodified by SFC elements that do not support SFC OAM procedures 
   may be acceptable for a subset of OAM functions, but can result in 
   unexpected outcomes for others, thus it is recommended to analyze the 
   impact of forwarding an OAM packet for all OAM functions prior to enabling 
   this behavior. The configurable parameter MUST be disabled by default.
            <vspace blankLines="1" /> 

    </t>
    <t>
    
TTL: Indicates the maximum SFF hops for an SFP. This field is used for service plane loop detection. The initial TTL value SHOULD be 
configurable via the control plane; the configured initial value can be specific to 
one or more SFPs. If no initial value is explicitly provided, the default initial TTL 
value 63 MUST be used. Each SFF involved in forwarding an NSH packet MUST decrement the 
TTL value by 1 prior to NSH forwarding lookup. Decrementing by 1 from an incoming value 
of 0 shall result in a TTL value of 63. The packet MUST NOT be forwarded if TTL is, 
after decrement, 0. 
</t>
    <t>
 All other flag fields are unassigned and available for future use, see <xref target="bbits" />. Unassigned bits
   MUST be set to zero upon origination and MUST be preserved
   unmodified by other NSH supporting elements. Elements which do not
   understand the meaning of any of these bits MUST NOT modify their
   actions based on those unknown bits.
    </t>

    <t>    
     Length: The total length, in 4-byte words, of NSH including the
   Base Header, the Service Path Header, the Fixed Length Context Header
   or Variable Length Context Header(s). The length MUST
   be of value 0x6 for MD Type equal to 0x1, and MUST be of value 0x2 or 
   greater for MD Type equal to 0x2. The length of the NSH header MUST
   be an integer multiple of 4 bytes, thus variable length metadata is 
   always padded out to a multiple of 4 bytes.
</t>
<t>
    MD Type: indicates the format of NSH beyond the mandatory Base Header and the Service Path Header. MD Type defines the
   format of the metadata being carried.  Please see the IANA Considerations <xref target="mdt" />.  

            <vspace blankLines="1" /> 
             This document specifies the following four MD Type values: 
                     <vspace blankLines="1" /> 
    0x0 - this is a reserved value. Implementations SHOULD silently discard packets with MD Type 0x0.
                     <vspace blankLines="1" /> 
    0x1 - which indicates that the format of the header includes a fixed
   length Context Header (see <xref target="t1c" /> below).

            <vspace blankLines="1" /> 
    0x2 - which does not mandate any headers beyond the Base Header and
  Service Path Header, but may contain optional variable length Context
  Header(s).  The semantics of the variable length Context Header(s) are not defined in this document.

The format of the optional variable length Context Headers
is provided in 
<xref target="tlvagain" />.

            <vspace blankLines="1" /> 
    0xF - this value is reserved for experimentation and testing, as per <xref target="RFC3692" />. Implementations
not explicitly configured to be part of an experiment SHOULD silently discard packets with MD Type 0xF.
        <vspace blankLines="1" /> 
    The format of the Base Header and the Service Path Header is invariant, and not affected by MD
   Type.

    <vspace blankLines="1" /> 
NSH implementations MUST support MD type = 0x1 and MD Type = 0x2 (where the length
   is of value 0x2). NSH implementations SHOULD support MD Type 0x2 with length > 0x2.  There exists, 
   however, a middle ground, wherein a device will support 
   MD Type 0x1 (as per the MUST) metadata, yet be deployed in a network with MD Type 0x2 
   metadata packets.  In that case, the MD Type 0x1 node, MUST utilize the base header length 
   field to determine the original payload offset if it requires access to the original packet/frame.
This specification does not disallow the MD Type value from changing along an SFP; however, the specification of the necessary mechanism to allow the MD Type to change along an SFP are outside the scope of this document, and would need to be defined for that functionality to be available. 
Packets with MD Type values not supported by an implementation
   MUST be silently dropped. 

    </t>
    
    <t>
    Next Protocol: indicates the protocol type of the encapsulated data.  NSH does not 
    alter the inner payload, and the semantics on the inner protocol remain unchanged
    due to NSH service function chaining.   Please see the IANA Considerations 
    section below, <xref target="bnp" />.

            <vspace blankLines="1" /> 
    This document defines the following Next Protocol values:
            <vspace blankLines="1" /> 
    0x0: Unassigned
            <vspace blankLines="0" /> 
    0x1: IPv4
            <vspace blankLines="0" /> 
    0x2: IPv6
        <vspace blankLines="0" /> 

    0x3: Ethernet
        <vspace blankLines="0" /> 
    0x4: NSH
        <vspace blankLines="0" /> 
    0x5: MPLS
        <vspace blankLines="0" /> 
    0xFE: Experiment 1
        <vspace blankLines="0" /> 
    0xFF: Experiment 2
    </t>
    <t>
Packets with Next Protocol values not supported SHOULD be silently dropped by default, although an implementation MAY provide a configuration parameter to forward them.


Additionally, an implementation not explicitly configured for a specific experiment <xref target="RFC3692" />
 SHOULD silently drop packets with Next Protocol values 0xFE and 0xFF.
    </t>

</section>
    
    <section title="Service Path Header" anchor="sph">

<t>
<xref target="pathreader" /> shows the format of the Service Path Header:
</t>

            <figure title="NSH Service Path Header" anchor="pathreader">
              <artwork align="center">
 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Service Path Identifier (SPI)        | Service Index |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Service Path Identifier (SPI): 24 bits
Service Index (SI): 8 bits
              </artwork>
          </figure>

<t>
The meaning of these fields is as follows:
</t>

    
    <t>
    Service Path Identifier (SPI):  identifies a service path.
 Participating nodes MUST use this identifier for Service Function
 Path selection.  The initial classifier MUST set the appropriate SPI
 for a given classification result.

    </t>
    
    <t>
Service Index (SI): provides location within the SFP. The
initial classifier for a given SFP SHOULD set the SI to 255, however the
control   plane MAY configure the initial value of SI as appropriate
(i.e.,   taking into account the length of the service function path).  
 Service Index MUST be decremented by a value of 1 by Service Functions or by SFC
   Proxy nodes after performing required services and the new
   decremented SI value MUST be used in the egress NSH packet.

The initial Classifier
MUST send the packet to the first SFF in the identified SFP  for
forwarding along an SFP. If re-classification occurs, and that
re-classification results in a new SPI, the (re)classifier is, in
effect, the initial classifier for the resultant SPI.
               <vspace blankLines="1" /> 
The SI is used in conjunction with Service Path Identifier for
Service Function Path   Selection and for determining the next SFF/SF in
the path. The SI is also valuable when troubleshooting/
reporting service paths.  Additionally, while the TTL field is the main mechanism for service plane loop detection,
the SI can also be used for 
detecting service plane loops.
    </t>

</section>

<section title="NSH MD Type 1" anchor="t1">

<t>
When the Base Header specifies MD Type = 0x1, a Fixed Length 
   Context Header (16-bytes) MUST be present immediately following the Service Path
   Header, as per <xref target="t1c" />.  A Fixed Length Context Header that carries no metadata 
   MUST be set to zero.
</t>
    



<figure title="NSH MD Type=0x1" anchor="t1c">
        <artwork align="center">
 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Service Path Identifier              | Service Index |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                 Fixed Length Context Header                   |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        </artwork>
    </figure>



<t>
This specification does not make any assumptions about the content of
 the 16 byte Context Header that must be present when the MD Type 
 field is set to 1, and does not describe the structure or meaning of
 the included metadata.
</t>
<t>
An SFC-aware SF MUST receive the data semantics first in
order to process the data placed in the mandatory context field. The data
semantics include both the allocation schema and the meaning of the included
data. How an SFC-aware SF gets the data semantics is outside the scope of
this specification.
</t>
<t>
An SF or SFC Proxy that does not know the format or semantics of the 
 Context Header for an NSH with MD Type 1 MUST discard any packet with
 such an NSH (i.e., MUST NOT ignore the metadata that it cannot 
 process), and MUST log the event at least once per the SPI for which
 the event occurs (subject to thresholding).
</t>
<t>
<xref target="I-D.guichard-sfc-nsh-dc-allocation"></xref> and <xref target="I-D.napper-sfc-nsh-broadband-allocation"></xref> provide specific 
examples of how metadata can be allocated.
</t>

</section>

<section title="NSH MD Type 2" anchor="t2">

<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 (see <xref target="t2c" />). Therefore, 
   Length = 0x2, indicates that only the Base Header followed by the Service Path Header 
   are present. The optional Variable Length Context Headers MUST be of an integer number 
   of 4-bytes.  The base header Length field MUST be used to determine the offset to locate
   the original packet or frame for SFC nodes that require access to that information.  
</t>
    


    <figure title="NSH MD Type=0x2" anchor="t2c">
        <artwork align="center">
 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Service Path Identifier              | Service Index |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~              Variable Length Context Headers  (opt.)          ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        </artwork>
    </figure>



<section title="Optional Variable Length Metadata" anchor="tlvagain">
    <t>  
        The format of the optional variable length Context Headers, is as depicted
in <xref target="vars" />.
      </t>
      
 
    <figure title="Variable Context Headers" anchor="vars">
        <artwork align="center">
 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|       Len   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Variable Metadata                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        </artwork>
    </figure>

    <t>
    Metadata Class (MD Class):  defines the scope of the 'Type' field to
    provide a hierarchical namespace.  The IANA Considerations <xref target="mdclass" /> defines how the
    MD Class values can be allocated to standards bodies, vendors, and others.

    </t>

    <t>
    Type: indicates the explicit type of metadata being carried and is the responsibility 
    of the MD Class owner.

    </t>
    
    <t>
    Unassigned bit: one unassigned bit is available for future use.  This bit
    MUST be set to 0b.
    </t>
    
    <t>
    Length: indicates the length of the variable metadata, in single byte words.  
In case the metadata  
    length is not an integer number of 4-byte words, the sender MUST add pad bytes immediately
 following the last metadata byte to extend the metadata to an integer number of 4-byte words. 
 The receiver MUST round up the
length field to the nearest 4-byte word boundary, to locate and process
the next field in the packet. The receiver MUST access only those bytes
in the metadata indicated by the length field (i.e., actual number of
single byte words) and MUST ignore the remaining bytes up to the nearest
4-byte word boundary. The Length may be 0 or greater.
    <vspace blankLines="1" /> 
  A value of
0 denotes a Context Header without a  Variable Metadata field.
  
    </t>
    <t>
This specification does not make any assumption about Context Headers that are
mandatory-to-implement or those that are mandatory-to-process. These
considerations are deployment-specific. However, the control plane
is entitled to instruct SFC-aware SFs with the data structure of
context header together with their scoping (see Section 3.3.3 of <xref target="I-D.ietf-sfc-control-plane"></xref>).
</t>
<t>
Upon receipt of a packet that belong to a given SFP, if a mandatory-
to-process context header is missing in that packet, the SFC-aware SF MUST NOT
process the packet and MUST log at least once per the SPI for which
a mandatory metadata is missing.
</t>
<t>
If multiple mandatory-to-process context headers are required for a given SFP,
the control plane MAY instruct the SFC-aware SF with the order to
consume these Context Headers. If no instructions are provided, the SFC-aware
SF MUST process these Context Headers in the order their appear in an NSH
packet.
</t>
<t>
 If multiple instances of the same metadata are included in an NSH packet,
 but the definition of that context header does not allow for it, the SFC-aware
 SF MUST process first instance and ignore subsequent instances.

</t>

  </section>
</section>


</section>

    

    <section title="NSH Actions" anchor="actions">
      <t>
NSH-aware nodes are the only nodes that may alter the content of NSH headers. 
NSH-aware nodes include: service classifiers, SFF, SF and SFC proxies. These nodes 
have several possible NSH-related actions:

      </t>
     <t><list style="numbers">
     <t>Insert or remove NSH: These actions can occur at the
       start and end respectively of a service path.  Packets are
       classified, and if determined to require servicing, NSH will be imposed. A service 
       classifier MUST insert NSH at the start of an SFP.  An imposed NSH MUST contain 
       valid Base Header and Service Path Header. At the end of a service function path, an SFF, MUST be
     the last node operating on the service header and MUST remove NSH before forwarding or 
     delivering the un-encapsulated packet
       

     <vspace blankLines="1" /> 
     Multiple logical classifiers may exist within a given service path.  Non-initial 
     classifiers may re-classify data and that re-classification MAY result in the 
     selection a different Service Function Path.  When the logical
     classifier performs re-classification that results in a change of
     service path, it MUST remove the existing NSH and MUST impose a
     new NSH with the Base Header and Service Path Header reflecting the new service path 
     information and set the initial SI.  Metadata MAY be preserved in the new NSH.
    <vspace blankLines="1" /> 
   
     </t>
    <t>Select service path: The Service Path Header provides service path
       information and is used by SFFs to determine correct service path
       selection.  SFFs MUST use the Service Path Header for selecting the next
       SF or SFF in the service path.
    </t>
    <t>Update NSH: SFs MUST
       decrement the service index by one.  If an SFF receives a packet with
        an SPI and SI that do not correspond to a valid next hop in a valid Service Function Path, 
        that packet MUST be dropped by the SFF.
    <vspace blankLines="1" /> 
Classifiers MAY update Context Headers if new/updated
       context is available. 
    <vspace blankLines="1" /> 
     If an SFC proxy is in use (acting on behalf of a
      NSH unaware service function for NSH actions), then the proxy
       MUST update Service Index and MAY update contexts.  When an SFC
       proxy receives an NSH-encapsulated packet, it MUST remove NSH
       before forwarding it to an NSH unaware SF.  When the SFC Proxy receives a
       packet back from an NSH unaware SF, it MUST re-encapsulates it with the correct NSH, 
       and MUST decrement the Service Index by one.

    <vspace blankLines="1" /> 

    </t>
    <t>Service policy selection: Service Functions derive
       policy (i.e., service actions such as permit or deny) selection and enforcement from NSH.  
       Metadata shared in NSH can provide a range of service-relevant
       information such as traffic classification.  
    </t>
    </list></t>
    <t>
    <xref target="actionsandroles" /> maps each of the four actions above to the components in the SFC architecture that can perform it.
    </t>
    
                <figure title="NSH Action and Role Mapping" anchor="actionsandroles">
              <artwork align="center">
+----------------+---------------+-------+----------------+---------+
|                | Insert        |Forward|   Update       |Service  |  
|                | or remove NSH |NSH    |    NSH         |policy   |  
|                |               |Packets|                |selection|
| Component      +-------+-------+       +----------------+         |  
|                |       |       |       | Dec.   |Update |         |  
|                |Insert |Remove |       |Service |Context|         |  
|                |       |       |       | Index  |Header |         |  
+----------------+-------+-------+-------+--------+-------+---------+  
|                |  +    |   +   |       |        |   +   |         |  
|Classifier      |       |       |       |        |       |         |  
+--------------- +-------+-------+-------+--------+-------+---------+  
|Service Function|       |   +   |  +    |        |       |         |  
|Forwarder(SFF)  |       |       |       |        |       |         |  
+--------------- +-------+-------+-------+--------+-------+---------+  
|Service         |       |       |       |   +    |   +   |   +     |  
|Function  (SF)  |       |       |       |        |       |         |  
+--------------- +-------+-------+-------+--------+-------+---------+  
|SFC Proxy       |  +    |   +   |       |   +    |   +   |         |  
+----------------+-------+-------+-------+--------+-------+---------+ 
             </artwork>
          </figure>
    
</section>

<section title="NSH Transport Encapsulation" anchor="encap">

    <t>
       Once NSH is added to a packet, an outer encapsulation is used to
   forward the original packet and the associated metadata to the start
   of a service chain.  The encapsulation serves two purposes:

    </t>
    <t><list style="numbers">
    <t>
    Creates a topologically independent services plane.  Packets are
       forwarded to the required services without changing the
       underlying network topology

    </t>
    <t>
Transit network nodes simply forward the encapsulated packets as
       is.

    </t>
    </list></t>
    <t>
    The service header is independent of the encapsulation used and is
   encapsulated in existing transports.  The presence of NSH is
   indicated via protocol type or other indicator in the outer
   encapsulation.

    </t>
</section>    


<section title="Fragmentation Considerations">
<t>
NSH and the associated transport header are "added" to the
encapsulated packet/frame.  This additional information increases the
size of the packet.  
</t>
<t>
As discussed in <xref target="I-D.ietf-rtgwg-dt-encap"></xref>, within an administrative domain,
an operator can ensure that the underlay MTU is sufficient to carry SFC traffic
without requiring fragmentation.
</t>
<t>
However, there will be cases where the underlay MTU is not large enough to carry the
NSH traffic.  Since NSH does not provide fragmentation support at the service plane,
the transport/overlay layer MUST provide the requisite fragmentation handling.  Section
6 of <xref target="I-D.ietf-rtgwg-dt-encap"></xref> provides guidance for those scenarios. 
</t>
</section>


<section title="Service Path Forwarding with NSH" anchor="fwding">


<section title="SFFs and Overlay Selection" anchor="overlay">
   <t>
     As described above, NSH contains a Service Path Identifier (SPI) and
   a Service Index (SI).  The SPI is, as per its name, an identifier.
   The SPI alone cannot be used to forward packets along a service path.
   Rather the SPI provides a level of indirection between the service
   path/topology and the network transport.  Furthermore, there is no
   requirement, or expectation of an SPI being bound to a pre-determined
   or static network path.  
  </t>
  <t>
  The Service Index provides an indication of location within a service
   path.  The combination of SPI and SI provides the identification of a logical SF and 
   its order within the service plane, and is used to select the appropriate network locator(s) for overlay forwarding. 
 The logical SF may be a single SF, or a set of eligible SFs that are equivalent.  In the latter
   case, the SFF provides load distribution amongst the collection of
   SFs as needed.  
   </t>
   <t>
  SI serves as a mechanism for detecting invalid service function
path. In particular, an SI value of zero indicates that forwarding is incorrect and the packet must be discarded
  </t>
  <t>
 This indirection -- SPI to overlay -- creates a true service
   plane.  That is the SFF/SF topology is constructed without impacting
   the network topology but more importantly service plane only
   participants (i.e., most SFs) need not be part of the network overlay
   topology and its associated infrastructure (e.g., control plane,
   routing tables, etc.)  SFs need to be able to return a packet to an appropriate SFF (i.e., has
   the requisite NSH information) when service processing is complete.  This can be via the over or 
   underlay and in some case require additional configuration on the SF.
   
   As mentioned above, an existing overlay
   topology may be used provided it offers the requisite connectivity.

  </t>
 <t>
The mapping of SPI to transport occurs on an SFF (as discussed above, the first SFF in the path gets a NSH encapsulated packet from the Classifier).  The SFF consults
   the SPI/ID values to determine the appropriate overlay transport
   protocol (several may be used within a given network) and next hop
   for the requisite SF.  <xref target="map1" /> below depicts an example of a single next-hop SPI/SI to network
   overlay network locator mapping.

</t>

 <texttable title="SFF NSH Mapping Example" anchor="map1">
          <ttcol align="left">SPI</ttcol>
          <ttcol align="left">SI</ttcol>
          <ttcol align="left">Next hop(s)</ttcol>
          <ttcol align="left">Transport</ttcol>

<c>  10  </c><c> 255 </c><c>  192.0.2.1          </c><c>   VXLAN-gpe        </c>
<c>  10  </c><c> 254 </c><c>  198.51.100.10      </c><c>   GRE              </c>
<c>  10  </c><c> 251 </c><c>  198.51.100.15      </c><c>   GRE              </c>
<c>  40  </c><c> 251 </c><c>  198.51.100.15      </c><c>   GRE              </c>
<c>  50  </c><c> 200 </c><c>  01:23:45:67:89:ab  </c><c>   Ethernet         </c>
<c>  15  </c><c> 212 </c><c>  Null (end of path) </c><c>   None             </c>
</texttable>

  <t>
    Additionally, further indirection is possible: the resolution of the
   required SF network locator may be a localized resolution on an
   SFF, rather than a service function chain control plane
   responsibility, as per 
<xref target="map2" /> and <xref target="map3" />
below.

  </t>
    <t>
    Please note: VXLAN-gpe and GRE in the above table refer to <xref target="I-D.ietf-nvo3-vxlan-gpe"></xref>
 and <xref target="RFC2784"></xref>, respectively.
    </t>


            <texttable title="NSH to SF Mapping Example" anchor="map2">
<ttcol> SPI </ttcol><ttcol>  SI </ttcol><ttcol>  Next hop(s)   </ttcol>
 <c> 10  </c><c>  3  </c><c>      SF2       </c>
 <c> 245 </c><c>  12 </c><c>      SF34      </c>
 <c> 40  </c><c>  9  </c><c>      SF9       </c>
          </texttable>



            <texttable title="SF Locator Mapping Example" anchor="map3">
<ttcol>  SF  </ttcol><ttcol>  Next hop(s)      </ttcol><ttcol>  Transport  </ttcol>
<c>  SF2 </c><c>  192.0.2.2        </c><c>  VXLAN-gpe  </c>
<c>  SF34</c><c>  198.51.100.34    </c><c>  UDP        </c>
<c>  SF9 </c><c>  2001:db8::1      </c><c>  GRE        </c>
          </texttable>

<t>
   Since the SPI is a representation of the service path, the lookup may
   return more than one possible next-hop within a service path for a
   given SF, essentially a series of weighted (equally or otherwise)
   paths to be used (for load distribution, redundancy or
   policy), see <xref target="map4" />.  The metric depicted in <xref target="map4" /> is an
   example to help illustrated weighing SFs.  In a real network, the
   metric will range from a simple preference (similar to routing next-
   hop), to a true dynamic composite metric based on some service
   function-centric state (including load, sessions state, capacity,
   etc.)



</t>


            <texttable title="NSH Weighted Service Path" anchor="map4">
<ttcol> SPI </ttcol><ttcol> SI </ttcol><ttcol>   NH        </ttcol><ttcol>  Metric </ttcol>
   <c> 10  </c><c>  3 </c><c> 203.0.113.1 </c><c>  1      </c>
   <c>     </c><c>    </c><c> 203.0.113.2 </c><c>  1      </c>
   <c> 20  </c><c> 12 </c><c> 192.0.2.1   </c><c>  1      </c>
   <c>     </c><c>    </c><c> 203.0.113.4 </c><c>  1      </c>
   <c> 30  </c><c>  7 </c><c> 192.0.2.10  </c><c>  10     </c>
   <c>     </c><c>    </c><c> 198.51.100.1</c><c>  5      </c>
<postamble>(encapsulation type omitted for formatting)</postamble>
          </texttable>


</section>


<section title="Mapping NSH to Network Transport">

<t>
As described above, the mapping of SPI to network topology may result
   in a single path, or it might result in a more complex
   topology.  Furthermore, the SPI to overlay mapping occurs at each
   SFF independently.  Any combination of topology selection is
   possible.  Please note, there is no requirement to create a new overlay topology 
   if a suitable one already existing.  NSH packets can use any (new or existing) 
   overlay provided the requisite connectivity requirements are satisfied.  

</t>

<t>
Examples of mapping for a topology:
</t>

 <t><list style="numbers">
 <t>
Next SF is located at SFFb with locator 2001:db8::1
<vspace blankLines="0" /> 
SFFa mapping: SPI=10 --> VXLAN-gpe, dst-ip: 2001:db8::1
  </t>
  <t>
Next SF is located at SFFc with multiple network locators for load
       distribution purposes:
<vspace blankLines="0" /> 
SFFb mapping: SPI=10 --> VXLAN-gpe, dst_ip:203.0.113.1, 203.0.113.2, 203.0.113.3, equal cost
  </t>
  <t>
Next SF is located at SFFd with two paths from SFFc, one for
       redundancy:
<vspace blankLines="0" /> 
SFFc mapping: SPI=10 --> VXLAN-gpe, dst_ip:192.0.2.10 cost=10,
       203.0.113.10, cost=20
  </t>
</list></t>

<t>
   In the above example, each SFF makes an independent decision about
   the network overlay path and policy for that path.  In other words,
   there is no a priori mandate about how to forward packets in the
   network (only the order of services that must be traversed).

</t>
<t>
The network operator retains the ability to engineer the network
   paths as required.  For example, the overlay path between SFFs 
   may utilize traffic engineering, QoS marking, or 
   ECMP, without requiring complex configuration and network protocol
   support to be extended to the service path explicitly.  In other
   words, the network operates as expected, and evolves as required, as
   does the service plane.

</t>


</section>


<section title="Service Plane Visibility">
<t>
The SPI and SI serve an important function for visibility into the
   service topology.  An operator can determine what service path a
   packet is "on", and its location within that path simply by viewing
   NSH information (packet capture, IPFIX, etc.)  The information
   can be used for service scheduling and placement decisions,
   troubleshooting and compliance verification.

</t>
</section>

<section title="Service Graphs">
<t>

While a given realized service function path is a specific sequence
of service functions, the service as seen by a user can actually be a
collection of service function paths, with the interconnection
provided by classifiers (in-service path, non-initial
reclassification).  These internal reclassifiers examine the packet
at relevant points in the network, and, if needed, SPI and SI are updated (whether
this update is a re-write, or the imposition of a new NSH with new values is implementation
specific) to reflect the "result" of the classification.  These classifiers may also 
of course modify the metadata associated with the packet.
<vspace blankLines="0" /> 
<xref target="RFC7665" />, Section 2.1 describes Service Graphs in detail.
</t>

</section>



</section>

<section title="Policy Enforcement with NSH">

<section title="NSH Metadata and Policy Enforcement">
<t>
As described in Section 3, NSH provides the ability to carry metadata
   along a service path.  This metadata may be derived from several
   sources, common examples include:

</t>
 <t><list style="hanging">
 <t>
Network nodes/devices: Information provided by network nodes can indicate
      network-centric information (such as VRF or tenant) that may be
      used by service functions, or conveyed to another network node
      post service path egress.  
 
</t>
<t>
External (to the network) systems: External systems, such as
      orchestration systems, often contain information that is valuable
      for service function policy decisions.  In most cases, this
      information cannot be deduced by network nodes.  For example, a
      cloud orchestration platform placing workloads "knows" what
      application is being instantiated and can communicate this
      information to all NSH nodes via metadata carried in the context header(s).

</t>

<t>
Service Functions: A classifier co-resident with Service Functions often perform very detailed
      and valuable classification.  In some cases they may terminate,
      and be able to inspect encrypted traffic.  

</t>
</list></t>

<t>
   Regardless of the source, metadata reflects the "result" of
   classification.  The granularity of classification may vary.  For
   example, a network switch, acting as a classifier, might only be able to classify based on a
   5-tuple, whereas, a service function may be able to inspect
   application information.  Regardless of granularity, the
   classification information can be represented in NSH.

</t>

<t>
Once the data is added to NSH, it is carried along the service path,
   NSH-aware SFs receive the metadata, and can use that metadata for
   local decisions and policy enforcement.  <xref target="g1" /> and <xref target="g2" />
   highlight the relationship between metadata and policy:

</t>



            <figure title="Metadata and Policy" anchor="g1">
              <artwork align="center">
+-------+        +-------+        +-------+
|  SFF  )------->(  SFF  |------->|  SFF  |
+---^---+        +---|---+        +---|---+
  ,-|-.            ,-|-.            ,-|-.
 /     \          /     \          /     \
( Class )        (  SF1  )        (  SF2  )
 \ ify /          \     /          \     /
  `---'            `---'            `---'
 5-tuple:        Permit             Inspect
 Tenant A        Tenant A           AppY
 AppY
             </artwork>
          </figure>
          
          
            <figure title="External Metadata and Policy" anchor="g2">
              <artwork align="center">
 +-----+           +-----+            +-----+  
 | SFF |---------> | SFF |----------> | SFF |  
 +--+--+           +--+--+            +--+--+  
    ^                 |                  |     
  ,-+-.             ,-+-.              ,-+-.   
 /     \           /     \            /     \  
( Class )         (  SF1  )          (  SF2  ) 
 \ ify /           \     /            \     /  
  `-+-'             `---'              `---'   
    |              Permit            Deny AppZ 
+---+---+          employees                   
|       |                                      
+-------+                                      
external                                       
system:                                        
Employee                                       
AppZ                                          
             </artwork>
          </figure>

<t>
   In both of the examples above, the service functions perform policy
   decisions based on the result of the initial classification: the SFs
   did not need to perform re-classification, rather they rely on a
   antecedent classification for local policy enforcement.

</t>
<t>
Depending on the information carried in the metadata, data privacy
considerations may need to be considered.  For example, if the metadata
conveys tenant information, that information may need to be
authenticated and/or encrypted between the originator and the intended
recipients (which may include intended SFs only) .  NSH itself does not
provide privacy functions, rather it relies on the transport/overlay
layer.  An operator can select the appropriate transport to ensure the
confidentially (and other security) considerations are met.  Metadata privacy 
 and security considerations are a matter for the documents that 
 define metadata format.
</t>

</section>

<section title="Updating/Augmenting Metadata">

<t>
   Post-initial metadata imposition (typically performed during initial
   service path determination), metadata may be augmented or updated:

</t>

<t>
<list style="numbers">
<t>
Metadata Augmentation: Information may be added to NSH's existing
       metadata, as depicted in <xref target="augment" />.  For example, if the initial
       classification returns the tenant information, a secondary
       classification (perhaps co-resident with DPI or SLB) may augment the tenant
       classification with application information, and impose that new information in NSH metadata.  The tenant
classification is still valid and present, but additional
       information has been added to it.

</t>
      
<t>
Metadata Update: Subsequent classifiers may update the initial
       classification if it is determined to be incorrect or not
       descriptive enough.  For example, the initial classifier adds
       metadata that describes the traffic as "internet" but a security
       service function determines that the traffic is really "attack".
       <xref target="update" /> illustrates an example of updating metadata.
</t>

</list>
</t>

            <figure title="Metadata Augmentation" anchor="augment">
              <artwork align="center">
 +-----+           +-----+            +-----+  
 | SFF |---------> | SFF |----------> | SFF |  
 +--+--+           +--+--+            +--+--+  
    ^                 |                  |     
  ,---.             ,---.              ,---.   
 /     \           /     \            /     \  
( Class )         (  SF1  )          (  SF2  ) 
 \     /           \     /            \     /  
  `-+-'             `---'              `---'   
    |              Inspect           Deny      
+---+---+          employees         employee+ 
|       |          Class=AppZ        appZ      
+-------+                                      
external                                       
system:                                        
Employee                                       
             </artwork>
          </figure>



<figure title="Metadata Update" anchor="update">
              <artwork align="center">
  +-----+           +-----+            +-----+   
  | SFF |---------> | SFF |----------> | SFF |   
  +--+--+           +--+--+            +--+--+   
     ^                 |                  |      
   ,---.             ,---.              ,---.    
  /     \           /     \            /     \   
 ( Class )         (  SF1  )          (  SF2  )  
  \     /           \     /            \     /   
   `---'             `---'              `---'    
5-tuple:            Inspect             Deny     
Tenant A            Tenant A            attack   
                     --> attack                  
             </artwork>
          </figure>

</section>

<section title="Service Path Identifier and Metadata">
<t>
 Metadata information may influence the service path selection since
  the Service Path Identifier values can represent the result of
  classification.  A given SPI can be defined based on classification results (including metadata classification).  
    The imposition of the SPI and SI results in the packet being placed on the newly 
    specified SFP at the position indicated by the imposed SPI and SI.
</t>
<t>
   This relationship provides the ability to create a dynamic service
  plane based on complex classification without requiring each node to
  be capable of such classification, or requiring a coupling to the
  network topology.  This yields service graph functionality as
  described in Section 7.4.  <xref target="g3" /> illustrates an example of this
  behavior.
</t>

            <figure title="Path ID and Metadata" anchor="g3">
              <artwork align="center">
  +-----+           +-----+            +-----+     
  | SFF |---------> | SFF |------+---> | SFF |      
  +--+--+           +--+--+      |     +--+--+      
     |                 |         |        |         
   ,---.             ,---.       |      ,---.       
  /     \           / SF1 \      |     /     \      
 (  SCL  )         (   +   )     |    (  SF2  )     
  \     /           \SCL2 /      |     \     /      
   `---'             `---'    +-----+   `---'       
5-tuple:            Inspect   | SFF |    Original   
Tenant A            Tenant A  +--+--+    next SF    
                     --> DoS     |                  
                                 V                  
                               ,-+-.                
                              /     \               
                             (  SF10 )              
                              \     /               
                               `---'                
                                DoS                 
                             "Scrubber"             
              </artwork>

          </figure>


<t>
Specific algorithms for mapping metadata to an SPI are outside the
   scope of this document.
</t>

</section>

</section>


<section title="Security Considerations" toc="default">
      <t>

  As with many other protocols, NSH data can be spoofed or otherwise
  modified.  In many deployments, NSH will be used in a controlled
  environment, with trusted devices (e.g., a data center) thus
  mitigating the risk of unauthorized header manipulation.


      </t>
      <t>
       NSH is always encapsulated in a transport protocol and therefore,
  when required, existing security protocols that provide authenticity
  (e.g.,  <xref target="RFC6071"></xref>) can be used.  Similarly, if confidentiality is
  required, existing encryption protocols can be used in conjunction
  with encapsulated NSH.
      </t>
      <t>
      Further, existing best practices, such as <xref target="BCP38" /> should be deployed
  at the network layer to ensure that traffic entering the service path
  is indeed "valid".  <xref target="I-D.ietf-rtgwg-dt-encap"></xref> provides
  additional transport encapsulation considerations.
      </t>
      <t>
          NSH metadata authenticity and confidentially must be considered as
   well.  In order to protect the metadata, an operator can leverage
   the aforementioned mechanisms provided the transport layer,
   authenticity and/or confidentiality. An operator MUST carefully
   select the transport/underlay services to ensure end to end security
   services, when those are sought after.  For example, if <xref target="RFC6071" /> is
   used, the operator MUST ensure it can be supported by the
   transport/underlay of all relevant network segments as well as SFF
   and SFs.  Further, as    
        described in Section 8.1, operators can and should use indirect    
        identification for personally identifying information, thus    
        significantly mitigating the risk of privacy violation.

Means to prevent leaking privacy-related information outside an administrative domain are natively supported by NSH given that the last SFF of a path will systematically remove the NSH header before forwarding a packet upstream.

   </t>
    <t>
   Lastly, SF security, although out of scope of this document, should
    be considered, particularly if an SF needs to access, authenticate
    or update NSH metadata.
    </t>            
    </section>
    
     

   <section title="Contributors" anchor="contrib">
      <t>

This WG document originated as draft-quinn-sfc-nsh and had the following co-authors and contributors.  
The editors of this document would like to thank and recognize them and their contributions.  
These co-authors and contributors provided invaluable concepts and content for this document's creation. 
</t>
 <t>
 
     Surendra Kumar
     <vspace blankLines="0" /> 
     Cisco Systems
     <vspace blankLines="0" /> 
     smkumar@cisco.com
     <vspace blankLines="1" /> 
     
     Michael Smith
     <vspace blankLines="0" /> 
     Cisco Systems
     <vspace blankLines="0" /> 
     michsmit@cisco.com
     <vspace blankLines="1" /> 
 
     Jim Guichard
     <vspace blankLines="0" /> 
    Huawei
     <vspace blankLines="0" /> 
     james.n.guichard@huawei.com
     <vspace blankLines="1" /> 
         
         
      Rex Fernando
      <vspace blankLines="0" /> 
      Cisco Systems
      <vspace blankLines="0" /> 
       Email: rex@cisco.com
      <vspace blankLines="1" /> 
 
     
      Navindra Yadav 
   <vspace blankLines="0" /> 
   Cisco Systems
   <vspace blankLines="0" /> 
   Email: nyadav@cisco.com
   <vspace blankLines="1" /> 
     
     Wim Henderickx
     <vspace blankLines="0" /> 
     Alcatel-Lucent
     <vspace blankLines="0" /> 
     wim.henderickx@alcatel-lucent.com
     <vspace blankLines="1" /> 
     
     Andrew Dolganow
    <vspace blankLines="0" /> 
    Alcaltel-Lucent
    <vspace blankLines="0" /> 
    Email: andrew.dolganow@alcatel-lucent.com
   <vspace blankLines="1" /> 
   
    Praveen Muley
     <vspace blankLines="0" /> 
     Alcaltel-Lucent
     <vspace blankLines="0" /> 
     Email: praveen.muley@alcatel-lucent.com
     <vspace blankLines="1" /> 
    

     Tom Nadeau
     <vspace blankLines="0" /> 
     Brocade
     <vspace blankLines="0" /> 
     tnadeau@lucidvision.com
     <vspace blankLines="1" /> 
     
     Puneet Agarwal
     <vspace blankLines="0" /> 
     puneet@acm.org
     <vspace blankLines="1" /> 
     
     Rajeev Manur
     <vspace blankLines="0" /> 
     Broadcom
     <vspace blankLines="0" /> 
     rmanur@broadcom.com
     <vspace blankLines="1" /> 
     
     Abhishek Chauhan
     <vspace blankLines="0" /> 
     Citrix
     <vspace blankLines="0" /> 
     Abhishek.Chauhan@citrix.com
     <vspace blankLines="1" /> 
     
     Joel Halpern
     <vspace blankLines="0" /> 
     Ericsson
     <vspace blankLines="0" /> 
     joel.halpern@ericsson.com
     <vspace blankLines="1" /> 
     
     Sumandra Majee
     <vspace blankLines="0" /> 
     F5
     <vspace blankLines="0" /> 
     S.Majee@f5.com
     <vspace blankLines="1" /> 
     
     David Melman
     <vspace blankLines="0" /> 
     Marvell
     <vspace blankLines="0" /> 
     davidme@marvell.com
     <vspace blankLines="1" /> 
     
     Pankaj Garg
     <vspace blankLines="0" /> 
     Microsoft
     <vspace blankLines="0" /> 
     pankajg@microsoft.com
     <vspace blankLines="1" /> 
     
     Brad McConnell
     <vspace blankLines="0" /> 
     Rackspace
     <vspace blankLines="0" /> 
     bmcconne@rackspace.com
     <vspace blankLines="1" /> 
     
     Chris Wright
     <vspace blankLines="0" /> 
     Red Hat Inc.
     <vspace blankLines="0" /> 
     chrisw@redhat.com
     <vspace blankLines="1" /> 
     
     Kevin Glavin
     <vspace blankLines="0" /> 
     Riverbed
     <vspace blankLines="0" /> 
     kevin.glavin@riverbed.com
     <vspace blankLines="1" /> 
     
     Hong (Cathy) Zhang
     <vspace blankLines="0" /> 
     Huawei US R&amp;D
     <vspace blankLines="0" /> 
     cathy.h.zhang@huawei.com
     <vspace blankLines="1" /> 
     
     Louis Fourie    
     <vspace blankLines="0" /> 
     Huawei US R&amp;D
     <vspace blankLines="0" /> 
     louis.fourie@huawei.com
     <vspace blankLines="1" /> 
     
     Ron Parker
     <vspace blankLines="0" /> 
     Affirmed Networks
     <vspace blankLines="0" /> 
     ron_parker@affirmednetworks.com
     <vspace blankLines="1" /> 
     
     Myo Zarny
     <vspace blankLines="0" /> 
     Goldman Sachs
     <vspace blankLines="0" /> 
    myo.zarny@gs.com    
    <vspace blankLines="1" /> 
 
   
      
      </t>
      
    
    </section>



    <section title="Acknowledgments" toc="default">
      <t>
      The authors would like to thank Sunil Vallamkonda, Nagaraj Bagepalli, Abhijit Patra,
      Peter Bosch, Darrel Lewis, Pritesh Kothari, Tal Mizrahi and Ken Gray for their detailed review, comments and contributions.
      </t>
      <t>
      A special thank you goes to David Ward and Tom Edsall for their guidance and feedback.
      </t>
      <t>
      Additionally the authors would like to thank Larry Kreeger for his
      invaluable ideas and contributions which are reflected throughout this document.
      </t>
      <t>
        Loa Andersson provided a thorough review and valuable comments, we thank him for that.
     </t>
      <t>
      Reinaldo Penno deserves a particular thank you for his architecture and implementation work 
      that helped guide the protocol concepts and design.
      </t>
      <t>
The editors also acknowledge a comprehensive review and respective suggestions by Med Boucadair.
      </t>
      <t>
      Lastly, David Dolson has provides significant review, feedback and suggestions throughout
      the evolution of this document.  His contributions are very much appreciated.  
       </t>
    </section>

    <section anchor="iana" title="IANA Considerations" toc="default">

     <section title ="NSH EtherType" anchor="et">
     <t>
     An IEEE EtherType, 0x894F, has been allocated for NSH.
    </t>
    </section>
         
         

         
         
         
     <section title = "Network Service Header (NSH) Parameters" anchor ="sfcparams">
      <t>
      IANA is requested to create a new "Network Service Header (NSH) Parameters" registry. 
      The following sub-sections request new registries within the "Network Service Header (NSH) Parameters
      " registry.
      </t>
      
      <section title = "NSH Base Header Unassigned Bits" anchor ="bbits">
      <t>
   There are five unassigned bits in the NSH Base Header.  New bits are assigned via Standards Action <xref
        target="RFC8126"></xref>.
    </t>
    <t>
  
   <vspace blankLines="0" /> 
   Bit 3 - Unassigned
  <vspace blankLines="0" /> 
   Bits 16-19 - Unassigned
   <vspace blankLines="0" /> 
   
   </t>
       </section>
      
      <section title = "NSH Version" anchor ="vbits">
      <t>
        IANA is requested to setup a registry of "NSH Version". 
        New values are assigned via Standards Action <xref target="RFC8126" />.
    </t>
    <t>
   Version 00b: This protocol version. This document.
      <vspace blankLines="0" /> 
   Version 01b: Reserved. This document.
      <vspace blankLines="0" /> 
   Version 10b: Unassigned.
      <vspace blankLines="0" /> 
   Version 11b: Unassigned.
       <vspace blankLines="0" /> 
    </t>          
      </section>
    
    
     <section title ="MD Type Registry" anchor="mdt">
    
    <t>    
IANA is requested to set up a registry of "MD Types". These are 4-bit values. MD Type 
values 0x0, 0x1, 0x2, and 0xF are specified in this document, see <xref target="tab1" />.

Registry entries are assigned by using the "IETF Review" policy defined in <xref
        target="RFC8126">RFC 8126</xref>.
</t>

 <texttable title="MD Type Values" anchor="tab1">
          

          <ttcol align="left">MD Type</ttcol>

          <ttcol align="left">Description</ttcol>
          
          <ttcol align="left">Reference</ttcol>

          <c>0x0</c>

          <c>Reserved</c>

          <c>This document</c>

          <c>0x1</c>

          <c>NSH MD Type 1</c>

          <c>This document</c>

           <c>0x2</c>

          <c>NSH MD Type 2</c>

          <c>This document</c>
          
          <c>0x3..0xE</c>

          <c>Unassigned</c>

          <c></c>
          
          <c>0xF</c>

          <c>Experimentation</c>

          <c>This document</c>
          
        </texttable>


    </section>

     <section title ="MD Class Registry" anchor="mdclass">
    
    <t>    
IANA is requested to set up a registry of "MD Class".  These are 16-
   bit values. New allocations are to be made according to the
   following policies:

  <vspace blankLines="1" /> 
   0x0000 to 0x01ff: IETF Review
  <vspace blankLines="0" /> 
   0x0200 to 0xfff5: Expert Review
  <vspace blankLines="0" /> 
   0xfff6 to 0xfffe: Experimental
  <vspace blankLines="0" /> 
   0xffff: Reserved
  <vspace blankLines="0" /> 


</t>
<t>
IANA is requested to assign the values as per <xref target="ttab" />::
</t>


<texttable anchor="ttab" title="MD Class Value" >
<ttcol>MD Class </ttcol><ttcol> Meaning                    </ttcol><ttcol> Reference </ttcol>
<c>0x0000   </c><c> IETF Base NSH MD Class     </c><c> This.I-D </c>
</texttable>
<t>

 
   Designated Experts evaluating new allocation requests
   from the "Expert Review" range should principally
   consider whether a new MD class is needed compared to
   adding MD types to an existing class. The Designated 
   Experts should also encourage the existence of an
   associated and publicly visible registry of MD types
   although this registry need not be maintained by IANA.
</t>


 </section>



<section title ="NSH Base Header Next Protocol" anchor="bnp">
    <t>
    IANA is requested to set up a registry of "Next Protocol". These are 8-bit values.  
    Next Protocol values 0, 1, 2, 3, 4 and 5 are defined in this document (see <xref target="tab2" />.  New
   values are assigned via "Expert Reviews" as per <xref
        target="RFC8126"></xref>.
   
</t>
    <texttable title="NSH Base Header Next Protocol Values" anchor="tab2">
          

          <ttcol align="left">Next Protocol</ttcol>

          <ttcol align="left">Description</ttcol>
          
          <ttcol align="left">Reference</ttcol>

          <c>0x0</c>

          <c>Unassigned</c>

          <c></c>

          <c>0x1</c>

          <c>IPv4</c>

          <c>This document</c>
          
          <c>0x2</c>

          <c>IPv6</c>

          <c>This document</c>
          
          <c>0x3</c>

          <c>Ethernet</c>

          <c>This document</c>

          <c>0x4</c>

          <c>NSH</c>

          <c>This document</c>
          
          <c>0x5</c>

          <c>MPLS</c>

          <c>This document</c>

          
          <c>0x6..0xFD</c>

          <c>Unassigned</c>

          <c></c>
                 <c>0xFE</c>

          <c>Experiment 1</c>

          <c>This document</c>
          
          <c>0xFF</c>

          <c>Experiment 2</c>

          <c>This document</c>
          
        </texttable>
   
</section>

<section title="New IETF assigned MD Type Registry" anchor="tr">
<t>
   This document requests IANA to create a registry for the type values
   owned by the IETF (i.e., MD Class set to 0x0000) called the "IETF Assigned
   MD Type Registry."
</t>
<t>
   The type values are assigned via Standards Action <xref target="RFC8126" />.
</t>
<t>
   No initial values are assigned at the creation of the registry.
</t>
</section>


</section>

</section>

</middle>


  <back>
  
  
   <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->



    <references title="Normative References">
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
   

&RFC2119;
&RFC8126;
&RFC7665;     



    </references>
        
    <references title="Informative References">
    
    &RFC2784;    
    &RFC6071;
    &RFC7325;
    &RFC7498;    
   <?rfc include="reference.RFC.3692"?>
   <?rfc include="reference.I-D.ietf-sfc-oam-framework"?>
   <?rfc include="reference.I-D.guichard-sfc-nsh-dc-allocation"?>
   <?rfc include="reference.I-D.napper-sfc-nsh-broadband-allocation"?>
   <?rfc include="reference.I-D.ietf-nvo3-vxlan-gpe"?>
   <?rfc include="reference.I-D.ietf-sfc-control-plane"?>
   <?rfc include="reference.I-D.ietf-rtgwg-dt-encap"?>
    
    
<reference anchor="BCP38" target="http://www.rfc-editor.org/info/rfc2827"><front><title>Network Ingress Filtering: Defeating Denial of Service Attacks which employ IP Source Address Spoofing</title><author initials="P." surname="Ferguson" fullname="P. Ferguson"><organization/></author><author initials="D." surname="Senie" fullname="D. Senie"><organization/></author><date year="2000" month="May"/><abstract><t>This paper discusses a simple, effective, and straightforward method for using ingress traffic filtering to prohibit DoS (Denial of Service) attacks which use forged IP addresses to be propagated from 'behind' an Internet Service Provider's (ISP) aggregation point.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract></front><seriesInfo name="BCP" value="38"/><seriesInfo name="RFC" value="2827"/><seriesInfo name="DOI" value="10.17487/RFC2827"/></reference>


 
 
<!--    
      <reference anchor="ETYPES"
                 target="http://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xml">
        <front>
          <title>IEEE 802 Numbers</title>

          <author>
            <organization>The IEEE Registration Authority</organization>
          </author>

          <date year="2012" />
        </front>
      </reference>
-->
        
</references> 


  </back>



</rfc>
