badge icon

This article was automatically translated from the original Turkish version.

Article

Spanning Tree Protocol (STP)

The Spanning Tree Protocol (STP) is a Layer 2 (data link layer) protocol developed to prevent loop formation in Ethernet-based networks. STP, developed by Dr. Radia Perlman in 1985, is defined by the IEEE 802.1D standard. This protocol controls redundant connections within a LAN by ensuring that only one active path is used, thereby preventing issues such as broadcast storms, MAC address table inconsistencies, and continuous frame loops.

Working Principle

When multiple switches in a network are redundantly interconnected, STP activates to prevent potential loops by temporarily blocking certain connections. This process consists of the following steps:

  1. Root Bridge Selection: All switches exchange Bridge ID information via BPDU (Bridge Protocol Data Unit) frames. The switch with the lowest Bridge ID is elected as the Root Bridge.
  2. Path Metric Calculation: The distance to the Root Bridge is calculated for each switch, and each switch selects its Root Port.
  3. Port Roles and States: Root Ports (RP), Designated Ports (DP), Alternate Ports, and Blocked Ports are assigned.
  4. Loop Prevention: Redundant paths are disabled to establish a loop-free network topology.

Port Roles and States

Ports may exist in the following states: Blocking, Listening, Learning, Forwarding, and Disabled.

STP Types

STP (IEEE 802.1D – Standard STP)

This is the original Spanning Tree Protocol. It applies state transitions sequentially to all ports to prevent network loops. The reconvergence time is relatively long (30 to 50 seconds). It is suitable for small networks but is rarely used today.


Usage Scenarios:

  • Simple networks with low risk of loops.
  • Rarely used on modern switches.

RSTP (IEEE 802.1w – Rapid Spanning Tree Protocol)

A faster version of STP. It improves the BPDU structure and significantly reduces transition times between port states. It is backward compatible with IEEE 802.1D. Port transition times can be reduced to just a few seconds.


Usage Scenarios:

  • Medium and large-scale enterprise networks.
  • Environments requiring faster fault recovery.
  • Networks without VLAN segmentation requirements.

MSTP (IEEE 802.1s – Multiple Spanning Tree Protocol)

MSTP allows VLANs with similar topologies to be grouped, enabling a separate STP instance for each group. This enables VLAN-based load balancing. MSTP is based on RSTP and inherits its fast transition advantages.


Usage Scenarios:

  • Large enterprise campus networks with hundreds of VLANs.
  • Networks requiring traffic distribution based on VLANs.
  • Networks where VLAN groups must be topologically separated for load balancing.

PVST+ (Per VLAN Spanning Tree Plus)

Developed by Cisco. It creates a separate STP instance for each VLAN, allowing a unique Root Bridge to be elected per VLAN. It is enabled by default on Cisco devices but operates only between Cisco devices.


Usage Scenarios:

  • Networks using Cisco equipment where per-VLAN traffic management is desired.
  • Environments requiring independent topologies for each VLAN.

Rapid PVST+

A combination of PVST+ and RSTP. It provides both VLAN-based management and rapid reconvergence. Port transition times are very low.


Usage Scenarios:

  • Large Cisco-based networks.
  • Fast networks requiring detailed traffic control per VLAN.

STP Configuration and Implementation

On manufacturers such as Cisco and Meraki, STP configurations can be performed via the device’s CLI or GUI interfaces. Root Bridge assignment is typically achieved by modifying the bridge priority value; the switch with the lowest priority value becomes the Root Bridge. This allows network administrators to control the location of the Root Bridge and consequently influence data flow. Additionally, systems like Meraki can automatically block certain ports when abnormal port behavior is detected, particularly important in scenarios where Layer 2 loops arise from physical node changes.

Advantages and Disadvantages

Advantages

  • Prevents Layer 2 loops.
  • Prevents issues such as broadcast storms and MAC flapping.
  • Reconfigures the network in case of failure, especially quickly with RSTP and MSTP.

Disadvantages

  • Slow convergence times in classic STP.
  • Redundant links remain inactive, leading to inefficiency.
  • Management complexity increases with the number of VLANs, especially in structures like PVST+.

Author Information

Avatar
AuthorCihat DemirelDecember 8, 2025 at 10:28 AM

Tags

Discussions

No Discussion Added Yet

Start discussion for "Spanning Tree Protocol (STP)" article

View Discussions

Contents

  • Working Principle

  • Port Roles and States

  • STP Types

    • STP (IEEE 802.1D – Standard STP)

    • RSTP (IEEE 802.1w – Rapid Spanning Tree Protocol)

    • MSTP (IEEE 802.1s – Multiple Spanning Tree Protocol)

    • PVST+ (Per VLAN Spanning Tree Plus)

    • Rapid PVST+

  • STP Configuration and Implementation

  • Advantages and Disadvantages

    • Advantages

    • Disadvantages

Ask to Küre