<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="no" ?>
<?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"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC7665 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7665.xml">
<!ENTITY RFC7799 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7799.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8300 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8300.xml">
]>

<rfc number="8393" category="std" submissionType="IETF" consensus="yes" ipr="trust200902">
  <front>
    <title abbrev="NSH With No Data">Operating the Network Service Header
    (NSH) with Next Protocol "None"</title>

    <author fullname="Adrian Farrel" initials="A." surname="Farrel">
      <organization>Juniper Networks</organization>
      <address>
        <email>afarrel@juniper.net</email>
      </address>
    </author>

    <author fullname="John Drake" initials="J." surname="Drake">
      <organization>Juniper Networks</organization>
      <address>
        <email>jdrake@juniper.net</email>
      </address>
    </author>

    <date month="May" year="2018" />
    <area>Routing</area>
    <workgroup>SFC Working Group</workgroup>
    <keyword>Service Function Chaining</keyword>
    <keyword>Network Service Header</keyword>
    <keyword>Metadata</keyword>

    <abstract>

      <t>This document describes a network that supports Service Function
      Chaining (SFC) using the Network Service Header (NSH) with no payload
      data and carrying only metadata.  This is achieved by defining a new NSH
      "Next Protocol" type value of "None".</t>

      <t>This document illustrates some of the functions that may be achieved
      or enhanced by this mechanism, but it does not provide an exhaustive
      list of use cases, nor is it intended to be definitive about the
      functions it describes. It is expected that other documents will
      describe specific use cases in more detail and will define the 
      protocol mechanics for each use case.</t>

    </abstract>
</front>

<middle>

  <section anchor="introduction" title="Introduction">

<t>An architecture for Service Function Chaining (SFC) is presented in <xref
target="RFC7665" />. That architecture enables packets to be forwarded along Service Function Paths (SFPs) to
       pass through various Service Functions (SFs) that act on the packets.  Each packet is encapsulated
       with a Network Service Header (NSH) <xref target="RFC8300" /> that identifies the SFP
       that the packet travels along (by means of a Service Path Identifier -- SPI) and the hop (i.e.,
       the next SF to be executed) along the SFP that the packet has reached (by means of a Service
       Index -- SI).  The SPI and SI are fields encoded in the NSH.</t>

<!-- [rfced] Note that here and throughout the document we changed "Classifier" to
"classifier" to match the lowercase form used in RFC 7665.  Please let us know
if this is incorrect. 

-->

    <t>Packets are classified at the SFC network ingress boundaries by classifiers (Section 4.4 of
       <xref target="RFC7665" />) and have an NSH applied to them.  Such packets are forwarded between
       Service Function Forwarders (SFFs) using tunnels across the underlay network, and each SFF may
       hand the packet off to one or more Service Function Instances (SFIs) according to the definition
       of the SFP.</t>

<t>The SFC classifier or any SFC-aware SFI may wish to share information (possibly state information)
       about the SFP, the traffic flow, or a specific packet, and they may do this by adding metadata
       to packets as part of the NSH.  Metadata may be used to enhance or enable the function performed by
       SFC-aware SFs, may enable coordination and data exchange between SFIs, or may be used to assist a
       network operator in the diagnosis and monitoring of an SFP.  The nature of metadata to be supplied
       and consumed is implementation- and deployment-specific.</t>

    <t>This document defines a mechanism for metadata to be carried on an SFP without the need for payload
       data.  This mechanism enables diagnosis and monitoring of SFPs, and coordination between SFC-aware
       SFIs.  The mechanism can be applied without the need for traffic to be flowing; if traffic is
       flowing, it can be applied without the need to insert what might be substantial amounts of metadata
       into data packets (an operation that may be costly in some hardware).</t>

    <t>This document describes how this function is achieved through the use of a new value for the NSH
       "Next Protocol" field to indicate "None".  Like any NSH packets, such packets are contained within
       the SFC-enabled domain.</t>

    <t>This document illustrates some of the functions that may be achieved or enhanced by this mechanism,
       but it does not provide an exhaustive list of use cases, nor is it intended to be definitive about the
       functions it describes (see <xref target="uses" />).</t>

    <t>This document uses the terms defined in <xref target="RFC7665" /> and <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&nbsp;14
       <xref target="RFC2119" /> <xref target="RFC8174" /> when, and only when,
       they appear in all capitals, as shown here.</t>
  </section>

  <section anchor="nsh" title="The Network Service Header">

    <t>The NSH includes a field called "Next Protocol" that is used to indicate the nature of the payload
       data that follows the NSH.  The field can be used by any component that processes the NSH (for example,
       to understand how to interpret and parse the payload) and by nodes at the end of the SFP that remove
       the NSH and forward the payload data.</t>

    <section anchor="none" title="Next Protocol &quot;None&quot;">

      <t>This document defines a new value (0x00) for the "Next Protocol"
      field to indicate that the next protocol is "None", which means that
      there is no user/payload data following the NSH.</t> 

      <t>When the next protocol is "None", the rest of the NSH still has meaning; in particular, the
         metadata carried in the NSH may still be present.  It is not intended
	 that a packet with next protocol
         set to "None" be sent with no metadata (see <xref target="process" />).  Thus, an SFC-aware node SHOULD NOT
         create a packet with "Next Protocol" set to "None", Metadata Type
      set to 0x2, and with an NSH Length of 0x2.</t>

    </section>

  </section>

  <section anchor="process" title="Processing Rules">

    <t>A packet with no payload data may be inserted at the head end of an SFP
    (such as at a classifier) and may be easily forwarded by an SFF or SFI on
    the SFP using the processing rules defined in <xref target="RFC8300" />.</t>

    <t>A packet with no payload may also be generated by an SFC-aware SFI as a
    result of processing an incoming packet (i.e., triggered by a condition
    arising from processing a normal NSH packet with a payload).  
In such cases, the SPI/SI can be inherited from the original packet or can be
set according to information supplied in one of three ways: 
<list style="symbols">
<t>through the control plane,</t>
<t>through the management plane, or</t>
<t>through information carried in the metadata of the data packet.</t>
</list>
This document does not further specify the triggers to generate
    an NSH packet with a "Next Protocol" set to "None".
</t> 

    <t>An SFC-aware node wishing to send metadata without a data packet (i.e., a node that conforms to
       this specification):
       <list style="symbols">
         <t>MUST create a packet carrying an NSH and the desired metadata.</t>
         <t>MUST set the "Next Protocol" field to 0x00.</t>
         <t>SHOULD ensure that there are no bytes following the end of the NSH (i.e., that there is
            no payload data).</t>
         <t>MUST encapsulate and send the packet as normal for tunneling to the next hop on the SFP as
            would be done for any NSH packet (i.e., for a data packet following the SFP).</t>
       </list></t>

<t>A transit node (SFF, SFI, or classifier) that conforms to this
specification and that receives a packet with "Next Protocol" indicating
"None" MUST NOT attempt to parse or process beyond the end of the NSH, but it
SHOULD process the NSH and the metadata as normal.  Processing for nodes that
do not support "Next Protocol" set to "None" is described in <xref
target="backward" />. Note, however, that an intermediate node that is
instructed to strip all metadata from packets will create a packet with an NSH
but no metadata and no payload.  Such packets SHOULD NOT continue to be forwarded along
       the SFP.</t>

    <t>A node that is the egress of an SFP would normally strip the NSH and forward the payload
       according to the setting of the "Next Protocol" field.  Such nodes MUST NOT forward packets
       with "Next Protocol" indicating "None" even if there are some bytes after the NSH.</t>

    <t>In deployments where use of next protocol "None" is not desired, administrators SHOULD instruct
       SFC-aware nodes to not create such packets and to discard packets with
    next protocol "None".</t>

  </section>

  <section anchor="backward" title="Backward Compatibility">

    <t>SFC-aware nodes that do not understand the meaning of a value contained in the "Next Protocol" field
       of the NSH are unable to parse the payload.  Such nodes silently drop packets with unknown "Next
       Protocol" values unless explicitly configured to forward them (Section 2.2 of <xref target="RFC8300" />).</t>

    <t>This means that legacy SFC-aware nodes that are unaware of the meaning of the "Next Protocol"
       value "None" will act as follows:
       <list style="symbols">
          <t>SFFs can be configured to forward the packets.</t>
          <t>SFC proxies will drop the packets.</t>
          <t>SFIs will most likely drop the packets.</t>
          <t>Classifiers (i.e., nodes performing reclassification) will most likely drop the packets.</t>
       </list></t>

    <t>SFC-aware nodes at the end of an SFP possibly forward packets with no knowledge of the payload in
       a "pop and forward" form of processing where the NSH is removed, the packet is simply put on
       an interface, and the payload protocol is known a priori (or assumed).  It is a general processing
       rule for all packet forwarding engines that they should not attempt to send packets with zero length.
       Packets with the NSH "Next Protocol" field set to "None" are expected to have zero payload length and
       so should not be forwarded once the NSH has been stripped.  In any case, as noted in <xref target="process" />,
       SFC-aware nodes at the end of an SFP do not forward packets with "Next Protocol" set to "None".</t>

  </section>

  <section anchor="uses" title="Overview of Use Cases">

    <section anchor="sfpuses" title="Per-SFP Metadata">

<t>Per-SFP metadata is metadata that applies to an SFP and any data packets on that SFP.  It does
          not need to be transmitted with every packet, but it can be installed
	  at the points of consumption
          (such as at SFIs) and applied to all packets on the SFP as they pass through this point.  It
          could be installed by inclusion in the NSH of a data packet sent on the SFP by out-of-band control- or management-plane mechanisms, or by separate metadata-only packets
	  using "Next Protocol" set to
          "None" as described in this document.</t>

       <t>Per-SFP metadata-only packets may be sent along the path of an SFP simply by setting the correct
          SPI in the NSH, and setting the SI to the correct value for the hop of the SFP at which the
          metadata is to be introduced.  SFC-aware nodes (e.g., classifiers) will know the correct SI values
          to be used from information supplied by the control or management plane as is the case for NSH
          packets with payload data.</t>

    </section>

    <section anchor="flowuses" title="Per-Flow Metadata">

       <t>Per-flow metadata is metadata that applies to a subset of the packets on an SFP, such as
          packets matching a particular 5-tuple of source address, destination address, source port,
          destination port, and payload protocol.  Also, this metadata does not need to be transmitted
          with every packet, but it can be installed at the SFIs on the SFP and applied to the packets
          that match the flow description.</t>

       <t>If there is just one flow on an SFP, then there is no difference between per-flow metadata
          and per-SFP metadata as described in <xref target="sfpuses" />.</t>

       <t>In normal processing, the flow to which per-flow metadata applies can be deduced by
          looking at the payload data in the context of the value of the "Next Protocol" field.
          However, when "Next Protocol" indicates "None", this cannot be done.  In this case, the
          identity of the flow is carried in the metadata itself.</t>

    </section>

    <section anchor="sfuses" title="Coordination between SFC-Aware SFIs">

       <t>A pair of SFC-aware SFIs (adjacent or not) on an SFP may desire to coordinate state and
          may do this by sending information encoded in metadata.</t>

       <t>To do this using the mechanisms defined in this document:
          <list style="symbols">
            <t>There must be an SFP that passes through the two SFIs in the direction of
               sender to receiver.</t>
            <t>The sender must know the correct SPI to use.</t>
            <t>The sender must know the correct SI to use for the point at which it resides
               on the SFP.</t>
            <t>Ideally, the receiver will know to remove the packet from the SFP and not forward
               it further as this might share metadata wider than desirable and would cause
               unnecessary packets in the network.  Note, however, that continued forwarding
               of such packets would not be substantially harmful in its own right.</t>
          </list></t>

       <t>Note that technically (according to the SFC architecture) the process of inserting a
          packet into an SFP is performed by a classifier.  However, a classifier may be
          co-resident with an SFI so that an implementation of an SF may also be able to generate
          NSH packets as described in this document.</t>

       <t>Note also that a system with SFIs that need to coordinate between each other may be
          configured so that there is a specific, dedicated SFP between those service functions
          that is used solely for this purpose.  Thus, such an SFI does not need to insert NSH
          packets onto SFPs used to carry payload data, but it can use (and
	  know the SPI of) this special, dedicated SFP.</t>

    </section>

    <section anchor="oamuses" title="Operations, Administration, and Maintenance (OAM)">

       <t>Requirements for Operations, Administration, and Maintenance (OAM) in SFC networks are
          discussed in <xref target="SFC-OAM-FRAME" />.  The NSH definition in
          <xref target="RFC8300" /> includes a O bit that indicates that the packet contains
          OAM information.</t>

       <t>If OAM information is carried in packets that also include payload data, that information
          might be carried between the NSH and the payload.  Therefore, the mechanism defined in this
          document can also be used to carry OAM information independent of payload data.</t>

       <t>Sending OAM separate from (but interleaved with) packets that carry payload data may
          have several advantages including:
          <list style="symbols">
            <t>Sending OAM when there is no other traffic flowing.</t>
            <t>Sending OAM at predictable intervals.</t>
            <t>Measuring path qualities distinct from behavior of SFIs.</t>
            <t>Sending OAM without needing to rewrite payload data buffers.</t>
            <t>Keeping OAM processing components separate from other processing components.</t>
          </list></t>

       <t>Mechanisms for providing active OAM <xref target="RFC7799"/> in an SFC network have been proposed
          <xref target="OAM-SFC" />.  This use case is not intended to define another
          mechanism for active OAM, but it does illustrate a further option for discussion by the working group.</t>

    </section>

    <section anchor="controluses" title="Control-Plane and Management-Plane Uses">

       <t>As described in <xref target="sfuses" />, SFPs can be established specifically to carry
          metadata-only packets.  And as described in <xref target="sfpuses" />, metadata-only
          packets can be sent down existing SFPs.  This means that metadata-only packets can be
          used to carry control-plane and management-plane messages used to control and
          manage the SFC network.</t>

       <t>In effect, SFPs can be established to serve as a Data Control
       Network (DCN) or a Management
          Control Network (MCN).  Further details of this process are out of scope for this document,
          but it should be understood that, just as for OAM, an essential feature of using a control
          channel is that the various speakers are assigned identifiers (i.e., addresses).  In this
          case, those identifiers could be SPI/SI pairs or could be IP addresses as used in the
          normal control and management plane of the SFC network.</t>

    </section>

    <section anchor="nonuses" title="Non-applicable Use Cases">

       <t>Per-packet metadata is metadata that applies specifically to a single payload packet.  It
          informs an SFI how to handle the payload packet and does not apply to any other packet.</t>

       <t>The mechanisms described in this document are not applicable to per-packet metadata
          because, by definition, if the "Next Protocol" indicates "None", then there is no packet
          following the NSH for the metadata to be associated with.</t>

    </section>

  </section>

  <section anchor="mgmt" title="Management and Congestion Control Considerations">

    <t>The mechanisms described in this document allow SFC-aware nodes in an SFC network to generate
       additional packets.  These are not intended to be sent frequently for any flow, but there is
       still a risk that they might flood the network.  For example, if an attempt is made to use this
       mechanism for "per-packet metadata" (see <xref target="nonuses"/>) then this might double the number of
       packets in the network.  Similarly, if this mechanism is used for a form of aliveness detection
       OAM that requires very frequent test messages, then the number of additional messages may be
       very high. Such additional messages risk causing congestion in the network.</t>

    <t>The underlay network (that is, the tunnels across the underlay between SFC nodes) will not
       distinguish between data-carrying packets and those packets with "Next Protocol" set to "None".
       All packets will be treated the same and will need to fall within the capabilities of the
       underlay network to process and forward packets.</t>

    <t>Nodes in the SFC overlay network will need to perform special processing on the additional
       packets according to their roles and according to the application for the metadata.  For
       example, an SFF will likely only have to forward per-SFP metadata, while an SF will need to
       extract it and process it as it would if the metadata was carried in a packet with user data.
       On the other hand, metadata might also be used to cause actions at all nodes
       (see Sections <xref target="sfuses" format="counter"/>, <xref
       target="oamuses" format="counter"/>, and <xref target="controluses" format="counter"/>)
       and could increase the processing load.</t>

    <t>In view of these potential issues, all implementations SHOULD implement rate limits on the
       generation of per-SFP packets with "Next Protocol" set to "None".  Furthermore, these rate limits
       SHOULD be configurable and applied per SFP and per application so that one application on
       one SFP does not encumber a different application on this or a different SFP.  When an
       implementation finds that it is unable to generate or send a packet, it SHOULD increment a
       counter that is accessible by the operator and MAY raise an alert (although such alerts
       SHOULD, themselves, be rate limited).</t>

    <t>Additionally, an SFC node needs to protect itself against another node in the network not
       applying suitable rate limits. Therefore, implementations SHOULD apply incoming rate limits
       for SFC packets with "Next Protocol" set to "None". Such rate limits
       MAY be application aware,
       per SFC or interface, and SHOULD be configurable, but implementations MAY be more subtle if
       they are aware of internal processing loads and have access to queues/buffers.  In any case,
       when an implementation drops a received packet because of these rate limits, it SHOULD
       increment a counter that is accessible by the operator and MAY raise an alert (although such
       alerts SHOULD, themselves, be rate limited).</t>

    <t>Suitable default rate limits will restrict an SFC node to not send more
    than one packet with "Next Protocol" set to "None" per ten data packets on
    any flow in a unit of time equal to the end-to-end delivery time on the flow.
</t>

  </section>

  <section anchor="security" title="Security Considerations">

    <t>Metadata-only packets as enabled by this document provide a covert channel.  However, this
       is only different from the metadata feature in the normal NSH in that it can be sent without
       the presence of a data flow.</t>

    <t>Metadata may, of course, contain sensitive data and may also contain information used to
       control the behavior of SFIs in the network.  As such, this data needs to be protected
       according to its value and according to the perceived vulnerabilities of the network.
       Protection of metadata may be achieved by using encrypted transport between SFC entities
       or by encrypting the metadata in its own right, and by authenticating the sender of the
       metadata.  The need to protect the metadata is not modified by this document and forms
       part of the NSH definition found in <xref target="RFC8300" />.</t>

    <t>The mechanism described in this document might be used to introduce packets into the SFC
       overlay network and might be used to illegitimately introduce false metadata to the nodes
       on an SFC.  Therefore, measures SHOULD be taken to ensure authorization of sources of such
       packets, and tunneling of such packets into the network SHOULD be prevented.</t>

    <t>The amount of packets with "Next Protocol" set to "None" on an SFP SHOULD be rate limited
       at each point on the SFP to provide additional network security.</t>

    <t>Further discussion of NSH security is presented in <xref target="RFC8300" />.</t>

  </section>

  <section anchor="iana" title="IANA Considerations">

<t>IANA maintains a registry called "Network Service Header (NSH) Parameters" with a sub-registry
 called "NSH Next Protocol".  IANA has allocated a new value to the
sub-registry as follows:</t>
 <figure>
   <artwork>
     <![CDATA[
Next Protocol  |  Description  | Reference
---------------+---------------+-------------
0x00           |  None         | RFC 8393
     ]]>
    </artwork>
  </figure>
  </section>


</middle>

<back>
  <references title="Normative References">

    &RFC2119;
    &RFC8174;
    &RFC8300;

  </references>

  <references title="Informative References">

    &RFC7665;
    &RFC7799;

    <!-- draft-ietf-sfc-oam-framework-04 IESG state: I-D Exists -->

<reference anchor='SFC-OAM-FRAME'>
<front>
<title>Service Function Chaining (SFC) Operation, Administration and Maintenance (OAM) Framework</title>

<author initials='S' surname='Aldrin' fullname='Sam Aldrin'>
    <organization />
</author>

<author initials='C' surname='Pignataro' fullname='Carlos Pignataro'>
    <organization />
</author>

<author initials='N' surname='Kumar' fullname='Nagendra Kumar'>
    <organization />
</author>

<author initials='N' surname='Akiya' fullname='Nobo Akiya'>
    <organization />
</author>

<author initials='R' surname='Krishnan' fullname='Ram Krishnan'>
    <organization />
</author>

<author initials='A' surname='Ghanwani' fullname='Anoop Ghanwani'>
    <organization />
</author>

<date month='March' day='5' year='2018' />

</front>

<seriesInfo name='Work in Progress,' value='draft-ietf-sfc-oam-framework-04' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-sfc-oam-framework-04.txt' />
</reference>

<!-- draft-wang-sfc-multi-layer-oam-10 IESG state: I-D Exists -->

<reference anchor="OAM-SFC">
<front>
<title>Multi-Layer Active OAM for Service Function Chains in Networks</title>

<author initials='G' surname='Mirsky' fullname='Gregory Mirsky'>
    <organization />
</author>

<author initials='W' surname='Meng' fullname='Wei Meng'>
    <organization />
</author>

<author initials='B' surname='Khasnabish' fullname='Bhumip Khasnabish'>
    <organization />
</author>

<author initials='C' surname='Wang' fullname='Cui(Linda) Wang'>
    <organization />
</author>

<date month='September' day='22' year='2017' />

</front>

<seriesInfo name='Work in Progress,' value='draft-wang-sfc-multi-layer-oam-10' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-wang-sfc-multi-layer-oam-10.txt' />
</reference>

  </references>

  <section anchor="acks" title="Acknowledgements" numbered="no">
    <t>Thanks to the attendees at the SFC interim meeting in Westford,
    Massachusetts in January 2017 for 
       discussions that suggested the value of this document.</t>

    <t>Thanks to Eric Rosen, Med Boucadair, Greg Mirsky, Dave Dolson, Tal Mizrahi, and
       Mirja Kuehlewind for valuable review comments.</t>

  </section>

  <section anchor="contributors" title="Contributors" numbered="no">
    <figure>
      <artwork>
Lucy Yong
Retired
      </artwork>
    </figure>

<!-- [rfced] It appears as though "Next Protocol" appears in quote marks when
it refers to the field name.  However, we also see use of "Next-Protocol" and
"next protocol" that seem to refer to the field.  Please review these instances
and let us know if updates are needed.  Perhaps quote marks aren't needed
except where the text indciates 'The NSH includes a field called "Next
Protocol"'? 

-->


  </section>

</back>
</rfc>
