SFC Netmod                                                      R. Penno
Internet-Draft                                                  P. Quinn
Intended status: Standards Track                           Cisco Systems
Expires: December 19, 2016                                       D. Zhou
                                                                   J. Li
                                                       Intel Corporation
                                                           June 19, 2016

             Yang Data Model for Service Function Chaining
                        draft-penno-sfc-yang-15

Abstract

   This document defines a YANG data model that can be used to configure
   and manage Service Function Chains.

Requirements Language

   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 RFC 2119 [RFC2119].

Status of this Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on December 19, 2016.

Copyright Notice

   Copyright (c) 2016 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents (http://trustee.ietf.org/
   license-info) in effect on the date of publication of this document.
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.  Code Components




Penno, Quinn, Zhou & LiExpires December 19, 2016                [Page 1]


Internet-Draft      Yang Model for Service Chaining            June 2016

   extracted from this document must include Simplified BSD License text
   as described in Section 4.e of the Trust Legal Provisions and are
   provided without warranty as described in the Simplified BSD License.

Table of Contents

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  2
   2.  Definitions and Acronyms . . . . . . . . . . . . . . . . . . .  3
   3.  Understanding SFC Yang Models  . . . . . . . . . . . . . . . .  3
   4.  Service Function (SF)  . . . . . . . . . . . . . . . . . . . .  4
     4.1.  Module Structure . . . . . . . . . . . . . . . . . . . . .  4
     4.2.  Service Function Configuration Module  . . . . . . . . . .  7
   5.  Service Function Type (SFT)  . . . . . . . . . . . . . . . . . 12
     5.1.  Module Structure . . . . . . . . . . . . . . . . . . . . . 12
     5.2.  Service Function Type Configuration Model  . . . . . . . . 12
   6.  Service Function Chain (SFC) . . . . . . . . . . . . . . . . . 15
     6.1.  Module Structure . . . . . . . . . . . . . . . . . . . . . 15
     6.2.  Service Function Chain Configuration Model . . . . . . . . 16
   7.  Service Function Path (SFP)  . . . . . . . . . . . . . . . . . 20
     7.1.  Module Structure . . . . . . . . . . . . . . . . . . . . . 20
     7.2.  Service Function Path Configuration Model  . . . . . . . . 21
   8.  Service Function Forwarder (SFF) . . . . . . . . . . . . . . . 26
     8.1.  Module Struture  . . . . . . . . . . . . . . . . . . . . . 26
     8.2.  Service Function Forwarder Model . . . . . . . . . . . . . 28
   9.  Service Locator (SL) . . . . . . . . . . . . . . . . . . . . . 34
     9.1.  Module Structure . . . . . . . . . . . . . . . . . . . . . 34
     9.2.  Service Locator Module . . . . . . . . . . . . . . . . . . 34
   10. Rendered Service Path (RSP)  . . . . . . . . . . . . . . . . . 38
     10.1.  Module Structure  . . . . . . . . . . . . . . . . . . . . 39
     10.2.  Rendered Service Path Module  . . . . . . . . . . . . . . 41
   11. Service Function Common (SFC-Common) . . . . . . . . . . . . . 48
     11.1.  Service Function Common Module  . . . . . . . . . . . . . 48
   12. Service Statistics (Sfc-ss)  . . . . . . . . . . . . . . . . . 50
     12.1.  Service Statistics Chain Common Module  . . . . . . . . . 50
   13. Service Function Path Metadata (SFC-MD)  . . . . . . . . . . . 52
     13.1.  Module Structure  . . . . . . . . . . . . . . . . . . . . 53
     13.2.  Service Function Path Metadata Module . . . . . . . . . . 53
   14. IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 56
   15. Security Considerations  . . . . . . . . . . . . . . . . . . . 56
   16. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 56
   17. Changes  . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
   18. References . . . . . . . . . . . . . . . . . . . . . . . . . . 59
     18.1.  Normative References  . . . . . . . . . . . . . . . . . . 59
     18.2.  Informative References  . . . . . . . . . . . . . . . . . 60
   Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 60

1.  Introduction








Penno, Quinn, Zhou & LiExpires December 19, 2016                [Page 2]


Internet-Draft      Yang Model for Service Chaining            June 2016


   YANG [RFC6020] is a data definition language that was introduced to
   define the contents of a conceptual data store that allows networked
   devices to be managed using NETCONF [RFC6241].  YANG is proving
   relevant beyond its initial confines, as bindings to other interfaces
   (e.g.  ReST) and encodings other than XML (e.g.  JSON) are being
   defined.  Furthermore, YANG data models can be used as the basis of
   implementation for other interfaces, such as CLI and programmatic
   APIs.

   This document defines a YANG data model that can be used to configure
   and manage Service Function Chains

2.  Definitions and Acronyms

   The reader should be familiar with the terms contained in [I-D.ietf-
   sfc-architecture], [I-D.ietf-sfc-problem-statement] ,[I-D.ietf-sfc-
   nsh] and [I-D.quinn-vxlan-gpe]

3.  Understanding SFC Yang Models

   There are two main models in SFC: service-function (SF) and service-
   function-forwarder (SFF). Most other models are used or derived from
   those models.  SF describes a service function like firewall, napt44,
   dpi, http-proxy, etc.  SFF describes a forwarding element that moves
   packets along a service path.  A SFF to function only needs to be
   able to associate a Service Path ID and SI to a next hop data plane
   locator.

   The service-locator model provides a centralized place to register
   transport and endpoints used with SFFs and SFs.  This allows reuse
   across a large number of other models since in networking usually
   data plane locators are widely used.  Some examples of transport
   types are GRE, VXLAN-GPE and the data plane locator are IP:port,
   VLAN-ID and MPLS Label.  This model is imported by SFF, SF and
   Rendered Service Path (RSP) models.

   Service Function Type model serves as a registry for SF types.  The
   model can be easily extended by anyone looking to define their own
   service type.  This model is imported by SF and Service Function
   Chain (SFC). Since a SFC is an abstract order of service function
   types, having a registry of types is important.  Furthermore, when we
   instantiate a SFP and RSP from a SFC we need to choose the actual SFs
   that will be traversed by the packets and this requires us to know
   the type associated with a Service Function.

   A service function path (SFP) is an intermediate step between SFC and
   RSP. It allows the user to provide input or constraints into the
   construction of a RSP. This input ranges from nothing to specifying
   the entire path.  During RSP construction, the controller examines
   the SFP and 'fill in the blanks'.




Penno, Quinn, Zhou & LiExpires December 19, 2016                [Page 3]


Internet-Draft      Yang Model for Service Chaining            June 2016


   One of the most important configuration aspects of a SF is the data
   plane locators.  A SF's data plane locators indicates how the SF can
   be reached.  A SF can have multiple data plane locators of different
   transport and types as specified in the service locator model.

   A SFF has also can have multiple data plane locators that indicate
   how it can be reached.  It is very important when constructing a RSP
   to pick SFFs that have data plane locators of the same transport and
   type so that the path works.  A SFF has an additional very important
   configuration container, the service function dictionary.  The
   service function dictionary stores the SFF's view of the Service
   Functions.  It contains all SFs and their data plane locators.

   Therefore the Service Function data plane locators and the SFF
   service function dictionary constitute two pieces of a puzzle.  If
   they fit, it means they can be used in a path, otherwise they can
   not.

   The RSP model is the result of creating a Service Function Chain,
   applying policies through the Service Function Path and finally
   choosing a collection of (SFF, SF) tuples that meet these criteria.
   The RSP is an operational model, meaning it can read but not changed.

4.  Service Function (SF)

   This module describe a Service Function, which is an essential
   building block of other modules.

4.1.  Module Structure

























Penno, Quinn, Zhou & LiExpires December 19, 2016                [Page 4]


Internet-Draft      Yang Model for Service Chaining            June 2016



                 module: service-function
      +--rw service-functions
      |  +--rw service-function* [name]
      |     +--rw tenant-id?                  sfc-common:tenant-id
      |     +--rw rest-uri?                   inet:uri
      |     x--rw request_reclassification?   boolean
      |     x--rw nsh-aware?                  boolean
      |     +--rw name                        sfc-common:sf-name
      |     +--rw type                        sfc-common:sft-type-name
      |     +--rw ip-mgmt-address?            inet:ip-address
      |     +--rw sf-data-plane-locator* [name]
      |        +--rw name                          sfc-common:sf-data-plane-locator-name
      |        +--rw (locator-type)
      |        |  +--:(ip)
      |        |  |  +--rw ip?                           inet:ip-address
      |        |  |  +--rw port?                         inet:port-number
      |        |  +--:(lisp)
      |        |  |  +--rw eid?                          inet:ip-address
      |        |  +--:(mac)
      |        |  |  +--rw mac?                          yang:mac-address
      |        |  |  +--rw vlan-id?                      uint16
      |        |  +--:(function)
      |        |  |  +--rw function-name?                string
      |        |  +--:(mpls)
      |        |  |  +--rw mpls-label?                   uint32
      |        |  +--:(other)
      |        |     +--rw other-name?                   string
      |        +--rw transport?                    identityref
      |        +--rw service-function-forwarder?   sfc-common:sff-name
      +--ro service-functions-state
         +--ro service-function-state* [name]
            +--ro name                      sfc-common:sf-name
            +--ro statistic-by-timestamp* [timestamp]
            |  +--ro timestamp            uint64
            |  +--ro service-statistic
            |     +--ro bytes-in?      yang:zero-based-counter64
            |     +--ro bytes-out?     yang:zero-based-counter64
            |     +--ro packets-in?    yang:zero-based-counter64
            |     +--ro packets-out?   yang:zero-based-counter64
            +--ro sf-service-path* [name]
               +--ro name                      sfc-common:sfp-name
               +--ro statistic-by-timestamp* [timestamp]
                  +--ro timestamp            uint64
                  +--ro service-statistic
                     +--ro bytes-in?      yang:zero-based-counter64
                     +--ro bytes-out?     yang:zero-based-counter64
                     +--ro packets-in?    yang:zero-based-counter64
                     +--ro packets-out?   yang:zero-based-counter64
   rpcs:
      +---x delete-all-service-function
      +---x put-service-function


Penno, Quinn, Zhou & LiExpires December 19, 2016                [Page 5]


Internet-Draft      Yang Model for Service Chaining            June 2016

      |  +--ro input
      |     +--ro tenant-id?                  sfc-common:tenant-id
      |     +--ro rest-uri?                   inet:uri
      |     x--ro request_reclassification?   boolean
      |     x--ro nsh-aware?                  boolean
      |     +--ro name?                       sfc-common:sf-name
      |     +--ro type                        sfc-common:sft-type-name
      |     +--ro ip-mgmt-address?            inet:ip-address
      |     +--ro sf-data-plane-locator* [name]
      |        +--ro name                          sfc-common:sf-data-plane-locator-name
      |        +--ro (locator-type)
      |        |  +--:(ip)
      |        |  |  +--ro ip?                           inet:ip-address
      |        |  |  +--ro port?                         inet:port-number
      |        |  +--:(lisp)
      |        |  |  +--ro eid?                          inet:ip-address
      |        |  +--:(mac)
      |        |  |  +--ro mac?                          yang:mac-address
      |        |  |  +--ro vlan-id?                      uint16
      |        |  +--:(function)
      |        |  |  +--ro function-name?                string
      |        |  +--:(mpls)
      |        |  |  +--ro mpls-label?                   uint32
      |        |  +--:(other)
      |        |     +--ro other-name?                   string
      |        +--ro transport?                    identityref
      |        +--ro service-function-forwarder?   sfc-common:sff-name
      +---x read-service-function
      |  +--ro input
      |  |  +--ro name    string
      |  +--ro output
      |     +--ro tenant-id?                  sfc-common:tenant-id
      |     +--ro rest-uri?                   inet:uri
      |     x--ro request_reclassification?   boolean
      |     x--ro nsh-aware?                  boolean
      |     +--ro name?                       sfc-common:sf-name
      |     +--ro type                        sfc-common:sft-type-name
      |     +--ro ip-mgmt-address?            inet:ip-address
      |     +--ro sf-data-plane-locator* [name]
      |        +--ro name                          sfc-common:sf-data-plane-locator-name
      |        +--ro (locator-type)
      |        |  +--:(ip)
      |        |  |  +--ro ip?                           inet:ip-address
      |        |  |  +--ro port?                         inet:port-number
      |        |  +--:(lisp)
      |        |  |  +--ro eid?                          inet:ip-address
      |        |  +--:(mac)
      |        |  |  +--ro mac?                          yang:mac-address
      |        |  |  +--ro vlan-id?                      uint16
      |        |  +--:(function)
      |        |  |  +--ro function-name?                string
      |        |  +--:(mpls)
      |        |  |  +--ro mpls-label?                   uint32


Penno, Quinn, Zhou & LiExpires December 19, 2016                [Page 6]


Internet-Draft      Yang Model for Service Chaining            June 2016

      |        |  +--:(other)
      |        |     +--ro other-name?                   string
      |        +--ro transport?                    identityref
      |        +--ro service-function-forwarder?   sfc-common:sff-name
      +---x delete-service-function
         +--ro input
            +--ro name    string


4.2.  Service Function Configuration Module













































Penno, Quinn, Zhou & LiExpires December 19, 2016                [Page 7]


Internet-Draft      Yang Model for Service Chaining            June 2016


   <CODE BEGINS> file "service-function@2014-07-01.yang"

   module service-function {

     namespace "urn:cisco:params:xml:ns:yang:sfc-sf";

     prefix sfc-sf;

     import ietf-inet-types {
         prefix inet;
         revision-date 2013-07-15;
     }
     import service-locator {
         prefix sfc-sl;
         revision-date 2014-07-01;
     }
     import service-statistics {
         prefix sfc-ss;
         revision-date 2014-07-01;
     }
     import sfc-common {
         prefix sfc-common;
         revision-date 2015-10-17;
     }


     organization "Cisco Systems, Inc.";
     contact "Reinaldo Penno <repenno@cisco.com>";


     description
       "This module contains a collection of YANG definitions for
        managing service function.";

     revision 2014-07-01 {
       description
         "Changes based on Opendaylight Testing.";
       reference
        "https://tools.ietf.org/html/draft-penno-sfc-yang";
     }

     grouping service-function-base {
       description
         "A group with all base nodes to describe service function";
       leaf name {
         type sfc-common:sf-name;
         description
           "The name of the service function.";
       }
       leaf type {
         type sfc-common:sft-type-name;
         mandatory true;
         description

Penno, Quinn, Zhou & LiExpires December 19, 2016                [Page 8]


Internet-Draft      Yang Model for Service Chaining            June 2016

           "Service Function Type from service-function-type yang
            model";
       }
       leaf ip-mgmt-address {
         type inet:ip-address;
         description
           "The IP and port used to configure this service-function";
       }
       list sf-data-plane-locator {
         key "name";
         description
           "A network data-plane locator";
         leaf name {
           type sfc-common:sf-data-plane-locator-name;
           description
             "A unique string that represents this
              data-plane-locator";
         }
         uses sfc-sl:data-plane-locator;
         leaf service-function-forwarder {
           type sfc-common:sff-name;
           description
             "The service function forwarder associated with this
              locator";
         }
       }
     }

     grouping service-function-entry {
       description
         "This group bundles together all information related to a
          single service function";
       leaf tenant-id {
         type sfc-common:tenant-id;
         description
           "This SF was created for a specific tenant-id";
       }
       leaf rest-uri {
         type inet:uri;
         description "URI of REST based management";
       }
       leaf request_reclassification {
         type boolean;
         status deprecated;
         description
           "This leaf determines whether SF can request
            reclassification by the SFF";
       }
       leaf nsh-aware {
         type boolean;
         status deprecated;
         description "Whether this SF can process NSH headers";
       }
       uses service-function-base;

Penno, Quinn, Zhou & LiExpires December 19, 2016                [Page 9]


Internet-Draft      Yang Model for Service Chaining            June 2016

     }

     container service-functions {
       description
         "A function that is responsible for specific
         treatment of received packets.  A Service Function can act at
         various layers of a protocol stack (e.g., at the network layer
         or other OSI layers).  A Service Function can be a virtual
         element or be embedded in a physical network element.  One of
         multiple Service Functions can be embedded in the same network
         element.  Multiple occurrences of the Service Function can be
         enabled in the same administrative domain.

         One or more Service Functions can be involved in the delivery
         of added-value services.  A non-exhaustive list of Service
         Functions includes: firewalls, WAN and application
         acceleration, Deep Packet Inspection (DPI),a LI (Lawful
         Intercept) module, server load balancers, NAT44 [RFC3022],
         NAT64 [RFC6146], NPTv6 [RFC6296], HOST_ID injection, HTTP
         Header Enrichment functions, TCP optimizer, etc.

         An SF may be SFC encapsulation aware, that is it receives, and
         acts on information in the SFC encapsulation, or unaware in
         which case data forwarded to the service does not contain the
         SFC encapsulation.";

       list service-function {
         key "name";
         description
           "This list holds configuration data for all service functions
            in the domain";
         uses service-function-entry;
       }
     }

     container service-functions-state {
       config false;
       description
         "This container hold operational state for all service
          functions";
       list service-function-state {
         key "name";
         description
           "This list holds operational data for all service functions
            in the domain";
         leaf name {
           type sfc-common:sf-name;
           description
             "the name of the service function";
         }
         uses sfc-ss:service-statistics-group {
           description "Global Service Function statistics";
         }
         list sf-service-path {

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 10]


Internet-Draft      Yang Model for Service Chaining            June 2016

           key "name";
           leaf name {
             type sfc-common:sfp-name;
             description
               "The name of the Service Path";
           }
           uses sfc-ss:service-statistics-group;
           description
           "A list of all service function paths that contain this
            service function";
         }
       }
     }

     rpc delete-all-service-function {
     description
       "Deletes all service functions";
     }

     rpc put-service-function {
       description
         "Creates a service function";
       input {
         uses service-function-entry;
       }
     }
     rpc read-service-function {
       description
         "Reads a service function";
       input {
         leaf name {
           type string;
           mandatory true;
           description "The name of the service function.";
         }
       }
       output {
         uses service-function-entry;
       }
     }
     rpc delete-service-function {
       description
         "Deletes a service function";
       input {
         leaf name {
           type string;
           mandatory true;
           description "The name of the service function.";
         }
       }
     }
   }



Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 11]


Internet-Draft      Yang Model for Service Chaining            June 2016


   <CODE ENDS>


5.  Service Function Type (SFT)

   This module holds one list for each service function type found in
   the system.  Each one of these lists has the name of all service
   functions configured on the system of that particular type.  This
   allows finding a service function of a given type simple.

5.1.  Module Structure

   module: service-function-type
      +--rw service-function-types
         +--rw service-function-type* [type]
            +--rw type                                sfc-common:sft-type-name
            +--rw symmetry?                           boolean
            +--rw bidirectionality?                   boolean
            +--rw nsh-aware?                          boolean
            +--rw request-reclassification?           boolean
            +--rw supported-dataplanelocator-types* [dataplanelocator-type]
            |  +--rw dataplanelocator-type    sfc-sl:sl-transport-type-def
            +--rw sft-service-function-name* [name]
               +--rw name    sfc-common:sf-name


5.2.  Service Function Type Configuration Model



























Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 12]


Internet-Draft      Yang Model for Service Chaining            June 2016


   <CODE BEGINS> file "service-function-type@2014-07-01.yang"

   module service-function-type {

     namespace "urn:cisco:params:xml:ns:yang:sfc-sft";

     prefix sfc-sft;

     import service-locator {
         prefix sfc-sl;
         revision-date 2014-07-01;
     }

     import sfc-common {
         prefix sfc-common;
         revision-date 2015-10-17;
     }

     organization "Cisco Systems, Inc.";
     contact "Reinaldo Penno <repenno@cisco.com>";

     description
       "This module contains a collection of YANG definitions for
        managing service function types.

        It follows closely the constructs of
        http://tools.ietf.org/html/draft-ietf-netmod-interfaces-cfg-12

        Copyright (c) 2013 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC XXXX; see
        the RFC itself for full legal notices.";

        // RFC Ed.: replace XXXX with actual RFC number and remove this
        // note.

        // RFC Ed.: update the date below with the date of RFC
        // publication and remove this note.

     revision 2014-07-01 {
       description
         "Changes based on Opendaylight Testing.";
       reference "https://tools.ietf.org/html/draft-penno-sfc-yang";
     }


Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 13]


Internet-Draft      Yang Model for Service Chaining            June 2016

     // Service Function Type definitions

     grouping service-function-type-definition {
       description
         "List of parameters to define an abstract type
          of Service Function";
       // TODO: Expand list to include metadata context
       // template support.
       // ie MD Type1 C3/C4 context, MD Type2 etc.
       leaf type {
         type sfc-common:sft-type-name;
         description
           "Service Function type names such as firewall,
            dpi, tcp-proxy, etc";
       }
       leaf symmetry {
         type boolean;
         description "SF is involved in a symmetric service path";
       }
       leaf bidirectionality {
         type boolean;
         description "SF handles uplink and downlink traffic";
       }
       leaf nsh-aware {
         type boolean;
         description
           "Service Function can handle Network Service
            Headers";
       }
       leaf request-reclassification {
           type boolean;
           description "This leaf determines whether SF can request
             reclassification by the SFF";
       }
       list supported-dataplanelocator-types {
         key "dataplanelocator-type";
         leaf dataplanelocator-type {
             type sfc-sl:sl-transport-type-def;
             description
               "Unique data plane identifier";
         }
         description
           "Data Plane Locator types from the Service
            Function";
       }
     }

     container service-function-types {
       description
         "A list of Service function Types. For each type we keep
          a list of Service Functions";

       list service-function-type {
         key "type";

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 14]


Internet-Draft      Yang Model for Service Chaining            June 2016

         uses service-function-type-definition;

         list sft-service-function-name {
           // TODO: should this be sf-name typedef? Also this should be
           // kept in a separate map as an alternate index as it mirrors
           // state.
           key "name";
           leaf name {
             type sfc-common:sf-name;
             description
               "The name of the service function.";
           }
           description
             "The list of all service functions of a specific type";
         }
         description
           "A list of all service types. Each service-type entry holds
            a list of all service functions of that type";
       }
     }
   }


   <CODE ENDS>

6.  Service Function Chain (SFC)

   This model describes a service function chain which is basically an
   ordered list of services.  But a service function chain does not
   specify exactly which service (firewal1 vs.  firewall2) will be used
   to actually process packets.

6.1.  Module Structure






















Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 15]


Internet-Draft      Yang Model for Service Chaining            June 2016


         module: service-function-chain
      +--rw service-function-chains
      |  +--rw service-function-chain* [name]
      |     +--rw name                    sfc-common:sfc-name
      |     +--rw symmetric?              boolean
      |     +--rw sfc-service-function* [name]
      |        +--rw name     string
      |        +--rw type     sfc-common:sft-type-name
      |        +--rw order?   uint8
      +--ro service-function-chains-state
         +--ro service-function-chain-state* [name]
            +--ro name                sfc-common:sfc-name
            +--ro sfc-service-path* [name]
               +--ro name    sfc-common:sfp-name
   rpcs:
      +---x instantiate-service-function-chain
      |  +--ro input
      |  |  +--ro name    string
      |  +--ro output
      |     +--ro name?   string
      +---x put-service-function-chains
         +--ro input
            +--ro service-function-chain* [name]
               +--ro name                    sfc-common:sfc-name
               +--ro symmetric?              boolean
               +--ro sfc-service-function* [name]
                  +--ro name     string
                  +--ro type     sfc-common:sft-type-name
                  +--ro order?   uint8


6.2.  Service Function Chain Configuration Model






















Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 16]


Internet-Draft      Yang Model for Service Chaining            June 2016



   <CODE BEGINS> file "service-function-chain@2014-07-01.yang"

   module service-function-chain {

     namespace "urn:cisco:params:xml:ns:yang:sfc-sfc";

     prefix sfc-sfc;

     import sfc-common {
         prefix sfc-common;
     }

     organization "Cisco Systems, Inc.";
     contact "Reinaldo Penno <repenno@cisco.com>";


     description
       "This module contains a collection of YANG definitions for
        managing service function chains.

        Copyright (c) 2013 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC XXXX; see
        the RFC itself for full legal notices.";

        // RFC Ed.: replace XXXX with actual RFC number and remove this
        // note.

        // RFC Ed.: update the date below with the date of RFC
        // publication and remove this note.

     revision 2014-07-01 {
       description
         "Revised based on Opendaylight Project feedback";
       reference "https://tools.ietf.org/html/draft-penno-sfc-yang";
     }

      grouping service-function-chain-grouping {
       list service-function-chain {
         key "name";
         description
           "A list that holds all service function chains in the
            domain";
         leaf name {

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 17]


Internet-Draft      Yang Model for Service Chaining            June 2016

           type sfc-common:sfc-name;
           description
             "the name of the service function chain";
         }
         leaf symmetric {
           type boolean;
           default false;
           description
             "If the chain is symmetric we will create two service
              paths, one ingress and another egress. Packets traverse
              the egress service path in the reverse order of the
              ingress path";
         }
         list sfc-service-function {
           key "name";
           leaf name {
             type string;
             description
               "A unique handle that describes the service function
                that will be chosen for this type, such as
                ingress-dpi. This is not the service function name";
           }
           leaf type {
             type sfc-common:sft-type-name;
             mandatory true;
             description
               "Service Function Type from service-function-type.yang";
           }
           leaf order {
             type uint8;
             description
               "A number that denotes the order of a service function
                type in a chain";
           }
           ordered-by user;
           description
             "A list of service functions that compose the service
              chain";
         }
       }
       description
         "This group bundles together all service function chains in the
          domain";
     }

     // Service Function Chains

     container service-function-chains {
       uses service-function-chain-grouping;
       description
         "A service Function chain defines an
          abstract set of service functions and their ordering
          constraints that must be applied to packets and/or frames
          selected as a result of classification.  The implied order

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 18]


Internet-Draft      Yang Model for Service Chaining            June 2016

          may not be a linear progression as the architecture allows
          for nodes that copy to more than one branch, and also allows
          for cases where there is flexibility in the order in which
          services need to be applied. The term service chain is often
          used as shorthand for service function chain.";
     }

     container service-function-chains-state {
       config false;
       list service-function-chain-state {
         key "name";
         description
           "A list that contains operational service function
            chain state";
         leaf name {
           type sfc-common:sfc-name;
           description
             "the name of the service function chain";
         }
         list sfc-service-path {
           key "name";
           leaf name {
             type sfc-common:sfp-name;
             description
               "The name of the Service Path";
           }
           description
           "A list of all service function paths instantiated from
            this chain";
         }
       }
       description
         "This containers holds operational service function
           chain state and their associated service path";
     }

   // Remote procedure calls

   // (main feature: instantiation of a SFC)

     rpc instantiate-service-function-chain {
       description
         "Instantiates a single service function";
       input {
         leaf name {
           type string;
             mandatory true;
             description
             "The name of the service function chain to be
              instantiated.";
         }
       }
       output {
         leaf name {

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 19]


Internet-Draft      Yang Model for Service Chaining            June 2016

           type string;
           description
             "The name of the created service function path.";
         }
       }
     }

       // (RPC for testing)
     rpc put-service-function-chains {
       description
         "Creates Service-Functions";
       input {
         uses service-function-chain-grouping;
       }
     }
   }



   <CODE ENDS>




7.  Service Function Path (SFP)

   A Service Function Path is an instantiation of a service function
   chain.  It allows be user to provide constrains for the rendering of
   the service path such as specific service-hops that need to be
   visited, the transport encapsulation used in the overlay, whether
   paths should be symmetric, amongst others.

7.1.  Module Structure






















Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 20]


Internet-Draft      Yang Model for Service Chaining            June 2016


   module: service-function-path
      +--rw service-function-paths
      |  +--rw service-function-path* [name]
      |     +--rw name                    sfc-common:sfp-name
      |     +--rw transport-type?         sfc-sl:sl-transport-type-def
      |     +--rw symmetric?              boolean
      |     +--rw classifier?             string
      |     +--rw symmetric-classifier?   string
      |     +--rw context-metadata?       sfc-md:context-metadata-ref
      |     +--rw variable-metadata?      sfc-md:variable-metadata-ref
      |     +--rw tenant-id?              string
      |     +--rw service-path-hop* [hop-number]
      |     |  +--rw hop-number                     uint8
      |     |  +--rw service-function-name?         sfc-common:sf-name
      |     |  +--rw service-function-group-name?   string
      |     |  +--rw service-function-forwarder?    sfc-common:sff-name
      |     |  +--rw service-index?                 uint8
      |     +--rw service-chain-name      sfc-common:sfc-name
      |     +--rw starting-index?         uint8
      |     +--rw path-id?                uint32
      +--ro service-function-paths-state
         +--ro service-function-path-state* [name]
            +--ro name                         sfc-common:sfp-name
            +--ro sfp-rendered-service-path* [name]
               +--ro name    sfc-common:rsp-name

7.2.  Service Function Path Configuration Model



























Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 21]


Internet-Draft      Yang Model for Service Chaining            June 2016


   <CODE BEGINS> file "service-function-path@2014-07-01.yang"

   module service-function-path {

     namespace "urn:cisco:params:xml:ns:yang:sfc-sfp";

     prefix sfc-sfp;

     import service-function-path-metadata {
         prefix sfc-md;
         revision-date 2014-07-01;
         }
     import service-locator {
         prefix sfc-sl;
         revision-date 2014-07-01;
         }

     import sfc-common {
         prefix sfc-common;
         revision-date 2015-10-17;
         }

     organization "Cisco Systems, Inc.";
     contact "Reinaldo Penno <repenno@cisco.com>";


     description
       "This module contains a collection of YANG definitions for
        managing service function chains.

        Copyright (c) 2013 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC XXXX; see
        the RFC itself for full legal notices.";

        // RFC Ed.: replace XXXX with actual RFC number and remove this
        // note.

        // RFC Ed.: update the date below with the date of RFC
        // publication and remove this note.

     revision 2014-07-01 {
       description
         "Changes based on Opendaylight Testing and IETF SFC ml.";
       reference "https://tools.ietf.org/html/draft-penno-sfc-yang";

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 22]


Internet-Draft      Yang Model for Service Chaining            June 2016

     }

     // Service Function Path

     container service-function-paths {
       description
         "The SFP provides a level of indirection
          between the fully abstract notion of service chain as an
          abstract sequence of functions to be delivered, and the
          fully specified notion of exactly what SFF/SFs the packet
          will visit when it actually traverses the network.  By
          allowing the control components to specify the use of this
          level of indirection, the deployment may choose the degree
          of SFF/SF selection authority that is delegated to the
          network";
       list service-function-path {
         key "name";
         description
           "A list that holds configuration data for all SFPs in the
            domain";
         leaf name {
           type sfc-common:sfp-name;
           description
             "The name of this service function path";
         }

         leaf transport-type {
           type sfc-sl:sl-transport-type-def;
           default "sfc-sl:vxlan-gpe";
           description
             "Transport type from service-locator.yang.";
         }

         leaf symmetric {
           type boolean;
           default false;
           description
             "If the chain is symmetric we will create two service
              paths, one ingress and another egress. Packets traverse
              the egress service path in the reverse order of the
              ingress path";
         }
         leaf classifier {
           type string;
           description "The classifier responsible for directing"
             + "packets to this service path";
         }
         leaf symmetric-classifier {
           type string;
           description "The classifier responsible for directing"
             + "packets to this service path";
         }
         leaf context-metadata {
           type sfc-md:context-metadata-ref;

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 23]


Internet-Draft      Yang Model for Service Chaining            June 2016

           description
             "The name of the associated context metadata";
         }
         leaf variable-metadata {
           type sfc-md:variable-metadata-ref;
           description
             "The name of the associated variable metadata";
         }
         leaf tenant-id {
           type string;
           description
             "This SFP was created for a specific tenant-id";
         }
         list service-path-hop {
           key "hop-number";
           leaf hop-number {
             type uint8;
             description
               "A Monotonically increasing number";
           }
           leaf service-function-name {
             type sfc-common:sf-name;
             description
               "Service Function name";
           }
           leaf service-function-group-name {
             type string;
             description
               "Service Function group name";
           }
           leaf service-function-forwarder {
             type sfc-common:sff-name;
             description
               "Service Function Forwarder name";
           }
           leaf service-index {
             type uint8;
             description
               "Provides location within the service path.
                Service index MUST be decremented by service functions
                or proxy nodes after performing required services.  MAY
                be used in conjunction with service path for path
                selection.  Service Index is also valuable when
                troubleshooting/reporting service paths.  In addition to
                location within a path, SI can be used for loop
                detection.";
           }
           ordered-by user;
           description
             "A list of service functions that compose the
              service path";
         }
         leaf service-chain-name {
           type sfc-common:sfc-name;

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 24]


Internet-Draft      Yang Model for Service Chaining            June 2016

           mandatory true;
           description
             "The Service Function Chain used as blueprint for this
              path";
         }
         leaf starting-index {
           type uint8;
           description
             "Starting service index";
         }
         leaf path-id {
           type uint32 {
             range "0..16777216";
           }
           description
             "Identifies a service path.
              Participating nodes MUST use this identifier for path
              selection.  An administrator can use the service path
              value for reporting and troubleshooting packets along
              a specific path.";
         }
       }
     }

     container service-function-paths-state {
       config false;
       description
         "This container hold operational state for all service
          function paths";
       list service-function-path-state {
         key "name";
         description
           "This list holds operational data for all service function
            paths in the domain";
         leaf name {
           type sfc-common:sfp-name;
           description
             "The name of the service function path";
         }
         list sfp-rendered-service-path {
           key "name";
           leaf name {
             type sfc-common:rsp-name;
             description
               "The name of the Rendered Service Path";
           }
           description
           "A list of all rendered service paths instantiated
            from this service path";
         }
       }
     }

   }

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 25]


Internet-Draft      Yang Model for Service Chaining            June 2016



   <CODE ENDS>



8.  Service Function Forwarder (SFF)

   This module describes the configuration a SFF needs to have in order
   to route packets to the service functions it serves.  the SFF needs
   to have a table with service function name and associated locator.
   The locator could be an IP address and port, an internal function
   call or some other unique identifier.

8.1.  Module Struture








































Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 26]


Internet-Draft      Yang Model for Service Chaining            June 2016


   module: service-function-forwarder

      +--rw service-function-forwarders
      |  +--rw service-function-forwarder* [name]
      |     +--rw name                           sfc-common:sff-name
      |     +--rw service-node?                  sfc-common:sn-name
      |     +--rw ip-mgmt-address?               inet:ip-address
      |     +--rw sff-data-plane-locator* [name]
      |     |  +--rw name                  sfc-common:sff-data-plane-locator-name
      |     |  +--rw data-plane-locator
      |     |     +--rw (locator-type)
      |     |     |  +--:(ip)
      |     |     |  |  +--rw ip?              inet:ip-address
      |     |     |  |  +--rw port?            inet:port-number
      |     |     |  +--:(lisp)
      |     |     |  |  +--rw eid?             inet:ip-address
      |     |     |  +--:(mac)
      |     |     |  |  +--rw mac?             yang:mac-address
      |     |     |  |  +--rw vlan-id?         uint16
      |     |     |  +--:(function)
      |     |     |  |  +--rw function-name?   string
      |     |     |  +--:(mpls)
      |     |     |  |  +--rw mpls-label?      uint32
      |     |     |  +--:(other)
      |     |     |     +--rw other-name?      string
      |     |     +--rw transport?       identityref
      |     +--rw rest-uri?                      inet:uri
      |     +--rw service-function-dictionary* [name]
      |     |  +--rw name                         sfc-common:sf-name
      |     |  +--rw sff-sf-data-plane-locator
      |     |  |  +--rw sf-dpl-name?    sfc-common:sf-data-plane-locator-name
      |     |  |  +--rw sff-dpl-name?   sfc-common:sff-data-plane-locator-name
      |     |  +--rw sff-interfaces* [sff-interface]
      |     |  |  +--rw sff-interface    string
      |     |  +--rw failmode?                    failmode-type
      |     +--rw connected-sff-dictionary* [name]
      |        +--rw name                          sfc-common:sff-name
      |        +--rw sff-sff-data-plane-locator
      |        |  +--rw (locator-type)
      |        |  |  +--:(ip)
      |        |  |  |  +--rw ip?              inet:ip-address
      |        |  |  |  +--rw port?            inet:port-number
      |        |  |  +--:(lisp)
      |        |  |  |  +--rw eid?             inet:ip-address
      |        |  |  +--:(mac)
      |        |  |  |  +--rw mac?             yang:mac-address
      |        |  |  |  +--rw vlan-id?         uint16
      |        |  |  +--:(function)
      |        |  |  |  +--rw function-name?   string
      |        |  |  +--:(mpls)
      |        |  |  |  +--rw mpls-label?      uint32
      |        |  |  +--:(other)
      |        |  |     +--rw other-name?      string

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 27]


Internet-Draft      Yang Model for Service Chaining            June 2016

      |        |  +--rw transport?       identityref
      |        +--rw sff-interfaces* [sff-interface]
      |        |  +--rw sff-interface    string
      |        +--rw failmode?                     failmode-type
      +--ro service-function-forwarders-state
         +--ro service-function-forwarder-state* [name]
            +--ro name                      sfc-common:sff-name
            +--ro statistic-by-timestamp* [timestamp]
            |  +--ro timestamp            uint64
            |  +--ro service-statistic
            |     +--ro bytes-in?      yang:zero-based-counter64
            |     +--ro bytes-out?     yang:zero-based-counter64
            |     +--ro packets-in?    yang:zero-based-counter64
            |     +--ro packets-out?   yang:zero-based-counter64
            +--ro sff-service-path* [name]
               +--ro name                      sfc-common:sfp-name
               +--ro statistic-by-timestamp* [timestamp]
                  +--ro timestamp            uint64
                  +--ro service-statistic
                     +--ro bytes-in?      yang:zero-based-counter64
                     +--ro bytes-out?     yang:zero-based-counter64
                     +--ro packets-in?    yang:zero-based-counter64
                     +--ro packets-out?   yang:zero-based-counter64

8.2.  Service Function Forwarder Model






























Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 28]


Internet-Draft      Yang Model for Service Chaining            June 2016


   <CODE BEGINS> file "service-function-forwarder@2014-07-01.yang"


   module service-function-forwarder {

     namespace "urn:cisco:params:xml:ns:yang:sfc-sff";

     prefix sfc-sff;

     import ietf-inet-types {
         prefix inet;
         revision-date 2010-09-24;
         }
     import service-locator {
         prefix sfc-sl;
         revision-date 2014-07-01;
         }
     import service-function-type {
         prefix sfc-sft;
         revision-date 2014-07-01;
         }
     import service-statistics {
         prefix sfc-ss;
         revision-date 2014-07-01;
         }
     import sfc-common {
         prefix sfc-common;
         revision-date 2015-10-17;
         }

     organization "Cisco Systems, Inc.";
     contact "Reinaldo Penno <repenno@cisco.com>";


     description
       "This module contains a collection of YANG definitions for
        managing service function forwarders.

        Copyright (c) 2013 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC XXXX; see
        the RFC itself for full legal notices.";

        // RFC Ed.: replace XXXX with actual RFC number and remove this
        // note.

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 29]


Internet-Draft      Yang Model for Service Chaining            June 2016


        // RFC Ed.: update the date below with the date of RFC
        // publication and remove this note.

     revision 2014-07-01 {
         description
         "Revision based on Opendaylight project feedback";
       reference "https://tools.ietf.org/html/draft-penno-sfc-yang";
     }

     // Failmode type definitions

     identity failmode-type-identity {
       description
         "Base identity from which specific failmode
          types are derived. Fail mode specifies the behavior
          when the interface does not have connectivity to the
          service node.";
     }

     typedef failmode-type {
       type identityref {
           base "failmode-type-identity";
       }
       description "This type is used to reference all
         registered failmode types";
     }

     identity close {
       base "failmode-type-identity";
       description "When service-function can not reach service
          function, packets will be dropped";
     }

     identity open {
       base "failmode-type-identity";
       description "When service-function can not reach service
          function, packets will be forwarded";
     }

     container service-function-forwarders {
       description
         "A service function forwarder is
          responsible for delivering traffic received from the SFC
          network forwarder to one or more connected service
          functions via information carried in the SFC encapsulation.
         ";
       list service-function-forwarder {
         key "name";
         description
           "A list that holds configuration of all SFFs in the domain";
         leaf name {
           type sfc-common:sff-name;
           description

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 30]


Internet-Draft      Yang Model for Service Chaining            June 2016

             "The unique name of this service function forwarder, such
              as SFF1";
         }

         leaf service-node {
           type sfc-common:sn-name;
           description "The service node that hosts this SFF";
         }

         leaf ip-mgmt-address {
           type inet:ip-address;
           description
             "The IP and port used to configure this
              service-function-forwarder";
         }

         leaf rest-uri {
           type inet:uri;
           description "URI of REST based management";
         }

         list sff-data-plane-locator {
           key "name";
           description
             "A list of all data-plane-locators of this SFF.";
           leaf name {
             type sfc-common:sff-data-plane-locator-name;
             description
               "A unique name that represents this
                data-plane-locator";
           }

           container data-plane-locator {
             description
               "This container holds configuration for the overlay data
                plane locator used by this SFF. This could be VXLAN,
                GRE, etc";
             uses sfc-sl:data-plane-locator;
           }
         }

         list service-function-dictionary {
           key "name";
           leaf name {
             type sfc-common:sf-name;
             description
                 "The name of the service function.";
           }
           container sff-sf-data-plane-locator {
             description
               "SFF and SF data plane locators to use when sending
                packets from this SFF to the associated SF";
             leaf sf-dpl-name {
               type sfc-common:sf-data-plane-locator-name;

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 31]


Internet-Draft      Yang Model for Service Chaining            June 2016

               description
                 "The SF data plane locator to use when sending
                  packets to the associated service function";
             }
             leaf sff-dpl-name {
               type sfc-common:sff-data-plane-locator-name;
               description
                 "The SFF data plane locator to use when sending
                  packets to the associated service function.
                  This is necessary when the SFF has multiple DPLs";
             }
           }
           list sff-interfaces {
             key "sff-interface";
             leaf sff-interface {
               type string;
               description
                 "An individual interface on the SFF connected to the
                  SF";
             }
             description
               "A list of interfaces on the SFF which are connected to
                this SF, usually one 1 or 2 elements";
           }
           leaf failmode {
             type failmode-type;
             description
               "This leaf defines what should the SFF do if it can not
                send packets to the SF";
           }
           description
             "A list of all Service Functions attached to this SFF.";
         }

         list connected-sff-dictionary {
           key "name";
           leaf name {
             type sfc-common:sff-name;
             description
               "The name of the SFF connected to this SFF";
           }
           container sff-sff-data-plane-locator {
             description
               "The SFF uses this data plane locator when sending
                packets to the associated SFF";
             uses sfc-sl:data-plane-locator;
           }
           list sff-interfaces {
             key "sff-interface";
             leaf sff-interface {
               type string;
               description
                 "An individual SFF interface connected to this SFF";
             }

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 32]


Internet-Draft      Yang Model for Service Chaining            June 2016

             description
               "A list of SFF interfaces connected to this SFF";
           }
           leaf failmode {
             type failmode-type;
             description
               "This leaf defines what the SFF should do if it can not
                send packets to a connected SFF";
           }
           description
             "A list of all Service Function Forwarders connected to
              this SFF";
         }
       }
     }

     container service-function-forwarders-state {
       config false;
       description
         "This container hold operational state for all service
          function forwarders";
       list service-function-forwarder-state {
         key "name";
         description
           "This list holds operational data for all service functions
            forwarders in the domain";
         leaf name {
           type sfc-common:sff-name;
           description
             "the name of the service function forwarder";
         }
         uses sfc-ss:service-statistics-group {
           description "Global Service Function Forwarder statistics";
         }

         list sff-service-path {
           key "name";
           leaf name {
             type sfc-common:sfp-name;
             description
               "The name of the Service Path";
           }
           uses sfc-ss:service-statistics-group;
           description
           "A list of all service function paths that use this
            service function forwarder";
         }
       }
     }
   }

   <CODE ENDS>



Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 33]


Internet-Draft      Yang Model for Service Chaining            June 2016


9.  Service Locator (SL)

   This module provides a single point of registration for all network
   locators types used in Services Function Chaining.  the model can be
   augmented at will with locators appropriate for each use-case.

9.1.  Module Structure

9.2.  Service Locator Module













































Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 34]


Internet-Draft      Yang Model for Service Chaining            June 2016


   <CODE BEGINS> file "service-locator@2014-07-01.yang"

   module service-locator {

     namespace "urn:cisco:params:xml:ns:yang:sfc-sl";

     prefix sfc-sl;

     import ietf-inet-types {
         prefix inet;
         revision-date 2013-07-15;
     }
     import ietf-yang-types {
         prefix yang;
         revision-date 2013-07-15;
     }

     organization "Cisco Systems, Inc.";
     contact "Reinaldo Penno <repenno@cisco.com>";


     description
       "This module contains a collection of YANG definitions for
        managing service locators. Service locators are used as
        data plane network destinations for Service Functions and
        Service Function Forwarders

        It follows closely the constructs of
        http://tools.ietf.org/html/draft-ietf-netmod-interfaces-cfg-12

        Copyright (c) 2013 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC XXXX; see
        the RFC itself for full legal notices.";

        // RFC Ed.: replace XXXX with actual RFC number and remove this
        // note.

        // RFC Ed.: update the date below with the date of RFC
        // publication and remove this note.

     revision 2014-07-01 {
       description
         "Changes based on Opendaylight Testing.";
       reference "https://tools.ietf.org/html/draft-penno-sfc-yang";

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 35]


Internet-Draft      Yang Model for Service Chaining            June 2016

     }

     // Locator definitions

     // Transport type definitions
     identity transport-type {
       description
         "Base identity from which specific transport types are
          derived.";
     }

     identity mac {
       base "sl-transport-type";
       description "Simple MAC with optional VLAN transport type";
     }

     identity vxlan-gpe {
       base "sl-transport-type";
       description "Programmable vxlan transport type";
     }

     identity gre {
       base "sl-transport-type";
       description "GRE transport type";
     }

     identity mpls {
       base "sl-transport-type";
       description "Multi Protocol Label Switching transport type";
     }

     identity other {
       base "sl-transport-type";
       description "unspecified transport type";
     }

     identity sl-transport-type {
       base "transport-type";
       description
         "This identity is used as a base for all transport
          types";

     }

     typedef sl-transport-type-def {
       type identityref {
         base "sl-transport-type";
       }
       description "This type is used to reference all
         registered transport types";
     }

     grouping lisp-locator {
       description

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 36]


Internet-Draft      Yang Model for Service Chaining            June 2016

         "Data plane-locator: Lisp Eid(IP)";
       leaf eid {
         type inet:ip-address;
         description "Data-plane IP address";
       }
     }

     grouping ip-port-locator {
       description
         "Data plane-locator: IP address and L4 port";
       leaf ip {
         type inet:ip-address;
         description "Data-plane IP address";
       }
       leaf port {
         type inet:port-number;
         description "Data-plane port number";
       }
     }

     grouping mac-address-locator {
       description
         "Data plane-locator: mac address and optional vlan-id";
       leaf mac {
         type yang:mac-address;
         description "Data-plane MAC address";
       }
       leaf vlan-id {
         type uint16 {
           range "1..4094";
         }
         description "Data-plane VLAN ID address";
       }
     }

     grouping mpls-locator {
       description
         "Data plane-locator: MPLS label";
       leaf mpls-label {
         type uint32 {
           range "1..1048575";
         }
         description "MPLS Label, 20 bits";
       }
     }

     grouping function-locator {
       description
         "When SF is co-located with SFF, this could be the name of a
          function or method.";
       leaf function-name {
         type string;
         description "Function or method name";
       }

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 37]


Internet-Draft      Yang Model for Service Chaining            June 2016

     }

     grouping other-locator {
       description
         "Other locator";
       leaf other-name {
         type string;
         description "A other or undefined locator";
       }
     }

     grouping data-plane-locator {
       description
         "This group presents data-plane locator
          information for service function elements in the domain";
       choice locator-type {
         mandatory true;
         case ip {
           uses ip-port-locator;
         }
         case lisp {
           uses lisp-locator;
         }
         case mac {
           uses mac-address-locator;
         }
         case function {
           uses function-locator;
         }
         case mpls {
           uses mpls-locator;
         }
         case other {
           uses other-locator;
         }
         description "The collection of all possible data-plane
           locators. Only one can be chosen";
       }
       leaf transport {
         type identityref {
           base sfc-sl:sl-transport-type;
         }
         description
           "The encapsulation used to carry NSH packets";
       }
     }
   }


   <CODE ENDS>


10.  Rendered Service Path (RSP)


Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 38]


Internet-Draft      Yang Model for Service Chaining            June 2016


   This module holds the actual service-hops a packet will traverse when
   forwarded through a specific service path.

10.1.  Module Structure


















































Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 39]


Internet-Draft      Yang Model for Service Chaining            June 2016


   module: rendered-service-path
      +--ro rendered-service-paths
         +--ro rendered-service-path* [name]
            +--ro name                            sfc-common:rsp-name
            +--ro parent-service-function-path?   sfc-common:sfp-name
            +--ro transport-type?                 sfc-sl:sl-transport-type-def
            +--ro context-metadata?               sfc-md:context-metadata-ref
            +--ro variable-metadata?              sfc-md:variable-metadata-ref
            +--ro tenant-id?                      string
            +--ro statistic-by-timestamp* [timestamp]
            |  +--ro timestamp            uint64
            |  +--ro service-statistic
            |     +--ro bytes-in?      yang:zero-based-counter64
            |     +--ro bytes-out?     yang:zero-based-counter64
            |     +--ro packets-in?    yang:zero-based-counter64
            |     +--ro packets-out?   yang:zero-based-counter64
            +--ro rendered-service-path-hop* [hop-number]
            |  +--ro hop-number                            uint8
            |  +--ro service-function-name?                sfc-common:sf-name
            |  +--ro service-function-group-name?          string
            |  +--ro service-function-forwarder?           sfc-common:sff-name
            |  +--ro service-function-forwarder-locator?   sfc-common:sff-data-plane-locator-name
            |  +--ro service-index?                        uint8
            +--ro service-chain-name              sfc-common:sfc-name
            +--ro starting-index?                 uint8
            +--ro path-id                         uint32
            +--ro symmetric-path-id?              uint32
   rpcs:
      +---x trace-rendered-service-path
      |  +--ro input
      |  |  +--ro name?   string
      |  +--ro output
      |     +--ro result?   boolean
      +---x delete-rendered-path
      |  +--ro input
      |  |  +--ro name?   string
      |  +--ro output
      |     +--ro result?   boolean
      +---x create-rendered-path
      |  +--ro input
      |  |  +--ro name?                           string
      |  |  +--ro parent-service-function-path?   string
      |  |  +--ro symmetric?                      boolean
      |  |  +--ro (context-header-allocation-type-1)?
      |  |     +--:(vxlan-classifier)
      |  |     |  +--ro vxlan-classifier-enabled?       boolean
      |  |     +--:(mobility)
      |  |     |  +--ro mobility-allocation-enabled?    boolean
      |  |     +--:(dc)
      |  |        +--ro dc-allocation-enabled?          boolean
      |  +--ro output
      |     +--ro name?   string
      +---x read-rendered-service-path-first-hop

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 40]


Internet-Draft      Yang Model for Service Chaining            June 2016

      |  +--ro input
      |  |  +--ro name?   string
      |  +--ro output
      |     +--ro rendered-service-path-first-hop
      |        +--ro starting-index?      uint8
      |        +--ro symmetric-path-id?   uint32
      |        +--ro path-id?             uint32
      |        +--ro transport-type?      sfc-sl:sl-transport-type-def
      |        +--ro ip?                  inet:ip-address
      |        +--ro port?                inet:port-number
      |        +--ro mpls-label?          uint32
      +---x read-rsp-first-hop-by-sft-list
         +--ro input
         |  +--ro sfst?       sfc-sfst:service-function-scheduler-type
         |  +--ro sft-list*   sfc-common:sft-type-name
         +--ro output
            +--ro rendered-service-path-first-hop
               +--ro starting-index?      uint8
               +--ro symmetric-path-id?   uint32
               +--ro path-id?             uint32
               +--ro transport-type?      sfc-sl:sl-transport-type-def
               +--ro ip?                  inet:ip-address
               +--ro port?                inet:port-number
               +--ro mpls-label?          uint32


10.2.  Rendered Service Path Module




























Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 41]


Internet-Draft      Yang Model for Service Chaining            June 2016



   <CODE BEGINS> file "rendered-service-path@2014-07-01.yang"

   module rendered-service-path {

     namespace "urn:cisco:params:xml:ns:yang:sfc-rsp";

     prefix sfc-rsp;

     import service-function-path-metadata {
         prefix sfc-md;
         revision-date 2014-07-01;
     }
     import service-locator {
         prefix sfc-sl;
         revision-date 2014-07-01;
     }
     import service-statistics {
         prefix sfc-ss;
         revision-date 2014-07-01;
     }
     import sfc-common {
         prefix sfc-common;
     }

     organization "Cisco Systems, Inc.";
     contact "Reinaldo Penno <repenno@cisco.com>";


     description
       "This module contains a collection of YANG definitions to
        manage Rendered Service Paths.

        Copyright (c) 2013 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC XXXX; see
        the RFC itself for full legal notices.";

        // RFC Ed.: replace XXXX with actual RFC number and remove this
        // note.

        // RFC Ed.: update the date below with the date of RFC
        // publication and remove this note.

     revision 2014-07-01 {

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 42]


Internet-Draft      Yang Model for Service Chaining            June 2016

       description
         "Changes based on Opendaylight Testing and IETF SFC ml.";
       reference "https://tools.ietf.org/html/draft-penno-sfc-yang";
     }

     // Rendered Service Path

     container rendered-service-paths {
       config false;
       description
         "A container that holds the list of all Rendered Service Paths
          in a SFC domain";
       list rendered-service-path {
         key "name";
         description
           "A list that holds operational data for all RSPs in the
            domain";
         leaf name {
           type sfc-common:rsp-name;
           description
             "The name of this rendered function path. This is the same
              name as the associated SFP";
         }
         leaf parent-service-function-path {
           type sfc-common:sfp-name;
           description
             "Service Function Path from which this RSP was
              instantiated";

         }
         leaf transport-type {
           type sfc-sl:sl-transport-type-def;
           default "sfc-sl:vxlan-gpe";
           description
             "Transport type as set in the Parent Service Function
              Path";
         }
         leaf context-metadata {
           type sfc-md:context-metadata-ref;
           description
             "The name of the associated context metadata";
         }
         leaf variable-metadata {
           type sfc-md:variable-metadata-ref;
           description
             "The name of the associated variable metadata";
         }
         leaf tenant-id {
           type string;
           description
             "This RSP was created for a specific tenant-id";
         }
         uses sfc-ss:service-statistics-group {
           description "Global Rendered Service Path statistics";

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 43]


Internet-Draft      Yang Model for Service Chaining            June 2016

         }
         list rendered-service-path-hop {
           key "hop-number";
           leaf hop-number {
             type uint8;
             description
               "A Monotonically increasing number";
           }
           leaf service-function-name {
             type sfc-common:sf-name;
             description
               "Service Function name";
           }
           leaf service-function-group-name {
             type string;
             description
               "Service Function group name";
           }
           leaf service-function-forwarder {
             type sfc-common:sff-name;
             description
               "Service Function Forwarder name";
           }
           leaf service-function-forwarder-locator {
             type sfc-common:sff-data-plane-locator-name;
             description
               "The name of the SFF data plane locator";
           }
           leaf service-index {
             type uint8;
             description
               "Provides location within the service path.
                Service index MUST be decremented by service functions
                or proxy nodes after performing required services.  MAY
                be used in conjunction with service path for path
                selection.  Service Index is also valuable when
                troubleshooting/reporting service paths.  In addition to
                location within a path, SI can be used for loop
                detection.";
           }
           ordered-by user;
           description
             "A list of service functions that compose the
              service path";
         }
         leaf service-chain-name {
           type sfc-common:sfc-name;
           mandatory true;
           description
             "The Service Function Chain used as blueprint for this
              path";
         }
         leaf starting-index {
           type uint8;

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 44]


Internet-Draft      Yang Model for Service Chaining            June 2016

           description
             "Starting service index";
         }
         leaf path-id {
           type uint32 {
             range "0..16777216";
           }
           mandatory true;
           description
             "Identifies a service path.
              Participating nodes MUST use this identifier for path
              selection.  An administrator can use the service path
              value for reporting and troubleshooting packets along
              a specific path.";
         }
         leaf symmetric-path-id {
           type uint32 {
             range "0..16777216";
           }
           description
             "Identifies the associated symmetric path, if any.";
         }
       }
     }

     rpc trace-rendered-service-path {
       description
         "Requests a NSH Traceroute through the specified
          rendered service path";
       input {
         leaf name {
           type string;
           description
             "The name of the rendered function path.";
         }
       }
       output {
         leaf result {
           type boolean;
           description
             "Whether NSH traceroute for the requested path was
              successful";
         }
       }
     }


     rpc delete-rendered-path {
       description
         "Delete a Rendered Service Path";
       input {
         leaf name {
           type string;
           description

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 45]


Internet-Draft      Yang Model for Service Chaining            June 2016

             "The name of this rendered function path.";
         }
       }
       output {
         leaf result {
           type boolean;
           description
             "True if Rendered Service Path was deleted, otherwise
              false";
         }
       }
     }

     rpc create-rendered-path {
       description
         "Created a Rendered Service Path";
       input {
         leaf name {
           type string;
           description
             "The name of this rendered function path.";
         }
         leaf parent-service-function-path {
           type string;
           description
             "Service Function Path from which this RSP was
              instantiated";
         }
         leaf symmetric {
           type boolean;
           default false;
           description
             "If the chain is symmetric we will create two service
              paths, one ingress and another egress. Packets traverse
              the egress service path in the reverse order of the
              ingress path";
         }
         choice context-header-allocation-type-1 {
           description
             "A RSP can support a single MD-type 1
              context-allocation-type";
           case vxlan-classifier {
             leaf vxlan-classifier-enabled {
               type boolean;
               default false;
               description "Client needs service path to implement
                 VXLAN overlay classifier metadata allocation";
             }
           }
           case mobility {
             leaf mobility-allocation-enabled {
               type boolean;
               default false;
               description "Client needs service path to implement

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 46]


Internet-Draft      Yang Model for Service Chaining            June 2016

                 Mobility Metadata allocation";
             }
           }
           case dc {
             leaf dc-allocation-enabled {
               type boolean;
               default false;
               description "Client needs service path to implement
                 DC Allocation Metadata allocation";
             }
           }
         }
       }
       output {
         leaf name {
           type string;
           description "Name of the created Rendered Service Path";
         }
       }
     }

     grouping rendered-service-path-first-hop-info {
       description
         "This groups holds the the container that provides
          information about the first hop in a rendered service
          path";
       container rendered-service-path-first-hop {
         description
           "Provides all necessary information for a system to construct
            a NSH header and associated overlay packet to target the
            first service hop of a Rendered Service Path";
         leaf starting-index {
           type uint8;
           description
               "Starting service index";
         }
         leaf symmetric-path-id {
           type uint32 {
             range "0..16777216";
           }
           description
             "Identifies the associated symmetric path, if any.";
         }
         leaf path-id {
           type uint32 {
             range "0..16777216";
           }
           description
             "Identifies a service path.
              Participating nodes MUST use this identifier for path
              selection.  An administrator can use the service path
              value for reporting and troubleshooting packets along
              a specific path.";
         }

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 47]


Internet-Draft      Yang Model for Service Chaining            June 2016

         leaf transport-type {
           type sfc-sl:sl-transport-type-def;
           description
             "Defines the data-plane protocol used by the first
              Service Function Forwarder";
         }

         uses sfc-sl:ip-port-locator;
         uses sfc-sl:mpls-locator;
       }
     }

     rpc read-rendered-service-path-first-hop {
       description
         "Read all the necessary information for the first hop of a
         Rendered Service Path";
       input {
         leaf name {
           type string;
           description
             "The name of this rendered service path";
         }
       }
       output {
         uses rendered-service-path-first-hop-info;
       }
     }
   }



   <CODE ENDS>


11.  Service Function Common (SFC-Common)

   This module holds common definitions for Service Chain modules

11.1.  Service Function Common Module
















Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 48]


Internet-Draft      Yang Model for Service Chaining            June 2016


   <CODE BEGINS> file "sfc-common@2015-10-17.yang"

   module sfc-common {

     namespace "urn:cisco:params:xml:ns:yang:sfc-common";

     prefix sfc-common;

     organization "Cisco Systems, Inc.";
     contact "Keith Burns <krb@cisco.com>";

     description
       "Common typedefs and leafrefs for project";

     revision 2015-10-17 {
       description
         "Initial revision";
       reference "https://tools.ietf.org/html/draft-penno-sfc-yang";
     }

     // general typedefs
     typedef tenant-id {
         type string;
         description "Tenant ID";
     }
     // typedef for Service Node
     typedef sn-name {
         type string;
         description "Service Node Name Type";
     }

     // typedefs for Service Function Chain
     typedef sfc-name {
         type string;
         description "Service Function Chain Name";
     }

     // typedefs for Service Function Type
     typedef sft-type-name {
         type string;
         description "Service function type name";
     }

     // typedefs for Service Function
     typedef sf-name {
         type string;
         description "Service Function Name";
     }

     typedef sf-data-plane-locator-name {
         type string;
         description
           "A unique name for SF data-plane-locator";

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 49]


Internet-Draft      Yang Model for Service Chaining            June 2016

     }

     // typedefs for Rendererd Service Paths
     typedef rsp-name {
         type string;
         description
           "Rendererd Service Path Name Type";
     }

     // typedefs for Service Function Path
     typedef sfp-name {
         type string;
         description "Service Function Path Name Type";
     }

     // typedefs for sff names
     typedef sff-data-plane-locator-name {
         type string;
         description
           "Service Function Forwarder data-plane-locator name type";
     }

     typedef sff-name {
         type string;
         description "Service Function Forwarder Name type";
     }

     // typedefs for renderer names
     typedef renderer-name {
         type string;
         description "Renderer Name type";
     }
   }


   <CODE ENDS>


12.  Service Statistics (Sfc-ss)

   This module holds common statistics definitions for Service Chain
   modules

12.1.  Service Statistics Chain Common Module











Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 50]


Internet-Draft      Yang Model for Service Chaining            June 2016


   <CODE BEGINS> file "service-statistics@2014-07-01.yang"

   module service-statistics {

     namespace "urn:cisco:params:xml:ns:yang:sfc-ss";

     prefix sfc-ss;

     import ietf-yang-types {
         prefix yang;
         revision-date 2013-07-15;
     }

     organization "Cisco Systems, Inc.";
     contact "Reinaldo Penno <repenno@cisco.com>";


     description
       "This module contains a collection of YANG definitions for
        managing service statistics. Service statistics are used
        to determine the load and efficiency of a service function
        or service function forwarder device

        Copyright (c) 2013 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC XXXX; see
        the RFC itself for full legal notices.";

        // RFC Ed.: replace XXXX with actual RFC number and remove this
        // note.

        // RFC Ed.: update the date below with the date of RFC
        // publication
        // and remove this note.

     revision 2014-07-01 {
       description
         "Initial Revision";
       reference
         "https://tools.ietf.org/html/draft-penno-sfc-yang";
     }

     grouping service-statistics-group {
         description
           "Group that holds the list that indexes statistics by timestamp";

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 51]


Internet-Draft      Yang Model for Service Chaining            June 2016

         list statistic-by-timestamp {
             key "timestamp";
             leaf timestamp {
                 type uint64;
                 description
                     "Date and time of record creation in milliseconds
                     counting from 1.1.1970 00:00:00 UTC (= 0)";
             }
             uses statistic-fields;
             description
               "This list holds statistics indexed by timestamp";
         }
     }

     grouping statistic-fields {
         description
           "Groups all statistics containers";
         container service-statistic {
             config false;
             leaf bytes-in {
               type yang:zero-based-counter64;
               description
                 "Received bytes";
             }
             leaf bytes-out {
               type yang:zero-based-counter64;
               description
                 "Transmitted bytes";
             }
             leaf packets-in {
               type yang:zero-based-counter64;
               description
                 "Received packets";
             }
             leaf packets-out {
               type yang:zero-based-counter64;
               description
                 "Transmitted packets";
             }
             description
               "This container holds packets and bytes statistics";
         }
     }
   }


   <CODE ENDS>


13.  Service Function Path Metadata (SFC-MD)

   This module holds the service function path metadata that is attached
   to a packet as it traverses a specific service path.


Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 52]


Internet-Draft      Yang Model for Service Chaining            June 2016


13.1.  Module Structure

      module: service-function-path-metadata
      +--rw service-function-metadata
         +--rw context-metadata* [name]
         |  +--rw name               string
         |  +--rw context-header1?   uint32
         |  +--rw context-header2?   uint32
         |  +--rw context-header3?   uint32
         |  +--rw context-header4?   uint32
         +--rw variable-metadata* [name]
            +--rw name            string
            +--rw tlv-metadata* [tlv-class tlv-type]
               +--rw tlv-class    uint16
               +--rw tlv-type     uint8
               +--rw flags?       bits
               +--rw length?      uint8
               +--rw tlv-data?    string


13.2.  Service Function Path Metadata Module

































Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 53]


Internet-Draft      Yang Model for Service Chaining            June 2016



   <CODE BEGINS> file "service-function-path-metadata@2014-07-01.yang"

   module service-function-path-metadata {

     namespace "urn:cisco:params:xml:ns:yang:sfc-md";

     prefix sfc-md;

     organization "Cisco Systems, Inc.";
     contact "Paul Quinn <paulq@cisco.com>";

     description
     "This module contains a collection of YANG definitions metadata
       used in a service function path between participating nodes";


     revision 2014-07-01 {
       description
         "Initial Version";
        reference
         "RFC XXXX: Service Path Metadata";
     }

     // Service Function Path Metadata

     typedef context-metadata-ref {
       type leafref {
         path "/sfc-md:service-function-metadata/" +
           "sfc-md:context-metadata/sfc-md:name";
       }
       description
         "This type is used by data models that need to reference
          configured context metadata headers.";
     }

     typedef variable-metadata-ref {
       type leafref {
         path "/sfc-md:service-function-metadata/" +
           "sfc-md:variable-metadata/sfc-md:name";
       }
       description
         "This type is used by data models that need to reference
          configured variable metadata headers.";
     }

     //Another module would reference these headers like
     //leaf name {
     //  type sfc-md:context-metadata-ref;
     //  description
     //   "A reference to the name of a configured context header";
     //}


Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 54]


Internet-Draft      Yang Model for Service Chaining            June 2016

     container service-function-metadata {

       description
         "NSH provides a mechanism to carry shared metadata between
          network  devices and service function, and between service
          functions. The semantics of the shared metadata is
          communicated via a control plane to participating
          nodes. Examples of metadata include classification
          information used for policy enforcement and network context
          for forwarding post service delivery.";

       list context-metadata {
         key "name";
         leaf name {
           type string;
           description "A unique name for this set of context headers";
         }
         leaf context-header1 {
           type uint32;
           description "network platform context, bytes 9-12";
         }
         leaf context-header2 {
           type uint32;
           description "network platform context, bytes 13-16";
         }
         leaf context-header3 {
           type uint32;
           description "network platform context, bytes 17-20";
         }
         leaf context-header4 {
           type uint32;
           description "network platform context, bytes 21-24";
         }
         description "Fixed Context metadata headers";
       }
       list variable-metadata {
         key "name";
         leaf name {
           type string;
           description "A unique name for this set of variable length
             metadata";
         }
         list tlv-metadata {
           key "tlv-class tlv-type";
           leaf tlv-class {
             type uint16;
             description "Class of TLV being used, bytes 25-26";
           }
           leaf tlv-type {
             type uint8;
             description "type of tlv for a given class";
           }
           leaf flags {
             type bits {

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 55]


Internet-Draft      Yang Model for Service Chaining            June 2016

               bit r1 {
                 position 24;
                 description "Reserved";
               }
               bit r2 {
                 position 25;
                 description "Reserved";
               }
               bit r3 {
                 position 26;
                 description "Reserved";
               }
             }
             description "reserved flag bits";
           }

           leaf length {
             type uint8 {
               range "0..32";
             }
             description "Length of the variable metadata in 4-byte
               words";
           }
           leaf tlv-data {
             type string;
             description "Variable Data";
           }
           description "A set of variable length metadata";
         }
         description "A list that contain sets of variable length
           metadata";
       }
     }
   }

   <CODE ENDS>


14.  IANA Considerations

   TBD

15.  Security Considerations

16.  Acknowledgements

   Thanks to Jan Medved, Ron Parker, Jan Lindblad, David Goldberg, Vina
   Ermagan, Sam Hague and Vinayak Joshi and for reviews and suggestions.

17.  Changes

   -15



Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 56]


Internet-Draft      Yang Model for Service Chaining            June 2016


   o  Getting ready for a possible WG adoption therefore removed OVS
      Scheduler and Classifier models since they are very implementation
      specific.

   o  New SFC-Common module that carries definition reused across many
      different modules

   o  Updated all models, regenerated all model structures.

   o  Fixed all errors flagged by pyang --ietf.  The warnings were not
      fixed and will be taken care if documented adopted by WG

   -14

   o  Updated all modules according to implementation experience

   -11

   o  Added new co-authors

   o  changed RSP and SFP models to allow multiple encap paths.

   o  Added the "need reclassififcation" leaf to allow a Service
      Function to tell a SFF that packet reclassification is needed

   o  Added RSP first hop container to allow SFC applications to request
      the ingress hop to a RSP. These applciations (such as dynamic
      classifier) treat RSP as a black box and only need ingress
      locator.

   -10

   This new revision comes after considerable control and dataplane
   interop testing.  The new changes reflect what we found necessary for
   building a well-rounded solution.

   o  Added Rendered Service Path Model

   o  Added Service Function Description Monitor and Report Models

   o  Updated Service Function Path (It allow users to control certain
      aspects of RSPs, new symmetric and metadata leaves)

   o  Updated Service Function Forwarder model

   o  Updated Service Function Model

   o  Updated Service Function Type Model (HTTP Header Enrichment
      service)

   o  Update Service Locator Model (MPLS encap)

   o  Removed Service Node

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 57]


Internet-Draft      Yang Model for Service Chaining            June 2016


   o  Others

   -09

   o  Modifed Service Function Forwarder OVS model based on OVS/
      Openstack deployment experience

   -08

   o  Removed VXLAN-GPE model

   o  Added Service Function Forwarder OVS model

   o  Added metadata reference to Service Function Path

   -07

   o  All models that need data plane locators reference service locator
      model

   o  Service Locator module has locators for IP:port, VLAN:MAC, LISP

   o  A SF can have multiple data place locators

   o  SF and SFF are decoupled and have their own views of the network

   o  Service Function Chains and derived path can be symmtric (bi-dir)
      or not

   o  Service Function Types separated into a model

   o  Service Function Path is a collection of service hops.  This
      allows hops such as SFF + classifier.

   -06

   o  Introduced operational tree in some models based on testing and
      user feedback.

   o  Introduced RPCs in some models

   o  Service Function Path needs SFC from which it will be instantiated

   o  Updated all module structures

   o  Introduced Service Locator module

   -05

   Changes based on Opendaylight Implementation Testing and Sfc-dev
   mailing list feedback



Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 58]


Internet-Draft      Yang Model for Service Chaining            June 2016


   o  Service Node becomes a container for Service Functions.  Moved
      data plane items to SFF.

   o  Fixed Service Function Forwarders into a list so we cna have
      multiple in a system

   o  Fixed Service Function Chain so it becomes a list of lists.

   o  Created RPCs for Service Functions and Service Chain

   -04

   o  Fixed list inside Service Function Chain to read service-function-
      type

   o  Small comment fixes

   -03

   o  Revision dates consistent

   o  Service function chain to container + list in order to allow
      multiple

   o  Service Function Path to cotainer + list

   o  VXLAN-gpe vni to multiple 8-bit fields

   o  Consistent typeref use

   o  Other consistency fixes

   -02

   o  After Opendaylight Testing converted multiple leafs to lists
      throughout all models

   o  Removed transport dependency.  Transport could be layer-2,
      layer-3, etc

   o  Used pathrefs similar to ietf-interfaces to reference
      configuration names

   o  Other consistency fixes

18.  References

18.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/
              RFC2119, March 1997, <http://www.rfc-editor.org/info/
              rfc2119>.

Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 59]


Internet-Draft      Yang Model for Service Chaining            June 2016


   [RFC2616]  Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
              Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext
              Transfer Protocol -- HTTP/1.1", RFC 2616, DOI 10.17487/
              RFC2616, June 1999, <http://www.rfc-editor.org/info/
              rfc2616>.

18.2.  Informative References

   [I-D.ietf-sfc-architecture]
              Halpern, J. and C. Pignataro, "Service Function Chaining
              (SFC) Architecture", Internet-Draft draft-ietf-sfc-
              architecture-11, July 2015.

   [I-D.ietf-sfc-nsh]
              Quinn, P. and U. Elzur, "Network Service Header",
              Internet-Draft draft-ietf-sfc-nsh-04, March 2016.

   [I-D.ietf-sfc-problem-statement]
              Quinn, P. and T. Nadeau, "Service Function Chaining
              Problem Statement", Internet-Draft draft-ietf-sfc-problem-
              statement-13, February 2015.

   [I-D.quinn-vxlan-gpe]
              Quinn, P., Manur, R., Kreeger, L., Lewis, D., Maino, F.,
              Smith, M., Agarwal, P., Yong, L., Xu, X., Elzur, U., Garg,
              P. and D. Melman, "Generic Protocol Extension for VXLAN",
              Internet-Draft draft-quinn-vxlan-gpe-04, February 2015.

Authors' Addresses

   Reinaldo Penno
   Cisco Systems
   170 West Tasman Dr
   San Jose, CA
   USA

   Email: repenno@cisco.com


   Paul Quinn
   Cisco Systems
   170 West Tasman Dr
   San Jose, CA
   USA

   Email: paulq@cisco.com








Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 60]


Internet-Draft      Yang Model for Service Chaining            June 2016


   Danny Zhou
   Intel Corporation
   2200 Mission College Blvd.
   Santa Clara, CA
   USA

   Email: danny.zhou@intel.com


   Johnson Li
   Intel Corporation
   2200 Mission College Blvd.
   Santa Clara, CA
   USA

   Email: johnson.li@intel.com





































Penno, Quinn, Zhou & LiExpires December 19, 2016               [Page 61]