Decoupling of SFF and SF. More bug fixes 05/9705/2
authorReinaldo Penno <[email protected]>
Tue, 5 Aug 2014 16:52:16 +0000 (09:52 -0700)
committerReinaldo Penno <[email protected]>
Tue, 5 Aug 2014 17:57:35 +0000 (10:57 -0700)
- Decoupling SFF and SF in a upcoming commit. Today when you create
  a SF, we create a SFF if it does not exist. But any coupling
  between the models is really bad because it makes us have to do
  garbage collection and synching of data. So, the user will have
  to explicitly create a SFF and in its configuration also specify
  the list of SFs attached to it.
- Changed sfc_provider_config.json to pretty format.
- Changed SFC chain model to allow symmetric paths
- Fixed a few Yang modules with lines larger than 70 chars.
- Fixed a few Yang descriptions according to new arch draft-01
- Fixed LOG statement in SnDataListener()
- Fixed service-function-forwarders.json to use new model syntax.
- Fixed OVS yang namespace issue

Change-Id: I56227cd8ef1d8a78386c75f3c3b6fcd97f34c1cc
Signed-off-by: Reinaldo Penno <[email protected]>
14 files changed:
sfc-distribution/src/main/resources/configuration/startup/bootstrap/service-function-forwarders.json
sfc-distribution/src/main/resources/configuration/startup/sfc_provider_config.json
sfc-model/src/main/yang/service-function-chain.yang
sfc-model/src/main/yang/service-function-forwarder-ovs.yang
sfc-model/src/main/yang/service-function-forwarder.yang
sfc-model/src/main/yang/service-function-path.yang
sfc-model/src/main/yang/service-function-type.yang
sfc-model/src/main/yang/service-function.yang
sfc-provider/pom.xml
sfc-provider/src/main/java/org/opendaylight/sfc/provider/OpendaylightSfc.java
sfc-provider/src/main/java/org/opendaylight/sfc/provider/SfcProviderSfEntryDataListener.java
sfc-provider/src/main/java/org/opendaylight/sfc/provider/SfcProviderSfpEntryDataListener.java
sfc-provider/src/main/java/org/opendaylight/sfc/provider/SfcProviderSnDataListener.java
sfc-provider/src/main/java/org/opendaylight/sfc/provider/bootstrap/SfcProviderBootstrapRestAPI.java

index d04f10e59b8f68cb1127c14941208e5ac389af20..ecf2b17d10dff6a5c0338954136fbb5c12d064e7 100755 (executable)
@@ -1,97 +1,75 @@
 {
-    "service-function-forwarders": {
-        "service-function-forwarder": [
-            {
-                "name": "SFF-bootstrap",
-                "sff-data-plane-locator": {
-                    "port": 33333,
-                    "ip": "10.3.1.101"
-                },
-                "transport": "service-function-forwarder:vxlan-gpe",
-                "service-function-dictionary": [
-                    {
-                        "name": "dpi-102-3",
-                        "type": "dpi",
-                        "service-function-forwarder": "SFF-bootstrap",
-                        "sf-data-plane-locator": {
-                            "port": 10003,
-                            "ip": "10.3.1.102"
-                        }
-                    },
-                    {
-                        "name": "napt44-104",
-                        "type": "napt44",
-                        "service-function-forwarder": "SFF-bootstrap",
-                        "sf-data-plane-locator": {
-                            "port": 10020,
-                            "ip": "10.3.1.104"
-                        }
-                    },
-                    {
-                        "name": "firewall-101-1",
-                        "type": "firewall",
-                        "service-function-forwarder": "SFF-bootstrap",
-                        "sf-data-plane-locator": {
-                            "port": 10001,
-                            "ip": "10.3.1.101"
-                        }
-                    },
-                    {
-                        "name": "napt44-103-2",
-                        "type": "napt44",
-                        "service-function-forwarder": "SFF-bootstrap",
-                        "sf-data-plane-locator": {
-                            "port": 10002,
-                            "ip": "10.3.1.103"
-                        }
-                    },
-                    {
-                        "name": "napt44-103-1",
-                        "type": "napt44",
-                        "service-function-forwarder": "SFF-bootstrap",
-                        "sf-data-plane-locator": {
-                            "port": 10001,
-                            "ip": "10.3.1.103"
-                        }
-                    },
-                    {
-                        "name": "firewall-101-2",
-                        "type": "firewall",
-                        "service-function-forwarder": "SFF-bootstrap",
-                        "sf-data-plane-locator": {
-                            "port": 10002,
-                            "ip": "10.3.1.101"
-                        }
-                    },
-                    {
-                        "name": "firewall-104",
-                        "type": "firewall",
-                        "service-function-forwarder": "SFF-bootstrap",
-                        "sf-data-plane-locator": {
-                            "port": 10001,
-                            "ip": "10.3.1.104"
-                        }
-                    },
-                    {
-                        "name": "dpi-102-1",
-                        "type": "dpi",
-                        "service-function-forwarder": "SFF-bootstrap",
-                        "sf-data-plane-locator": {
-                            "port": 10001,
-                            "ip": "10.3.1.102"
-                        }
-                    },
-                    {
-                        "name": "dpi-102-2",
-                        "type": "dpi",
-                        "service-function-forwarder": "SFF-bootstrap",
-                        "sf-data-plane-locator": {
-                            "port": 10002,
-                            "ip": "10.3.1.102"
-                        }
-                    }
-                ]
+  "service-function-forwarders": {
+    "service-function-forwarder": [
+      {
+        "name": "br-int-ovs-1",
+        "uuid": "4c3778e4-840d-47f4-b45e-0988e514d26c",
+        "service-node": "OVSDB1",
+        "sff-data-plane-locator": [
+          {  
+            "name": "eth0",
+            "data-plane-locator": {
+              "port": 5000,
+              "ip": "192.168.1.1"
+            },
+            "transport": "vxlan-gpe"
+          }
+        ],
+        "service-function-dictionary": [
+          {
+            "sf-data-plane-locator": {
+              "port": 5000,
+              "ip": "10.1.1.1"
+            },
+            "name": "SF1",
+            "service-function-forwarder": "br-int-ovs-1",
+            "type": "dp1"
+          },
+          {
+            "sf-data-plane-locator": {
+              "port": 5000,
+              "ip": "10.1.1.2"
+            },
+            "name": "SF2",
+            "service-function-forwarder": "br-int-ovs-1",
+            "type": "firewall"
+          }
+        ]
+      },
+      {
+        "name": "br-int-ovs-2",
+        "uuid": "fd4d849f-5140-48cd-bc60-6ad1f5fc0a02",
+        "service-node": "OVSDB2",
+        "sff-data-plane-locator": [
+          {
+            "name": "eth0",
+            "data-plane-locator": {
+              "port": 5000,
+              "ip": "192.168.1.2"
             }
+          }
+        ],
+        "service-function-dictionary": [
+          {
+            "sf-data-plane-locator": {
+              "port": 5000,
+              "ip": "10.1.1.5"
+            },
+            "name": "SF5",
+            "service-function-forwarder": "br-int-ovs-2",
+            "type": "qos"
+          },
+          {
+            "sf-data-plane-locator": {
+              "port": 5000,
+              "ip": "10.1.1.6"
+            },
+            "name": "SF6",
+            "service-function-forwarder": "br-int-ovs-2",
+            "type": "napt44"
+          }
         ]
-    }
+      }
+    ]
+  }
 }
\ No newline at end of file
index 7ae80ce95e2c4325e62994b2ac0dd7621abf1199..c350d431bb2cb6c3fef9dabd7bd3e90cdba2652c 100755 (executable)
@@ -1,13 +1,25 @@
 {
-    "bootstrap": {
-        "bootstrapDataDir": "configuration/startup/bootstrap/",
-        "configDataUrl": "http://localhost:8080/restconf/config/",
-        "configDataMimeType": "application/json",
-        "files": [
-            {"name": "service-function-forwarders.json", "urlpath": "service-function-forwarder:service-function-forwarders"},
-            {"name": "service-functions.json", "urlpath": "service-function:service-functions"},
-            {"name": "service-function-chains.json", "urlpath": "service-function-chain:service-function-chains"},
-            {"name": "service-nodes.json", "urlpath": "service-node:service-nodes"}
-        ]
-    }
+  "bootstrap": {
+    "bootstrapDataDir": "configuration/startup/bootstrap/",
+    "configDataUrl": "http://localhost:8080/restconf/config/",
+    "configDataMimeType": "application/json",
+    "files": [
+      {
+        "name": "service-function-forwarders.json",
+        "urlpath": "service-function-forwarder:service-function-forwarders"
+      },
+      {
+        "name": "service-functions.json",
+        "urlpath": "service-function:service-functions"
+      },
+      {
+        "name": "service-function-chains.json",
+        "urlpath": "service-function-chain:service-function-chains"
+      },
+      {
+        "name": "service-nodes.json",
+        "urlpath": "service-node:service-nodes"
+      }
+    ]
+  }
 }
index 8e68120cd25a4c6a49dc877cb98213c930ba9dd1..a9e7db3ea43ff7dd7f03722983eb19f400252e9c 100644 (file)
@@ -44,34 +44,36 @@ module service-function-chain {
   grouping service-function-chain-grouping {
     list service-function-chain {
       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.";
+        "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 {
         key "name";
         leaf name {
           type string;
           description
-            "The name of the service function if known,
-            otherwise a generic unique string";
+            "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.";
+            "Service Function Type from service-function-type.yang";
         }
         ordered-by user;
         description
@@ -89,8 +91,15 @@ module service-function-chain {
   container service-function-chains {
     uses service-function-chain-grouping;
     description
-      "This containers holds service function chains configuration
-       data";
+      "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 {
index c2ec7f30e0f204880d2c05f4106e701d4bcb6b7e..6a9635c36e7a319a98223847d9548dbcd3a000fc 100644 (file)
@@ -1,7 +1,7 @@
 module service-function-forwarder-ovs {
   yang-version 1;
 
-  namespace "urn:cisco:params:xml:ns:yang:sfc-acl";
+  namespace "urn:cisco:params:xml:ns:yang:sfc-sff-ovs";
 
   prefix sfc-sff-ovs;
 
@@ -16,7 +16,8 @@ module service-function-forwarder-ovs {
     description "Augmentation of SFF for OVS";
   }
 
-  augment "/sfc-sff:service-function-forwarders/sfc-sff:service-function-forwarder/" {
+  augment "/sfc-sff:service-function-forwarders/"
+        + "sfc-sff:service-function-forwarder/" {
     description "OVSDB bridge UUID";
     leaf uuid {
       type string;
index f5977a6e8dcbc0c20254dc150b6c3b04328c9f9e..69c85604ad43002ccc76a8129abdf96345cd7519 100644 (file)
@@ -99,7 +99,15 @@ module service-function-forwarder {
 
 
   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;
@@ -163,16 +171,7 @@ module service-function-forwarder {
         description
           "A list of all Service Functions attached to this SFF.";
       }
-      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.
-        ";
     }
-    description
-      "This container holds the configuration for all service
-       function forwarders";
   }
 }
 
index 86d32e06421d9a847ca172c971bae2794849cfc6..cd963d7e119c67229d027a918959c5890408b4ad 100644 (file)
@@ -53,7 +53,20 @@ module service-function-path {
   // 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;
@@ -74,7 +87,7 @@ module service-function-path {
         }
         ordered-by user;
         description
-          "A list of service function instances that compose the
+          "A list of service functions that compose the
            service path";
       }
       leaf service-chain-name {
@@ -107,18 +120,6 @@ module service-function-path {
            value for reporting and troubleshooting packets along
            a specific path.";
       }
-      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";
     }
-    description
-      "This container holds all service-paths in the domain";
   }
 }
index a59a76deab5440a51fd5e8ebeb8e18078dea8dc1..63e43fd9af3e8e300ec49ed124bc9c831d12af17 100644 (file)
@@ -100,8 +100,8 @@ module service-function-type {
           "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";
+        "A list of all service types. Each service-type entry holds
+         list of all service functions of the type";
     }
   }
 }
index 9bceeebeded0090e803d53593d2570254a60ef4d..5bba8463f9bbbad9d95de98c53e6adbc071b3ac4 100644 (file)
@@ -47,7 +47,8 @@ module service-function {
 
   typedef service-function-ref {
     type leafref {
-      path "/sfc-sf:service-functions/sfc-sf:service-function/sfc-sf:name";
+      path "/sfc-sf:service-functions/sfc-sf:service-function/"
+          + "sfc-sf:name";
     }
     description
       "This type is used by data models that need to reference
index a37326e20bff1287284446a7648b4375376a33f2..d32737ba2efb6e799b12b52e2bdda9ee6d43dcc1 100755 (executable)
             <artifactId>jackson-module-jaxb-annotations</artifactId>
             <version>${jackson.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.glassfish</groupId>
+            <artifactId>javax.json</artifactId>
+            <version>1.0.4</version>
+        </dependency>
     </dependencies>
 
     <build>
index 60affa798bc47d3e1be8151f10006f163f150f43..c9e9d86871160ba92986b8c0d7e2a2e84d4e52de 100755 (executable)
@@ -117,15 +117,15 @@ public class OpendaylightSfc implements AutoCloseable {
 
         if (dataProvider != null) {
             final AsyncReadWriteTransaction t = dataProvider.newReadWriteTransaction();
-            t.delete(LogicalDatastoreType.OPERATIONAL, sfEntryIID);
-            t.delete(LogicalDatastoreType.OPERATIONAL, sfEntryIID);
-            t.delete(LogicalDatastoreType.OPERATIONAL, sfEntryIID);
-            t.delete(LogicalDatastoreType.OPERATIONAL, sfcEntryIID);
-            t.delete(LogicalDatastoreType.OPERATIONAL, sfsIID);
-            t.delete(LogicalDatastoreType.OPERATIONAL, snIID);
-            t.delete(LogicalDatastoreType.OPERATIONAL, sffIID);
-            t.delete(LogicalDatastoreType.OPERATIONAL, sfpIID);
-            t.delete(LogicalDatastoreType.OPERATIONAL, sftIID);
+            t.delete(LogicalDatastoreType.CONFIGURATION, sfEntryIID);
+            t.delete(LogicalDatastoreType.CONFIGURATION, sfEntryIID);
+            t.delete(LogicalDatastoreType.CONFIGURATION, sfEntryIID);
+            t.delete(LogicalDatastoreType.CONFIGURATION, sfcEntryIID);
+            t.delete(LogicalDatastoreType.CONFIGURATION, sfsIID);
+            t.delete(LogicalDatastoreType.CONFIGURATION, snIID);
+            t.delete(LogicalDatastoreType.CONFIGURATION, sffIID);
+            t.delete(LogicalDatastoreType.CONFIGURATION, sfpIID);
+            t.delete(LogicalDatastoreType.CONFIGURATION, sftIID);
             t.commit().get();
         }
     }
index 1462c0280d23641e1b4564b7bb5ce18beca10498..486efb2f3819a9450f7c8cc02c43a6338a0b8844 100644 (file)
@@ -63,10 +63,10 @@ public class SfcProviderSfEntryDataListener implements DataChangeListener  {
                 odlSfc.executor.execute(SfcProviderServiceTypeAPI
                         .getDeleteServiceFunctionFromServiceType(serviceTypeObj, serviceTypeClass));
 
-                Object[] sfParams = {originalServiceFunction};
-                Class[] sfParamsTypes = {ServiceFunction.class};
-                odlSfc.executor.execute(SfcProviderServiceForwarderAPI
-                        .getDeleteServiceFunctionFromForwarder(sfParams, sfParamsTypes ));
+                //Object[] sfParams = {originalServiceFunction};
+                //Class[] sfParamsTypes = {ServiceFunction.class};
+                //odlSfc.executor.execute(SfcProviderServiceForwarderAPI
+                //        .getDeleteServiceFunctionFromForwarder(sfParams, sfParamsTypes ));
 
                 Object[] functionParams = {originalServiceFunction};
                 Class[] functionParamsTypes = {ServiceFunction.class};
@@ -90,8 +90,8 @@ public class SfcProviderSfEntryDataListener implements DataChangeListener  {
                 odlSfc.executor.execute(SfcProviderServiceTypeAPI
                         .getCreateServiceFunctionToServiceType(serviceTypeObj, serviceTypeClass));
 
-                Object[] sfParams = {createdServiceFunction};
-                Class[] sfParamsTypes = {ServiceFunction.class};
+                //Object[] sfParams = {createdServiceFunction};
+                //Class[] sfParamsTypes = {ServiceFunction.class};
                 //odlSfc.executor.execute(SfcProviderServiceForwarderAPI
                 //        .getCreateServiceForwarderAPI(sfParams, sfParamsTypes));
                 LOG.debug("\n########## getCreatedConfigurationData {}  {}",
@@ -113,8 +113,8 @@ public class SfcProviderSfEntryDataListener implements DataChangeListener  {
 
                 Object[] sfParams = {updatedServiceFunction};
                 Class[] sfParamsTypes = {ServiceFunction.class};
-                odlSfc.executor.execute(SfcProviderServiceForwarderAPI
-                        .getUpdateServiceForwarderAPI(sfParams, sfParamsTypes ));
+                //odlSfc.executor.execute(SfcProviderServiceForwarderAPI
+                //        .getUpdateServiceForwarderAPI(sfParams, sfParamsTypes ));
 
                 odlSfc.executor.execute(SfcProviderServicePathAPI
                         .getUpdateServicePathContainingFunction(sfParams, sfParamsTypes));
index 0515db2e87ba96e7dba4549610553903189aa540..d4f5ec400b4c3879582eefc064c7236eaa6a0415 100644 (file)
@@ -51,7 +51,7 @@ public class SfcProviderSfpEntryDataListener implements DataChangeListener {
             }
         }
 
-        // SFC CREATION
+        // SFP CREATION
         Map<InstanceIdentifier<?>, DataObject> dataCreatedObject = change.getCreatedData();
 
         for (Map.Entry<InstanceIdentifier<?>, DataObject> entry : dataCreatedObject.entrySet())
index dc5ce989444fec3ad4bc7f31912b69730a61002a..a43f7fb44ba465dd81da15cef59bb7c3d23931dd 100644 (file)
@@ -32,9 +32,9 @@ public class SfcProviderSnDataListener implements DataChangeListener {
     public void onDataChanged(
             final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> change ) {
 
-        LOG.info("\n########## Start: {}", Thread.currentThread().getStackTrace()[1]);
+        LOG.debug("\n########## Start: {}", Thread.currentThread().getStackTrace()[1]);
 
 
-        LOG.info("\n########## Stop: {}", Thread.currentThread().getStackTrace()[1]);
+        LOG.debug("\n########## Stop: {}", Thread.currentThread().getStackTrace()[1]);
     }
 }
index 169b10a4a1a60c9a4573b09c4e4165c2eeb561a8..2382cc0830254cb74108276b406fb05649aadce4 100755 (executable)
@@ -58,7 +58,7 @@ public class SfcProviderBootstrapRestAPI extends SfcProviderAbstractRestAPI {
 
         JSONObject jo = providerConfig.getJsonBootstrapObject();
 
-        JSONArray files = new JSONArray();
+        JSONArray files;
 
         try {
             final String CONFIG_FILES_DIR = jo.getString("bootstrapDataDir");
@@ -66,6 +66,7 @@ public class SfcProviderBootstrapRestAPI extends SfcProviderAbstractRestAPI {
             final String CONFIG_DATA_MIME_TYPE = jo.getString("configDataMimeType");
             files = jo.getJSONArray("files");
 
+
             ClientConfig clientConfig = new DefaultClientConfig();
             Client client = Client.create(clientConfig);