62. Spanning Tree Protocol

Опубликовано: 23 Июль 2026
на канале: ITProDan
44
1

The need for STP
manage switches has the capability to manage/implement STP
problems with redundant networks:
*Broadcast Storm
*Infinite frames transmitted and received
*MAC Address Table Instability (Interface flapping)
when this problems occur, network will be down
STP is the solution (Spanning Tree Protocol)
enabled by default on the interface
How STP works
amber light upon powering an interface which indicates the STP process initiated
checking for loops on the network. If none, it will go to amber led which is forwarding state
How switches detect if there are switching loops
a. Each switch has its own Bridge ID
Bridge ID = Bridge Priority (32768) + System-ID/MAC Address
b. Switches sends out BPDUs out on all active interfaces
BPDU - Bridge Protocol Data Unit
BPDU contents:
Root Bridge ID
Sender's Bridge ID
STP Port Cost from Sender to the Root Bridge
STP Timers

*BPDU packets are sent to other devices like a broadcast packet. One a switch receives a BPDU with a Bridge ID that is the same on its Bridge ID, It will shut down one the interfaces killing the loop. STP process will determine while int to be shut down.
STP Port states:
2 categories
a. Operating states
*forwarding
green light
normal operation
transmits and receives frames
transmits and receives BPDUs
*blocking state
amber led light
drops frames received
does not send out frames
does not send out BPDUs
received BPDUs
b. Transitional states
*Disabled
*Listening
*Learning
How switches know which link / interface to block
1. They need to elect a Root Bridge
election is based on the Bridged ID
Bridge ID = Bridge Priority (32768) + System-ID/MAC Address
lowest value always wins
a. bridge priority
b. MAC address / System ID
BPDU contents:
Root Bridge ID
Sender's Bridge ID
STP Port Cost from Sender to the Root Bridge
*formula: cost = incoming cost + port cost of the ingress port
10Mbps = 100
100Mbps = 19
1 Gbps = 4
10 Gps = 2
STP Timers
2. They need to assign STP Port Roles
STP Port Roles
1. Root Port (RP) - port with lowest STP port cost going to the root bridge
2. Designated Port (DP) - a forwarding port. STP Combo (RP-DP) (BP-DP) one DP per link only
3. Alternative Blocking Port (BP) - drop frames.
*all ports of the root bridge are designated ports
3. Then, they ca "block" an interface
What is Root Bridge
*STP forwarding traffic "boss"
*Central point of the network
*All powerful switch
STP Process
1. elect a root bridge
base on the lowest Bridge-ID
a. Bridge Priority
b. MAC Address
2. label stp port roles
a. all ports of root bridge are "designated ports"
b. find the root port
c. all links without a root port, one port must be blocking
When will a switch know if there is a link failure
1. If it stops receiving BPDUs on a n interface
STP timers:
-Hello BPDU = 2 seconds
-Max Age = 10X Hello (20 seconds)
-Listening = 15 seconds
-Learning = 15 seconds
2. If it receives a BPDU with a different value.
STP Port States:
1. Operating States
a. Blocking
b. Forwarding.
2. Transitional States
a. Listening
-does not TX BPDU, but RX BPDU
-discards MAC addresses learned from this interface
b. Learning
-does not TX BPDU, but RX BPDU
-does not TX Frames, but RX Frames
c. Disabled
*STP total transition is 50seconds which is very slow on modern networks.
*Latest IEEE, introduced RSTP with faster convergence.
RSTP timers:
-Hello BPDU = 2 seconds
-Max Age = 3X Hello (9 seconds)
-Listening = no listening state
-Learning = 15 seconds
*19 seconds all in transition time.
*however, their are techniques to further enhanced STP and RSTP convergence like
backbonefast, portfast. etc.,
*needed to manually configure the STP process.
*In STP setup, we can configure Primary and Secondary root bridges
*PVST
per vlan spanning tree
cisco proprietary
*MST
Multiple Spanning Tree Protocol
IEEE Standard
*Remember for the exam:
-STP 802.1d
-RSTP 802.1w
-MST 802.1s