a66129a540cd9aaa9ad05681c6d872352869f7a6
[ovsdb.git] / southbound / southbound-api / src / main / yang / ovsdb.yang
1 module ovsdb {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:ovsdb";
4     prefix "southbound";
5
6     import network-topology {prefix "topo"; revision-date "2013-10-21"; }
7     import yang-ext { prefix "ext"; }
8     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
9     import overlay { prefix overlay; }
10     import ietf-yang-types { prefix yang; revision-date "2013-07-15";}
11     import opendaylight-l2-types { prefix ethertype; revision-date "2013-08-27";}
12
13     revision "2015-01-05" {
14         description "Initial revision of southbound model";
15     }
16
17     typedef ovsdb-termination-point-ref {
18         description "A reference to an ovsdb termination point";
19         type instance-identifier;
20     }
21
22     typedef ovsdb-bridge-ref {
23         description "A reference to an ovsdb bridge";
24         type instance-identifier;
25     }
26
27     typedef ovsdb-node-ref {
28         description "A reference to an ovsdb node";
29         type instance-identifier;
30     }
31
32     typedef flow-node-ref {
33         description "A reference to a flow node";
34         type instance-identifier;
35     }
36
37     typedef ovsdb-qos-ref {
38         description "A reference to a ovsdb QoS entry";
39         type instance-identifier;
40     }
41
42     typedef ovsdb-queue-ref {
43         description "A reference to an ovsdb queue entry";
44         type instance-identifier;
45     }
46
47     typedef ovsdb-bridge-name {
48         type string;
49     }
50
51     typedef datapath-id {
52         type string {
53           pattern
54             '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}';
55         }
56         description
57           "The datapath-d type represents OpenFlow datapath-id .
58         The canonical representation uses lowercase characters.
59
60         In the value set and its semantics, this type is similar
61         to the MacAddress textual convention of the SMIv2, but with
62         16 extra bits";
63         reference
64           "Openflow 1.3.0 Spec
65            IEEE 802: IEEE Standard for Local and Metropolitan Area
66                 Networks: Overview and Architecture
67            RFC 2579: Textual Conventions for SMIv2";
68     }
69
70     identity datapath-type-base {
71         description "Base identity for all OVSDB datapath types";
72     }
73
74     identity datapath-type-system {
75         description "Datapath type for the kernel datapath";
76         base datapath-type-base;
77     }
78
79     identity datapath-type-netdev {
80         description "Datapath type for the userspace datapath";
81         base datapath-type-base;
82     }
83
84     identity ovsdb-bridge-protocol-base {
85         description "Base identity for all ovsdb-bridge-protocols";
86     }
87
88     identity ovsdb-bridge-protocol-openflow-10 {
89         description "Ovsdb bridge protocol OpenFlow 1.0";
90         base ovsdb-bridge-protocol-base;
91     }
92
93     identity ovsdb-bridge-protocol-openflow-11 {
94         description "Ovsdb bridge protocol OpenFlow 1.1";
95         base ovsdb-bridge-protocol-base;
96     }
97
98     identity ovsdb-bridge-protocol-openflow-12 {
99         description "Ovsdb bridge protocol OpenFlow 1.2";
100         base ovsdb-bridge-protocol-base;
101     }
102
103     identity ovsdb-bridge-protocol-openflow-13 {
104         description "Ovsdb bridge protocol OpenFlow 1.3";
105         base ovsdb-bridge-protocol-base;
106     }
107
108     identity ovsdb-bridge-protocol-openflow-14 {
109         description "Ovsdb bridge protocol OpenFlow 1.4";
110         base ovsdb-bridge-protocol-base;
111     }
112
113     identity ovsdb-bridge-protocol-openflow-15 {
114         description "Ovsdb bridge protocol OpenFlow 1.5";
115         base ovsdb-bridge-protocol-base;
116     }
117
118     identity ovsdb-fail-mode-base {
119         description "Base identity for ovsdb-failmode";
120     }
121
122     identity ovsdb-fail-mode-standalone {
123         description "Identity for ovsdb-failmode standalone";
124         base ovsdb-fail-mode-base;
125     }
126
127     identity ovsdb-fail-mode-secure {
128         description "Identity for ovsdb-failmode standalone";
129         base ovsdb-fail-mode-base;
130     }
131
132     grouping ovsdb-bridge-attributes {
133         leaf bridge-uuid {
134             description "The unique identifier of the bridge";
135             type yang:uuid;
136         }
137         leaf bridge-openflow-node-ref {
138             description "A reference to the openflow node";
139             type instance-identifier;
140         }
141
142         leaf bridge-name {
143             description "The name of the bridge";
144             type ovsdb-bridge-name;
145         }
146         list protocol-entry {
147             key "protocol";
148             leaf protocol {
149                 description "Protocol bridge should seek to speak to its controller";
150                 type identityref {
151                     base ovsdb-bridge-protocol-base;
152                 }
153             }
154         }
155
156         list controller-entry {
157             description "Bridge controller info";
158             key "target";
159             leaf target {
160                 description "Uri telling bridge how to connect to controller";
161                 type inet:uri;
162             }
163             leaf controller-uuid {
164                 description "The unique identifier of the controller";
165                 type yang:uuid;
166             }
167             leaf is-connected {
168                 type boolean;
169             }
170             leaf max_backoff {
171                 description
172                     "Maximum  number  of  milliseconds  to  wait between
173                 connection attempts";
174                 type uint32 {
175                     range "1000..max";
176                 }
177             }
178             leaf inactivity_probe {
179                 description
180                     "Maximum number of milliseconds of idle time on connection
181                 to controller before sending an inactivity probe message.
182                 A value of 0 disables inactivity probes.";
183                 type uint32;
184             }
185
186         }
187
188         leaf datapath-id {
189             description "Datapath-id of the bridge";
190             type datapath-id;
191         }
192
193         leaf datapath-type {
194             description "The datapath type of the bridge";
195             type identityref {
196                 base datapath-type-base;
197             }
198         }
199
200         leaf fail-mode {
201             description "Failmode of the bridge";
202             type identityref {
203                 base ovsdb-fail-mode-base;
204             }
205         }
206
207         leaf flow-node {
208             description "Flow node corresponding to this bridge";
209             type flow-node-ref;
210         }
211
212         leaf managed-by {
213             description "The OVSDB which this bridge belongs to";
214             type ovsdb-node-ref;
215         }
216
217         leaf stp_enable {
218             description
219                 "Enable spanning tree on the bridge. By default, STP is
220                  disabled on bridges";
221             type boolean;
222         }
223
224         list bridge-external-ids {
225             description
226                "Key-value pairs for use by external frameworks that integrate
227             with Open vSwitch.
228
229             external_ids : bridge-id: optional string
230
231             A unique identifier of the bridge. On Citrix XenServer this
232             will commonly be the same as external_ids:xs-network-uuids.
233
234             external_ids : xs-network-uuids: optional string
235
236             Semicolon-delimited set of universally unique identifier(s)
237             for the network with which this bridge is associated on a
238             Citrix XenServer host. The network identifiers are RFC 4122
239             UUIDs as displayed by, e.g., xe network-list.";
240
241             key "bridge-external-id-key";
242             leaf bridge-external-id-key {
243                 description "external-id name/key";
244                 type string;
245                 mandatory true;
246             }
247             leaf bridge-external-id-value {
248                 description "bridge-external-id value";
249                 type string;
250                 mandatory true;
251             }
252         }
253
254         list bridge-other-configs {
255             description
256                "Key-value pairs for configuring rarely used features.
257
258             other_config : hwaddr: optional string
259                An Ethernet address in the form xx:xx:xx:xx:xx:xx to set the
260                hardware address of the local port and influence the datapath
261                ID.
262
263             other_config : forward-bpdu: optional string
264                either true or false. Option to allow forwarding of BPDU frames when NORMAL
265                action is invoked. Frames with reserved Ethernet
266                addresses (e.g. STP BPDU) will be forwarded when this option
267                is enabled and the switch is not providing that functionality.
268
269             other_config : mac-aging-time: optional string
270                containing an integer, at least 1 The maximum number of seconds to retain a
271                MAC learning entry for which no packets have been seen. The
272                default is currently 300 seconds (5 minutes). The value, if
273                specified, is forced into a reasonable range, currently 15
274                   to 3600 seconds.
275
276             other_config : mac-table-size: optional string
277                containing an integer, at least 1 The maximum number of MAC addresses to
278                learn. The default is currently 2048. The value, if
279                specified, is forced into a reasonable range, currently 10
280                to 1,000,000.
281
282             other_config : datapath-id: optional string
283                Exactly 16 hex digits to set the OpenFlow datapath ID to a
284                specific value. May not be all-zero.
285
286             other_config : dp-desc: optional string
287                Human readable description of datapath. It it a maximum
288                256 byte-long free-form string to describe the datapath for
289                debugging purposes.
290
291             other_config : disable-in-band: optional string
292                either true or false
293                If set to true, disable in-band control on the bridge
294                regardless of controller and manager settings.
295
296             other_config : in-band-queue: optional string
297                containing an integer, in range 0 to 4,294,967,295 A queue ID as a
298                nonnegative integer.
299
300              other_config : stp-system-id: optional string
301                 The bridge's STP identifier (the lower 48 bits of the
302                 bridge-id) in the form xx:xx:xx:xx:xx:xx. By default, the
303                 identifier is the MAC address of the bridge.
304
305              other_config : stp-priority: optional string
306                 containing an integer, in range 0 to 65,535 The bridge's relative priority
307                 value for determining the root bridge (the upper 16 bits of
308                 the bridgeid).  A bridge with the lowest bridge-id is elected
309                 the root. By default, the priority is 0x8000.
310
311              other_config : stp-hello-time: optional string
312                 containing an integer, in range 1 to 10 The interval between transmissions
313                 of hello messages by designated ports, in seconds. By default
314                 the hello interval is 2 seconds.
315
316              other_config : stp-max-age: optional string
317                 containing an integer, in range 6 to 40 The maximum age of the information
318                 transmitted by the bridge when it is the root bridge, in
319                 seconds.  By default, the maximum age is 20 seconds.
320
321              other_config : stp-forward-delay: optional string
322                 containing an integer, in range 4 to 30 The delay to wait between
323                 transitioning root and designated ports to forwarding, in
324                 seconds. By default, the forwarding delay is 15 seconds.
325
326              other_config : mcast-snooping-aging-time: optional string,
327                 containing an integer, at least 1 The maximum number of
328                 seconds to retain a multicast snooping entry for which no
329                 packets have been seen. The default is currently 300
330                 seconds (5 minutes). The value, if specified, is forced into
331                 a reasonable range, currently 15 to 3600 seconds.
332
333              other_config : mcast-snooping-table-size: optional string,
334                 containing an integer, at least 1 The maximum number of
335                 multicast snooping addresses to learn. The default is
336                 currently 2048.  The value, if specified, is forced into a
337                 reasonable range, currently 10 to 1,000,000.
338
339              other_config : mcast-snooping-disable-flood-unregistered:
340                 optional string, either true or false If set to false,
341                 unregistered multicast packets are forwarded to all ports.
342                 If set to true, unregistered multicast packets are forwarded
343                 to ports connected to multicast routers.";
344
345             key "bridge-other-config-key";
346             leaf bridge-other-config-key {
347                 description "bridge-other-config name/key";
348                 type string;
349             }
350             leaf bridge-other-config-value {
351                 description "bridge-other-config value";
352                 type string;
353             }
354         }
355
356         leaf auto-attach {
357             description "The unique identifier of the auto_attach entry for this bridge.";
358             type yang:uuid;
359         }
360     }
361
362     grouping ovsdb-connection-info-attributes {
363           leaf remote-ip {
364             type inet:ip-address;
365             description "Ovsdb Connection Remote IP";
366           }
367           leaf remote-port {
368             type inet:port-number;
369             description "Ovsdb Connection Remote Port Number";
370           }
371           leaf local-ip {
372             type inet:ip-address;
373             description "Ovsdb Connection Local IP";
374           }
375           leaf local-port {
376             type inet:port-number;
377             description "Ovsdb Connection Local Port Number IP";
378           }
379     }
380
381     grouping ovsdb-node-attributes {
382         description "Plugin will not allow multiple connections to the same device.
383         If an application attempts to make more than one connection to the device by
384         putting multiple entries in the config data store, then it is the responsibility
385         of the application to clean the config data store";
386         container connection-info{
387             uses ovsdb-connection-info-attributes;
388         }
389
390         leaf db-version {
391             description "The database schema version";
392             type string;
393         }
394
395         leaf ovs-version {
396             description "The Open_vSwitch version number";
397             type string;
398         }
399
400         list managed-node-entry {
401             key "bridge-ref";
402             leaf bridge-ref {
403                 type ovsdb-bridge-ref;
404             }
405         }
406
407         list datapath-type-entry {
408             key "datapath-type";
409             leaf datapath-type {
410                 description "Datapath types supported by OVSDB node";
411                 type identityref {
412                     base datapath-type-base;
413                 }
414             }
415         }
416
417         list interface-type-entry {
418             key "interface-type";
419             leaf interface-type {
420                 description "Interface types supported by OVSDB node";
421                 type identityref {
422                     base interface-type-base;
423                 }
424             }
425         }
426
427         list openvswitch-external-ids {
428             description "Key-value pairs for use by external frameworks that integrate
429                   with Open vSwitch.
430
431             external_ids : system-id: optional string
432                A unique identifier for the Open vSwitch's physical host.
433                The form of the identifier depends on the type of the host.
434                On a Citrix XenServer, this will likely be the same as
435                external_ids:xs-system-uuid.
436
437            external_ids : xs-system-uuid: optional string
438                The Citrix XenServer universally unique identifier for the
439                 physical host as displayed by xe-host-list.";
440
441             key "external-id-key";
442             leaf external-id-key {
443                 description "external-id name/key";
444                 type string;
445                 mandatory true;
446             }
447             leaf external-id-value {
448                 description "external-id value";
449                 type string;
450                 mandatory true;
451             }
452         }
453
454         list openvswitch-other-configs {
455             description "Key-value pairs for configuring rarely used features.
456
457             other_config : stats-update-interval: optional string
458                This option will affect the update of the statistics column
459                in the following tables: Port, Interface , Mirror.
460
461             other_config : flow-restore-wait: optional string
462                either true or false When ovs-vswitchd starts up, it has an empty flow
463                table and therefore it handles all arriving packets in its
464                default fashion according to its configuration, by
465                dropping them or sending them to an OpenFlow controller or
466                switching them as a standalone switch.
467
468             other_config : flow-limit: optional string
469                containing an integer, at least 0. The maximum number of flows allowed in
470                the datapath flow table.
471
472             other_config : n-dpdk-rxqs: optional string
473                containing an integer, at least 1 Specifies the number of rx queues to be
474                created for each dpdk interface. If not specified or
475                specified to 0, one rx queue will be created for each dpdk
476                interface by default.
477
478             other_config : pmd-cpu-mask: optional string
479                Specifies CPU mask for setting the cpu affinity of
480                PMD (Poll Mode Driver) threads. Value should be in the form
481                of hex string, similar to the dpdk EAL '-c COREMASK' option
482                input or the 'taskset' mask input.
483
484             other_config : n-handler-threads: optional string
485                containing an integer, at least 1 Specifies the number of threads for
486                software datapaths to use for handling new flows. The default
487                the number of online CPU cores minus the number of
488                revalidators.
489
490             other_config : n-revalidator-threads: optional string,
491                containing an integer, at least 1 Specifies the number of
492                threads for software datapaths to use for revalidating flows
493                in the datapath.
494
495              other_config : enable-statistics: optional string
496                 either ture or false. Set this value to true to enable populating the
497                 statistics column or to false to explicitly disable it.";
498
499             key "other-config-key";
500             leaf other-config-key {
501                 description "other-config name/key";
502                 type string;
503             }
504             leaf other-config-value {
505                 description "other-config value";
506                 type string;
507             }
508          }
509
510          list manager-entry {
511             description "Node managers info";
512             config false;
513             key "target";
514             leaf target {
515                 description "Uri that user set to connect to the controller";
516                 type inet:uri;
517             }
518             leaf connected {
519                 type boolean;
520             }
521             leaf number_of_connections {
522                 type uint32;
523             }
524         }
525
526         list qos-entries {
527             key "qos-id";
528             leaf qos-id {
529                 description "An identifier used for QoS entries in the MD-SAL.";
530                 type inet:uri;
531             }
532             leaf qos-uuid {
533                 description "The unique identifier of the QoS.";
534                 type yang:uuid;
535             }
536             leaf qos-type {
537                 type identityref {
538                     base qos-type-base;
539                 }
540             }
541             list queue-list {
542                 description "The list of queues used by the QoS";
543                 key "queue-number";
544                 leaf queue-number {
545                     description "The queue number of the record in the QoS entry";
546                     type uint32;
547                 }
548
549                 leaf queue-ref {
550                     description "Instance identifier to a Queue in the MD-SAL.";
551                     type ovsdb-queue-ref;
552                 }
553
554                 leaf queue-uuid {
555                     description "The unique identifier of the queue record.";
556                     type yang:uuid;
557                     status deprecated;
558                 }
559             }
560             list qos-external-ids {
561                 key "qos-external-id-key";
562                 leaf qos-external-id-key {
563                     description "qos external-id name/key";
564                     type string;
565                     mandatory true;
566                 }
567                 leaf qos-external-id-value {
568                     description "qos-external-id value";
569                     type string;
570                     mandatory true;
571                 }
572             }
573             list qos-other-config {
574                 description "
575                     other_config : max-rate
576                         optional string, containing an integer.";
577
578                 key "other-config-key";
579                 leaf other-config-key {
580                     description "qos-other-config name/key";
581                     type string;
582                 }
583                 leaf other-config-value {
584                     description "qos-other-config value";
585                     type string;
586                 }
587             }
588         }
589
590         list queues {
591             key "queue-id";
592             leaf queue-id {
593                 description "An identifier used for Queue entries in the MD-SAL.";
594                 type inet:uri;
595             }
596             leaf queue-uuid {
597                 description "The unique identifier of the queue.";
598                 type yang:uuid;
599             }
600             leaf dscp {
601                 type uint8;
602             }
603             list queues-external-ids {
604                 key "queues-external-id-key";
605                 leaf queues-external-id-key {
606                     description "queues external-id name/key";
607                     type string;
608                     mandatory true;
609                 }
610                 leaf queues-external-id-value {
611                     description "queues-external-id value";
612                     type string;
613                     mandatory true;
614                 }
615             }
616             list queues-other-config {
617                 description "
618                 Configuration for linux-htb QoS:
619
620                 other_config : min-rate optional string
621                     containing an integer, at least 1.
622                     Minimum guaranteed bandwidth, in bit/s.
623
624                 other_config : max-rate optional string
625                     containing an integer, at least 1.
626                     Maximum allowed bandwidth, in bit/s. Optional. If specified, the queue's rate will not be allowed
627                     to exceed the specified value, even if excess bandwidth is available. If unspecified, defaults to no
628                     limit.
629
630                 other_config : burst optional string
631                     containing an integer, at least 1.
632                     Burst size, in bits. This is the maximum amount of ''credits'' that a queue can accumulate while it
633                     is idle. Optional. Details of the linux-htb implementation require a minimum burst size, so a
634                     too-small burst will be silently ignored.
635
636                 other_config : priority optional string.
637                     containing an integer, in range 0 to 4,294,967,295.
638                     A queue with a smaller priority will receive all the excess bandwidth that it can use before a
639                     queue with a larger value receives any. Specific priority values are unimportant; only relative
640                     ordering matters. Defaults to 0 if unspecified.
641
642                 Configuration for linux-htb QoS:
643
644                 other_config : min-rate optional string
645                     containing an integer, at least 1.
646                     Minimum guaranteed bandwidth, in bit/s.
647
648                 other_config : max-rate optional string
649                     containing an integer, at least 1.
650                     Maximum allowed bandwidth, in bit/s. Optional. If specified, the queue's rate will not be allowed
651                     to exceed the specified value, even if excess bandwidth is available. If unspecified, defaults to no
652                     limit..";
653
654                 key "queue-other-config-key";
655                 leaf queue-other-config-key {
656                     type string;
657                 }
658                 leaf queue-other-config-value {
659                     type string;
660                 }
661             }
662         }
663
664         list autoattach {
665             key "autoattach-id";
666             leaf autoattach-id {
667                 description "An identifier used for AutoAttach table in the MD-SAL.";
668                 type inet:uri;
669             }
670             leaf bridge-id {
671                 description "Node-id of the Bridge table from where Autoattach table can be referenced.";
672                 type inet:uri;
673             }
674             leaf autoattach-uuid {
675                 description "The unique identifier of the autoattach table.";
676                 type yang:uuid;
677             }
678             leaf system-name {
679                 type string;
680                 description "The  system_name string is exported in LLDP messages.
681                     It should uniquely identify the bridge in the network.";
682             }
683             leaf system-description {
684                 type string;
685                 description "The system_description string is exported in LLDP messages.
686                     It should describe the type of software and hardware.";
687             }
688             list mappings {
689                 description "Map  of integer-integer pairs, key in range 0 to 16,777,215,
690                     value in range 0 to 4,095. A mapping from SPB network Individual Service
691                     Identifier  (ISID) to VLAN id.";
692                 key "mappings-key";
693                 leaf mappings-key {
694                     type uint32 {
695                         range "0..16777215";
696                     }
697                 }
698                 leaf mappings-value {
699                     type uint16 {
700                         range "0..4095";
701                     }
702                 }
703             }
704             list autoattach-external-ids {
705                 description
706                    "Key-value pairs for use by external frameworks that integrate with
707                     Open vSwitch, rather than by Open vSwitch itself.";
708
709                 key "autoattach-external-id-key";
710                 leaf autoattach-external-id-key {
711                     description "external-id name/key";
712                     type string;
713                     mandatory true;
714                 }
715                 leaf autoattach-external-id-value {
716                     description "autoattach-external-id value";
717                     type string;
718                     mandatory true;
719                 }
720             }
721         }
722      }
723
724     identity interface-type-base {
725         description "Base identity for all OVSDB interface types";
726     }
727
728     identity interface-type-system {
729         description "Interface type for system interfaces";
730         base interface-type-base;
731     }
732
733     identity interface-type-internal {
734         description "Interface type for internal interfaces";
735         base interface-type-base;
736     }
737
738     identity interface-type-vxlan {
739         description "Interface type for vxlan interfaces";
740         base interface-type-base;
741     }
742
743     identity interface-type-vxlan-gpe {
744         description "Interface type for vxlan gpe interfaces";
745         base interface-type-base;
746     }
747
748     identity interface-type-patch {
749         description "Interface type for patch interfaces";
750         base interface-type-base;
751     }
752
753     identity interface-type-tap {
754         description "Interface type for tun/tap interfaces";
755         base interface-type-base;
756     }
757
758     identity interface-type-geneve {
759         description "Interface type for geneve interfaces";
760         base interface-type-base;
761     }
762
763     identity interface-type-gre {
764         description "Interface type for gre interfaces";
765         base interface-type-base;
766     }
767
768     identity interface-type-ipsec-gre {
769         description "Interface type for ipsec-gre interfaces";
770         base interface-type-base;
771     }
772
773     identity interface-type-gre64 {
774         description "Interface type for gre64 interfaces";
775         base interface-type-base;
776     }
777
778     identity interface-type-ipsec-gre64 {
779         description "Interface type for ipsec-gre64 interfaces";
780         base interface-type-base;
781     }
782
783     identity interface-type-lisp {
784         description "Interface type for lisp interfaces";
785         base interface-type-base;
786     }
787
788     identity interface-type-dpdk {
789         description "Interface type for dpdk interfaces";
790         base interface-type-base;
791     }
792
793     identity interface-type-dpdkr {
794         description "Interface type for dpdk ring interfaces";
795         base interface-type-base;
796     }
797
798     identity interface-type-dpdkvhost {
799         description "Interface type for dpdkvhost interfaces";
800         base interface-type-base;
801     }
802
803     identity interface-type-dpdkvhostuser {
804         description "Interface type for dpdkvhostuser interfaces";
805         base interface-type-base;
806     }
807
808     identity interface-type-stt {
809         description "Interface type for stt interfaces";
810         base interface-type-base;
811     }
812
813     identity qos-type-base {
814         description "the base identity for qos";
815     }
816
817     identity qos-type-linux-htb {
818         description "linux hierarchy token bucket classifier";
819         base qos-type-base;
820     }
821
822     identity qos-type-linux-hfsc {
823         description "linux hierarchical fair service curve classifier";
824         base qos-type-base;
825     }
826
827     identity qos-type-linux-sfq {
828         description "linux stochastic fairness queueing classifier";
829         base qos-type-base;
830     }
831
832     identity qos-type-linux-codel {
833         description "linux controlled delay classifier";
834         base qos-type-base;
835     }
836
837     identity qos-type-linux-fq-codel {
838         description "linux fair queueing controlled delay classifier";
839         base qos-type-base;
840     }
841
842     identity qos-type-egress-policer {
843         description "DPDK user space egress policer";
844         base qos-type-base;
845     }
846
847     grouping ovsdb-port-interface-attributes {
848         leaf port-uuid {
849             description "The unique identifier of the OVSDB port";
850             type yang:uuid;
851         }
852
853         leaf interface-uuid {
854             description "The unique identifier of the OVSDB interface";
855             type yang:uuid;
856         }
857
858         leaf name {
859             description "The name of the OVSDB port/interface";
860             type string;
861         }
862
863         leaf ifindex {
864             description "The ifindex is useful for seamless integration with protocols such as SNMP and sFlow.
865                 It is a positive interface index as defined for SNMP MIB-II in RFCs 1213 and 2863 if the interface
866                 has one, otherwise 0. It is a read-only column and an integer in the range 0 to 4,294,967,295";
867             type uint32;
868             config false;
869         }
870
871         leaf interface-type {
872             description "The type of the OVSDB interface";
873             type identityref {
874                 base interface-type-base;
875             }
876         }
877
878         list options {
879             description "Port/Interface related optional input values";
880             key "option";
881             leaf option {
882                 description "Option name";
883                 type string;
884             }
885             leaf value {
886                 description "Option value";
887                 type string;
888             }
889         }
890
891         leaf ofport {
892             description "Port/Interface related optional ofport";
893             type uint32;
894         }
895
896         leaf ofport_request {
897             description "Port/Interface related optional ofport_request, in range 1 to 65279";
898             type uint16 {
899                 range "1..65279";
900             }
901         }
902
903         leaf vlan-tag {
904             description "The VLAN tag of the termination point.";
905             type ethertype:vlan-id;
906         }
907
908         list trunks {
909             description "Represents the trunks of a termination point.";
910             leaf trunk {
911                 type ethertype:vlan-id;
912             }
913         }
914
915         leaf vlan-mode {
916             description "The VLAN mode of the termination point.";
917             type enumeration {
918                 enum "access" {
919                     value 1;
920                     description
921                         "The VLAN mode access.";
922                 }
923                 enum "native-tagged" {
924                     value 2;
925                     description
926                         "The VLAN mode native-tagged.";
927                 }
928                 enum "native-untagged" {
929                     value 3;
930                     description
931                         "The VLAN mode native-untagged.";
932                 }
933                 enum "trunk" {
934                     value 4;
935                     description
936                         "The VLAN mode trunk.";
937                 }
938             }
939         }
940
941         list port-other-configs {
942             description "Other config attributes for Ports
943
944             other_config : priority-tags: optional string
945                either true or false An 802.1Q header contains two important pieces of
946                information: a VLAN ID and a priority.
947
948             other_config : bond-hash-basis: optional string
949                containing an integer An integer hashed along with flows when choosing output
950                slaves in load balanced bonds. When changed, all flows will be
951                assigned different hash values possibly causing slave selection
952                decisions to change.
953
954             other_config : bond-detect-mode: optional string
955                either miimon or carrier The means used to detect link failures. Defaults to
956                carrier which uses each interface's carrier to detect failures.
957                When set to miimon, will check for failures by polling each
958                interface's MII.
959
960             other_config : bond-miimon-interval: optional string
961                containing an integer The interval, in milliseconds, between successive
962                attempts to poll each interface's MII. Relevant only when
963                other_config:bond-detect-mode is miimon
964
965             other_config : lacp-system-id: optional string
966                The LACP system ID of this Port. The system ID of a LACP bond
967                is used to identify itself to its partners. Must be a nonzero
968                MAC address. Defaults to the bridge Ethernet address if unset.
969
970             other_config : lacp-system-priority: optional string
971                containing an integer, in range 1 to 65,535 The LACP system priority of this
972                Port. In LACP negotiations, link status decisions are made by
973                the system with the numerically lower priority.
974
975             other_config : lacp-time: optional string
976                 either slow or fast. The LACP timing which should be used on this Port. By default
977                 slow is used. When configured to be fast LACP heartbeats are
978                 requested at a rate of once per second causing connectivity
979                 problems to be detected more quickly. In slow mode, heartbeats
980                 are requested at a rate of once every 30 seconds.
981
982             other_config : lacp-fallback-ab: optional string
983                 either true or false Determines the behavior of openvswitch bond in LACP mode.
984                 If the partner switch does not support LACP, setting this
985                 option to true allows openvswitch to fallback to active-backup.
986                 If the option is set to false, the bond will be disabled.
987                 In both the cases, once the partner switch is configured
988                 to LACP mode, the bond will use LACP.
989
990             other_config : bond-rebalance-interval: optional string,
991                 containing an integer, in range 0 to 10,000 For a load
992                 balanced bonded port, the number of milliseconds between
993                 successive attempts to rebalance the bond, that is, to move
994                 flows from one interface on the bond to another in an attempt
995                 to keep usage of each interface roughly equal. If zero, load
996                 balancing is disabled on the bond (link failure still cause
997                 flows to move). If less than 1000ms, the rebalance interval
998                 will be 1000ms.
999
1000             other_config : stp-enable: optional string
1001                either true or false. If spanning tree is enabled on the bridge, member ports are
1002                enabled by default (with the exception of bond, internal, and
1003                mirror ports which do not work with STP). If this column's
1004                value is false spanning tree is disabled on the port.
1005
1006             other_config : stp-port-num: optional string
1007                containing an integer, in range 1 to 255 The port number used for the lower 8
1008                bits of the port-id. By default, the numbers will be assigned
1009                automatically. If any port's number is manually configured on
1010                a bridge, then they must all be.
1011
1012             other_config : stp-port-priority: optional string
1013                containing an integer, in range 0 to 255 The port's relative priority value
1014                for determining the root port (the upper 8 bits of the port-id).
1015
1016             other_config : stp-path-cost: optional string
1017                 containing an integer, in range 0 to 65,535 Spanning tree path cost for the
1018                 port. A lower number indicates a faster link. By default, the
1019                 cost is based on the maximum speed of the link.
1020
1021              other_config : rstp-enable: optional string
1022                  either true or false
1023                  If rapid spanning tree is enabled on the bridge, member ports
1024                  are enabled by default (with the exception of bond, internal,
1025                  and mirror ports which do not work with RSTP). If this
1026                  column's value is false rapid spanning tree is disabled on
1027                  the port.
1028
1029              other_config : rstp-port-priority: optional string
1030                  containing an integer, in range 0 to 240 The port's relative priority value
1031                  for determining the root port, in multiples of 16. By default,
1032                  the port priority is 0x80 (128).
1033
1034              other_config : rstp-port-num: optional string
1035                  containing an integer, in range 1 to 4,095 The local RSTP port number, used
1036                  as the lower 12 bits of the port-id.
1037
1038              other_config : rstp-port-path-cost: optional string
1039                  containing an integer The port path cost. The Port's contribution, when it
1040                  is the Root Port, to the Root Path Cost for the Bridge.
1041
1042              other_config : rstp-port-admin-edge: optional string
1043                  either true or false
1044
1045              other_config : rstp-port-auto-edge: optional string
1046                  either true or false The auto edge port parameter for the Port. Default
1047                  is true.
1048
1049              other_config : rstp-port-mcheck: optional string
1050                  either true or false The mcheck port parameter for the Port. Default is false.
1051
1052               other_config : mcast-snooping-flood: optional string
1053                   either true or false If set to true, multicast packets are
1054                   unconditionally forwarded to the specific port";
1055
1056             key "other-config-key";
1057             leaf other-config-key {
1058                 description "port-other-config name/key";
1059                 type string;
1060             }
1061             leaf other-config-value {
1062                 description "port-other-config value";
1063                 type string;
1064             }
1065         }
1066
1067         list interface-other-configs {
1068             description "Other config attributes for Interfaces
1069
1070             other_config : enable-vlan-splinters: optional string
1071                either true or false. Set to true to enable VLAN splinters on this
1072                interface. Defaults to false.";
1073
1074             key "other-config-key";
1075             leaf other-config-key {
1076                 description "interface-other-config name/key";
1077                 type string;
1078             }
1079             leaf other-config-value {
1080                 description "interface-other-config value";
1081                 type string;
1082             }
1083         }
1084
1085         list port-external-ids {
1086             description "Port external ids
1087
1088             external_ids : fake-bridge-id-*: optional string
1089                External IDs for a fake bridge (see the fake_bridge column) are defined by
1090                prefixing a Bridge external_ids key with
1091                fake-bridge-, e.g. fake-bridge-xs-network-uuids.";
1092
1093             key "external-id-key";
1094             leaf external-id-key {
1095                 description "external-id name/key";
1096                 type string;
1097                 mandatory true;
1098             }
1099             leaf external-id-value {
1100                 description "external-id value";
1101                 type string;
1102                 mandatory true;
1103             }
1104         }
1105
1106         list interface-external-ids {
1107             description "Interface external ids
1108
1109             external_ids : attached-mac: optional string.
1110                The MAC address programmed into the ''virtual hardware'' for this interface, in
1111                the form xx:xx:xx:xx:xx:xx. For Citrix XenServer, this is the
1112                value of the MAC field in the VIF record for this interface.
1113
1114             external_ids : iface-id: optional string.
1115                A system-unique identifier for the interface. On XenServer, this will commonly
1116                be the same as external_ids:xs-vif-uuid.
1117
1118             external_ids : iface-status: optional string
1119                either active or inactive Hypervisors may sometimes have more than one interface
1120                associated with a given external_ids:iface-id, only one of
1121                which is actually in use at a given time.
1122
1123             external_ids : xs-vif-uuid: optional string.
1124                The virtual interface associated with this interface.
1125
1126             external_ids : xs-network-uuid: optional string.
1127                The virtual network to which this interface is attached.
1128
1129             external_ids : vm-id: optional string.
1130                The VM to which this interface belongs. On XenServer, this will be the same as
1131                external_ids:xsvm-uuid.
1132
1133             external_ids : xs-vm-uuid: optional string.
1134                The VM to which this interface belongs";
1135
1136             key "external-id-key";
1137             leaf external-id-key {
1138                 description "external-id name/key";
1139                 type string;
1140                 mandatory true;
1141             }
1142             leaf external-id-value {
1143                 description "external-id value";
1144                 type string;
1145                 mandatory true;
1146             }
1147         }
1148
1149         list interface-lldp {
1150             description "Auto Attach configuration for a particular interface.
1151                 If LLDP is enabled on an interface, the interface processes received
1152                 LLDP packets and never passes them to OpenFlow or forwards them.
1153
1154                 lldp : enable: optional string, either true or false
1155                        True to enable LLDP on this Interface. If not specified, LLDP
1156                        will be disabled by default.";
1157
1158             key "lldp-key";
1159             leaf lldp-key {
1160                 description "lldp name/key";
1161                 type string;
1162             }
1163             leaf lldp-value {
1164                 description "lldp value";
1165                 type string;
1166             }
1167         }
1168
1169         list interface-bfd {
1170             description "BFD configuration for a particular interface.
1171                 BFD, defined in RFC 5880 and RFC 5881, allows point-to-point
1172                 detection of connectivity failures by occasional transmission of
1173                 BFD control messages.
1174
1175                 bfd : enable: optional string, either true or false
1176                        True to enable BFD on this Interface. If not specified, BFD
1177                        will be disabled by default.
1178
1179                 bfd : min_rx: optional string
1180                        containing an integer, at least 1.
1181                        The shortest interval, in milliseconds, at which this BFD session
1182                        offers to receive BFD control messages.  The remote endpoint may
1183                        choose to send messages at a slower rate.  Defaults to 1000.
1184
1185                 bfd : min_tx: optional string
1186                        containing an integer, at least 1.
1187                        The shortest interval, in milliseconds, at which this BFD session is
1188                        willing to transmit BFD control messages.  Messages will actually be
1189                        transmitted at a slower rate if the remote endpoint is not willing to
1190                        receive as quickly as specified.  Defaults to 100.
1191
1192                 bfd : decay_min_rx: optional string
1193                        containing an integer
1194                        An alternate receive interval, in milliseconds, that must be greater
1195                        than or equal to bfd:min_rx.  The implementation switches from
1196                        bfd:min_rx to bfd:decay_min_rx when there is no obvious incoming
1197                        data traffic at the interface, to reduce the CPU and bandwidth cost
1198                        of monitoring an idle interface.  This feature may be disabled by
1199                        setting a value of 0. This feature is reset whenever bfd:decay_min_rx
1200                        bfd:min_rx changes.
1201
1202                 bfd : forwarding_if_rx: optional string, either true or false
1203                        When true, traffic received on the Interface is used to
1204                        indicate the capability of packet I/O. BFD control packets are
1205                        still transmitted and received.  At least one BFD control
1206                        packet must be received every 100 * bfd:min_rx amount of time.
1207                        Otherwise, even if traffic are received, the bfd-status:forwarding
1208                        will be false.
1209
1210                 bfd : cpath_down: optional string, either true or false
1211                        Set to true to notify the remote endpoint that traffic should not be
1212                        forwarded to this system for some reason other than a connectivity
1213                        failure on the interface being monitored.  The typical underlying
1214                        reason is concatenated path down, that is, that connectivity
1215                        beyond the local system is down.  Defaults to false.
1216
1217                 bfd : cpath_down: optional string, either true or false
1218                        Set to true to notify the remote endpoint that traffic should not be
1219                        forwarded to this system for some reason other than a connectivity
1220                        failure on the interface being monitored.  The typical underlying
1221                        reason is concatenated path down, that is, that connectivity
1222                        beyond the local system is down.  Defaults to false.
1223
1224                 bfd : check_tnl_key: optional string, either true or false
1225                        Set to true to make BFD accept only control messages with a tunnel
1226                        key of zero.  By default, BFD accepts control messages with any
1227                        tunnel key.
1228
1229                 bfd : bfd_local_dst_mac: optional string, mac address
1230                        Set to an Ethernet address in the form xx:xx:xx:xx:xx:xx
1231                        to set the MAC used as destination for transmitted BFD packets. The
1232                        default is 00:23:20:00:00:01
1233
1234                 bfd : bfd_remote_dst_mac: optional string, mac address
1235                        Set to an Ethernet address in the form xx:xx:xx:xx:xx:xx
1236                        to set the MAC used for checking the destination of received BFD packets.
1237                        Packets with different destination MAC will not be considered as BFD packets.
1238                        If not specified the destination MAC address of received BFD packets
1239                        are not checked.
1240
1241                 bfd : bfd_src_ip: optional string, ip address
1242                        Set to an IPv4 address to set the IP address used as source
1243                        for transmitted BFD packets.  The default is 169.254.1.1
1244
1245                 bfd : bfd_dst_ip: optional string, ip address
1246                        Set to an IPv4 address to set the IP address used as destination
1247                        for transmitted BFD packets.  The default is 169.254.1.0";
1248
1249             key "bfd-key";
1250             leaf bfd-key {
1251                 description "bfd name/key";
1252                 type string;
1253             }
1254             leaf bfd-value {
1255                 description "bfd value";
1256                 type string;
1257             }
1258         }
1259
1260         list interface-bfd-status {
1261             description "BFD status for a particular interface.
1262                 The switch sets key-value pairs in the bfd_status column to
1263                 report the status of BFD on this interface.  When BFD is not
1264                 enabled, with bfd:enable, the switch clears all key-value
1265                 pairs from bfd_status.
1266
1267                 bfd_status : state: optional string, one of [admin_down, down, init, up]
1268                        Reports the state of the BFD session.  The BFD session is fully
1269                        healthy and negotiated if UP.
1270
1271                 bfd_status : forwarding: optional string, true or false
1272                        Reports whether the BFD session believes this Interface
1273                        may be used to forward traffic.  Typically this means
1274                        the local session is signaling UP, and the remote
1275                        system isn't signaling a problem such as concatenated path down.
1276
1277                 bfd_status : diagnostic: optional string
1278                        A diagnostic code specifying the local system's reason for the
1279                        last change in session state. The error messages are defined in
1280                        section 4.1 of [RFC 5880].
1281
1282                 bfd_status : remote_state: optional string, one of [admin_down, down, init, up]
1283                        Reports the state of the remote endpoint's BFD session.
1284
1285                 bfd_status : remote_diagnostic: optional string
1286                        A diagnostic code specifying the remote system's reason for the
1287                        last change in session state. The error messages are defined in
1288                        section 4.1 of [RFC 5880].
1289
1290                 bfd_status : flap_count: optional string,
1291                        containing an integer, minimum 0
1292                        Counts the number of bfd_status:forwarding flaps since start.
1293                        A flap is considered as a change of the bfd_status:forwarding value.";
1294
1295             key "bfd-status-key";
1296             leaf bfd-status-key {
1297                 description "bfd-status name/key";
1298                 type string;
1299             }
1300             leaf bfd-status-value {
1301                 description "bfd-status value";
1302                 type string;
1303             }
1304         }
1305
1306         leaf qos {
1307             description "The unique identifier of the QoS entry for this port.";
1308             status deprecated;
1309             type yang:uuid;
1310         }
1311
1312         list qos-entry {
1313             key "qos-key";
1314             max-elements 1;
1315             leaf qos-key {
1316                 description "Fixed key to reference the QoS entry in MD-SAL.";
1317                 type uint32 {
1318                     range "1..1";
1319                 }
1320                 mandatory true;
1321             }
1322             leaf qos-ref {
1323                 description "Instance identifier of a QoS entry in the MD-SAL.";
1324                 type ovsdb-qos-ref;
1325                 mandatory true;
1326             }
1327         }
1328
1329         leaf ingress-policing-rate {
1330             description "Maximum rate for data received on this interface in kbps.
1331                 Data received faster than this rate is dropped.  Set to 0 (default)
1332                 to disable policing";
1333             type uint32;
1334         }
1335
1336         leaf ingress-policing-burst {
1337             description "Maximum burst size for data received on this interface in kb.
1338                 The default burst size if set to 0 is 1000 kb.  This value has no
1339                 effect if ingress-policing-rate is 0.";
1340             type uint32;
1341         }
1342     }
1343
1344     augment "/topo:network-topology/topo:topology/topo:node" {
1345         description "Augmentation for bridge nodes managed by ovsdb";
1346         ext:augment-identifier "ovsdb-bridge-augmentation";
1347         uses ovsdb-bridge-attributes;
1348     }
1349
1350     augment "/topo:network-topology/topo:topology/topo:node" {
1351         description "Augment topology node for an ovsdb node";
1352         ext:augment-identifier "ovsdb-node-augmentation";
1353         uses ovsdb-node-attributes;
1354     }
1355
1356     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
1357         description "Augment topology node termination-point for an ovsdb port/interface";
1358         ext:augment-identifier "ovsdb-termination-point-augmentation";
1359         uses ovsdb-port-interface-attributes;
1360     }
1361 }