3 namespace "urn:opendaylight:params:xml:ns:yang:v3po";
6 revision "2015-01-05" {
7 description "Initial revision of v3po model";
13 import ietf-interfaces {
16 import ietf-yang-types {
19 import ietf-inet-types {
28 import vpp-classifier {
29 prefix "vpp-classifier";
31 import ietf-access-control-list {
35 typedef bridge-domain-ref {
37 path "/vpp/bridge-domains/bridge-domain/name";
40 "This type is used by to reference a bridge domain table";
43 typedef bridged-virtual-interface-ref {
45 path "/if:interfaces/if:interface/l2/bridged-virtual-interface";
48 "This type is used by to reference a bridged virtual interface";
51 identity vxlan-tunnel {
52 base if:interface-type;
56 base if:interface-type;
60 base if:interface-type;
64 base if:interface-type;
67 identity l2-fib-action {
68 description "Base identity for l2-fib actions";
71 identity l2-fib-forward {
74 "Forwards packet with configured mac address";
77 identity l2-fib-filter {
80 "Drops packet with configured mac address";
83 typedef l2-fib-action {
87 description "Identifies a specific L2 FIB action";
91 // FIXME: should be in a vxlan-specific model
92 description "VNI used in a VXLAN tunnel";
98 typedef vhost-user-role {
105 identity vxlan-gpe-tunnel {
106 base if:interface-type;
109 typedef vxlan-gpe-vni {
110 description "VNI used in a VXLAN-GPE tunnel";
116 typedef vxlan-gpe-next-protocol {
133 typedef interface-mode {
140 grouping bridge-domain-attributes {
145 "Enable/disable L2 flooding.";
151 "Enable/disable L2 forwarding.";
157 "Enable/disable L2 learning.";
159 leaf unknown-unicast-flood {
163 leaf arp-termination {
168 container arp-termination-table {
169 when "../v3po:arp-termination = 'true'";
171 // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done)
172 list arp-termination-table-entry {
173 key "ip-address phys-address";
175 // FIXME: change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved
176 type inet:ip-address;
179 type yang:phys-address;
185 // TODO express constraints for L2 FIB entries in YANG if possible
186 grouping l2-fib-attributes {
187 container l2-fib-table {
192 type yang:phys-address;
195 leaf outgoing-interface {
198 // mandatory for forward action
199 // FIXME VPP's CLI does not require to set iface id for filter action
200 // VPP's binary api in constrast to CLI does some checks on the iface id value,
201 // so currently it has to be set for all actions
203 "One of interfaces assigned to the FIB table's bridge-domain.";
209 "Static entries cannot be overridden by mac learning.";
215 "L2 FIB action. For filter action, entry must be configured as static.";
217 leaf bridged-virtual-interface {
218 when "../action = 'forward'";
220 config false; // FIXME setting bvi is currently not supported by VPP's binary api
226 grouping tap-interface-base-attributes {
229 pattern "[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*";
234 grouping tap-interface-config-attributes {
236 type yang:phys-address;
238 description "Mac address to be set for the tap interface. Random will be used if not configured";
241 leaf device-instance {
244 description "Custom device instance. Autogenerated will be used if not configured";
248 grouping ethernet-base-attributes {
256 "The size, in octets, of the largest packet that the
257 hardware interface will send and receive.";
261 grouping ethernet-state-attributes {
262 leaf manufacturer-description {
275 grouping vhost-user-interface-base-attributes {
282 type vhost-user-role;
285 description "vhost-user settings";
288 grouping vhost-user-interface-state-attributes {
293 leaf virtio-net-hdr-size {
297 leaf num-memory-regions {
307 grouping vxlan-base-attributes {
308 // FIXME: this should be in an vxlan-specific extension
311 type inet:ip-address;
315 type inet:ip-address;
326 grouping gre-base-attributes {
329 type inet:ip-address;
333 type inet:ip-address;
340 grouping vxlan-gpe-base-attributes {
343 type inet:ip-address;
347 type inet:ip-address;
354 type vxlan-gpe-next-protocol;
364 grouping l2-base-attributes {
366 "Parameters for configuring Layer2 features on interfaces.";
368 choice interconnection {
369 case xconnect-based {
370 leaf xconnect-outgoing-interface {
371 /* Don't allow selection of this interface */
372 must "../../if:name != current()";
373 type if:interface-ref; // todo use interface-state-ref for operational data?
380 type bridge-domain-ref;
383 "Interfaces in a bridge-domain forward packets to other
384 interfaces in the same bridge-domain based on
385 destination mac address.";
387 leaf split-horizon-group {
388 when "../bridge-domain";
392 default 0; //no split horizon group
394 "Interface's split-horizon group. Interfaces in the same
395 bridge-domain and split-horizon group can not forward
396 packets between each other. ";
398 leaf bridged-virtual-interface {
399 when "../bridge-domain";
403 "Interface forward packets in the bridge-domain
404 associated with the BVI.";
410 grouping proxy-arp-attributes {
412 "Parameters for configuring Proxy ARP on interfaces.";
419 type inet:ipv4-address;
422 type inet:ipv4-address;
426 grouping acl-base-attributes {
428 "Defines references to classify tables.
429 At least one table reference should be specified.";
431 leaf classify-table {
432 type vpp-classifier:classify-table-ref;
438 leaf classify-table {
439 type vpp-classifier:classify-table-ref;
445 leaf classify-table {
446 type vpp-classifier:classify-table-ref;
453 grouping ietf-acl-base-attributes {
455 "Provides limited support for ietf-acl model.";
457 container access-lists {
459 "Defines references to ietf-acl lists. Before assignment to interface,
460 ACL lists are merged into 3 type of acls (eth0, ip4 and ip6) that are supported by vpp.
461 Then corresponding tables and sessions are created and assigned to the interface.
463 All ACEs for all assigned ACLs have to use the same packet-handling action (either deny or parmit).
465 Assignment update/delete removes all created tables and sessions and repeats process described above.
466 Update/delete of ACL lists referenced here is not permitted (assignment needs to be removed first).
468 Read is supported only for acls that were created and assigned by Honeycomb agent
469 (corresponding metadata are present).
471 Limitations (due to vpp limitations):
472 - egress rules are currently ignored (HONEYCOMB-234)
473 - L4 rules are currently not supported (limited support will by provided by HONEYCOMB-218)
474 - mixing L2/L3/L4 rules is currently not supported (limited support will by provided by HONEYCOMB-233)
475 - L2 only rules on L3 interfaces are not supported (not allowed by vpp,
476 in the future defining L2/L3 pairs should be partially supported)
477 - vlan tags are supported only for sub-interfaces defined as exact-match";
486 type acl:access-control-list-ref;
494 "The way ACLs are translated depends on the interface mode.
495 In case of L2 interfaces (bridge/interconnection)
496 classify tables are assigned as l2_table using input_acl_set_interface (ether type matching is automatically
497 added in case of L3 rules).
498 In case of L3 interfaces, classify tables are assigned as ip4/ip6 tables.
500 It is the user responsibility to choose mode that matches target interface.
506 augment /if:interfaces/if:interface {
507 ext:augment-identifier "vpp-interface-augmentation";
509 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
510 // 1. The link between interface type and this augmentation is unclear
511 // 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
512 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
515 when "../if:type = 'v3po:tap'";
516 uses tap-interface-base-attributes;
517 uses tap-interface-config-attributes;
521 when "../if:type = 'ianaift:ethernetCsmacd'";
522 uses ethernet-base-attributes;
526 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
532 container vhost-user {
533 when "../if:type = 'v3po:vhost-user'";
534 uses vhost-user-interface-base-attributes;
538 when "../if:type = 'v3po:vxlan-tunnel'";
539 uses vxlan-base-attributes;
543 when "../if:type = 'v3po:gre-tunnel'";
544 uses gre-base-attributes;
548 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
549 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
551 uses l2-base-attributes;
554 container vxlan-gpe {
555 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
557 uses vxlan-gpe-base-attributes;
560 container proxy-arp {
561 uses proxy-arp-attributes;
566 uses acl-base-attributes;
569 uses acl-base-attributes;
575 uses ietf-acl-base-attributes;
578 uses ietf-acl-base-attributes;
587 container bridge-domains {
595 uses bridge-domain-attributes;
596 uses l2-fib-attributes;
599 "bridge-domain configuration";
604 augment /if:interfaces-state/if:interface {
605 ext:augment-identifier "vpp-interface-state-augmentation";
612 when "../if:type = 'v3po:tap'";
613 uses tap-interface-base-attributes;
617 when "../if:type = 'ianaift:ethernetCsmacd'";
618 uses ethernet-base-attributes;
619 uses ethernet-state-attributes;
622 container vhost-user {
623 when "../if:type = 'v3po:vhost-user'";
624 uses vhost-user-interface-base-attributes;
625 uses vhost-user-interface-state-attributes;
629 when "../if:type = 'v3po:vxlan-tunnel'";
630 uses vxlan-base-attributes;
632 container vxlan-gpe {
633 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
635 uses vxlan-gpe-base-attributes;
639 when "../if:type = 'gre-tunnel'";
640 uses gre-base-attributes;
644 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
645 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
647 uses l2-base-attributes;
650 container proxy-arp {
651 uses proxy-arp-attributes;
656 uses acl-base-attributes;
659 uses acl-base-attributes;
665 uses ietf-acl-base-attributes;
668 uses ietf-acl-base-attributes;
673 augment /if:interfaces-state/if:interface/if:statistics {
674 ext:augment-identifier "vpp-interface-statistics-augmentation";
675 leaf in-errors-no-buf {
678 leaf in-errors-miss {
681 leaf out-discards-fifo-full {
686 container vpp-state {
690 "VPP operational data";
692 container bridge-domains {
693 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
701 uses bridge-domain-attributes;
702 uses l2-fib-attributes;
705 "bridge-domain operational data";
713 leaf build-directory {
729 typedef interface-status {
740 typedef interface-name-or-index {
747 notification interface-state-change {
749 type interface-name-or-index;
753 type interface-status;
757 type interface-status;
761 notification interface-deleted {
763 type interface-name-or-index;