Spanning Tree Flashcards
STP
Spanning Tree Protocol 802.1D
802.1D provides support for ensuring a loop-free topology for one VLAN.
STP was designed before modern switches. The device that originally used STP were known as bridges. Switches perform the same role at a higher speed and scale while essentially bridging Layer 2 traffic.
BPDU
Bridge Protocol Data Unit
Enables switches to become aware of other STP switches through the advertisement of BDPU’s
This network packet is used for network switches to identify a hierarchy and notify of changes in the topology.
A BPDU uses the destination MAC address 01:80:c2:00:00:00.
There are two types of BPDU’s:
- Configuration BPDU
Is used to identify the root bridge, root ports, designated ports and blocking ports. - Topology change notification (TCN) BPDU
Is used to communicate changes in the Layer 2 topology to other switches.
BPDU TCN
Bridge Protocol Data Unit Topology Change Notification
The switch that detects a link status change sends a topology change notification towards the root bridge, out of its Root Port (RP). If an upstream switch receives the TCN, it sends out and acknowledgement and forward the TCN out its RP to the root bridge.
BPDU configuration
After receipt of the TCN, the root bridge creates a new configuration BPDU with the Topology Change flag set and it is then flooded to all the switches.
When a switch receives a configuration BPDU it will change their MAC address timer to the forwarding delay timer. This flushes out MAC addresses for devices that have not communicated in the (default) 15 second window.
802.1D Port States
- Disabled
Port is shut down (admin down) - Blocking
Port is enabled, but the port is not forwarding any traffic to ensure that a loop is not created. It can only receive BPDU’s from other switches. The switch does not modify the MAC address table. - Listening
It can now send or receive BPDU’s. It cannot forward any other network traffic. - Learning
The port can now modify the MAC address table with any network traffic it receives. The switch still does not forward any other network traffic besides BPDU’s. - Forwarding
The port can forward all network traffic and can update the MAC address table as expected. This is the final state for a switch port. - Broken
The switch has detected a configuration or an operational problem on a port. The port discards packets as long as the problem continues to exist.
802.1D port types
- Root port (RP)
A network port that connects to the root bridge or an upstream switch in the STP topology. There should be only one root port per VLAN on a switch. - Designated port (DP)
A network port that receives and forwards BDPU frames to other switches. DP ports can provide connectivity to downstream devices and switches. - Blocking port
A network port that is not forwarding traffic because of STP calculations.
Root bridge
The root bridge is the most important switch in the Layer 2 topology.
All ports are in a forwarding state.
The switch is considered the top of the spanning tree for all path calculations by other switches. All ports on the root bridge are categorized as designated ports.
Root bridge election
STP deems a switch more preferable if the priority in the bridge identifier is lower than the priority of the other switch’s configuration BPDU’s. If the priority is the same, then the switch prefers the BPDU with the lower system MAC.
Root port election
- The interface associated to lowest path cost is more preferred.
- The interface associated to the lowest system priority of the advertising switch is preferred next
- The interface associated to the lowest MAC address of the advertising switch is preferred next.
- When multiple links are associated to the same switch, the lowest port priority from the advertising switch is preferred.
- When multiple links are associated to the same switch, the lower port number from the advertising switch is preferred.
Blocked port election
- The interface is a designated port and must not be be considered an RP.
- The switch with the lower path cost to the root bridge forward packets, and the one with the higher path cost blocks.
- The system priority of the local switch is compared to the system priority of the remote switch.
- The system MAC address of the local switch is compared to the remote switch.
Root path cost
This is the combined cost for a specific path toward the root switch.
System priority
This 4-bit value indicates the preference for a switch to be root bridge. The default is 32,768.
System ID extension
This 12 bit value indicates the VLAN that the BPDU correlates to. The systems priority and system ID extension are combined as part of the switch’s identification of a bridge.
Root bridge identifier
This is a combination of the root bridge system MAC address, System ID extension and system priority of the root bridge.