Yang models for OpenStack Neutron SFC APIs. 48/38748/4
authorAnil Vishnoi <vishnoianil@gmail.com>
Thu, 12 May 2016 02:34:54 +0000 (19:34 -0700)
committerAnil Vishnoi <vishnoianil@gmail.com>
Wed, 25 May 2016 06:16:59 +0000 (23:16 -0700)
Patch has the yang models for OpenStack Neutron Service Function
Chaining API. These models are based on the OpenStack SFC flow
classifier and port grouping APIs. Following URL contains the list
of OpenStack SFC APIs exposed by networking-sfc project:

References:
http://docs.openstack.org/developer/networking-sfc/api.html
https://github.com/openstack/networking-sfc/blob/master/networking_sfc/extensions/sfc.py
https://github.com/openstack/networking-sfc/blob/master/networking_sfc/extensions/flowclassifier.py

Change-Id: I5c1a20d18b34df5850af7ad13529da4a3f1ba767
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
model/src/main/yang/neutron-sfc-flow-classifier.yang [new file with mode: 0644]
model/src/main/yang/neutron-sfc.yang [new file with mode: 0644]
model/src/main/yang/neutron.yang

diff --git a/model/src/main/yang/neutron-sfc-flow-classifier.yang b/model/src/main/yang/neutron-sfc-flow-classifier.yang
new file mode 100644 (file)
index 0000000..fa653f0
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+ module neutron-sfc-flow-classifier {
+
+     yang-version 1;
+
+     namespace "urn:opendaylight:neutron-sfc-flow-classifier";
+
+     prefix neutron-sfc-flow-classifier;
+
+     import ietf-yang-types { prefix "yang"; }
+     import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
+     import neutron-attrs { prefix "attrs"; }
+     import neutron-constants { prefix "constants"; }
+
+
+     organization "OpenDaylight Neutron Northbound Project";
+
+     contact "Anil Vishnoi <vishnoianil@gmail.com>";
+
+     description "This YANG module defines Openstack Neutron SFC Flow Classfier Models.These models are based on the
+                API's exposed by the OpenStack Neutron Networking SFC (networking-sfc) project. List of classifier APIs
+                are listed at following URL (http://docs.openstack.org/developer/networking-sfc/api.html)";
+
+     revision "2016-05-11" {
+         description
+                 "OpenStack Neutron SFC Flow Classfier Models - Version 1.";
+     }
+
+     grouping flow-classifier-match-attributes {
+         leaf ethertype {
+             description "
+                Classify flows based on the provided ethertype.Currently OpenStack SFC only supports IPv4 and IPv6.";
+
+             type identityref {
+                 base "constants:ethertype-base";
+             }
+         }
+         leaf protocol {
+             description "
+                Classify flows based on the provided protocol.Currently OpenStack SFC only supports TCP,UDP and ICMP";
+             type identityref {
+                 base "constants:protocol-base";
+             }
+         }
+         leaf source-port-range-min {
+             description "Minimum source protocol port";
+             type uint16 {
+                 range "0 .. 65535";
+             }
+         }
+         leaf source-port-range-max {
+             description "Maximum source protocol port.";
+             type uint16 {
+                 range "0 .. 65535";
+             }
+         }
+         leaf destination-port-range-min {
+             description "Minimum destination protocol port.";
+             type uint16 {
+                 range "0 .. 65535";
+             }
+         }
+         leaf destination-port-range-max {
+             description "Maximum destination protocol port.";
+             type uint16 {
+                 range "0 .. 65535";
+             }
+         }
+         leaf source-ip-prefix {
+             description "Source IPv4 or IPv6 prefix.";
+             type inet:ip-prefix;
+         }
+         leaf destination-ip-prefix {
+             description "Destination IPv4 or IPv6 prefix.";
+             type inet:ip-prefix;
+         }
+         leaf logical-source-port {
+             description "Neutron source port.";
+             type yang:uuid;
+         }
+         leaf logical-destination-port {
+             description "Neutron destination port.";
+             type yang:uuid;
+         }
+         list l7-parameter {
+             description "List of Key-Value pair of L7 matching attributes";
+             key "match-parameter";
+             leaf match-parameter {
+                 description "Name of the L7 parameter";
+                 type string;
+             }
+             leaf match-parameter-value {
+                 description "Value of the L7 parameter";
+                 type string;
+             }
+         }
+     }
+
+     grouping sfc-flow-classifiers-attributes {
+         container flow-classifiers {
+             description "Contains list of Service Function Chaining flow classifiers";
+             list flow-classifier {
+                 description "
+                    Defines high level model of SFC Flow Classifier. This models is based on the flow classifier APIs
+                    defined by OpenStack Neutron networking-sfc project.";
+
+                 key "uuid";
+                 uses attrs:base-attributes;
+                 uses flow-classifier-match-attributes;
+             }
+         }
+     }
+ }
diff --git a/model/src/main/yang/neutron-sfc.yang b/model/src/main/yang/neutron-sfc.yang
new file mode 100644 (file)
index 0000000..bc600e7
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+ module neutron-sfc {
+
+     yang-version 1;
+
+     namespace "urn:opendaylight:neutron-sfc";
+
+     prefix neutron-sfc;
+
+     import ietf-yang-types { prefix "yang"; }
+     import neutron-attrs { prefix "attrs"; }
+
+
+     organization "OpenDaylight Neutron Northbound Project";
+
+     contact "Anil Vishnoi <vishnoianil@gmail.com>";
+
+     description "This YANG module defines Openstack Neutron Service Function Chaining Models.These models are based on
+                the API's exposed by the OpenStack Neutron Networking SFC (networking-sfc) project. List of SFC related
+                APIs are listed at following URL (http://docs.openstack.org/developer/networking-sfc/api.html)";
+
+     revision "2016-05-11" {
+         description
+                 "OpenStack Neutron Service Function Chaining Models - Version 1.";
+     }
+
+     grouping port-chain-attributes {
+         description "Grouping of port chain attributes";
+
+         leaf-list port-pair-groups {
+             description "List of ID of Port pair groups that is part of the SF chain";
+             type yang:uuid;
+         }
+
+         leaf-list flow-classifiers {
+             description "List of ID of flow classifiers associated to the SF chain";
+             type yang:uuid;
+         }
+
+         list chain-parameters {
+             description "
+                List of additional parameters related to the SF chain. Current only one parameter 'correlation' is
+                defined. The 'correlation' parameter is used to specify the type of chain correlation mechanism. This
+                parameter allows different correlation mechanism to be selected. This is currently set to 'mpls' as a
+                default correlation mechanism because that's the only mechanism OpenStack SFC API's supports. If this
+                parameter is not specified, it will default to 'mpls'";
+
+             key "chain-parameter";
+
+             leaf chain-parameter {
+                 description "SF Chain parameter attribute name";
+                 type string;
+                 default "correlation";
+             }
+
+             leaf chain-parameter-value {
+                 description "SF Chain parameter's value";
+                 type string;
+                 default "mpls";
+             }
+         }
+     }
+
+     grouping port-pair-group-attributes {
+         description "Grouping of port pair group attributes";
+
+         leaf-list port-pairs {
+             description "List of the port pair's ID that is part of the port pair group";
+             type yang:uuid;
+         }
+     }
+
+     grouping port-pair-attributes {
+         description "Grouping of port pair attributes";
+
+         leaf ingress {
+             description "Ingress neutron port ID of the Service Function";
+             type yang:uuid;
+         }
+
+         leaf egress {
+             description "Egress neutron port ID of the Service Function";
+             type yang:uuid;
+         }
+
+         list service-function-parameters {
+             description "
+             Service Function specific parameters. These parameters are generally used to pass the SF specific parameter
+             information to the data path. Currently OpenStack SFC defined only one parameter - 'correlation'. The
+             'correlation' parameter is used to specify the type of chain correlation mechanism supported by a specific
+             SF. This is needed by the data plane switch to determine how to associate a packet with a chain. Currently
+             there is no default mechanism defined by OpenStack SFC API.";
+
+             key "service-function-parameter";
+
+             leaf service-function-parameter {
+                 description "Name of parameter defined for service function ";
+                 type string;
+                 default "correlation";
+             }
+
+             leaf service-function-parameter-value {
+                 description "Value of the service function parameter";
+                 type string;
+             }
+         }
+     }
+
+     grouping sfc-attributes {
+
+         container port-chains {
+             description "List of Service Function Paths (Port Chain) created by OpenStack SFC";
+
+             list port-chain {
+                 description "
+                    A Port Chain (Service Function Path) consists of (1) a set of Neutron ports, to define the sequence
+                    of service functions and (2)a set of flow classifiers, to specify the classified traffic flows to
+                    enter the chain. (1) is defined using the port pair groups. If a chain consists of a sequence of
+                    different types of Service Functions, then the chain will have multiple 'port-pair-group's. There
+                    must be at least one 'port-pair-group' in the Port Chain. Each port chain can be associated with
+                    multiple flow classifiers";
+
+                 key "uuid";
+                 uses attrs:base-attributes;
+                 uses port-chain-attributes;
+             }
+         }
+
+         container port-pair-groups {
+             description "List of group of Service Functions (Port Pair Groups) created by OpenStack SFC";
+
+             list port-pair-group {
+                 description "
+                    Port Pair group defines the group of Service Fucntions (Port pair). Inside each 'port-pair-group',
+                    there could be one or more port-pairs. Multiple port-pairs may be included in a 'port-pair-group to
+                    allow the specification of a set of functionally equivalent SFs that can be be used for load
+                    distribution, i.e., the 'port-pair' option may be repeated for multiple port-pairs of functionally
+                    equivalent SFs.";
+
+                 key "uuid";
+                 uses attrs:base-attributes;
+                 uses port-pair-group-attributes;
+             }
+         }
+
+         container port-pairs {
+             description "List of Service Function (Port Pair) created by OpenStack";
+
+             list port-pair {
+                 description "
+                 A Port Pair represents a service function instance. The ingress port and the egress port of the service
+                 function are defined separately but if the service function has one bidirectional port, the ingress
+                 port will have the same value as the egress port. ";
+
+                 key "uuid";
+                 uses attrs:base-attributes;
+                 uses port-pair-attributes;
+             }
+         }
+     }
+ }
index de4ebcf5f5d6d283b3522ee80e2ba43954013521..02948e061b4c16ae105eb965d82a72ddc0b2bb83 100644 (file)
@@ -26,6 +26,8 @@ module neutron {
     import neutron-fwaas { prefix "fwaas"; }
     import neutron-bgpvpns { prefix "bgpvpns"; }
     import neutron-hostconfig { prefix "hostconfig"; }
+    import neutron-sfc-flow-classifier { prefix "neutron-sfc-flow-classifier"; }
+    import neutron-sfc { prefix "neutron-sfc"; }
 
     organization "OpenDaylight Neutron Group";
 
@@ -60,5 +62,7 @@ module neutron {
         uses l2gateways:l2gateways-attributes;
         uses l2gateways:l2gateway-connections-attributes;
         uses hostconfig:hostconfig-attributes;
+        uses neutron-sfc-flow-classifier:sfc-flow-classifiers-attributes;
+        uses neutron-sfc:sfc-attributes;
     }
 }