Spanning Tree Protocol (STP)
Need For Spanning Tree
- Loops in a complex switched environment
- Need to block on redundant links
- Spanning Tree Protocol (STP)
- IEEE 802.1d
- Layer 2 protocol
- Exchange BPDUs
- Blocks on redundant links
- On by default on Cisco
Spanning Tree Operation
- STP exchanges BPDUs with other switches Elects a root bridge based on bridge ID
- Lowest priority wins
- If priority is tied, lowest MAC wins
- Default priority is 32768
- Increments at 4096
Which switch becomes root?
/CAP/Network+/Visual%20Aids/Pasted%20image%2020250210125433.png)
- All priorities are the same so it comes down to the MAC address.
Spanning Tree Path Cost
| Link Speed |
STP Path Cost |
| 10 Mbps |
100 |
| 100 Mbps |
19 |
| 1 Gbps |
4 |
| 10 Gbps |
1 |
Spanning Tree Port Roles
- Once root is selected, non-root switches determine their root port.
- Root port is based on path cost
- Lowest cost to root is selected
- Non-root ports become designated or non-designated
- A designated port goes to the root port
- A non-designated port is in a blocking state
- Block on non-designated ports
/CAP/Network+/Visual%20Aids/Pasted%20image%2020250210125828.png)
Spanning Tree Protocol (STP) Port States
| Port State |
Description |
Duration |
| Blocking |
Evaluates BPDUs/blocks traffic |
20 sec/stable |
| Listening |
sources BPDUs/informs intent to forward |
15 sec |
| Learning |
learns source MAC addresses |
15 sec |
| Forwarding |
begins to forward frames |
stable |
Rapid Spanning Tree Protocol (RSTP) Port States
| Port State |
| Discarding |
| Discarding |
| Learning |
| Forwarding |