netconfcentral logo

openconfig-spanning-tree@2017-07-14



  module openconfig-spanning-tree {

    yang-version 1;

    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;
    }

    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.";

    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";

    }

    oc-ext:openconfig-version "0.2.0";

    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";
        }
      }  // container counters
    }  // grouping stp-interfaces-state

    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-config

    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 config

          container state {
            config false;
            description
              "Operational state data for STP on each interface";
            uses stp-interfaces-config;

            uses stp-interfaces-state;
          }  // container state
        }  // list interface
      }  // container interfaces
    }  // grouping stp-interfaces-top

    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 bridge-priority-config

    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-common-state

    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-timer-config

    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-config

    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 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;
        }  // container state

        uses stp-interfaces-top;
      }  // list vlan
    }  // grouping stp-rapid-pvst-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-config

    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 config

        container state {
          config false;
          description
            "Operational data for MSTP instance";
          uses mst-instance-config;

          uses bridge-priority-config;

          uses stp-common-state;
        }  // container state

        uses stp-interfaces-top;
      }  // list mst-instance
    }  // grouping mst-instance-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-config

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

    grouping stp-mstp-top {
      description
        "Top grouping for MSTP configuration and operation data";
      container config {
        description
          "Configuration data for MSTP";
        uses mstp-config;
      }  // container config

      container state {
        config false;
        description
          "Operational data for MSTP";
        uses mstp-config;

        uses mstp-state;
      }  // container state

      container mst-instances {
        description
          "Configuration and operation data for MSTP instances";
        uses mst-instance-top;
      }  // container mst-instances
    }  // grouping stp-mstp-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 config

      container state {
        config false;
        description
          "Operational state data for RSTP";
        uses stp-timer-config;

        uses bridge-priority-config;

        uses stp-common-state;
      }  // container state

      uses stp-interfaces-top;
    }  // grouping stp-rstp-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-config

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

    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 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;
        }  // container state
      }  // list interface
    }  // grouping stp-interface-common-top

    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-bpdu-config

    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-config

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

    grouping stp-global-base {
      description
        "Grouping for global spanning tree data";
      container config {
        description
          "Global spanning tree configuration";
        uses stp-global-config;
      }  // container config

      container state {
        config false;
        description
          "Global spanning tree state";
        uses stp-global-config;

        uses stp-global-state;
      }  // container state
    }  // grouping stp-global-base

    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 global

        container rstp {
          description
            "Rapid Spanning-tree protocol configuration and operation
          data";
          uses stp-rstp-top;
        }  // container rstp

        container mstp {
          description
            "Multi Spanning-tree protocol configuration and operation
          data";
          uses stp-mstp-top;
        }  // container mstp

        container rapid-pvst {
          description
            "Rapid per vlan Spanning-tree protocol configuration and
          operational data";
          uses stp-rapid-pvst-top;
        }  // container rapid-pvst

        container interfaces {
          description
            "Enclosing container for the list of interface references";
          uses stp-interface-common-top;
        }  // container interfaces
      }  // container stp
    }  // grouping stp-top

    uses stp-top;
  }  // module openconfig-spanning-tree