networking:stp
This is an old revision of the document!
STP
Algorithm
How it works:
- Each switch generates an ID for itself (PBDU ID)
- BPDU ID has two parts - priority:System-Mac
- Each switch sends BPDUs out of all its ports (as multicast)
- After BPDUs are exchanged, Root switch is elected
- Root is having the smallest priority, and if equal - smallest System-Mac
- Only Root switch keeps sending BPDUs
- On the Root switch all ports are Designated
- All non-Root switches will elect a Root port - port closest to the Root switch
- Root port is having the smallest Cost to the Root switch (cost is based on the speed)
- If there are parallel links, port with the smallest number wins
- On all non-Root switches, elect Designated port and define Blocked ports
- Designated port is the port closest (cost-wise) to the Root
- If cost is the same - the port on the switch with lowest System-MAC becomes a Designated port
Port States
- Disabled
- Listening - switch sends and receives BPDUs. It lasts 15 seconds and it's where Root is elected
- Learning - switch is building MAC address table. Also lasts 15 seconds
- Forwarding
- Root Port
- Designated Port
During Failure
Root port sends BPDUs every 2 seconds. If non-root switch stops receiving BPDUs over Root port for 20 seconds, it starts the Listening and Learning process on the Blocked port.
RSTP
RST improves convergence time. Instead of having a Blocked port and spending too much time in Listening and Learning, we have Alternate port.
networking/stp.1764776339.txt.gz · Last modified: by v1ctor
