The Spanning Tree Protocol (STP) is a network protocol that ensures a loop-free topology for any bridged Ethernet local area network. The Spanning Tree algorithm works by designating a single switch (The Root Bridge) in the network as the root or the parent to all the switches, and then all the switches in the network will use the same algorithm to form a unique path that reaches all the way back to the Root Bridge from itself, with some switches establishing a blocking point (a port on a switch) somewhere along these paths if these paths form a loop.

List are different flavors of Spanning tree.

  • STP—Defined in IEEE 802.1D, this is the original standard that provided a loop-free topology in a network with redundant links. Also called Common Spanning Tree (CST), it assumed one spanning-tree instance for the entire bridged network, regardless of the number of VLANs.
  • Per-VLAN Spanning Tree (PVST+)—PVST+ is a Cisco enhancement of STP that provides a separate 802.1D spanning-tree instance for each VLAN configured in the network.
  • Rapid Spanning Tree Protocol (RSTP)—RSTP is defined in IEEE 802.1w. It is an evolution of STP that provides faster convergence than STP.
  • Rapid Per-VLAN Spanning Tree (Rapid PVST+)—Rapid PVST+ is a Cisco enhancement of RSTP that uses PVST+ and provides a separate instance of 802.1w for each VLAN.
  • Multiple Spanning Tree Protocol (MSTP)—MSTP, defined in IEEE 802.1s, maps multiple VLANs into the same spanning-tree instance. The Cisco implementation of MSTP is often referred to as Multiple Spanning Tree (MST).

STP-Characteristics

  • EEE 802.1D is the original standard.
  • STP creates one spanning-tree instance for the entire bridged network, regardless of the number of VLANs.
  • However, because there is only one root bridge, traffic for all VLANs flows over the same path, which can lead to suboptimal traffic flows.
  • This version is slow to converge.
  • The CPU and memory requirements are lower than for all other STP protocols.
  • This is a Cisco enhancement of STP that provides a separate STP instance for each VLAN.
  • Each instance supports PortFast, BPDU guard, BPDU filter, root guard, and loop guard.

PVST+-Characteristics

  • This design allows the spanning tree to be optimized for the traffic of each VLAN.
  • However, CPU and memory requirements are high due to maintaining separate STP instances per VLAN.
  • Convergence is per-VLAN and is slow, like 802.1D.
  • 802.1w is an evolution of 802.1D that addresses many convergence issues.

RSTP- Characteristics

  • Like STP, it provides only a single instance of STP and therefore does not address suboptimal traffic flow issues.
  • The CPU and memory requirements are less than for Rapid PVST+ but more than for 802.1D.
  • This is a Cisco enhancement of RSTP.
  • Rapid PVST+ uses PVST+ and provides a separate instance of 802.1w for each VLAN.

Rapid PVST+-Characteristics

  • Each instance supports PortFast, BPDU guard, BPDU filter, root guard, and loop guard.
  • This version addresses the convergence issues and the suboptimal traffic flow issues.
  • The CPU and memory requirements are the highest of all STP implementations.
  • IEEE 802.1s is based on the Cisco Multiple Instance Spanning-Tree Protocol (MISTP) which is often simply referred to as Multiple Spanning Tree (MST).
  • The Cisco implementation is often referred to as Multiple Spanning Tree (MST).

MSTP- Characteristics

  • MSTP maps multiple VLANs into the same spanning-tree instance.
  • It supports up to 16 instances of RSTP.
  • Each instance supports PortFast, BPDU guard, BPDU filter, root guard, and loop guard.
  • The CPU and memory requirements are less than for Rapid PVST+ but more than for RSTP.

Spanning Tree Protocol Timers

There are several STP timers, as this list shows:

  • hello—The hello time is the time between each bridge protocol data unit (BPDU) that is sent on a port. This time is equal to 2 seconds (sec) by default, but you can tune the time to be between 1 and 10 sec.
  • forward delay—The forward delay is the time that is spent in the listening and learning state. This time is equal to 15 sec by default, but you can tune the time to be between 4 and 30 sec.
  • max age—The max age timer controls the maximum length of time that passes before a bridge port saves its configuration BPDU information. This time is 20 sec by default, but you can tune the time to be between 6 and 40 sec.

Other Parameters of the Spanning Tree Protocol

IEEE also defines these parameters that relate to STP:

  • diameter of the STP domain (dia)—This value is the maximum number of bridges between any two points of attachment of end stations. The IEEE recommendation is to consider a maximum diameter of seven bridges for the default STP timers.
  • bridge transit delay (transit delay)—This value is the time that elapsed between the reception and the transmission of the same frame by the bridge. This is logically the latency through the bridge. The IEEE recommendation is to consider 1 sec as the maximum bridge transit delay.
  • BPDU transmission delay (bpdu_delay)—This value is the delay between the time that a BPDU is received on a port and the time that the configuration BPDU is effectively transmitted to another port. The IEEE recommends 1 sec as the maximum BPDU transmission delay.
  • message age increment overestimate (msg_overestimate)—This value is the increment that each bridge adds to the message age before forwarding a BPDU. Cisco switches (and probably all switches) add 1 sec to the message age before the switches forward a BPDU.
  • lost message (lost_msg)—This value is the number of BPDUs that can be lost as a BPDU moves from one end of the bridged network to the other end. The IEEE recommendation is to use three as the number of BPDUs that can be lost.
  • transmit halt delay (Tx_halt_delay)—This value is the maximum amount of time that is necessary for a bridge to effectively move a port into the blocking state after the determination that the port needs to be blocked. The IEEE recommendation is to use 1 sec for this parameter.
  • medium access delay (med_access_delay)—This value is the time that is necessary for a device to gain access to the media for initial transmission. It is the time between the CPU decision to send a frame and the moment when the frame effectively begins to leave the bridge. The IEEE recommendation is to use 0.5 sec as the maximum time