SFC Netmod R. Penno Internet-Draft P. Quinn Intended status: Standards Track Cisco Systems Expires: November 30, 2014 May 29, 2014 Yang Data Model for Service Function Chaining draft-penno-sfc-yang-02 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 November 30, 2014. 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 November 30, 2014 [Page 1] Internet-Draft Yang Model for Service Chaining May 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. VXLAN-GPE . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.1. Module Structure . . . . . . . . . . . . . . . . . . . . 3 3.2. VXLAN -GPE Configuration Model . . . . . . . . . . . . . 3 4. Service Function (SF) . . . . . . . . . . . . . . . . . . . . 6 4.1. Module Structure . . . . . . . . . . . . . . . . . . . . 6 4.2. Service Function . . . . . . . . . . . . . . . . . . . . 6 5. Service Function Chain (SFC) . . . . . . . . . . . . . . . . 9 5.1. Module Structure . . . . . . . . . . . . . . . . . . . . 9 5.2. Service Function Chain Configuration Model . . . . . . . 9 6. Service Node (SN) . . . . . . . . . . . . . . . . . . . . . . 10 6.1. Module Structure . . . . . . . . . . . . . . . . . . . . 11 6.2. Service Node Configuration Model . . . . . . . . . . . . 11 7. Service Function Path (SFP) . . . . . . . . . . . . . . . . . 15 7.1. Module Structure . . . . . . . . . . . . . . . . . . . . 15 7.2. Service Function Path Configuration Model . . . . . . . . 15 8. Service Function Forwarder (SFF) . . . . . . . . . . . . . . 16 8.1. Service Function Forwarder Configuration Model . . . . . 17 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 10. Security Considerations . . . . . . . . . . . . . . . . . . . 18 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 18 12. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 19 13.1. Normative References . . . . . . . . . . . . . . . . . . 19 13.2. Informative References . . . . . . . . . . . . . . . . . 19 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 20 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 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 Penno & Quinn Expires November 30, 2014 [Page 2] Internet-Draft Yang Model for Service Chaining May 2014 2. Definitions and Acronyms The reader should be familiar with the terms contained in [I-D.quinn-sfc-arch], [I-D.quinn-sfc-problem-statement] ,[I-D.quinn-nsh] and [I-D.quinn-vxlan-gpe] 3. VXLAN-GPE This model describes the VXLAN-GPE encapsulation when used as a overlay mechanism to create service function paths. VXLAN is one of many transport protocols that can be used to setup service chaining overlays. 3.1. Module Structure module: vxlan-gpe +--rw vxlan-gpe-header +--rw gpe-header-flag-value? vxlan-gpw-header-flag-type +--rw reserved? uint8 +--rw protocol-type? uint16 +--rw vni* uint8 +--rw reserved2? uint8 3.2. VXLAN -GPE Configuration Model file "vxlan-gpe@2013-12-04.yang" module vxlan-gpe { namespace "urn:cisco:params:xml:ns:yang:vxlan-gpe"; prefix vxlan-gpe; import ietf-inet-types { prefix inet; } import ietf-yang-types { prefix yang; } organization "Cisco Systems, Inc."; contact "Reinaldo Penno "; 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. Penno & Quinn Expires November 30, 2014 [Page 3] Internet-Draft Yang Model for Service Chaining May 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 2013-11-26 { description "Initial revision."; } // 0 1 2 3 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // | Source Port = xxxx | Dest Port = 4789 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // | UDP Length | UDP Checksum | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // |R|R|R|R|I|P|R|R| Reserved | Protocol Type | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // | VXLAN Network Identifier (VNI) | Reserved | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ typedef vxlan-gpw-header-flag-type { type bits { bit r1 { position 0; description "reserved"; } bit r2 { position 1; description "reserved"; } bit r3 { position 2; description "reserved"; } Penno & Quinn Expires November 30, 2014 [Page 4] Internet-Draft Yang Model for Service Chaining May 2014 bit r4 { position 3; description "reserved"; } bit i { position 5; description "Some description"; } bit p { position 6; description "Some description"; } bit r7 { position 7; description "reserved"; } bit r8 { position 8; description "reserved"; } } description "vxlan-gpe Header Flags"; reference "http://tools.ietf.org/html/draft-quinn-vxlan-gpe-01"; } container vxlan-gpe-header { description "Network Service Base header"; leaf gpe-header-flag-value { type vxlan-gpw-header-flag-type; } leaf reserved { default 0; type uint8; } leaf protocol-type { type uint16; // Reinaldo: Another option is to import Opendaylight L2 Types so have ethertype } leaf-list vni { type uint8; min-elements 3; max-elements 3; } Penno & Quinn Expires November 30, 2014 [Page 5] Internet-Draft Yang Model for Service Chaining May 2014 leaf reserved2 { default 0; type uint8 { range "0 .. 255"; } description "Reserved field"; } } } 4. Service Function (SF) This module describe a Service Function, which is an essential building block of other modules. 4.1. Module Structure 4.2. Service Function file "service-function@2014-05-29.yang" module service-function { namespace "urn:cisco:params:xml:ns:yang:sfc-sf"; prefix sfc-sf; import ietf-inet-types { prefix inet; } import ietf-yang-types { prefix yang; } organization "Cisco Systems, Inc."; contact "Reinaldo Penno "; 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. Penno & Quinn Expires November 30, 2014 [Page 6] Internet-Draft Yang Model for Service Chaining May 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-29-04 { description "Changes based on Opendaylight Testing."; } // Service Function // Service Function Type definitions identity service-function-type-indentity { description "Base identity from which specific service function types are derived."; } identity firewall { base "service-function-type-indentity"; description "Firewall"; } identity dpi { base "service-function-type-indentity"; description "Deep Packet Inspection"; } identity napt44 { base "service-function-type-indentity"; description "Network Address and Port Translation 44"; } typedef service-function-type { Penno & Quinn Expires November 30, 2014 [Page 7] Internet-Draft Yang Model for Service Chaining May 2014 type identityref { base "service-function-type-indentity"; } } typedef service-function-ref { type leafref { path "/sfc-sf:service-functions/sfc-sf:service-function/sfc-sf:name"; } description "This type is used by data models that need to reference configured service functions."; } container service-functions { description "A network or application based packet treatment, application, compute or storage resource, used singularly or in concert with other service functions within a service chain to enable a service offered by an operator. A non-exhaustive list of Service Functions includes: firewalls, WAN and application acceleration, Deep Packet Inspection (DPI), server load balancers, NAT44 [RFC3022], NAT64 [RFC6146], HOST_ID injection, HTTP Header Enrichment functions, TCP optimizer, etc."; list service-function { key "name"; leaf name { type string; description "The name of the service function."; mandatory true; } leaf type { type service-function-type; } leaf ip-host-address { type inet:ip-address; } } } } Penno & Quinn Expires November 30, 2014 [Page 8] Internet-Draft Yang Model for Service Chaining May 2014 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. 5.1. Module Structure module: service-function-chain +--rw service-function | +--rw name string | +--rw type? service-function-type | +--rw ip-host-address? inet:ip-address | +--rw context-headers* uint32 +--rw service-function-chain +--rw service-function* string 5.2. Service Function Chain Configuration Model file "service-function-chain@2014-05-29.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 "; 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 Penno & Quinn Expires November 30, 2014 [Page 9] Internet-Draft Yang Model for Service Chaining May 2014 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-05-05 { description "Initial revision."; } // Service Function Chain container service-function-chain { description "A service chain defines the required functions and associated order (service-function1 --> service-function 2) that must be applied to packets and/or frames. A service chain does not specify the network location or specific instance of service functions (e.g. firewall1 vs. firewall2)."; leaf-list service-function { type sfc-sf:service-function-type; ordered-by user; description "A list of service functions that compose the service chain"; } } } 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. Penno & Quinn Expires November 30, 2014 [Page 10] Internet-Draft Yang Model for Service Chaining May 2014 6.1. Module Structure module: service-node +--rw service-node +--rw name string +--rw type? service-node-type +--rw transport? transport-type +--rw service-function* string +--rw ip-host-address? inet:ip-address 6.2. Service Node Configuration Model file "service-node@2014-05-29.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; } organization "Cisco Systems, Inc."; contact "Reinaldo Penno "; 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."; Penno & Quinn Expires November 30, 2014 [Page 11] Internet-Draft Yang Model for Service Chaining May 2014 // 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-05-08 { description "Initial revision."; } // Transport type definitions identity transport-type-identity { description "Base identity from which specific transport types are derived."; } identity vxlan-gpe { base "transport-type-identity"; description "Programmable vxlan transport type"; } typedef transport-type { type identityref { base "transport-type-identity"; } } // 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"; } } identity close { base "failmode-type-identity"; Penno & Quinn Expires November 30, 2014 [Page 12] Internet-Draft Yang Model for Service Chaining May 2014 description "When service-node can not reach service function, packets will be dropped"; } identity open { base "failmode-type-identity"; description "When service-node can not reach service function, packets will be forwarded"; } // Service Nodes // Service Node Type definitions identity service-node-type-identity { description "Base identity from which specific service function types are derived."; } identity egress { base "service-node-type-identity"; description "Last node in the chain"; } identity ingress { base "service-node-type-identity"; description "First node in the chain"; } identity middle { base "service-node-type-identity"; description "Service nodes in the middle of the chain"; } identity legacy { base "service-node-type-identity"; description "Service Nodes that need a proxy function"; } typedef service-node-type { type identityref { base "service-node-type-identity"; } } typedef service-node-ref { type leafref { path "/sfc-sn:service-nodes/sfc-sn:service-node/sfc-sn:name"; Penno & Quinn Expires November 30, 2014 [Page 13] Internet-Draft Yang Model for Service Chaining May 2014 } description "This type is used by data models that need to reference configured service functions."; } 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"; leaf name { type string; description "The name of the service node."; mandatory true; } leaf type { type service-node-type; } leaf transport { type transport-type; } leaf ip-host-address { type inet:ip-address; } leaf failmode { type failmode-type; } leaf-list service-function { type sfc-sf:service-function-ref; description "A list of service functions resident in this service node"; } } } } Penno & Quinn Expires November 30, 2014 [Page 14] Internet-Draft Yang Model for Service Chaining May 2014 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. 7.1. Module Structure module: service-function-path +--rw service-function-path +--rw service-function* string +--rw transport? sfc-sn:transport-type +--rw service-header-flag-value? service-header-flag-type +--rw protocol-type? uint8 +--rw service-index? uint8 +--rw service-path* uint8 +--rw reserved? uint8 7.2. Service Function Path Configuration Model file "service-function-path@2014-05-14.yang" module service-function-path { namespace "urn:cisco:params:xml:ns:yang:sfc-path"; prefix sfc-path; 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 "; 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 November 30, 2014 [Page 15] Internet-Draft Yang Model for Service Chaining May 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-29-04 { description "Changes based on Opendaylight Testing"; } // Service Function Path container service-function-path { description "A Service Function Path is an instantiation of a Service Chain. It specifies the actual firewall (say, firewall-3) that will be traversed by the packets. The Service Path needs to be known before hand or stitched run-time (given the dynamic LB decision) since a forwarding decision need to be made regardless."; leaf-list service-function-instance { type sfc-sf:service-function-ref; ordered-by user; description "A list of service function instances that compose the service chain"; } } } 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. Penno & Quinn Expires November 30, 2014 [Page 16] Internet-Draft Yang Model for Service Chaining May 2014 8.1. Service Function Forwarder Configuration Model file "service-function-forwarder@2014-05-14.yang" module service-function-forwarder { namespace "urn:cisco:params:xml:ns:yang:sfc-sff"; prefix sfc-sff; import ietf-inet-types { prefix inet; } import ietf-yang-types { prefix yang; } organization "Cisco Systems, Inc."; contact "Reinaldo Penno "; 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-05-08 { description "Initial revision."; } // Service Function Forwarding Map Penno & Quinn Expires November 30, 2014 [Page 17] Internet-Draft Yang Model for Service Chaining May 2014 container service-forwarding-map { description "This dictionary holds the configuration for a service function forwarder. For each service function, it has the location information. Example of a working Python Implementation of a SFF Map. A service function can be reached through IP:port or internal function call. "; //sfi_map = {"fw1": {"function": "fw1_process_packet", "ip_address":"", "port":""}, \ // "fw2": {"function": "", "ip_address": "192.168.0.2", "port":""}, \ // "dpi1":{"function": "", "ip_address": "192.168.0.4", "port":10000}, \ // "nat1":{"function": "nat1_process_packet", "ip_address": "", "port":""}} list service-map { ordered-by user; key "service-function-name"; leaf service-function-name { type string; } container service-function-location { leaf ip { type inet:ip-address; } leaf port { type inet:port-number; } } } } } 9. IANA Considerations TBD 10. Security Considerations 11. Acknowledgements thanks to Jan Medved for reviews and suggestions. Penno & Quinn Expires November 30, 2014 [Page 18] Internet-Draft Yang Model for Service Chaining May 2014 12. Changes -03 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 13. References 13.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. 13.2. Informative References [I-D.quinn-nsh] Quinn, P., Guichard, J., Fernando, R., Surendra, S., Smith, M., Yadav, N., Agarwal, P., Manur, R., Chauhan, A., McConnell, B., and C. Wright, "Network Service Header", draft-quinn-nsh-02 (work in progress), February 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-problem-statement] Quinn, P., "Service Function Chaining Problem Statement", draft-quinn-sfc-problem-statement-02 (work in progress), December 2013. Penno & Quinn Expires November 30, 2014 [Page 19] Internet-Draft Yang Model for Service Chaining May 2014 [I-D.quinn-vxlan-gpe] Agarwal, P., Fernando, R., Lewis, D., Kreeger, L., Quinn, P., Yong, L., Xu, X., Smith, M., Yadav, N., and U. Elzur, "Generic Protocol Extension for VXLAN", draft-quinn-vxlan- gpe-02 (work in progress), December 2013. 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 November 30, 2014 [Page 20]