Initial Code commit for OVS Support for vpnservice 76/29176/2
authorFaseela K <faseela.k@ericsson.com>
Tue, 3 Nov 2015 09:03:53 +0000 (14:33 +0530)
committerFaseela K <faseela.k@ericsson.com>
Tue, 3 Nov 2015 11:49:22 +0000 (17:19 +0530)
Change-Id: I5435f9f4717a750d151f3f5562d7994bcd9d6cdc
Signed-off-by: Faseela K <faseela.k@ericsson.com>
commons/config-parent/pom.xml
features/pom.xml
features/src/main/features/features.xml
interfacemgr/interfacemgr-api/pom.xml
interfacemgr/interfacemgr-api/src/main/yang/odl-interface-meta.yang [new file with mode: 0644]
interfacemgr/interfacemgr-api/src/main/yang/odl-interface-rpc.yang [new file with mode: 0644]
interfacemgr/interfacemgr-api/src/main/yang/odl-interface-service-bindings.yang [new file with mode: 0644]
interfacemgr/interfacemgr-api/src/main/yang/odl-interface.yang
interfacemgr/interfacemgr-impl/pom.xml

index 0416c9d43023c71d21c2a926e172c5a7a385edd4..0a47ecfa6b53abb8d7bf1c55b5041822a873baa6 100644 (file)
@@ -29,6 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <vpns.mdsalutil.version>0.2.0-SNAPSHOT</vpns.mdsalutil.version>
     <model.bgp.version>2013.07.15.8-SNAPSHOT</model.bgp.version>
     <openflowplugin.version>0.2.0-SNAPSHOT</openflowplugin.version>
+    <vpns.ovsdb.version>1.2.1-SNAPSHOT</vpns.ovsdb.version>
   </properties>
 
   <dependencyManagement>
index 26c591ef42d2d9e946064eefe1a1e72a34dad78f..298fc804de3533d9a234e3b63e626be72983e760 100644 (file)
@@ -27,6 +27,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
     <mdsal.model.version>0.8.0-SNAPSHOT</mdsal.model.version>
     <vpnservices.version>0.2.0-SNAPSHOT</vpnservices.version>
+    <ovsdb.version>1.2.1-SNAPSHOT</ovsdb.version>
     <mdsalutil.version>${vpnservices.version}</mdsalutil.version>
     <vpnmanager.version>${vpnservices.version}</vpnmanager.version>
     <interfacemgr.version>${vpnservices.version}</interfacemgr.version>
@@ -78,6 +79,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>features-ovsdb</artifactId>
+      <version>${ovsdb.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.openflowplugin</groupId>
       <artifactId>features-openflowplugin</artifactId>
index f6888a2ec89c66993ab3dec51ce48d63b816612b..4a4b1cac2c4247fc31d900c42623824e032d1e4e 100644 (file)
@@ -15,10 +15,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
   <repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin/${openflowplugin.version}/xml/features</repository>
   <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.ovsdb/features-ovsdb/${ovsdb.version}/xml/features</repository>
   <feature name='odl-vpnservice-api' version='${project.version}' description='OpenDaylight :: vpnservice :: api '>
     <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
     <feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
     <feature version='${openflowplugin.version}'>odl-openflowplugin-nsf-model</feature>
+    <feature version="${ovsdb.version}">odl-ovsdb-southbound-api</feature>
     <bundle>mvn:org.opendaylight.vpnservice/model-bgp/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.vpnservice/idmanager-api/${idmanager.version}</bundle>
     <bundle>mvn:org.opendaylight.vpnservice/vpnmanager-api/${vpnmanager.version}</bundle>
@@ -28,6 +30,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   </feature>
   <feature name='odl-vpnservice-impl' version='${project.version}' description='OpenDaylight :: vpnservice :: impl '>
     <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+    <feature version="${ovsdb.version}">odl-ovsdb-southbound-api</feature>
     <feature version='${project.version}'>odl-vpnservice-api</feature>
     <feature version="${openflowplugin.version}">odl-openflowplugin-southbound</feature>
     <feature version="${openflowplugin.version}">odl-openflowplugin-flow-services</feature>
index 8c24456065bc678d450bcd22c58f0b8014d73b8c..2fed9a0d837c03a0c839b93733b78a18737c1672 100644 (file)
@@ -55,5 +55,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>mdsalutil-api</artifactId>
       <version>${vpns.mdsalutil.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>southbound-api</artifactId>
+      <version>${vpns.ovsdb.version}</version>
+    </dependency>
   </dependencies>
 </project>
diff --git a/interfacemgr/interfacemgr-api/src/main/yang/odl-interface-meta.yang b/interfacemgr/interfacemgr-api/src/main/yang/odl-interface-meta.yang
new file mode 100644 (file)
index 0000000..c2a99da
--- /dev/null
@@ -0,0 +1,50 @@
+module odl-interface-meta {
+    namespace "urn:opendaylight:vpnservice:interfacemgr:meta";
+    prefix "odlifmeta";
+
+    import ovsdb {
+        prefix southbound; revision-date "2015-01-05";
+    }
+
+    revision "2015-10-07" {
+        description "ODL rendering specific Interface Manager Meta Module";
+    }
+
+    container bridge-interface-info {
+        description "Contains the list of dpns along with the tunnel interfaces configured on them.";
+
+        list bridge-entry {
+            key dpid;
+            leaf dpid {
+                type uint64;
+            }
+
+            list bridge-interface-entry {
+                key interface-name;
+                leaf interface-name {
+                    type string;
+                }
+                leaf tp-id-ref {
+                    type southbound:ovsdb-termination-point-ref;
+                }
+            }
+        }
+    }
+
+    container bridge-ref-info {
+        config false;
+        description "The container that maps dpid with ovs bridge ref in the operational DS.";
+
+        list bridge-ref-entry {
+            key dpid;
+            leaf dpid {
+                type uint64;
+            }
+
+            leaf bridge-reference {
+                type southbound:ovsdb-bridge-ref;
+                description "This is the reference to an ovs bridge";
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/interfacemgr/interfacemgr-api/src/main/yang/odl-interface-rpc.yang b/interfacemgr/interfacemgr-api/src/main/yang/odl-interface-rpc.yang
new file mode 100644 (file)
index 0000000..f95d52c
--- /dev/null
@@ -0,0 +1,175 @@
+module odl-interface-rpc {
+    namespace "urn:opendaylight:vpnservice:interfacemgr:rpcs";
+    prefix "odlifrpc";
+
+    import ietf-inet-types {
+        prefix inet;
+    }
+
+    import odl-interface {
+        prefix odlif; revision-date 2015-03-31;
+    }
+
+    import opendaylight-action-types {prefix action;}
+    import opendaylight-flow-types {prefix offlow;revision-date "2013-10-26";}
+
+    revision "2015-10-03" {
+        description "ODL Specific Interface Manager Rpcs Module";
+    }
+
+/* RPCs */
+    rpc get-interface-from-lporttag {
+        description "Used to retrieve the interface-name using lporttag";
+        input {
+            leaf lportag {
+                type uint32;
+            }
+        }
+        output {
+            leaf intf-name {
+                type string;
+            }
+        }
+    }
+
+    rpc get-lporttag-from-interface {
+        description "Used to retrieve the lporttag from interface-name";
+        input {
+            leaf intf-name {
+                type string;
+            }
+        }
+        output {
+            leaf lportag {
+                type uint32;
+            }
+        }
+    }
+
+    rpc get-interface-from-groupid {
+        description "Used to retrieve the interface-name using groupid";
+        input {
+            leaf groupid {
+                type uint32;
+            }
+        }
+        output {
+            leaf intf-name {
+                type string;
+            }
+        }
+    }
+
+    rpc get-groupid-from-interface {
+        description "Used to retrieve the interface-name using groupid";
+        input {
+            leaf intf-name {
+                type string;
+            }
+        }
+        output {
+            leaf groupid {
+                type uint32;
+            }
+        }
+    }
+
+    rpc get-dpid-from-interface {
+        description "used to retrieve dpid from interface name";
+        input {
+            leaf intf-name {
+                type string;
+            }
+        }
+        output {
+            leaf dpid {
+                type uint64;
+            }
+        }
+    }
+
+    rpc get-port-from-interface {
+        description "used to retrieve dpid from interface name";
+        input {
+            leaf intf-name {
+                type string;
+            }
+        }
+        output {
+            leaf dpid {
+                type uint64;
+            }
+            leaf portno {
+                type uint32;
+            }
+            leaf portname {
+                type string;
+            }
+        }
+    }
+
+    rpc get-interface-from-port {
+        description "used to retrieve interface from port details";
+        input {
+            leaf interface-type {
+                description "Type of the interface (vlan/gre or vxlan tunnel)";
+                type identityref {
+                    base odlif:tunnel-type-base;
+                }
+            }
+            leaf dpid {
+                type uint64;
+            }
+            leaf portno {
+                type uint32;
+            }
+            leaf interface-id {
+                description "Used to provide the interface specific differentiator information (vlanId/gre-key/vxlan-vni)";
+                type uint64;
+            }
+        }
+        output {
+            leaf interface-name {
+                type string;
+            }
+        }
+    }
+
+    rpc get-egress-actions-for-interface {
+        description "used to retrieve group actions to use from interface name";
+        input {
+            leaf intf-name {
+                type string;
+            }
+        }
+        output {
+            uses action:action-list;
+        }
+    }
+
+    rpc get-egress-instructions-for-interface {
+        description "used to retrieve flow instructions to use from interface name";
+        input {
+            leaf intf-name {
+                type string;
+            }
+        }
+        output {
+            uses offlow:instruction-list;
+        }
+    }
+
+    rpc get-endpoint-ip-for-dpn {
+        description "to get the local ip of the tunnel/trunk interface";
+        input {
+            leaf dpid {
+                type uint64;
+            }
+        }
+        output {
+            leaf-list local-ips {
+                type inet:ip-address;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/interfacemgr/interfacemgr-api/src/main/yang/odl-interface-service-bindings.yang b/interfacemgr/interfacemgr-api/src/main/yang/odl-interface-service-bindings.yang
new file mode 100644 (file)
index 0000000..cebf3bd
--- /dev/null
@@ -0,0 +1,79 @@
+module interface-service-bindings {
+    namespace "urn:opendaylight:params:xml:ns:yang:servicebinding";
+    prefix ifservicebindings;
+
+    import opendaylight-flow-types {prefix offlow;revision-date "2013-10-26";}
+
+    import yang-ext {
+        prefix ext;
+    }
+
+    revision "2015-10-15" {
+        description "This YANG module defines the service binding model.";
+    }
+
+    identity service-type-base {
+       description "Base identity for all service-types";
+    }
+
+    identity service-type-flow-based {
+       description "Service type for flow-based services";
+       base service-type-base;
+    }
+
+    container service-bindings {
+        list services-info {
+            key interface-name;
+            leaf interface-name {
+                type string;
+            }
+
+            list bound-services {
+                key "service-priority";
+                max-elements "2";
+                min-elements "0";
+                leaf service-priority {
+                    type uint8;
+                }
+
+                leaf service-type {
+                    type identityref {
+                        base service-type-base;
+                    }
+                }
+
+                leaf interface-name {
+                    type string;
+                }
+
+                leaf service-name {
+                    type string;
+                }
+            }
+        }
+    }
+
+    grouping service-openflow-info {
+        description "openflow specific information for services info.";
+
+        leaf dispatcher-table-id {
+            type uint8;
+        }
+
+        leaf flow-priority {
+            type uint16;
+        }
+
+        leaf flow-cookie {
+            type uint64;
+        }
+
+        uses offlow:instruction-list;
+    }
+
+    augment "/service-bindings/services-info/bound-services" {
+        ext:augment-identifier "stype-openflow";
+        when "service-type = 'service-type-flow-based'";
+        uses service-openflow-info;
+    }
+}
\ No newline at end of file
index 78816c8d03a55984835b65670c308ed0a85f0389..609c11472d5941bcd744b5cf91bf91c00dba1045 100644 (file)
@@ -1,4 +1,3 @@
-
 module odl-interface {
     namespace "urn:opendaylight:vpnservice:interfacemgr";
 
@@ -32,25 +31,30 @@ module odl-interface {
         description "ODL Interface Manager Module";
     }
 
+    identity odl-interface {
+        status deprecated;
+        base "config:service-type";
+        config:java-class "org.opendaylight.vpnservice.interfacemgr.interfaces.IInterfaceManager";
+    }
+
     identity stacked-vlan {
         base if:interface-type;
-        reference
-        "Q-in-Q interface";
+        reference "Q-in-Q interface";
     }
 
-    identity l3tunnel {
+    identity mpls {
         base if:interface-type;
-        reference
-        "l3 tunnel interface";
+        reference "MPLS interface";
     }
 
-    identity mpls {
+    identity l3tunnel {
+        status deprecated;
         base if:interface-type;
         reference
-        "MPLS interface";
+        "l3 tunnel interface";
     }
 
-    /* l3Tunnel (GRE, VxLAN) logical port */
+    /* Tunnel (GRE, VxLAN) logical port */
     identity tunnel-type-base {
         description "Base identity for all tunnel-types";
     }
@@ -65,25 +69,26 @@ module odl-interface {
         base tunnel-type-base;
     }
 
-    identity odl-interface {
-        base "config:service-type";
-        config:java-class "org.opendaylight.vpnservice.interfacemgr.interfaces.IInterfaceManager";
-    }
-
     /* base/common properties */
     augment "/if:interfaces/if:interface" {
+        status deprecated;
         ext:augment-identifier "base-ids";
         leaf of-port-id {
             type inv:node-connector-id;
             description "can be a physical switch port or virtual switch port e.g. neutron port";
         }
-        leaf tenant-id {
+    }
+
+    augment "/if:interfaces/if:interface" {
+        ext:augment-identifier "parent-refs";
+        leaf datapath-node-identifier {
+            type uint64;
+            description "can be a physical switch identifier (optional)";
+        }
+
+        leaf parent-interface {
             type string;
-            description "Tenant that owns particular interface";
-        } /* optional */
-        leaf base-interface {
-            type if:interface-ref;
-            description "some interfaces need a reference to parent interface ";
+            description "can be a physical switch port or virtual switch port e.g. neutron port";
         }
     }
 
@@ -97,31 +102,48 @@ module odl-interface {
             type uint16 {
                 range "1..4094";
             }
-            must "../base-interface" {
-                description
-                "If a vlan-id is defined, a base-interface must
-                be specified.";
-            }
         }
     }
 
     /* Q-in-Q logical port */
     augment "/if:interfaces/if:interface" {
         ext:augment-identifier "if-stacked-vlan";
-        when "if:type = 'stacked_vlan'";
+        when "if:type = 'stacked-vlan'";
         leaf stacked_vlan-id {
             type uint16 {
                 range "1..4094";
             }
-            must "../base-interface" {
-                description
-                "If a vlan-id is defined, a base-interface must
-                be specified.";
+        }
+    }
+
+    augment "/if:interfaces/if:interface" {
+        ext:augment-identifier "if-tunnel";
+        when "if:type = 'ianaift:tunnel'";
+
+        leaf tunnel-interface-type {
+            type identityref {
+                base tunnel-type-base;
             }
         }
+
+        leaf tunnel-source {
+            type inet:ip-address;
+            description "Local Endpoint IP address";
+        }
+
+        leaf tunnel-destination {
+            type inet:ip-address;
+            description "Remote Endpoint IP address";
+        }
+
+        leaf tunnel-gateway {
+            type inet:ip-address;
+            description "gateway IP address";
+        }
     }
 
     augment "/if:interfaces/if:interface" {
+        status deprecated;
         ext:augment-identifier "if-l3tunnel";
         when "if:type = 'ianaift:l3tunnel'";
 
@@ -144,10 +166,7 @@ module odl-interface {
             type inet:ip-address;
             description "gateway IP address";
         }
-
     }
-
-
     /* MPLS logical port */
     augment "/if:interfaces/if:interface" {
         ext:augment-identifier "if-mpls";
@@ -163,5 +182,4 @@ module odl-interface {
             }
         }
     }
-
-}
+}
\ No newline at end of file
index 32d1ab6dc18f455c1a8ea99a16e797af4f5a2df7..2045f87d03ba53aa47d8ff2380c6b4e252631070 100644 (file)
@@ -55,5 +55,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>idmanager-impl</artifactId>
       <version>${vpnservices.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.ovsdb</groupId>
+      <artifactId>southbound-api</artifactId>
+      <version>${vpns.ovsdb.version}</version>
+    </dependency>
   </dependencies>
 </project>