aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-spanning-tree.yang
blob: 3a70d5ea4a835657d3ec14f6caad6cefac3144ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
module openconfig-spanning-tree {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/spanning-tree";

  prefix "oc-stp";

  import openconfig-spanning-tree-types { prefix oc-stp-types; }
  import openconfig-interfaces { prefix oc-if; }
  import openconfig-types { prefix oc-types; }
  import openconfig-vlan-types { prefix oc-vlan-types; }
  import openconfig-yang-types { prefix oc-yang; }
  import openconfig-extensions { prefix oc-ext; }


  // meta
  organization "OpenConfig working group";

  contact
    "OpenConfig working group
    www.openconfig.net";

  description
    "This module defines configuration and operational state data
    for the spanning tree protocol.";

  oc-ext:openconfig-version "0.2.0";

  revision "2017-07-14" {
    description
      "Migrated to OpenConfig types; fixed missing applied state
      in rapid-pvst";
    reference "0.2.0";
  }

  revision "2016-10-03" {
    description
      "Initial public revision";
    reference "0.1.0";
  }


  // identity statements


  // grouping statements

  grouping stp-interfaces-state {
    description
      "Grouping of STP operational data for bridge port";

    leaf port-num {
      type uint16;
      description
        "The port number of the bridge port";
      reference "RFC4188 BRIDGE-MIB dot1dStpPort";
    }

    leaf role {
      type identityref {
        base oc-stp-types:STP_PORT_ROLE;
      }
      description
        "The current role of the bridge port";
      reference
        "IEEE8021-MSTP-MIB ieee8021MstpPortRole";
    }

    leaf port-state {
      type identityref {
        base oc-stp-types:STP_PORT_STATE;
      }
      description
        "The current state of the bridge port";
      reference "RFC4188 BRIDGE-MIB dot1dStpPortState";
    }

    leaf designated-root-priority {
      type oc-stp-types:stp-bridge-priority-type;
      description
        "The bridge priority of the bridge recorded as the
        root in the configuration BPDUs transmitted by the designated
        bridge for the segment to which the port is attached";
      reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedRoot";
    }

    leaf designated-root-address {
      type oc-yang:mac-address;
      description
        "The bridge address of the bridge recorded as the
        root in the configuration BPDUs transmitted by the designated
        bridge for the segment to which the port is attached";
      reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedRoot";
    }

    leaf designated-cost {
      type uint32;
      description
        "The path cost of the Designated Port of the
        segment connected to this port";
      reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedCost";
    }

    leaf designated-bridge-priority {
      type oc-stp-types:stp-bridge-priority-type;
      description
        "The bridge priority of the bridge that this port considers
        to be the designated bridge for this port's segment.";
      reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedBridge";
    }

    leaf designated-bridge-address {
      type oc-yang:mac-address;
      description
        "The bridge address of the bridge that this port considers
        to be the designated bridge for this port's segment.";
      reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedBridge";
    }

    leaf designated-port-priority {
      type oc-stp-types:stp-port-priority-type;
      description
        "The Port priority of the port on the Designated
        Bridge for this port's segment, two octet string";
      reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedPort";
    }

    leaf designated-port-num {
      type uint16;
      description
        "The Port number of the port on the Designated
        Bridge for this port's segment, two octet string";
      reference "RFC4188 BRIDGE-MIB dot1dStpPortDesignatedPort";
    }

    leaf forward-transisitions {
      type oc-yang:counter64;
      description
        "The number of times this port has transitioned
        from the Learning state to the Forwarding state";
      reference "RFC4188 BRIDGE-MIB dot1dStpPortForwardTransitions";
    }

    container counters {
      description
        "The BPDU packet transmition statistics";

      leaf bpdu-sent {
        type oc-yang:counter64;
        description
          "The number of BPDU packet sent";
      }

      leaf bpdu-received {
        type oc-yang:counter64;
        description
          "The number of BPDU packet received";
      }
    }
  }

  grouping stp-interfaces-config {
    description
      "Grouping of STP configuration for bridge port";

    leaf name {
      type oc-if:base-interface-ref;
      description
        "Reference to the STP ethernet interface";
    }

    leaf cost {
      type uint32 {
        range 1..200000000;
      }
      description
        "The port's contribution, when it is the Root Port,
        to the Root Path Cost for the Bridge";
      reference
        "IEEE 802.1D 17.13.11 PortPathCost";
    }

    leaf port-priority {
      type oc-stp-types:stp-port-priority-type;
      description
        "The manageable component of the Port Identifier,
        also known as the Port Priority";
      reference
        "IEEE 802.1D 17.13.10 Port Identifier Priority";
    }
  }

  grouping stp-interfaces-top {
    description
      "Grouping of STP configuration and operation data for
      bridge port";

    container interfaces {
      description
        "Enclosing container for the list of interface references";

      list interface {
        key "name";
        description
          "List of interfaces on which STP is enable";

      	leaf name {
      	  type leafref {
      	    path "../config/name";
      	  }
      	  description
      	    "Reference to the list key";
      	}

      	container config {
      	  description
      	    "Configuration data for STP on each interface";

      	  uses stp-interfaces-config;
      	}

      	container state {

      	  config false;

      	  description
      	    "Operational state data for STP on each interface";

      	  uses stp-interfaces-config;
      	  uses stp-interfaces-state;
      	}
      }
    }
  }

  grouping bridge-priority-config {
    description
      "Grouping for bridge priority";

    leaf bridge-priority {
      type oc-stp-types:stp-bridge-priority-type;
      description
        "The manageable component of the Bridge Identifier";
      reference
        "IEEE 802.1D 17.13.7 Bridge Identifier Priority";
    }
  }

  grouping stp-common-state {
    description
      "Grouping for common STP operation data";

    leaf bridge-address {
      type oc-yang:mac-address;
      description
        "A unique 48-bit Universally Administered MAC Address
        assigned to the bridge";
      reference
        "IEEE 802.1D 7.12.5 Unique identification of a bridge";
    }

    leaf designated-root-priority {
      type oc-stp-types:stp-bridge-priority-type;
      description
        "The bridge priority of the root of the spanning
        tree, as determined by the Spanning Tree Protocol,
        as executed by this node";
	    reference
        "RFC4188 BRIDGE-MIB dot1dStpDesignatedRoot";
    }

    leaf designated-root-address {
      type oc-yang:mac-address;
      description
        "The bridge address of the root of the spanning
        tree, as determined by the Spanning Tree Protocol,
        as executed by this node";
      reference
        "RFC4188 BRIDGE-MIB dot1dStpDesignatedRoot";
    }

    leaf root-port {
      type uint16;
      description
        "The port number of the port which offers the lowest
        cost path from this bridge to the root bridge";
      reference
        "RFC4188 BRIDGE-MIB dot1dStpRootPort";
    }

    leaf root-cost {
      type uint32;
      description
        "The cost of the path to the root as seen from this bridge";
      reference
        "RFC4188 BRIDGE-MIB dot1dStpRootCost";
    }

    leaf hold-time {
      type uint8;
      description
        "This time value determines the interval length
        during which no more than two Configuration bridge
        PDUs shall be transmitted by this node";
      reference
        "RFC4188 BRIDGE-MIB dot1dStpHoldTime";
    }

    leaf topology-changes {
      type oc-yang:counter64;
      description
        "The total number of topology changes detected by
        this bridge since the management entity was last
        reset or initialized";
      reference
        "RFC4188 BRIDGE-MIB dot1dStpTopChanges";
    }

    leaf time-since-topology-change {
      type oc-types:timeticks64;
      description
        "The time (in hundredths of a second) since the
        last time a topology change was detected by the
        bridge entity

        The value is the timestamp in seconds relative to
        the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
      reference
        "RFC4188 BRIDGE-MIB dot1dStpTimeSinceTopologyChange";
    }
  }

  grouping stp-timer-config {
    description
      "Grouping for common STP parameters";

    leaf hello-time {
      type uint8 {
        range 1..10;
      }
      units "seconds";
      description
        "The interval between periodic transmissions of
        configuration messages by designated ports";
      reference
        "IEEE 802.1D 17.13.6 Bridge Hello Time";
    }

    leaf max-age {
      type uint8 {
        range 6..40;
      }
      units "seconds";
      description
        "The maximum age of the information transmitted by the
        bridge when it is the root bridge";
      reference
        "IEEE 802.1D 17.13.8 Bridge Max Age";
    }

    leaf forwarding-delay {
      type uint8 {
        range 4..30;
      }
      units "seconds";
      description
        "The delay used by STP bridges to transition root and
        designated ports to forwarding";
      reference
        "IEEE 802.1D 17.13.5 Bridge Forward Delay";
    }

    leaf hold-count {
      type uint8 {
        range 1..10;
      }
      default 6;
      description
        "the maximum number of BPDUs per second that the
         switch can send from an interface";
      reference
        "IEEE 802.1D 17.13.12 Transmit Hold Count";
    }
  }

  grouping stp-rapid-pvst-config {
    description
      "Configuration parameters relating to rapid PVST";

    leaf vlan-id {
      type oc-vlan-types:vlan-id;
      description
        "Interface VLAN ID";
    }
  }

  grouping stp-rapid-pvst-top {
    description
      "Top grouping for rapid per vlan spanning tree configuration
      and operation data";

    list vlan {
      key "vlan-id";
      description
        "List of the vlans";

      leaf vlan-id {
        type leafref {
          path "../config/vlan-id";
        }
        description
          "Reference to the list key";
      }

      container config {
      	description
      	  "Configuration data for each vlan";

        uses stp-rapid-pvst-config;
        uses stp-timer-config;
        uses bridge-priority-config;
      }

      container state {
        config false;
        description
          "Operational data for each vlan";

        uses stp-rapid-pvst-config;
        uses stp-timer-config;
        uses bridge-priority-config;
        uses stp-common-state;
      }

      uses stp-interfaces-top;
    }
  }

  grouping mst-instance-config {
    description
      "Grouping for mstp instance configuration";

    leaf mst-id {
      type uint16 {
        range "1..4094";
      }
      description
        "In an MSTP Bridge, an MSTID, i.e., a value used to identify
        a spanning tree (or MST) instance.";
      reference
        "IEEE8021-TC-MIB IEEE8021MstIdentifier";
    }

    leaf-list vlan {
      type union {
        type oc-vlan-types:vlan-id;
        type oc-vlan-types:vlan-range;
      }
      description
        "list of vlans mapped to the MST instance";
    }
  }

  grouping mst-instance-top {
    description
      "Top level grouping for mstp instances";

    list mst-instance {
      key "mst-id";
      description
        "List of the mstp instances";

      leaf mst-id {
        type leafref {
          path "../config/mst-id";
        }
        description
          "Reference to the list key";
      }

      container config {
        description
          "Configuration data for MSTP instance";

        uses mst-instance-config;
        uses bridge-priority-config;
      }

      container state {
        config false;

        description
          "Operational data for MSTP instance";

        uses mst-instance-config;
        uses bridge-priority-config;
        uses stp-common-state;
      }

      uses stp-interfaces-top;
    }
  }

  grouping mstp-config {
    description
      "Grouping for MSTP configuration data";

    leaf name {
      type string {
        length "1..32";
      }
      description
        "The Configuration Name in the MST Configuration Identifier";
      reference
        "IEEE 802.1Q 13.8 MST Configuration Identifier (MCID)";
    }

    leaf revision {
      type uint32;
      description
        "The Revision Level in the MST Configuration Identifier";
      reference
        "IEEE 802.1Q 13.8 MST Configuration Identifier";
    }

    leaf max-hop {
      type uint8 {
        range 1..255;
      }
      description
        "The max hop determines the number of bridges in an MST
        region that a BPDU can traverse before it is discarded";
      reference
        "IEEE 802.1Q 13.26.4 BridgeTimes";
    }

    uses stp-timer-config;
  }

  grouping mstp-state {
    description
      "Operational state data for MSTP";
  }

  grouping stp-mstp-top {
    description
      "Top grouping for MSTP configuration and operation data";

    container config {
      description
        "Configuration data for MSTP";

      uses mstp-config;
    }

    container state {
      config false;

      description
        "Operational data for MSTP";

      uses mstp-config;
      uses mstp-state;
    }

    container mst-instances {
      description
        "Configuration and operation data for MSTP instances";

      uses mst-instance-top;
    }
  }

  grouping stp-rstp-top {
    description
      "Top grouping for RSTP configuration and operation data";

    container config {
      description
        "Configuration data for RSTP";

      uses stp-timer-config;
      uses bridge-priority-config;
    }

    container state {
      config false;

      description
        "Operational state data for RSTP";

      uses stp-timer-config;
      uses bridge-priority-config;
      uses stp-common-state;
    }

    uses stp-interfaces-top;
  }

  grouping stp-interface-common-config {
    description
      "Configuration data for interface specific STP features";

    leaf name {
      type oc-if:base-interface-ref;
      description
        "Reference to the STP Ethernet interface";
    }

    leaf edge-port {
      type identityref {
        base oc-stp-types:STP_EDGE_PORT;
      }
      description
        "Configure the edge port state";
    }

    leaf link-type {
      type oc-stp-types:stp-link-type;
      description
        "specifies the interface's link type";
    }

    leaf guard {
      type oc-stp-types:stp-guard-type;
      description
        "Enable root guard or loop guard";
    }

    uses stp-bpdu-config;

  }

  grouping stp-interface-common-state {
    description
      "Operational state data for STP on interfaces";
  }

  grouping stp-interface-common-top {
    description
      "Top-level grouping for interface specific STP features";

    list interface {
      key "name";
      description
        "List of interfaces on which STP is enable";

      leaf name {
        type leafref {
          path "../config/name";
        }
        description
          "Reference to the list key";
      }

      container config {
        description
          "Configuration data for STP on each bridge port";

        uses stp-interface-common-config;
      }

      container state {

        config false;

        description
          "Operational state data for STP on each bridge port";

        uses stp-interface-common-config;
        uses stp-interface-common-state;
      }
    }
  }

  grouping stp-bpdu-config {
    description
      "Grouping for STP BPDU configuration";

    leaf bpdu-guard {
      type boolean;
      description
        "Enable edge port BPDU guard";
    }

    leaf bpdu-filter {
      type boolean;
      description
        "Enable edge port BPDU filter";
    }
  }

  grouping stp-global-config {
    description
      "Global spanning tree configuration";

    leaf-list enabled-protocol {
      type identityref {
        base oc-stp-types:STP_PROTOCOL;
      }
      description
        "List of the spanning tree protocols enabled on the
        device";
    }

    leaf bridge-assurance {
      type boolean;
      description
        "Enable bridge assurance to protect against unidirectional
        link failure";
    }

    leaf etherchannel-misconfig-guard {
      type boolean;
      description
        "EtherChannel guard detects a misconfigured EtherChannel
        when interfaces on the switch are configured as an
        EtherChannel while interfaces on the other device are not
        or when not all the interfaces on the other device are in
        the same EtherChannel.";
    }

    leaf bpduguard-timeout-recovery {
      type uint8;
      units "seconds";
      description
        "Amount of time, in seconds, the interface receiving BPDUs
        is disabled. Once the timeout expires, the interface is
        brought back into service.";
    }

    leaf loop-guard {
      type boolean;
      description
        "The loop guard default setting for the bridge";
    }

    uses stp-bpdu-config;

  }

  grouping stp-global-state {
    description
      "Global operational state for STP";
  }

  grouping stp-global-base {
    description
      "Grouping for global spanning tree data";

    container config {
      description
        "Global spanning tree configuration";
      uses stp-global-config;
    }

    container state {
      config false;

      description
        "Global spanning tree state";
      uses stp-global-config;
      uses stp-global-state;
    }
  }

  grouping stp-top {
    description
      "Top-level grouping for spanning-tree model";

    container stp {
      description
        "Top-level container for spanning tree configuration and
        state data";

      container global {
        description
          "Global configuration and state data";

        uses stp-global-base;
      }

      container rstp {

        description
          "Rapid Spanning-tree protocol configuration and operation
          data";

        uses stp-rstp-top;
      }

      container mstp {
        description
          "Multi Spanning-tree protocol configuration and operation
          data";

        uses stp-mstp-top;
      }

      container rapid-pvst {
      	description
      	  "Rapid per vlan Spanning-tree protocol configuration and
          operational data";

      	uses stp-rapid-pvst-top;
      }

      container interfaces {
        description
          "Enclosing container for the list of interface references";

        uses stp-interface-common-top;
      }
    }
  }

  // data definition statements

  uses stp-top;

}