<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="info" docName="draft-wang-sfc-nsh-ns-allocation-01"
     ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

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

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title abbrev="NSH Context Header Allocation (Security)">Network Service
    Header (NSH) Context Header Allocation (Network Security)</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Eric Wang" initials="E." surname="Wang">
      <organization>Cisco Systems Inc.</organization>

      <address>
        <postal>
          <street>170 W Tasman Dr</street>

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

          <country>U.S.A.</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>ejwang@cisco.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Kent Leung" initials="K." surname="Leung">
      <organization>Cisco Systems Inc.</organization>

      <address>
        <postal>
          <street>170 W Tasman Dr</street>

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

          <country>U.S.A.</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>kleung@cisco.com</email>

        <uri/>
      </address>
    </author>

    <date month="October" year="2016"/>

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
         in the current day for you. If only the current year is specified, xml2rfc will fill 
	 in the current day and month for you. If the year is not the current one, it is 
	 necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
	 purpose of calculating the expiry date).  With drafts it is normally sufficient to 
	 specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</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. -->

    <keyword>template</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>This document provides a recommended default allocation of the
      mandatory fixed context headers for a Network Service Header (NSH)
      relevant to Service Function Chaining (SFC) for network security Service
      Functions. NSH is defined in <xref target="I-D.ietf-sfc-nsh"/>. This
      allocation is intended to support the use cased described in <xref
      target="I-D.wang-sfc-ns-use-cases"/>.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>Service Function Chaining (SFC) provides a mechanism for network
      traffic to go through a set of Service Functions in sequence. Network
      Service Header (NSH) allows metadata to be shared between Service
      Functions along with the packets. Such metadata is carried by either a
      fixed number of 32-bit context headers (MD-Type 1) or a variable number
      of TLVs (MD-Type 2), as defined in <xref
      target="I-D.ietf-sfc-nsh">NSH</xref>. This document provides a
      recommended default allocation of the fixed size context headers for
      network security Service Functions forming a Service Function Chain. The
      allocation may also form a MD-Type 2 metadata TLV. Supporting use cases
      for a metadata definition in this context are described in <xref
      target="I-D.wang-sfc-ns-use-cases">SFC-NS-Use-Cases</xref> . This
      document does not define any other variable TLVs. It does not address
      the control plane mechanisms.</t>

      <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>

    <section title="Definition Of Terms">
      <t>This document uses the terms as defined in <xref target="RFC7498">RFC
      7498</xref>, <xref target="RFC7665"/> and <xref
      target="I-D.ietf-sfc-nsh"/>.</t>
    </section>

    <section title="Network Service Header (NSH) Context Headers">
      <t>NSH MD-Type 1 is composed of three parts as described in <xref
      target="I-D.ietf-sfc-nsh"/>: a 4-byte base header, a 4-byte service path
      header, and four 4-byte mandatory context headers.</t>

      <figure align="center" anchor="NSH_Type1"
              title="Network Service Header - MD-Type 1">
        <artwork align="center"><![CDATA[ 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|C|R|R|R|R|R|R|   Length  |  MD-Type = 1  | Next Protocol |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Service Path ID                      | Service Index |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Mandatory Context Header                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Mandatory Context Header                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Mandatory Context Header                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Mandatory Context Header                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
      </figure>
    </section>

    <section title="Recommended Security Mandatory Context Allocation">
      <t>The following context header allocation provides information used to
      support SFC operation within a generic network security environment. The
      16-byte context headers are used to deliver metadata and classification
      results between security Service Functions. Service Functions may use
      the metadata for local policy enforcement, security actions,
      classification refinement, and other functionality.</t>

      <figure align="center" anchor="Security_Allocation"
              title="NSH Security Context Allocation">
        <artwork align="center"><![CDATA[
 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Session ID                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|D|   Reserved  |               Tenant ID                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Class / Reserved  |        Source Class           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Reserved            | Dest Score    |  Src Score    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+            ]]></artwork>
      </figure>

      <section title="Network Security Allocation Specifics">
        <t>The specific 16-byte allocation of the mandatory context headers is
        as follows:</t>

        <t><list hangIndent="0" style="empty">
            <t>Session ID: Session ID is used to identify a particular
            connection, transaction, or any unit that the security Service
            Functions use to maintain states. Session ID may be used to
            associate a packet with existing states even if the packet does
            not contain all the network headers for deriving the Session ID,
            or if the network headers are modified by a Service Function. It
            may appear in events and logs for correlation between Service
            Functions in the SFC-domain.</t>

            <t>The Session SHOULD be bi-directional so that both directions of
            Service Paths are associated with the same Service Function
            instance. Service Path reclassification for the same session MUST
            not change the Session ID.</t>

            <t>Flag bits: Bits 0-7 of the 2nd word are flag bits. Only bit 0
            is defined in this document and the remaining bits are
            reserved.</t>

            <t><list hangIndent="4" style="empty">
                <t>D bit: The D-bit is used to indicate whether the
                Destination Class field in the 3rd word is used. If D-bit is
                not set then the 3rd word is reserved.</t>
              </list>Tenant ID: The tenant identifier is used to represent the
            tenant or security policy domain that the Service Function Chain
            is being applied to. The Tenant ID is a unique value assigned by a
            control plane. The distribution of Tenant ID's is outside the
            scope of this document. As an example application of this field,
            the first node on the Service Function Chain may insert a VRF
            number, VLAN number, VXLAN VNI or a policy domain ID.</t>

            <t>Destination Class: The destination class represents the logical
            classification of the destination of the traffic. This field is
            optional and/or the Destination Class may not be known. The D-bit
            is used to indicate that this field contains a valid Destination
            Class.</t>

            <t>Source Class: represents the logical classification of the
            source of the traffic. For example, this might represent a source
            application, a group of like endpoints, or a set of users
            originating the traffic. This grouping is done for the purposes of
            applying policy. Policy is applied to groups rather than
            individual endpoints.</t>

            <t>The 4th word contains security classification results for
            communicating immediate actions and accumulated verdicts to
            downstream Service Functions.</t>

            <t>Score: Security Score is a numeric value for participating
            Service Functions to deliver security classification results based
            on their processing of the packet data. The Score value may be set
            by one Service Function and refined by a subsequent Service
            Function to produce an accumulated result. Alternatively, each
            Service Function may set a different score value which is
            collected by a control point. The Score value is interpreted
            consistently in the SFC-domain. For example, a Score value of -5
            may trigger additional scanning functions to be conducted by the
            subsequent Service Function for the Session. As another example, a
            Score value -20 may result in block of the source or destination
            host by a Service Function. The interpretation of the Score is
            distributed by a control plane and is outside the scope of the
            document.</t>
          </list></t>
      </section>
    </section>

    <section title="Context Allocation and Control Plane Considerations">
      <t>This document describes an allocation scheme for the NSH context
      headers in the context of network security SFC use cases.</t>

      <t>The suggested allocation in this document would be considered as a
      guideline only. Some of the allocated fields are specific to certain use
      cases. A control plane mechanism is required to ensure consistency among
      the SFC components participating in the allocation scheme. The actual
      control plane mechanism is out of the scope of this document.</t>
    </section>

    <section title="Security Considerations">
      <t>The SFC control plane responsible for identifying and distributing
      the allocation scheme should ensure the communication mechanism is
      secure.</t>

      <t>The metadata defined in this document carries important information
      for participating Service Functions to make security policy decisions.
      Some of the metadata such as the security score may be accumulated
      before a Service Function takes an action. There is a risk that the
      metadata may be intercepted or even spoofed by an unauthorized party.
      Proper precaution must be taken to ensure the confidentiality and
      integrity of the metadata fields.</t>
    </section>

    <section title="Acknowledgments">
      <t>Authors would like to thank Jeremy Felix and Jay Iyer for their
      contributions.</t>
    </section>

    <section title="IANA Considerations">
      <t>This document includes no request to IANA.</t>
    </section>

    <!-- -->
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <references title="Normative References">
      <?rfc include='reference.I-D.ietf-sfc-nsh'?>

      <?rfc include='reference.RFC.2119'?>

      <?rfc include='reference.RFC.7498'?>

      <?rfc include='reference.RFC.7665'?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.I-D.wang-sfc-ns-use-cases'?>
    </references>
  </back>
</rfc>
