In our previous post we learnt about connecting switches with trunk ports and their configuration using Dynamic Trunking Protocol. But connecting the switches using single link causes connectivity issues if that link goes down (single point of failure).
To eliminate this scenario, switches were connected with multiple links but then another issue raised due to basic working principle of switches that on first go when any frame is received on switch port it broadcasts that frame on all of its ports except the port on which it received the frame.
This causes switching loops will flood the switches as ethernet frames do not have a TTL (time to live).
Here Comes the Role of Spanning Tree Protocol
Spanning Tree Protocol was invented to create a loop free topology by blocking interfaces. Spanning Tree Protcol (STP) enables switches to become aware of other switches through advertisement and receipt of bridge protocol data units (BPDUs).
STP operates by selecting a master switch and running tree based algorithm to determine which redundant paths must not forward traffic.
Spanning Tree Iterations
Depending on STP port states & its convergence time it has evolved & has multiple versions:
- 802.1D, Spanning Tree Protocol Original Specification.
- Per-VLAN Spanning Tree (PVST)
- Per-VLAN Spanning Tree Plus (PVST+)
- 802.1W Rapid Spanning Tree (RSTP)
- 802.1S Multi Spanning Tree (MST)
Please note that in Cisco catalyst switches now operate in PVST+, RSTP & MST but they are backward compatible with 802.1D. Before diving into the details of spanning tree protocol lets have a look at its port states and types.
Spanning Tree Protocol (STP) 801.1D Port States
Port state transitions of standard STP are defined below.
Disabled: The port is in an administratively off position (that is, shut down).
Blocking: The switch port is enabled, but the port is not forwarding any traffic.
Listening: The switch port has transitioned from a blocking state and can now send or receive only BPDUs.
Learning: The switch port can modify the MAC address table. The switch still does not forward any other network traffic besides BPDUs.
Forwarding: The switch port can forward all network traffic and can update the MAC address table as expected.
Broken: The switch has detected a problem on a port that can have major effects. The
port discards packets as long as the problem continues to exist.
Spanning Tree 802.1D Port types
There are three types of ports in standard spanning tree protocol as follows:
Root port (RP): A network port that connects to the root bridge or an upstream switch in the spanning-tree topology. There should be only one root port per VLAN on a switch.
Designated Port (DP): A network port that receives and forwards BPDU frames to other switches. Designated ports provide connectivity to downstream devices and switches. There should be only one active designated port on a link.
Blocking port: A network that is not forwarding traffic because of STP calculations.
now that we have brief understanding about STP port states and its types. however there is some terminology like root bridge, BPDUs etc which needs some explanation for better understanding.
STP key Terminologies
Root Bridge is the most important switch in STP topology. All ports are in a forwarding state and are categorized as designated ports.
Bridge protocol data unit (BPDU) is used to identify a hierarchy and notify of changes in the topology, There are two types of BPDUs: configuration BPDU and topology change notification BPDU.
Configuration BPDU is used to identify the root bridge, root, designated, and blocking ports.
Topology Change Notification (TCN) BPDU is used to communicate changes in the Layer 2 topology to other switches.
Root Path Cost: The combined cost for a specific path toward the root switch.
System priority is 4-bit value indicates the preference for a switch to be root bridge. The default value is 32,768.
System ID extension is 12-bit value indicates the VLAN that the BPDU correlates.
Root bridge Identifier is a combination of the root bridge system MAC address system ID extension, and system priority of the root bridge.
Local bridge identifier is a combination of the local switch’s bridge system MAC address, system ID extension, and system priority of the root bridge.
Max age Maximum length of time that passes before a bridge port saves its
BPDU information. The default value is 20 seconds.
Hello time The time that a BPDU is advertised out of a port. The default value is 2 seconds, but the value can be configured to 1 to 10 seconds.
Forward Delay The amount of time that a port stays in a listening and learning state. The default value is 15 seconds.
In this lesson we learnt some basics of spanning tree protocol and its terminologies. in our next lesson we shall lab up the spanning tree topology to better understand it. thanks for your time & looking forward you in next lesson.