Skip to main content

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

The information below is for an old version of the document.
Document Type
This is an older version of an Internet-Draft whose latest revision state is "Expired".
Authors Reinaldo Penno , Paul Quinn
Last updated 2014-10-27
RFC stream (None)
Formats
Additional resources
Stream Stream state (No stream defined)
Consensus boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date (None)
Responsible AD (None)
Send notices to (None)
draft-penno-sfc-yang-09
SFC Netmod                                                      R. Penno
Internet-Draft                                                  P. Quinn
Intended status: Standards Track                           Cisco Systems
Expires: April 28, 2015                                 October 25, 2014

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

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 April 28, 2015.

Copyright Notice

   Copyright (c) 2014 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 extracted from this document must

Penno & Quinn            Expires April 28, 2015                 [Page 1]
Internet-Draft       Yang Model for Service Chaining        October 2014

   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.  Service Function (SF) . . . . . . . . . . . . . . . . . . . .   3
     3.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .   3
     3.2.  Service Function  . . . . . . . . . . . . . . . . . . . .   4
   4.  Service Function Type (SFT) . . . . . . . . . . . . . . . . .   9
     4.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .   9
     4.2.  Service Function Type Configuration Model . . . . . . . .   9
   5.  Service Function Chain (SFC)  . . . . . . . . . . . . . . . .  11
     5.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .  12
     5.2.  Service Function Chain Configuration Model  . . . . . . .  12
   6.  Service Node (SN) . . . . . . . . . . . . . . . . . . . . . .  16
     6.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .  16
     6.2.  Service Node Configuration Model  . . . . . . . . . . . .  16
   7.  Service Function Path (SFP) . . . . . . . . . . . . . . . . .  18
     7.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .  19
     7.2.  Service Function Path Configuration Model . . . . . . . .  19
   8.  Service Function Forwarder (SFF)  . . . . . . . . . . . . . .  22
     8.1.  Module Struture . . . . . . . . . . . . . . . . . . . . .  22
     8.2.  Service Function Forwarder Model  . . . . . . . . . . . .  23
   9.  Service Function Forwarder Open vSwitch (SFF-OVS) . . . . . .  27
     9.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .  27
     9.2.  Service Function Forwarder OVS Model  . . . . . . . . . .  28
   10. Service Locator (SL)  . . . . . . . . . . . . . . . . . . . .  30
     10.1.  Module Structure . . . . . . . . . . . . . . . . . . . .  30
     10.2.  Service Locator Module . . . . . . . . . . . . . . . . .  30
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  33
   12. Security Considerations . . . . . . . . . . . . . . . . . . .  33
   13. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  33
   14. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . .  33
   15. References  . . . . . . . . . . . . . . . . . . . . . . . . .  35
     15.1.  Normative References . . . . . . . . . . . . . . . . . .  35
     15.2.  Informative References . . . . . . . . . . . . . . . . .  36
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  36

1.  Introduction

   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

Penno & Quinn            Expires April 28, 2015                 [Page 2]
Internet-Draft       Yang Model for Service Chaining        October 2014

   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.quinn-sfc-arch], [I-D.ietf-sfc-problem-statement]
   ,[I-D.quinn-sfc-nsh] and [I-D.quinn-vxlan-gpe]

3.  Service Function (SF)

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

3.1.  Module Structure

  module: service-function
     +--rw service-functions
     |  +--rw service-function* [name]
     |     +--rw name                     string
     |     +--rw type                     string
     |     +--rw ip-mgmt-address?         inet:ip-address
     |     +--rw nsh-aware?               boolean
     |     +--rw sf-data-plane-locator* [name]
     |        +--rw name                          string
     |        +--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
     |        +--rw transport?                    identityref
     |        +--rw service-function-forwarder?   string
     +--ro service-functions-state
        +--ro service-function-state* [name]
           +--ro name                        string
           +--ro sf-service-function-path*   string
  rpcs:
     +---x delete-all-service-function
     +---x put-service-function
     |  +--ro input

Penno & Quinn            Expires April 28, 2015                 [Page 3]
Internet-Draft       Yang Model for Service Chaining        October 2014

     |     +--ro name?                    string
     |     +--ro type                     string
     |     +--ro ip-mgmt-address?         inet:ip-address
     |     +--ro nsh-aware?               boolean
     |     +--ro sf-data-plane-locator* [name]
     |        +--ro name                          string
     |        +--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
     |        +--ro transport?                    identityref
     |        +--ro service-function-forwarder?   string
     +---x read-service-function
     |  +--ro input
     |  |  +--ro name    string
     |  +--ro output
     |     +--ro name?                    string
     |     +--ro type                     string
     |     +--ro ip-mgmt-address?         inet:ip-address
     |     +--ro nsh-aware?               boolean
     |     +--ro sf-data-plane-locator* [name]
     |        +--ro name                          string
     |        +--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
     |        +--ro transport?                    identityref
     |        +--ro service-function-forwarder?   string
     +---x delete-service-function
        +--ro input
           +--ro name    string

3.2.  Service Function

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

 module service-function {

Penno & Quinn            Expires April 28, 2015                 [Page 4]
Internet-Draft       Yang Model for Service Chaining        October 2014

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

   prefix sfc-sf;

   import ietf-inet-types { prefix inet; }
   import ietf-yang-types { prefix yang; }
   import service-function-type {prefix sfc-sft;}
   import service-locator {prefix sfc-sl;}

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

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

      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.";
   }

   typedef service-function-ref {
     type leafref {
       path "/sfc-sf:service-functions/sfc-sf:service-function/"

Penno & Quinn            Expires April 28, 2015                 [Page 5]
Internet-Draft       Yang Model for Service Chaining        October 2014

           + "sfc-sf:name";
     }
     description
       "This type is used by data models that need to reference
        configured service functions.";
   }

   grouping service-function-entry {
     description
       "This group bundles together all information related to a
        single service function";
     leaf name {
       type string;
       description
           "The name of the service function.";
     }
     leaf type {
       type string;
       mandatory true;
       description
         "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-node";
     }
     leaf nsh-aware {
       type boolean;
       description "Whether this SF can process NSH headers";
     }

     list sf-data-plane-locator {
       description
         "A network data-plane locator";
       key "name";
       leaf name {
         type string;
         description
           "A unique string that represents this
            data-plane-locator";
       }
       uses sfc-sl:data-plane-locator;
       leaf service-function-forwarder {
         type string;
         description
           "The service function forwarder associated with this

Penno & Quinn            Expires April 28, 2015                 [Page 6]
Internet-Draft       Yang Model for Service Chaining        October 2014

            locator";
       }
     }
   }

   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 {
       description
         "This list holds configuration data for all service functions
          in the domain";
       key "name";
       uses service-function-entry;
     }
   }

   container service-functions-state {
     description
       "This container hold operational state for all service
        functions";
     config false;
     list service-function-state {
       description
         "This list holds operational data for all service functions
          in the domain";
       key "name";

Penno & Quinn            Expires April 28, 2015                 [Page 7]
Internet-Draft       Yang Model for Service Chaining        October 2014

       leaf name {
         type string;
         description
           "the name of the service function";
       }
       leaf-list sf-service-function-path {
         type string;
         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            Expires April 28, 2015                 [Page 8]
Internet-Draft       Yang Model for Service Chaining        October 2014

       }
     }
   }
 }

 </CODE ENDS>

4.  Service Function Type (SFT)

4.1.  Module Structure

   module: service-function-type
      +--rw service-function-types
         +--rw service-function-type* [type]
            +--rw type                         string
            +--rw sft-service-function-name* [name]
               +--rw name    string

4.2.  Service Function Type Configuration Model

 <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 ietf-inet-types { prefix inet; }
   import ietf-yang-types { prefix yang; }

   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.

Penno & Quinn            Expires April 28, 2015                 [Page 9]
Internet-Draft       Yang Model for Service Chaining        October 2014

      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.";
   }

   // Service Function

   // Service Function Type definitions

   identity service-function-type-identity {
     description
       "Base identity from which specific service function
        types are derived.";
   }

   identity firewall {
     base "service-function-type-identity";
     description "Firewall";
   }

   identity dpi {
     base "service-function-type-identity";
     description "Deep Packet Inspection";
   }

   identity napt44 {
     base "service-function-type-identity";
     description "Network Address and Port Translation 44";
   }

   typedef service-function-type {

Penno & Quinn            Expires April 28, 2015                [Page 10]
Internet-Draft       Yang Model for Service Chaining        October 2014

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

   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";
       leaf type {
         type string;
         description
             "The service function type";
       }
       list sft-service-function-name {
         key "name";
         leaf name {
           type string;
           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 the type";
     }
   }
 }

 </CODE ENDS>

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

Penno & Quinn            Expires April 28, 2015                [Page 11]
Internet-Draft       Yang Model for Service Chaining        October 2014

5.1.  Module Structure

   module: service-function-chain
      +--rw service-function-chains
      |  +--rw service-function-chain* [name]
      |     +--rw name                    string
      |     +--rw symmetric?              boolean
      |     +--rw sfc-service-function* [name]
      |        +--rw name    string
      |        +--rw type    string
      +--ro service-function-chains-state
         +--ro service-function-chain-state* [name]
            +--ro name                         string
            +--ro sfc-service-function-path*   string
   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                    string
               +--ro symmetric?              boolean
               +--ro sfc-service-function* [name]
                  +--ro name    string
                  +--ro type    string

5.2.  Service Function Chain Configuration Model

 <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 ietf-inet-types { prefix inet; }
   import ietf-yang-types { prefix yang; }
   import service-function {prefix sfc-sf; }

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

Penno & Quinn            Expires April 28, 2015                [Page 12]
Internet-Draft       Yang Model for Service Chaining        October 2014

   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";
   }

   grouping service-function-chain-grouping {
     list service-function-chain {
       description
         "A list that holds all service function chains in the
          domain";
       key "name";
       leaf name {
         type string;
         description
           "the name of the service function chain";
       }
       leaf symmetric {
         type boolean;
         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 {

Penno & Quinn            Expires April 28, 2015                [Page 13]
Internet-Draft       Yang Model for Service Chaining        October 2014

         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 string;
           mandatory true;
           description
             "Service Function Type from service-function-type.yang";
         }
         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
        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 {
       description
         "A list that contains operational service function
          chain state";
       key "name";

Penno & Quinn            Expires April 28, 2015                [Page 14]
Internet-Draft       Yang Model for Service Chaining        October 2014

       leaf name {
         type string;
         description
           "the name of the service function chain";
       }
       leaf-list sfc-service-function-path {
         type string;
         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 {
         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;

Penno & Quinn            Expires April 28, 2015                [Page 15]
Internet-Draft       Yang Model for Service Chaining        October 2014

     }
   }
 }

 </CODE ENDS>

6.  Service Node (SN)

   A Service Node is a virtual or physical element that houses one or
   more service functions.  A Service node might contain an entire
   service function chain or be part of a larger service function chain.

6.1.  Module Structure

   module: service-node
      +--rw service-nodes
         +--rw service-node* [name]
            +--rw name                string
            +--rw ip-mgmt-address?    inet:ip-address
            +--rw service-function*   sfc-sf:service-function-ref
   rpcs:
      +---x put-service-node
         +--ro input
            +--ro name?               string
            +--ro ip-mgmt-address?    inet:ip-address
            +--ro service-function*   sfc-sf:service-function-ref

6.2.  Service Node Configuration Model

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

module service-node {

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

  prefix sfc-sn;

  import ietf-inet-types { prefix inet; }
  import ietf-yang-types { prefix yang; }
  import service-function {prefix sfc-sf; }

Penno & Quinn            Expires April 28, 2015                [Page 16]
Internet-Draft       Yang Model for Service Chaining        October 2014

  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
      "Revision based on Opendaylight project feedback";
  }

    // Service Nodes

  typedef service-node-ref {
      type leafref {
          path "/sfc-sn:service-nodes/sfc-sn:service-node/sfc-sn:name";
      }
      description
          "This type is used by data models that need to reference
           configured service functions.";
  }

  grouping service-node-grouping {
      leaf name {

Penno & Quinn            Expires April 28, 2015                [Page 17]
Internet-Draft       Yang Model for Service Chaining        October 2014

        type string;
        description
             "The name of the service node.";
      }

      leaf ip-mgmt-address {
        type inet:ip-address;
      }
      leaf-list service-function {
        type sfc-sf:service-function-ref;
        description
            "A list of service functions resident in this service node";
      }
  }

  container service-nodes {
    description
        "Physical or virtual element that hosts one or
        more service functions and has one or more network locators
        associated with it for reachability and service delivery.";
    list service-node {
      key "name";
      uses service-node-grouping;
    }
  }

    // Remote procedure calls (for testing)

    rpc put-service-node {
        input {
            uses service-node-grouping;
    }
  }
}

</CODE ENDS>

7.  Service Function Path (SFP)

   A Service Function Path is an instantiation of a service function
   chain.  It specifies the actual service functions (e.g. firewall1)
   and the transport encapsulation used in the overlay.

Penno & Quinn            Expires April 28, 2015                [Page 18]
Internet-Draft       Yang Model for Service Chaining        October 2014

7.1.  Module Structure

   module: service-function-path
      +--rw service-function-paths
         +--rw service-function-path* [name]
            +--rw name                  string
            +--rw context-metadata?     string
            +--rw variable-metadata?    string
            +--rw service-path-hop* [hop-number]
            |  +--rw hop-number                    uint8
            |  +--rw service-function-name?        string
            |  +--rw service-function-forwarder?   string
            |  +--rw service_index?                uint8
            +--rw service-chain-name    string
            +--rw starting-index?       uint8
            +--rw path-id?              uint32     uint32

7.2.  Service Function Path Configuration Model

<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 ietf-inet-types { prefix inet; }
  import ietf-yang-types { prefix yang; }
  import service-function {prefix sfc-sf; }

  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

Penno & Quinn            Expires April 28, 2015                [Page 19]
Internet-Draft       Yang Model for Service Chaining        October 2014

     (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.";
  }

  typedef service-function-path-ref {
    type leafref {
      path "/sfc-sfp:service-function-paths/sfc-sfp:service-function-path/sfc-sfp:name";
    }
    description
      "This type is used by data models that need to reference
       configured service functions.";
  }

  // 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 {
      description
        "A list that holds configuration data for all SFPs in the
         domain";
      key "name";
      leaf name {
        type string;
        description
          "The name of this service function path";
      }

Penno & Quinn            Expires April 28, 2015                [Page 20]
Internet-Draft       Yang Model for Service Chaining        October 2014

      leaf context-metadata {
        type string;
        description
          "The name of the associated context metadata";
      }
      leaf variable-metadata {
        type string;
        description
          "The name of the associated variable metadata";
      }
      list service-path-hop {
        key "hop-number";
        leaf hop-number {
          type uint8;
          description
            "A Monotonically increasing number";
        }
        leaf service-function-name {
          type string;
          description
            "Service Function name";
        }
        leaf service-function-forwarder {
          type string;
          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 string;
        mandatory true;
        description

Penno & Quinn            Expires April 28, 2015                [Page 21]
Internet-Draft       Yang Model for Service Chaining        October 2014

          "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.";
      }
    }
  }
}

<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            Expires April 28, 2015                [Page 22]
Internet-Draft       Yang Model for Service Chaining        October 2014

   module: service-function-forwarder
      +--rw service-function-forwarders
         +--rw service-function-forwarder* [name]
            +--rw name                           string
            +--rw service-node?                  string
            +--rw classifier?                    string
            +--rw sff-data-plane-locator* [name]
            |  +--rw name                  string
            |  +--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
            |     +--rw transport?   identityref
            +--rw service-function-dictionary* [name]
               +--rw name                         string
               +--rw type?                        string
               +--rw sff-sf-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
               |  +--rw transport?   identityref
               +--rw sff-interfaces* [sff-interface]
               |  +--rw sff-interface    string
               +--rw failmode?                    failmode-type

8.2.  Service Function Forwarder Model

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

Penno & Quinn            Expires April 28, 2015                [Page 23]
Internet-Draft       Yang Model for Service Chaining        October 2014

  import ietf-inet-types        { prefix inet;}
  import ietf-yang-types {
    prefix "yang";
    revision-date 2013-07-15;
  }
  import service-locator        { prefix sfc-sl; }

  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.

     // 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";
  }

  // 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.";
  }

Penno & Quinn            Expires April 28, 2015                [Page 24]
Internet-Draft       Yang Model for Service Chaining        October 2014

  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 {
      description
        "A list that holds configuration of all SFFs in the domain";
      key "name";
      leaf name {
        type string;
        description
          "The unique name of this service function forwarder, such
           as SFF1";
      }

      leaf service-node {
        type string;
        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-node";

Penno & Quinn            Expires April 28, 2015                [Page 25]
Internet-Draft       Yang Model for Service Chaining        October 2014

      }

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

      leaf classifier {
        type string;
        description "the access-list responsible for directing"
          + "packets to a specific service path";
      }

      list sff-data-plane-locator {
        description
          "A list of all data-plane-locators of this SFF.";
        key "name";
        leaf name {
          type string;
          description
            "A unique string 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 string;
          description
              "The name of the service function.";
        }
        leaf type {
          type string;
          description
            "Service Function Type from service-function-type yang
             model";
        }
        container sff-sf-data-plane-locator {
          description
            "The SFF uses this data plane locator when sending packets to the"
          + "associated service function";

Penno & Quinn            Expires April 28, 2015                [Page 26]
Internet-Draft       Yang Model for Service Chaining        October 2014

          uses sfc-sl:data-plane-locator;
        }
        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.";
      }
    }
  }
}

<CODE ENDS>

9.  Service Function Forwarder Open vSwitch (SFF-OVS)

   This module augments the SFF model for Open vSwitch, meaning when
   Open vSwitche (OVS) bridges are used as SFF.

9.1.  Module Structure

Penno & Quinn            Expires April 28, 2015                [Page 27]
Internet-Draft       Yang Model for Service Chaining        October 2014

module: service-function-forwarder-ovs
augment /sfc-sff:service-function-forwarders/sfc-sff:service-function-forwarder/sfc-sff:sff-data-plane-locator:
   +--rw ovs-bridge
      +--rw bridge-name?    string
      +--rw uuid?           yang:uuid
      +--rw external-ids* [name]
      |  +--rw name     string
      |  +--rw value?   string
      +--rw rest-uri?       inet:uri
augment /sfc-sff:service-function-forwarders/sfc-sff:service-function-forwarder/sfc-sff:service-function-dictionary/sfc-sff:sff-sf-data-plane-locator:
   +--rw ovs-bridge
      +--rw bridge-name?    string
      +--rw uuid?           yang:uuid
      +--rw external-ids* [name]
      |  +--rw name     string
      |  +--rw value?   string
      +--rw rest-uri?       inet:uri

9.2.  Service Function Forwarder OVS Model

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

module service-function-forwarder-ovs {
  yang-version 1;

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

  prefix sfc-sff-ovs;

  import service-function-forwarder {
    prefix "sfc-sff";
  }

  import ietf-inet-types {
    prefix "inet";
  }

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

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

  revision 2014-07-01 {
    description "Augmentation of SFF for OVS";

Penno & Quinn            Expires April 28, 2015                [Page 28]
Internet-Draft       Yang Model for Service Chaining        October 2014

  }

  grouping bridge {
    container ovs-bridge {
      leaf bridge-name {
        description "Open vSwitch bridge name. In Openstack it is usually"
          + "br-tun or br-int depending if it is used in the overlay or"
          + "facing virtual machines respectively";
        type string;
      }
      leaf uuid {
        description "Open vSwitch bridge UUID";
        type yang:uuid;
      }
      list external-ids {
        description
          "The list of external ids associated with this
           bridge";
        key "name";
        leaf name {
          type string;
          description
            "A unique string that represents this external-id such
             as attached-mac";
        }
        leaf value {
          type string;
          description
            "A unique string that represents the value of the
             external-id such as fa:16:3e:56:47:10";
        }
      }
    }
  }

  augment "/sfc-sff:service-function-forwarders/"
        + "sfc-sff:service-function-forwarder/"
        + "sfc-sff:sff-data-plane-locator" {

    uses bridge;
  }

  augment "/sfc-sff:service-function-forwarders/"
        + "sfc-sff:service-function-forwarder/"
        + "sfc-sff:service-function-dictionary/"
        + "sfc-sff:sff-sf-data-plane-locator" {

    uses bridge;

Penno & Quinn            Expires April 28, 2015                [Page 29]
Internet-Draft       Yang Model for Service Chaining        October 2014

  }
}

<CODE ENDS>

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

10.1.  Module Structure

10.2.  Service Locator Module

 <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; }
   import ietf-yang-types { prefix yang; }

   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

Penno & Quinn            Expires April 28, 2015                [Page 30]
Internet-Draft       Yang Model for Service Chaining        October 2014

      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.";
   }

   // Locator definitions

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

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

   identity gre {
     base "sl-transport-type";
     description "GRE 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";

Penno & Quinn            Expires April 28, 2015                [Page 31]
Internet-Draft       Yang Model for Service Chaining        October 2014

   }

   grouping lisp-locator {
     description
       "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 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;
       }

Penno & Quinn            Expires April 28, 2015                [Page 32]
Internet-Draft       Yang Model for Service Chaining        October 2014

       case lisp {
         uses lisp-locator;
       }
       case mac {
         uses mac-address-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;
       }
     }
   }
 }

 <CODE ENDS>

11.  IANA Considerations

   TBD

12.  Security Considerations

13.  Acknowledgements

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

14.  Changes

   -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

Penno & Quinn            Expires April 28, 2015                [Page 33]
Internet-Draft       Yang Model for Service Chaining        October 2014

   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

   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

Penno & Quinn            Expires April 28, 2015                [Page 34]
Internet-Draft       Yang Model for Service Chaining        October 2014

   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

15.  References

15.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [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, June 1999.

Penno & Quinn            Expires April 28, 2015                [Page 35]
Internet-Draft       Yang Model for Service Chaining        October 2014

15.2.  Informative References

   [I-D.ietf-sfc-problem-statement]
              Quinn, P. and T. Nadeau, "Service Function Chaining
              Problem Statement", draft-ietf-sfc-problem-statement-10
              (work in progress), August 2014.

   [I-D.quinn-sfc-arch]
              Quinn, P. and J. Halpern, "Service Function Chaining (SFC)
              Architecture", draft-quinn-sfc-arch-05 (work in progress),
              May 2014.

   [I-D.quinn-sfc-nsh]
              Quinn, P., Guichard, J., Fernando, R., Surendra, S.,
              Smith, M., Yadav, N., Agarwal, P., Manur, R., Chauhan, A.,
              Elzur, U., Garg, P., McConnell, B., and C. Wright,
              "Network Service Header", draft-quinn-sfc-nsh-03 (work in
              progress), July 2014.

   [I-D.quinn-vxlan-gpe]
              Quinn, P., Agarwal, P., Fernando, R., Lewis, D., Kreeger,
              L., Smith, M., Yadav, N., Yong, L., Xu, X., Elzur, U., and
              P. Garg, "Generic Protocol Extension for VXLAN", draft-
              quinn-vxlan-gpe-03 (work in progress), July 2014.

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            Expires April 28, 2015                [Page 36]