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