Skip to main content

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:

  1. all ports of the root bridge are designated interfaces, in forwarding state
  2. select all root port on non-root bridges, in forwarding state
  3. select designated interfaces in the rest networks, priority -> cost -> mac (smaller is better)
  4. 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