STP notes
used to prevent loop in L2 by selecting root bridge to make a tree-like logical topology
Election:
- Priority. smaller is better
- MAC. smaller is better
steps of Blocking a interface:
- all ports of the root bridge are designated interfaces, in forwarding state
- select all root port on non-root bridges, in forwarding state
- select designated interfaces in the rest networks, priority -> cost -> mac (smaller is better)
- block the rest interfaces
root port selection rule: lower cost to root bridge
STP optimization:
- portfast: stop receiving BPDU, save 30s
- uplinkfast:, used on access switches, save 30s
- backbonefast: used on all switches, save 20s
STP security:
- BPDU guard: filter BPDU on access ports, put interfaces on err-disable when receiving BPDU
- BPDU filter: filter BPDU on access ports, drop BPDU, no change on interfaces.
- UDLD: detect packet forwarding on hardware level, put interfaces in err-disable when forwarding error happens
- loop guard: detect congestion on software level, put interfaces in err-disable when congestion happens
- root guard: prevents a port from becoming root port or blocked port.
RSTP: STP with portfast & uplinkfast
MST: share logical tree topology among VLANs based on MST instances