Interactive STP Simulator: Watch Spanning Tree Protocol Converge

MB
Moussa BENALI
Senior Network & Security Engineer · 6+ years designing and securing enterprise networks. CCNA, Security+, and AWS certified.
Verified for CCNA 200-301 · Apr 2026

About This Simulator

This interactive simulator lets you watch Spanning Tree Protocol converge in real-time. Instead of memorizing rules from a textbook, you'll see BPDUs being exchanged, the Root Bridge being elected, Root Ports and Designated Ports being assigned, and blocking ports preventing loops - all animated step by step.

💡
How to use: Choose a topology below, then customize switch priorities, MAC addresses, and link speeds using the parameter panel. Click "Start STP" and walk through each step. Click on any switch to see its details. The side panel explains what's happening at each stage.

Choose from three difficulty levels:

  • Basic Triangle - 3 switches, perfect for understanding the fundamentals of root election and port roles
  • Enterprise Ring - 5 switches with mixed link speeds (1 Gbps and 100 Mbps), showing how cost affects path selection
  • Complex Mesh - 7 switches in a hierarchical design with multiple redundant paths and tiebreaker scenarios

Choose Your Topology

Select a network topology to begin the simulation.

Basic Triangle

3 switches, equal priority, equal link speeds. Learn root election by MAC address tiebreaker.

Beginner

Enterprise Ring

5 switches with mixed speeds (1 Gbps + 100 Mbps). See how cost determines best paths.

Intermediate

Complex Mesh

7 switches in a hierarchical design. Multiple redundant paths with BID tiebreaker scenarios.

Advanced
STP Simulation

STP Converged!

The network is loop-free with optimal forwarding paths.

1
Root Bridge
2
Root Ports
3
Designated Ports
4
Converged
Root Bridge
Forwarding
Blocking
Root Port
Designated
Blocking
BPDU
Select a topology to begin.

How Root Bridge Election Works

The Root Bridge is the central reference point for the entire STP topology. Every other switch calculates its shortest path back to this switch. The election is based on the Bridge ID (BID).

Bridge ID = Priority + MAC Address. The switch with the lowest BID becomes the Root Bridge. Priority is compared first; if tied, the lowest MAC address wins.

The Bridge ID has two components:

  • Bridge Priority - A configurable value between 0 and 61440, in increments of 4096. The default is 32768 on all switches
  • MAC Address - If priorities are tied, the switch with the lowest base MAC address wins the tiebreaker
📝
CCNA Exam Note: On the exam, you may see questions where all switches have default priority (32768). In that case, the switch with the lowest MAC address becomes root. Administrators should always explicitly set the root bridge using spanning-tree vlan 1 priority 0 or spanning-tree vlan 1 root primary.

STP Port Cost by Link Speed

Link SpeedSTP Cost (802.1D)RSTP Cost (802.1w)
10 Mbps1002,000,000
100 Mbps19200,000
1 Gbps420,000
10 Gbps22,000

How Root Port Election Works

Every non-root switch must select exactly one Root Port - the port with the best (lowest cost) path back to the Root Bridge. The selection uses this tiebreaker sequence:

  1. Lowest Root Path Cost - The cumulative cost of all links from this switch to the Root Bridge. Lower total cost wins
  2. Lowest Sender Bridge ID - If two paths have equal cost, the path through the neighbor with the lower BID wins
  3. Lowest Sender Port ID - If connected to the same upstream switch via parallel links, the lower port number wins
💡
Tip: In the simulator above, try the "Enterprise Ring" topology. Notice how the 1 Gbps links (cost 4) create shorter paths than the 100 Mbps links (cost 19), even though they may have more hops.

How Designated Port Election Works

Every network segment (link between two switches) must have exactly one Designated Port. This port is responsible for forwarding traffic onto that segment.

  1. All Root Bridge ports are Designated - The Root Bridge's cost to itself is 0, so it always wins
  2. Lowest Root Path Cost - On other segments, the switch closer to the root (lower cumulative cost) makes its port designated
  3. Lowest Sender Bridge ID - Tiebreaker if both switches have equal cost to root
  4. Lowest Sender Port ID - Final tiebreaker for parallel links through a hub (rare in modern networks)
⚠️
Blocking Ports: Any port that is NOT elected as Root Port or Designated Port goes into Blocking state. These ports receive BPDUs but do not forward data - this is how STP prevents loops.
Included with Exam Purchase

Get the Complete CCNA Study Guide

When you purchase a CCNA practice exam, you get full access to our comprehensive study guides covering every exam topic in depth - not just the free samples here.

All CCNA topics covered Detailed explanations 10 free preview pages
Create Free Account to Preview

STP Practice Questions

Test your understanding with these 5 expert-created questions. Each includes a detailed explanation to reinforce your learning.

Ready for More?

You've just explored STP convergence interactively. Here's how to keep preparing for your CCNA:

Frequently Asked Questions

How does the STP root bridge election work?

All switches exchange BPDUs containing their Bridge ID (Priority + MAC Address). The switch with the lowest Bridge ID becomes the Root Bridge. Priority (default 32768) is compared first; if tied, the lowest MAC address wins. Administrators can influence the election by setting spanning-tree vlan <id> priority <value>.

What is the difference between Root Port and Designated Port?

A Root Port is found on non-root switches - it's the single port with the lowest cost path back to the Root Bridge. A Designated Port is the port on each network segment responsible for forwarding traffic - one per segment. All ports on the Root Bridge are automatically Designated Ports.

Why do some ports go into Blocking state?

Blocking is STP's loop prevention mechanism. If a port is not elected as a Root Port or Designated Port, it means allowing traffic on that port would create a loop. The port enters Blocking state: it stops forwarding data frames but continues receiving BPDUs so it can detect topology changes and potentially transition to forwarding if needed.

How does STP link cost affect path selection?

STP assigns costs based on link bandwidth: 10 Mbps = 100, 100 Mbps = 19, 1 Gbps = 4, 10 Gbps = 2. The Root Path Cost is the cumulative cost of all links from a switch to the Root Bridge. Switches choose the path with the lowest total cost. This means a single 1 Gbps link (cost 4) is preferred over two 100 Mbps hops (cost 38).