From d3cc1233ec946c202d2ca0edc5de5b72c5763e38 Mon Sep 17 00:00:00 2001 From: Suchi Raman Date: Mon, 21 Oct 2013 10:59:26 -0400 Subject: [PATCH] Fixed address domain to match documentation. Signed-off-by: Suchi Raman --- affinity/yang/pom.xml | 2 +- .../src/main/yang/affinity-config-all.yang | 343 +++++++++++------- 2 files changed, 212 insertions(+), 133 deletions(-) diff --git a/affinity/yang/pom.xml b/affinity/yang/pom.xml index 527d17e..4073c10 100644 --- a/affinity/yang/pom.xml +++ b/affinity/yang/pom.xml @@ -14,7 +14,7 @@ 4.0.0 org.opendaylight.affinity - model-parent + model 1.0-SNAPSHOT jar diff --git a/affinity/yang/src/main/yang/affinity-config-all.yang b/affinity/yang/src/main/yang/affinity-config-all.yang index f17fc59..fdabdfc 100644 --- a/affinity/yang/src/main/yang/affinity-config-all.yang +++ b/affinity/yang/src/main/yang/affinity-config-all.yang @@ -9,92 +9,106 @@ module affinity-config-all { import opendaylight-l2-types { prefix l2types; } revision "2013-09-25" { - description "Initial revision of affinity model to be reviewed"; + description "Initial revision of affinity model to be reviewed"; } //************************************************** - // Stationary location -- switch + port, includes physical or virtual - // ports for example within a hypervisor representing a virtual switch. + // Stationary location within the network -- switch + port, including physical switch port + // or virtual switch port within a hypervisor virtual switch. //************************************************** grouping affinity-endpoint { leaf switch-port { - type inv:node-connector-id; + type inv:node-connector-id; } } - //************************************************** // Affinity address domain: This represents a domain (i.e, set) of one or - // more addresses. An affinity address may not have a corresponding - // endpoint on the network, for example, for traffic from a set of - // external addresses (north-south traffic in a data center), the source - // IP address domain is not required to map exactly to endpoints or node - // connectors on the network. We assume that there will be a resolution - // service that resolves one of these into an endpoint, when the address - // is present on the network. + // more addresses. An affinity address may not always have a corresponding + // endpoint on the network, for example, an address domain representing + // external addresses, or north-south traffic in a data center). Here the + // IP address domain representing such external addresses does not map to + // endpoints or node connectors on the network. + // Whenever possible, the affinity service must resolve the address domain + // into a list of endpoints especially when the address is present on the network. + // + // Affinity address domains specify one or more of the following: + // layer 2 address (vlan + mac range) + // layer 3 address (IP prefix) + // layer 4 address (tcp or udp port number) //************************************************** + grouping affinity-address-domain { - leaf id { - type string; - } - // Address is either an IP address, IP prefix, IP range, or - // MAC address, or MAC range. Address may also be a transport - // protocol layer address. - - leaf address { - description "Mac or Inet address"; - type union { - type inet:ip-address; - type inet:ip-prefix; - type l2types:vlan-id; // tbd - type yang:mac-address; -// type yang:mac-address-range; -// type yang:tp-address; // tbd - } - } - } + // l2-domain-address is vlan + MAC address range + container l2-address { + leaf vlan-id { + type l2types:vlan-id; + } + container mac-address-range { + uses mac-address-range; + } + } - typedef affinity-group-ref { - type instance-identifier; - } - - typedef affinity-link-ref { - type instance-identifier; - } - - typedef network-service-chain-ref { - type instance-identifier; - } + // l3-domain-address is IPv4 prefix + leaf l3-address { + type inet:ipv4-prefix; + } + // l4 port number + container l4-address { + leaf proto { + type string; // "tcp" or "udp" + } + leaf port-number { + type inet:port-number; + } + } + } - grouping affinity-element { - leaf id { - type string; - } - choice element { - description "affinity element"; - case affinity-endpoint { - uses affinity-endpoint; - } - - // Apply waypoint routing to the selected flows and send it through service chain. - case affinity-address-domain { - uses affinity-address-domain; - } - } - } - //************************************************** - // Affinity group - //************************************************** + grouping mac-address-range { + leaf start-address { + type yang:mac-address; + } + leaf end-address { + type yang:mac-address; + } + } + + typedef affinity-group-ref { + type instance-identifier; + } + + typedef affinity-link-ref { + type instance-identifier; + } + + grouping affinity-element { + leaf id { + type string; + } + choice element { + description "affinity element"; + case affinity-endpoint { + uses affinity-endpoint; + } + + case affinity-address-domain { + uses affinity-address-domain; + } + } + } + //************************************************** + // Affinity group + //************************************************** grouping affinity-group { - leaf id { - type string; - } - list affinity-element { - key id; - uses affinity-element; - } + leaf id { + type string; + } + list affinity-element { + key id; + uses affinity-element; + } } //************************************************** @@ -107,63 +121,67 @@ module affinity-config-all { // affinity links, one in each direction. //************************************************** grouping affinity-link { - leaf id { - type string; - } - leaf from-affinity-group { - type affinity-group-ref; - } - leaf to-affinity-group { - type affinity-group-ref; - } - container attribute { - uses affinity-attribute; - } + leaf id { + type string; + } + leaf from-affinity-group { + type affinity-group-ref; + } + leaf to-affinity-group { + type affinity-group-ref; + } + container attribute { + uses affinity-attribute; + } } typedef affinity-access-control-type { - type enumeration { - enum permit; - enum deny; - } + type enumeration { + enum permit; + enum deny; + } } //************************************************** // Affinity attribute. Each is expanded in their own grouping construct below. //************************************************** grouping affinity-attribute { - leaf id { - type string; - } - choice attribute-type { - description "affinity attribute"; - // Apply access control to selected flows. - case affinity-access-control { - leaf affinity-access-control { - type affinity-access-control-type; - } - } - - // Apply waypoint routing to the selected flows and send it through service chain. - case network-service-chain { - leaf network-service-chain { - type network-service-chain-ref; - } - } - } + leaf id { + type string; + } + choice attribute-type { + description "affinity attribute"; + // Apply access control to selected flows. + case affinity-access-control { + leaf affinity-access-control { + type affinity-access-control-type; + } + } + + // Apply waypoint routing to the selected flows and send it through service chain. + case network-service-chain { + leaf network-service-chain { + type network-service-chain-ref; + } + } + } } //************************************************** // Network service chain configuration. //************************************************** + typedef network-service-chain-ref { + type instance-identifier; + } + grouping network-service-chain { - leaf id { - type string; - } - list service-chain { - key id; - uses network-service-function; - } + leaf id { + type string; + } + list service-chain { + key id; + uses network-service-function; + } } //************************************************** @@ -171,18 +189,18 @@ module affinity-config-all { // types of addresses. //************************************************** grouping network-service-function { - leaf id { - type string; - } - // Address is either an IP address, MAC address, or switch/port. - leaf location { - description "Mac or Inet address"; - type union { - type inv:node-connector-id; - type yang:mac-address; - type inet:ip-address; - } - } + leaf id { + type string; + } + // Address is either an IP address, MAC address, or switch/port. + leaf location { + description "Mac or Inet address"; + type union { + type inv:node-connector-id; + type yang:mac-address; + type inet:ip-address; + } + } } // Main container that represents the complete set of affinity @@ -190,18 +208,79 @@ module affinity-config-all { // as the key. List contains affinity group and affinity link objects // defined above. container affinity-config { - list affinity-group { - key id; - ext:context-instance "affinity-group-context"; - uses affinity-group; - } - list affinity-link { - key id; - ext:context-instance "affinity-link-context"; - uses affinity-link; - } + list affinity-group { + key id; + ext:context-instance "affinity-group-context"; + uses affinity-group; + } + list affinity-link { + key id; + ext:context-instance "affinity-link-context"; + uses affinity-link; + } + } + + //****************************** + // RPCs to create affinity groups, add endpoints and address domains. + //****************************** + rpc create-affinity-group { + input { + uses affinity-group; + } + output { + leaf status { + type string; + } + } + } + + rpc add-affinity-endpoint { + input { + leaf affinity-endpoint { + type inv:node-connector-id; + } + } + output { + leaf status { + type string; + } + } } + rpc add-affinity-domain { + input { + container affinity-domain { + uses affinity-address-domain; + } + } + output { + leaf status { + type string; + } + } + } + + rpc get-affinity-groups { + output { + list affinity-group { + key id; + uses affinity-group; + } + } + } + rpc get-affinity-links; + rpc get-affinity-group; + rpc get-affinity-link; + + rpc get-stats-per-affinity-link; + + //************************************************** + // Notifications + //************************************************** + notification new-affinity-endpoint; + notification new-affinity-domain; + notification modify-affinity-attribute; + } -- 2.36.6