Spanning Tree Protocol (STP)

 

Definition of STP

Spanning Tree Protocol (STP) is a Layer 2 protocol that prevents switching loops in a network by dynamically blocking redundant paths and creating a loop-free logical topology.


Key Terms in STP

  • Bridge ID (BID):
    Unique identifier for each switch, made of Bridge Priority (default 32768) + MAC address.

  • Root Bridge:
    The switch with the lowest Bridge ID; becomes the logical center of the STP topology.

  • Root Port (RP):
    On non-root switches, the port with the lowest path cost to reach the Root Bridge. Only one Root Port per switch.

  • Designated Port (DP):
    On each network segment, the port that has the lowest cost to the Root Bridge. Note: All ports in root bridge is designated port. 

  • Blocked/Non-Designated Port:
    Ports that are neither Root nor Designated. These remain in a blocking state to prevent loops.

  • Path Cost:
    • A numeric value assigned to a network link based on its bandwidth.
    • Lower cost = higher bandwidth (preferred path).
    • Used by STP to select the shortest path to the Root Bridge.
    • Path Cost Values
      • 10 Mbps (Ethernet): 100
      • 100 Mbps (Fast Ethernet): 19
      • 1 Gbps (Gigabit Ethernet): 4
      • 10 Gbps (10 Gigabit Ethernet): 2
  • Port States (Classic STP):

    1. Blocking – listens for BPDUs, doesn’t forward.

    2. Listening – preparing to forward, no MAC learning.

    3. Learning – learns MACs, no forwarding.

    4. Forwarding – fully operational.

    5. Disabled – administratively shut down.

  • BPDU (Bridge Protocol Data Unit):
    Control packets exchanged by switches to share STP information.

  • Timers:

    • Hello Time: 2 sec (interval between BPDUs).

    • Forward Delay: 15 sec (Listening/Learning state duration).

    • Max Age: 20 sec (time BPDU is valid).

  • Types of STP:

    • STP (802.1D) – Original, slower convergence.

    • RSTP (802.1w) – Rapid STP, faster convergence.

    • MSTP (802.1s) – Multiple STP, for VLAN groups.

    • PVST+ – Cisco per-VLAN STP.

    • Rapid PVST+ – Cisco’s per-VLAN rapid STP.

Comments

Popular posts from this blog

VLAN Trunking Protocol