3 namespace "urn:opendaylight:params:xml:ns:yang:v3po";
6 revision "2016-12-14" {
8 "This revision adds the following new features:
9 - ingress/egress ACLs support
10 - moved ACL definitions to vpp-acl module
11 - updated l2 container constraint (permit IP address on BVI interface)
12 - added PID of vpp process to vpp-state
13 - added support for Loopback interfaces";
16 revision "2015-01-05" {
17 description "Initial revision of v3po model";
23 import ietf-interfaces {
26 import ietf-yang-types {
29 import ietf-inet-types {
42 typedef bridge-domain-ref {
44 path "/vpp/bridge-domains/bridge-domain/name";
47 "This type is used by to reference a bridge domain table";
50 typedef bridged-virtual-interface-ref {
52 path "/if:interfaces/if:interface/l2/bridged-virtual-interface";
55 "This type is used by to reference a bridged virtual interface";
58 identity vxlan-tunnel {
59 base if:interface-type;
63 base if:interface-type;
67 base if:interface-type;
71 base if:interface-type;
75 base if:interface-type;
78 identity l2-fib-action {
79 description "Base identity for l2-fib actions";
82 identity l2-fib-forward {
85 "Forwards packet with configured mac address";
88 identity l2-fib-filter {
91 "Drops packet with configured mac address";
94 typedef l2-fib-action {
98 description "Identifies a specific L2 FIB action";
102 // FIXME: should be in a vxlan-specific model
103 description "VNI used in a VXLAN tunnel";
109 typedef vhost-user-role {
116 identity vxlan-gpe-tunnel {
117 base if:interface-type;
120 typedef vxlan-gpe-vni {
121 description "VNI used in a VXLAN-GPE tunnel";
127 typedef vxlan-gpe-next-protocol {
144 grouping bridge-domain-attributes {
149 "Enable/disable L2 flooding.";
155 "Enable/disable L2 forwarding.";
161 "Enable/disable L2 learning.";
163 leaf unknown-unicast-flood {
167 leaf arp-termination {
172 container arp-termination-table {
173 when "../v3po:arp-termination = 'true'";
175 // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done)
176 list arp-termination-table-entry {
177 key "ip-address phys-address";
179 // FIXME: change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved
180 type inet:ip-address;
183 type yang:phys-address;
189 // TODO express constraints for L2 FIB entries in YANG if possible
190 grouping l2-fib-attributes {
191 container l2-fib-table {
196 type yang:phys-address;
199 leaf outgoing-interface {
202 // mandatory for forward action
203 // FIXME VPP's CLI does not require to set iface id for filter action
204 // VPP's binary api in constrast to CLI does some checks on the iface id value,
205 // so currently it has to be set for all actions
207 "One of interfaces assigned to the FIB table's bridge-domain.";
213 "Static entries cannot be overridden by mac learning.";
219 "L2 FIB action. For filter action, entry must be configured as static.";
221 leaf bridged-virtual-interface {
222 when "../action = 'forward'";
224 config false; // FIXME setting bvi is currently not supported by VPP's binary api
230 grouping tap-interface-base-attributes {
233 pattern "[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*";
238 grouping tap-interface-config-attributes {
240 type yang:phys-address;
242 description "Mac address to be set for the tap interface. Random will be used if not configured";
245 leaf device-instance {
248 description "Custom device instance. Autogenerated will be used if not configured";
252 grouping loopback-interface-base-attributes {
254 type yang:phys-address;
256 description "Mac address of the loopback interface";
260 grouping ethernet-base-attributes {
268 "The size, in octets, of the largest packet that the
269 hardware interface will send and receive.";
273 grouping ethernet-state-attributes {
274 leaf manufacturer-description {
287 grouping vhost-user-interface-base-attributes {
294 type vhost-user-role;
297 description "vhost-user settings";
300 grouping vhost-user-interface-state-attributes {
305 leaf virtio-net-hdr-size {
309 leaf num-memory-regions {
319 grouping vxlan-base-attributes {
320 // FIXME: this should be in an vxlan-specific extension
323 type inet:ip-address;
327 type inet:ip-address;
338 grouping gre-base-attributes {
341 type inet:ip-address;
345 type inet:ip-address;
352 grouping vxlan-gpe-base-attributes {
355 type inet:ip-address;
359 type inet:ip-address;
366 type vxlan-gpe-next-protocol;
376 grouping l2-base-attributes {
378 "Parameters for configuring Layer2 features on interfaces.";
380 choice interconnection {
381 case xconnect-based {
382 leaf xconnect-outgoing-interface {
383 /* Don't allow selection of this interface */
384 must "../../if:name != current()";
385 type if:interface-ref; // todo use interface-state-ref for operational data?
392 type bridge-domain-ref;
395 "Interfaces in a bridge-domain forward packets to other
396 interfaces in the same bridge-domain based on
397 destination mac address.";
399 leaf split-horizon-group {
400 when "../bridge-domain";
404 default 0; //no split horizon group
406 "Interface's split-horizon group. Interfaces in the same
407 bridge-domain and split-horizon group can not forward
408 packets between each other. ";
410 leaf bridged-virtual-interface {
411 when "../bridge-domain";
415 "Interface forward packets in the bridge-domain
416 associated with the BVI.";
422 grouping proxy-arp-attributes {
424 "Parameters for configuring Proxy ARP on interfaces.";
431 type inet:ipv4-address;
434 type inet:ipv4-address;
438 augment /if:interfaces/if:interface {
439 ext:augment-identifier "vpp-interface-augmentation";
441 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
442 // 1. The link between interface type and this augmentation is unclear
443 // 2. Only this augmentation with combination of ifc type is trigger to do something for vpp, what if user only configures base interface stuff ? + We need to get leaves defined by ietf-interfaces when we are processing this augment
444 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
447 when "../if:type = 'v3po:tap'";
448 uses tap-interface-base-attributes;
449 uses tap-interface-config-attributes;
453 presence "Presence of this container indicates loopback nature of the interface";
454 when "../if:type = 'v3po:loopback'";
455 uses loopback-interface-base-attributes;
459 when "../if:type = 'ianaift:ethernetCsmacd'";
460 uses ethernet-base-attributes;
464 // TODO (HONEYCOMB-127): add routing info for oper
472 "Defines VRF tables used for ipv4 and ipv6 traffic";
475 container vhost-user {
476 when "../if:type = 'v3po:vhost-user'";
477 uses vhost-user-interface-base-attributes;
481 when "../if:type = 'v3po:vxlan-tunnel'";
482 uses vxlan-base-attributes;
486 when "../if:type = 'v3po:gre-tunnel'";
487 uses gre-base-attributes;
491 must "bridged-virtual-interface = 'true' or " +
492 "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
493 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
495 uses l2-base-attributes;
498 container vxlan-gpe {
499 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
501 uses vxlan-gpe-base-attributes;
504 container proxy-arp {
505 uses proxy-arp-attributes;
510 uses vpp-acl:acl-base-attributes;
513 uses vpp-acl:acl-base-attributes;
519 uses vpp-acl:ietf-acl-base-attributes;
522 uses vpp-acl:ietf-acl-base-attributes;
531 container bridge-domains {
539 uses bridge-domain-attributes;
540 uses l2-fib-attributes;
543 "bridge-domain configuration";
548 augment /if:interfaces-state/if:interface {
549 ext:augment-identifier "vpp-interface-state-augmentation";
556 when "../if:type = 'v3po:tap'";
557 uses tap-interface-base-attributes;
561 when "../if:type = 'ianaift:ethernetCsmacd'";
562 uses ethernet-base-attributes;
563 uses ethernet-state-attributes;
566 container vhost-user {
567 when "../if:type = 'v3po:vhost-user'";
568 uses vhost-user-interface-base-attributes;
569 uses vhost-user-interface-state-attributes;
573 when "../if:type = 'v3po:vxlan-tunnel'";
574 uses vxlan-base-attributes;
576 container vxlan-gpe {
577 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
579 uses vxlan-gpe-base-attributes;
583 when "../if:type = 'gre-tunnel'";
584 uses gre-base-attributes;
588 must "bridged-virtual-interface = 'true' or " +
589 "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
590 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
592 uses l2-base-attributes;
595 container proxy-arp {
596 uses proxy-arp-attributes;
601 uses vpp-acl:acl-base-attributes;
604 uses vpp-acl:acl-base-attributes;
610 uses vpp-acl:ietf-acl-base-attributes;
613 uses vpp-acl:ietf-acl-base-attributes;
618 augment /if:interfaces-state/if:interface/if:statistics {
619 ext:augment-identifier "vpp-interface-statistics-augmentation";
620 leaf in-errors-no-buf {
623 leaf in-errors-miss {
626 leaf out-discards-fifo-full {
631 container vpp-state {
635 "VPP operational data";
637 container bridge-domains {
638 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
646 uses bridge-domain-attributes;
647 uses l2-fib-attributes;
650 "bridge-domain operational data";
658 leaf build-directory {
670 "PID of the vpp process";
679 typedef interface-status {
690 typedef interface-name-or-index {
697 notification interface-state-change {
699 type interface-name-or-index;
703 type interface-status;
707 type interface-status;
711 notification interface-deleted {
713 type interface-name-or-index;