From 98d90be34e10a45f55e973a119a2f67a0e70a058 Mon Sep 17 00:00:00 2001 From: Faseela K Date: Tue, 3 Nov 2015 14:33:53 +0530 Subject: [PATCH] Initial Code commit for OVS Support for vpnservice Change-Id: I5435f9f4717a750d151f3f5562d7994bcd9d6cdc Signed-off-by: Faseela K --- commons/config-parent/pom.xml | 1 + features/pom.xml | 9 + features/src/main/features/features.xml | 3 + interfacemgr/interfacemgr-api/pom.xml | 5 + .../src/main/yang/odl-interface-meta.yang | 50 +++++ .../src/main/yang/odl-interface-rpc.yang | 175 ++++++++++++++++++ .../yang/odl-interface-service-bindings.yang | 79 ++++++++ .../src/main/yang/odl-interface.yang | 88 +++++---- interfacemgr/interfacemgr-impl/pom.xml | 5 + 9 files changed, 380 insertions(+), 35 deletions(-) create mode 100644 interfacemgr/interfacemgr-api/src/main/yang/odl-interface-meta.yang create mode 100644 interfacemgr/interfacemgr-api/src/main/yang/odl-interface-rpc.yang create mode 100644 interfacemgr/interfacemgr-api/src/main/yang/odl-interface-service-bindings.yang diff --git a/commons/config-parent/pom.xml b/commons/config-parent/pom.xml index 0416c9d4..0a47ecfa 100644 --- a/commons/config-parent/pom.xml +++ b/commons/config-parent/pom.xml @@ -29,6 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html 0.2.0-SNAPSHOT 2013.07.15.8-SNAPSHOT 0.2.0-SNAPSHOT + 1.2.1-SNAPSHOT diff --git a/features/pom.xml b/features/pom.xml index 26c591ef..298fc804 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -27,6 +27,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL 0.8.0-SNAPSHOT 0.8.0-SNAPSHOT 0.2.0-SNAPSHOT + 1.2.1-SNAPSHOT ${vpnservices.version} ${vpnservices.version} ${vpnservices.version} @@ -78,6 +79,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL xml runtime + + org.opendaylight.ovsdb + features-ovsdb + ${ovsdb.version} + features + xml + runtime + org.opendaylight.openflowplugin features-openflowplugin diff --git a/features/src/main/features/features.xml b/features/src/main/features/features.xml index f6888a2e..4a4b1cac 100644 --- a/features/src/main/features/features.xml +++ b/features/src/main/features/features.xml @@ -15,10 +15,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features mvn:org.opendaylight.openflowplugin/features-openflowplugin/${openflowplugin.version}/xml/features mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features + mvn:org.opendaylight.ovsdb/features-ovsdb/${ovsdb.version}/xml/features odl-mdsal-broker odl-mdsal-models odl-openflowplugin-nsf-model + odl-ovsdb-southbound-api mvn:org.opendaylight.vpnservice/model-bgp/{{VERSION}} mvn:org.opendaylight.vpnservice/idmanager-api/${idmanager.version} mvn:org.opendaylight.vpnservice/vpnmanager-api/${vpnmanager.version} @@ -28,6 +30,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html odl-mdsal-broker + odl-ovsdb-southbound-api odl-vpnservice-api odl-openflowplugin-southbound odl-openflowplugin-flow-services diff --git a/interfacemgr/interfacemgr-api/pom.xml b/interfacemgr/interfacemgr-api/pom.xml index 8c244560..2fed9a0d 100644 --- a/interfacemgr/interfacemgr-api/pom.xml +++ b/interfacemgr/interfacemgr-api/pom.xml @@ -55,5 +55,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html mdsalutil-api ${vpns.mdsalutil.version} + + org.opendaylight.ovsdb + southbound-api + ${vpns.ovsdb.version} + 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 index 00000000..c2a99dac --- /dev/null +++ b/interfacemgr/interfacemgr-api/src/main/yang/odl-interface-meta.yang @@ -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 index 00000000..f95d52c2 --- /dev/null +++ b/interfacemgr/interfacemgr-api/src/main/yang/odl-interface-rpc.yang @@ -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 index 00000000..cebf3bdd --- /dev/null +++ b/interfacemgr/interfacemgr-api/src/main/yang/odl-interface-service-bindings.yang @@ -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 diff --git a/interfacemgr/interfacemgr-api/src/main/yang/odl-interface.yang b/interfacemgr/interfacemgr-api/src/main/yang/odl-interface.yang index 78816c8d..609c1147 100644 --- a/interfacemgr/interfacemgr-api/src/main/yang/odl-interface.yang +++ b/interfacemgr/interfacemgr-api/src/main/yang/odl-interface.yang @@ -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 diff --git a/interfacemgr/interfacemgr-impl/pom.xml b/interfacemgr/interfacemgr-impl/pom.xml index 32d1ab6d..2045f87d 100644 --- a/interfacemgr/interfacemgr-impl/pom.xml +++ b/interfacemgr/interfacemgr-impl/pom.xml @@ -55,5 +55,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html idmanager-impl ${vpnservices.version} + + org.opendaylight.ovsdb + southbound-api + ${vpns.ovsdb.version} + -- 2.36.6