blob: 3a70d5ea4a835657d3ec14f6caad6cefac3144ea [file] [log] [blame]
Thomas Vachuska6655bee2017-08-24 16:12:59 -07001module openconfig-spanning-tree {
2
3 yang-version "1";
4
5 // namespace
6 namespace "http://openconfig.net/yang/spanning-tree";
7
8 prefix "oc-stp";
9
10 import openconfig-spanning-tree-types { prefix oc-stp-types; }
11 import openconfig-interfaces { prefix oc-if; }
12 import openconfig-types { prefix oc-types; }
13 import openconfig-vlan-types { prefix oc-vlan-types; }
14 import openconfig-yang-types { prefix oc-yang; }
15 import openconfig-extensions { prefix oc-ext; }
16
17
18 // meta
19 organization "OpenConfig working group";
20
21 contact
22 "OpenConfig working group
23 www.openconfig.net";
24
25 description
26 "This module defines configuration and operational state data
27 for the spanning tree protocol.";
28
29 oc-ext:openconfig-version "0.2.0";
30
31 revision "2017-07-14" {
32 description
33 "Migrated to OpenConfig types; fixed missing applied state
34 in rapid-pvst";
35 reference "0.2.0";
36 }
37
38 revision "2016-10-03" {
39 description
40 "Initial public revision";
41 reference "0.1.0";
42 }
43
44
45 // identity statements
46
47
48 // grouping statements
49
50 grouping stp-interfaces-state {
51 description
52 "Grouping of STP operational data for bridge port";
53
54 leaf port-num {
55 type uint16;
56 description
57 "The port number of the bridge port";
58 reference "RFC4188 BRIDGE-MIB dot1dStpPort";
59 }
60
61 leaf role {
62 type identityref {
63 base oc-stp-types:STP_PORT_ROLE;
64 }
65 description
66 "The current role of the bridge port";
67 reference
68 "IEEE8021-MSTP-MIB ieee8021MstpPortRole";
69 }
70
71 leaf port-state {
72 type identityref {
73 base oc-stp-types:STP_PORT_STATE;
74 }
75 description
76 "The current state of the bridge port";
77 reference "RFC4188 BRIDGE-MIB dot1dStpPortState";
78 }
79
80 leaf designated-root-priority {
81 type oc-stp-types:stp-bridge-priority-type;
82 description
83 "The bridge priority of the bridge recorded as the
84 root in the configuration BPDUs transmitted by the designated
85 bridge for the segment to which the port is attached";
86 reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedRoot";
87 }
88
89 leaf designated-root-address {
90 type oc-yang:mac-address;
91 description
92 "The bridge address of the bridge recorded as the
93 root in the configuration BPDUs transmitted by the designated
94 bridge for the segment to which the port is attached";
95 reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedRoot";
96 }
97
98 leaf designated-cost {
99 type uint32;
100 description
101 "The path cost of the Designated Port of the
102 segment connected to this port";
103 reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedCost";
104 }
105
106 leaf designated-bridge-priority {
107 type oc-stp-types:stp-bridge-priority-type;
108 description
109 "The bridge priority of the bridge that this port considers
110 to be the designated bridge for this port's segment.";
111 reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedBridge";
112 }
113
114 leaf designated-bridge-address {
115 type oc-yang:mac-address;
116 description
117 "The bridge address of the bridge that this port considers
118 to be the designated bridge for this port's segment.";
119 reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedBridge";
120 }
121
122 leaf designated-port-priority {
123 type oc-stp-types:stp-port-priority-type;
124 description
125 "The Port priority of the port on the Designated
126 Bridge for this port's segment, two octet string";
127 reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedPort";
128 }
129
130 leaf designated-port-num {
131 type uint16;
132 description
133 "The Port number of the port on the Designated
134 Bridge for this port's segment, two octet string";
135 reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedPort";
136 }
137
138 leaf forward-transisitions {
139 type oc-yang:counter64;
140 description
141 "The number of times this port has transitioned
142 from the Learning state to the Forwarding state";
143 reference "RFC4188 BRIDGE-MIB dot1dStpPortForwardTransitions";
144 }
145
146 container counters {
147 description
148 "The BPDU packet transmition statistics";
149
150 leaf bpdu-sent {
151 type oc-yang:counter64;
152 description
153 "The number of BPDU packet sent";
154 }
155
156 leaf bpdu-received {
157 type oc-yang:counter64;
158 description
159 "The number of BPDU packet received";
160 }
161 }
162 }
163
164 grouping stp-interfaces-config {
165 description
166 "Grouping of STP configuration for bridge port";
167
168 leaf name {
169 type oc-if:base-interface-ref;
170 description
171 "Reference to the STP ethernet interface";
172 }
173
174 leaf cost {
175 type uint32 {
176 range 1..200000000;
177 }
178 description
179 "The port's contribution, when it is the Root Port,
180 to the Root Path Cost for the Bridge";
181 reference
182 "IEEE 802.1D 17.13.11 PortPathCost";
183 }
184
185 leaf port-priority {
186 type oc-stp-types:stp-port-priority-type;
187 description
188 "The manageable component of the Port Identifier,
189 also known as the Port Priority";
190 reference
191 "IEEE 802.1D 17.13.10 Port Identifier Priority";
192 }
193 }
194
195 grouping stp-interfaces-top {
196 description
197 "Grouping of STP configuration and operation data for
198 bridge port";
199
200 container interfaces {
201 description
202 "Enclosing container for the list of interface references";
203
204 list interface {
205 key "name";
206 description
207 "List of interfaces on which STP is enable";
208
209 leaf name {
210 type leafref {
211 path "../config/name";
212 }
213 description
214 "Reference to the list key";
215 }
216
217 container config {
218 description
219 "Configuration data for STP on each interface";
220
221 uses stp-interfaces-config;
222 }
223
224 container state {
225
226 config false;
227
228 description
229 "Operational state data for STP on each interface";
230
231 uses stp-interfaces-config;
232 uses stp-interfaces-state;
233 }
234 }
235 }
236 }
237
238 grouping bridge-priority-config {
239 description
240 "Grouping for bridge priority";
241
242 leaf bridge-priority {
243 type oc-stp-types:stp-bridge-priority-type;
244 description
245 "The manageable component of the Bridge Identifier";
246 reference
247 "IEEE 802.1D 17.13.7 Bridge Identifier Priority";
248 }
249 }
250
251 grouping stp-common-state {
252 description
253 "Grouping for common STP operation data";
254
255 leaf bridge-address {
256 type oc-yang:mac-address;
257 description
258 "A unique 48-bit Universally Administered MAC Address
259 assigned to the bridge";
260 reference
261 "IEEE 802.1D 7.12.5 Unique identification of a bridge";
262 }
263
264 leaf designated-root-priority {
265 type oc-stp-types:stp-bridge-priority-type;
266 description
267 "The bridge priority of the root of the spanning
268 tree, as determined by the Spanning Tree Protocol,
269 as executed by this node";
270 reference
271 "RFC4188 BRIDGE-MIB dot1dStpDesignatedRoot";
272 }
273
274 leaf designated-root-address {
275 type oc-yang:mac-address;
276 description
277 "The bridge address of the root of the spanning
278 tree, as determined by the Spanning Tree Protocol,
279 as executed by this node";
280 reference
281 "RFC4188 BRIDGE-MIB dot1dStpDesignatedRoot";
282 }
283
284 leaf root-port {
285 type uint16;
286 description
287 "The port number of the port which offers the lowest
288 cost path from this bridge to the root bridge";
289 reference
290 "RFC4188 BRIDGE-MIB dot1dStpRootPort";
291 }
292
293 leaf root-cost {
294 type uint32;
295 description
296 "The cost of the path to the root as seen from this bridge";
297 reference
298 "RFC4188 BRIDGE-MIB dot1dStpRootCost";
299 }
300
301 leaf hold-time {
302 type uint8;
303 description
304 "This time value determines the interval length
305 during which no more than two Configuration bridge
306 PDUs shall be transmitted by this node";
307 reference
308 "RFC4188 BRIDGE-MIB dot1dStpHoldTime";
309 }
310
311 leaf topology-changes {
312 type oc-yang:counter64;
313 description
314 "The total number of topology changes detected by
315 this bridge since the management entity was last
316 reset or initialized";
317 reference
318 "RFC4188 BRIDGE-MIB dot1dStpTopChanges";
319 }
320
321 leaf time-since-topology-change {
322 type oc-types:timeticks64;
323 description
324 "The time (in hundredths of a second) since the
325 last time a topology change was detected by the
326 bridge entity
327
328 The value is the timestamp in seconds relative to
329 the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
330 reference
331 "RFC4188 BRIDGE-MIB dot1dStpTimeSinceTopologyChange";
332 }
333 }
334
335 grouping stp-timer-config {
336 description
337 "Grouping for common STP parameters";
338
339 leaf hello-time {
340 type uint8 {
341 range 1..10;
342 }
343 units "seconds";
344 description
345 "The interval between periodic transmissions of
346 configuration messages by designated ports";
347 reference
348 "IEEE 802.1D 17.13.6 Bridge Hello Time";
349 }
350
351 leaf max-age {
352 type uint8 {
353 range 6..40;
354 }
355 units "seconds";
356 description
357 "The maximum age of the information transmitted by the
358 bridge when it is the root bridge";
359 reference
360 "IEEE 802.1D 17.13.8 Bridge Max Age";
361 }
362
363 leaf forwarding-delay {
364 type uint8 {
365 range 4..30;
366 }
367 units "seconds";
368 description
369 "The delay used by STP bridges to transition root and
370 designated ports to forwarding";
371 reference
372 "IEEE 802.1D 17.13.5 Bridge Forward Delay";
373 }
374
375 leaf hold-count {
376 type uint8 {
377 range 1..10;
378 }
379 default 6;
380 description
381 "the maximum number of BPDUs per second that the
382 switch can send from an interface";
383 reference
384 "IEEE 802.1D 17.13.12 Transmit Hold Count";
385 }
386 }
387
388 grouping stp-rapid-pvst-config {
389 description
390 "Configuration parameters relating to rapid PVST";
391
392 leaf vlan-id {
393 type oc-vlan-types:vlan-id;
394 description
395 "Interface VLAN ID";
396 }
397 }
398
399 grouping stp-rapid-pvst-top {
400 description
401 "Top grouping for rapid per vlan spanning tree configuration
402 and operation data";
403
404 list vlan {
405 key "vlan-id";
406 description
407 "List of the vlans";
408
409 leaf vlan-id {
410 type leafref {
411 path "../config/vlan-id";
412 }
413 description
414 "Reference to the list key";
415 }
416
417 container config {
418 description
419 "Configuration data for each vlan";
420
421 uses stp-rapid-pvst-config;
422 uses stp-timer-config;
423 uses bridge-priority-config;
424 }
425
426 container state {
427 config false;
428 description
429 "Operational data for each vlan";
430
431 uses stp-rapid-pvst-config;
432 uses stp-timer-config;
433 uses bridge-priority-config;
434 uses stp-common-state;
435 }
436
437 uses stp-interfaces-top;
438 }
439 }
440
441 grouping mst-instance-config {
442 description
443 "Grouping for mstp instance configuration";
444
445 leaf mst-id {
446 type uint16 {
447 range "1..4094";
448 }
449 description
450 "In an MSTP Bridge, an MSTID, i.e., a value used to identify
451 a spanning tree (or MST) instance.";
452 reference
453 "IEEE8021-TC-MIB IEEE8021MstIdentifier";
454 }
455
456 leaf-list vlan {
457 type union {
458 type oc-vlan-types:vlan-id;
459 type oc-vlan-types:vlan-range;
460 }
461 description
462 "list of vlans mapped to the MST instance";
463 }
464 }
465
466 grouping mst-instance-top {
467 description
468 "Top level grouping for mstp instances";
469
470 list mst-instance {
471 key "mst-id";
472 description
473 "List of the mstp instances";
474
475 leaf mst-id {
476 type leafref {
477 path "../config/mst-id";
478 }
479 description
480 "Reference to the list key";
481 }
482
483 container config {
484 description
485 "Configuration data for MSTP instance";
486
487 uses mst-instance-config;
488 uses bridge-priority-config;
489 }
490
491 container state {
492 config false;
493
494 description
495 "Operational data for MSTP instance";
496
497 uses mst-instance-config;
498 uses bridge-priority-config;
499 uses stp-common-state;
500 }
501
502 uses stp-interfaces-top;
503 }
504 }
505
506 grouping mstp-config {
507 description
508 "Grouping for MSTP configuration data";
509
510 leaf name {
511 type string {
512 length "1..32";
513 }
514 description
515 "The Configuration Name in the MST Configuration Identifier";
516 reference
517 "IEEE 802.1Q 13.8 MST Configuration Identifier (MCID)";
518 }
519
520 leaf revision {
521 type uint32;
522 description
523 "The Revision Level in the MST Configuration Identifier";
524 reference
525 "IEEE 802.1Q 13.8 MST Configuration Identifier";
526 }
527
528 leaf max-hop {
529 type uint8 {
530 range 1..255;
531 }
532 description
533 "The max hop determines the number of bridges in an MST
534 region that a BPDU can traverse before it is discarded";
535 reference
536 "IEEE 802.1Q 13.26.4 BridgeTimes";
537 }
538
539 uses stp-timer-config;
540 }
541
542 grouping mstp-state {
543 description
544 "Operational state data for MSTP";
545 }
546
547 grouping stp-mstp-top {
548 description
549 "Top grouping for MSTP configuration and operation data";
550
551 container config {
552 description
553 "Configuration data for MSTP";
554
555 uses mstp-config;
556 }
557
558 container state {
559 config false;
560
561 description
562 "Operational data for MSTP";
563
564 uses mstp-config;
565 uses mstp-state;
566 }
567
568 container mst-instances {
569 description
570 "Configuration and operation data for MSTP instances";
571
572 uses mst-instance-top;
573 }
574 }
575
576 grouping stp-rstp-top {
577 description
578 "Top grouping for RSTP configuration and operation data";
579
580 container config {
581 description
582 "Configuration data for RSTP";
583
584 uses stp-timer-config;
585 uses bridge-priority-config;
586 }
587
588 container state {
589 config false;
590
591 description
592 "Operational state data for RSTP";
593
594 uses stp-timer-config;
595 uses bridge-priority-config;
596 uses stp-common-state;
597 }
598
599 uses stp-interfaces-top;
600 }
601
602 grouping stp-interface-common-config {
603 description
604 "Configuration data for interface specific STP features";
605
606 leaf name {
607 type oc-if:base-interface-ref;
608 description
609 "Reference to the STP Ethernet interface";
610 }
611
612 leaf edge-port {
613 type identityref {
614 base oc-stp-types:STP_EDGE_PORT;
615 }
616 description
617 "Configure the edge port state";
618 }
619
620 leaf link-type {
621 type oc-stp-types:stp-link-type;
622 description
623 "specifies the interface's link type";
624 }
625
626 leaf guard {
627 type oc-stp-types:stp-guard-type;
628 description
629 "Enable root guard or loop guard";
630 }
631
632 uses stp-bpdu-config;
633
634 }
635
636 grouping stp-interface-common-state {
637 description
638 "Operational state data for STP on interfaces";
639 }
640
641 grouping stp-interface-common-top {
642 description
643 "Top-level grouping for interface specific STP features";
644
645 list interface {
646 key "name";
647 description
648 "List of interfaces on which STP is enable";
649
650 leaf name {
651 type leafref {
652 path "../config/name";
653 }
654 description
655 "Reference to the list key";
656 }
657
658 container config {
659 description
660 "Configuration data for STP on each bridge port";
661
662 uses stp-interface-common-config;
663 }
664
665 container state {
666
667 config false;
668
669 description
670 "Operational state data for STP on each bridge port";
671
672 uses stp-interface-common-config;
673 uses stp-interface-common-state;
674 }
675 }
676 }
677
678 grouping stp-bpdu-config {
679 description
680 "Grouping for STP BPDU configuration";
681
682 leaf bpdu-guard {
683 type boolean;
684 description
685 "Enable edge port BPDU guard";
686 }
687
688 leaf bpdu-filter {
689 type boolean;
690 description
691 "Enable edge port BPDU filter";
692 }
693 }
694
695 grouping stp-global-config {
696 description
697 "Global spanning tree configuration";
698
699 leaf-list enabled-protocol {
700 type identityref {
701 base oc-stp-types:STP_PROTOCOL;
702 }
703 description
704 "List of the spanning tree protocols enabled on the
705 device";
706 }
707
708 leaf bridge-assurance {
709 type boolean;
710 description
711 "Enable bridge assurance to protect against unidirectional
712 link failure";
713 }
714
715 leaf etherchannel-misconfig-guard {
716 type boolean;
717 description
718 "EtherChannel guard detects a misconfigured EtherChannel
719 when interfaces on the switch are configured as an
720 EtherChannel while interfaces on the other device are not
721 or when not all the interfaces on the other device are in
722 the same EtherChannel.";
723 }
724
725 leaf bpduguard-timeout-recovery {
726 type uint8;
727 units "seconds";
728 description
729 "Amount of time, in seconds, the interface receiving BPDUs
730 is disabled. Once the timeout expires, the interface is
731 brought back into service.";
732 }
733
734 leaf loop-guard {
735 type boolean;
736 description
737 "The loop guard default setting for the bridge";
738 }
739
740 uses stp-bpdu-config;
741
742 }
743
744 grouping stp-global-state {
745 description
746 "Global operational state for STP";
747 }
748
749 grouping stp-global-base {
750 description
751 "Grouping for global spanning tree data";
752
753 container config {
754 description
755 "Global spanning tree configuration";
756 uses stp-global-config;
757 }
758
759 container state {
760 config false;
761
762 description
763 "Global spanning tree state";
764 uses stp-global-config;
765 uses stp-global-state;
766 }
767 }
768
769 grouping stp-top {
770 description
771 "Top-level grouping for spanning-tree model";
772
773 container stp {
774 description
775 "Top-level container for spanning tree configuration and
776 state data";
777
778 container global {
779 description
780 "Global configuration and state data";
781
782 uses stp-global-base;
783 }
784
785 container rstp {
786
787 description
788 "Rapid Spanning-tree protocol configuration and operation
789 data";
790
791 uses stp-rstp-top;
792 }
793
794 container mstp {
795 description
796 "Multi Spanning-tree protocol configuration and operation
797 data";
798
799 uses stp-mstp-top;
800 }
801
802 container rapid-pvst {
803 description
804 "Rapid per vlan Spanning-tree protocol configuration and
805 operational data";
806
807 uses stp-rapid-pvst-top;
808 }
809
810 container interfaces {
811 description
812 "Enclosing container for the list of interface references";
813
814 uses stp-interface-common-top;
815 }
816 }
817 }
818
819 // data definition statements
820
821 uses stp-top;
822
823}