1 module affinity-config {
2 namespace "urn:opendaylight:affinity";
5 import ietf-inet-types { prefix inet; }
6 import ietf-yang-types { prefix yang; }
7 import yang-ext { prefix ext; }
8 import opendaylight-inventory {prefix inv;}
9 import opendaylight-l2-types { prefix l2types; }
11 revision "2013-09-25" {
12 description "Initial revision of affinity model to be reviewed";
16 //**************************************************
17 // Switch + port. Access port on a physical switch.
18 // Includes access port on a hypervisor ovswitch to which a VM is connected.
19 //**************************************************
22 type inv:node-connector-id;
26 //**************************************************
27 // Affinity address domain: This represents a domain (i.e, set) of one or
28 // more addresses. An affinity address may not always have a corresponding
29 // endpoint on the network, for example, an address domain representing
30 // external addresses, or north-south traffic in a data center). Here the
31 // IP address domain representing such external addresses does not map to
32 // endpoints or node connectors on the network.
34 // Affinity address domains specify one or more of the following:
35 // layer 2 address (vlan + mac range)
36 // layer 3 address (IP prefix)
37 //**************************************************
39 grouping address-domain {
40 // l2-domain-address is vlan + MAC address range
41 container l2-address {
45 container mac-address-range {
46 uses mac-address-range;
50 // l3-domain-address is IPv4 prefix
52 type inet:ipv4-prefix;
56 grouping mac-address-range {
58 type yang:mac-address;
61 type yang:mac-address;
66 type instance-identifier;
70 type instance-identifier;
78 description "affinity element";
88 //**************************************************
90 //**************************************************
101 //**************************************************
102 // Affinity link connects one group (from group) to another (to
103 // group). It represents a set of flows that start from the source group
104 // and end in the destination group. An affinity link has attributes
105 // (policies) attached to it that represent how these flows must be
106 // handled. An affinity link also has directionality associated with
107 // it. A bidirectional affinity link is equivalent to two unidirectional
108 // affinity links, one in each direction.
109 //**************************************************
120 container attribute {
125 grouping access-control-rule {
127 type string; // "tcp" or "udp"
130 type inet:port-number;
132 // permit flag - false here means no access to be allowed for
133 // flows in the affinity link matching the traffic spec.
139 grouping access-control {
142 uses access-control-rule;
146 //**************************************************
147 // Affinity attribute. Each is expanded in their own grouping construct below.
148 //**************************************************
149 // Various types of affinity topologies. Used in union 'attribute'.
151 // Affinity attribute.
156 choice attribute-type {
157 description "affinity attribute";
159 container isolate-path {
164 container shortest-path {
168 case bandwidth-optimized-path {
169 container bandwidth-optimized-path {
170 uses bandwidth-optimized-path;
173 // Redirect through service chain.
176 type network-service-chain-ref;
179 // Apply access control to selected flows.
180 case access-control {
181 container access-control {
189 // Isolate flows according to certain constraints.
190 grouping isolate-path {
191 leaf max-flows-per-link {
199 // Route through shortest path
200 grouping shortest-path {
201 leaf max-flows-per-link {
209 // bandwidth optimized path
210 grouping bandwidth-optimized-path {
211 leaf max-link-oversubscription-percent {
219 //**************************************************
220 // Network service chain configuration.
221 //**************************************************
222 typedef network-service-chain-ref {
223 type instance-identifier;
226 grouping network-service-chain {
232 uses network-service-function;
236 //**************************************************
237 // Network-service-function represented by one of the following
238 // types of addresses.
239 //**************************************************
240 grouping network-service-function {
244 // Address is either an IP address, MAC address, or switch/port.
246 description "Mac or Inet address";
248 type inv:node-connector-id;
249 type yang:mac-address;
250 type inet:ip-address;
255 // Main container that represents the complete set of affinity
256 // groups and links. Each set is represented as a YANG list with 'id'
257 // as the key. List contains affinity group and affinity link objects
262 ext:context-instance "group-context";
267 ext:context-instance "link-context";
272 //******************************
273 // RPCs to create affinity groups, add endpoints and address domains.
274 //******************************
289 type inv:node-connector-id;
324 rpc get-stats-per-link;
326 //**************************************************
328 //**************************************************
329 notification new-endpoint;
330 notification new-domain;
331 notification modify-attribute;