Week 5 · Lesson 18

STP Fundamentals

Redundancy means parallel paths, and parallel paths mean loops. The Spanning Tree Protocol is the layer of calm underneath every switched network: it elects a root, blocks just enough ports to break every loop, and keeps the rest forwarding. This lesson is the mathematics of that calm — bridge IDs, BPDUs, path costs, port roles, and the five port states.

CCNA 200-301 Domain 2.0 Network Access Verified 2026-10-11
Learning objectives
Part 1

The loop problem

Add a second link to a network for redundancy and you create a forwarding loop. Three disasters follow, and the exam names all of them:

STP exists to prevent these by making sure a loop never exists in the first place. It does not add bandwidth; it removes paths until the active topology is a single tree.

Definition — spanning tree A spanning tree is a subset of the topology’s links that reaches every switch exactly once — no loops, every node still connected. IEEE 802.1D’s STP computes this tree and then blocks every port that is not part of it. The blocked ports quietly stand by for the day a primary link fails.
In this lesson · select a part to jump

Key ideas & exam traps · select one

Part 2

The spanning tree idea

STP’s algorithm has three steps: elect a root bridge, pick the best path to the root from every other switch, and block every port that is not on such a path. The result is a tree rooted at the root bridge. Every switch other than the root has exactly one port that leads toward the root (its root port), every LAN segment has exactly one switch that owns it (the segment’s designated port), and every other port is blocked.

SW1 ROOT bridge ID 32768.aaaa.aaaa.aaaa SW2 root port Gi0/1 SW3 root port Gi0/1 cost 4 cost 4 BLK redundant link — blocked
Every non-root switch reaches the root through its root port. The extra triangle link is not needed, so STP blocks it — leaving a loop-free tree with a hot standby in place.
Part 3

The bridge ID: priority + MAC

Every switch is identified in STP by its bridge ID, traditionally a combination of priority and MAC address:

On modern Cisco platforms the running identity is the extended system ID: the effective bridge ID combines the configurable priority plus the VLAN number, e.g. priority 32768 in VLAN 10 appears as 32778 (32768 + 10) in show output. The rule the exam wants is plain and stemless: the bridge with the lowest bridge ID wins the election, where bridge ID = priority + MAC, compared in that order.

Exam tip Root election: compare priority first; on a tie, compare the base MAC numerically (lowest wins). Defaults: priority 32768, increments of 4096. Both facts are free marks if you learn the single sentence: “lowest bridge ID wins; priority is the first half, MAC is the tie-breaker.”
Part 4

Electing the root bridge

At startup every switch believes it is the root and sends BPDUs claiming so. As the BPDUs propagate, each switch compares the received bridge ID with its own and with those it has heard. The lower value wins, and the winner becomes the shared root. The election is stable because the bridge ID never changes — it is a property of the switch, not of the traffic. In a real design you pick the root deliberately (usually the core switch) and lower its priority, because someone will win the election whether you plan it or not.

Part 5

BPDUs

STP’s vocabulary is the Bridge Protocol Data Unit, a Layer 2 frame sent to the multicast address 01:80:C2:00:00:00 (the STP multicast address). A BPDU carries the sender’s bridge ID, the root bridge ID as it knows it, the path cost to the root, and timers. The root bridge originates BPDUs with all the timer information; every other switch improves the root ID or the path cost and forwards accordingly. BPDUs are what make the tree self-healing: when a link dies, blocked ports stop hearing superior BPDUs and begin the transition to forwarding (Section 8).

Two BPDU types matter conceptually: Configuration BPDUs carry the normal election and topology information, and TCN (Topology Change Notification) BPDUs are sent whenever the topology changes so the root can flush stale forwarding entries and the network can converge on the new tree.

Part 6

Path cost

Each link has a path cost derived from its bandwidth. The path cost to the root is the sum of the costs of the links along the path; the port whose path has the lowest total cost becomes the root port. The classic IEEE 802.1D costs:

Link speedIEEE 802.1D costModern shortcut cost
10 Mbps1002,000,000
100 Mbps19200,000
1 Gbps420,000
10 Gbps22,000

The exam usually tests the 802.1D column — and the fact that the cost is inverse to speed: faster link, smaller number. In the figure above, the 1 Gbps links cost 4 each, so SW2’s path to the root through SW3 is 4 + 4 = 8, worse than its direct path (4), which is why its direct port becomes the root port and the far-side port blocks.

Part 7

Port roles: root, designated, non-designated

Once the root is known, every port in the network takes one of three roles:

The heuristic that maps roles to ports: every switch has one root port; every link has one designated port on one side; everything else blocks. In the triangle figure, SW2 and SW3 each have a root port toward SW1; the link between SW2 and SW3 is owned by none and blocks.

Part 8

The five port states

Ports do not start forwarding. They pass through states, and the exam expects the four memorable ones plus the disabled afterthought:

StateLearning MACs?Forwards frames?Notes
BlockingNoNoListens for BPDUs; non-designated ports live here.
ListeningNoNoAfter max age expires; still deciding roles.
LearningYesNoPopulates the MAC table without forwarding yet.
ForwardingYesYesFully operational; normal data plane behaviour.
DisabledNoNoAdministratively down; not participating in STP.

The order is always the same: Blocking → Listening → Learning → Forwarding. The exam’s favourite trap: learning populates the MAC table but does not forward frame data — it is the middle state that makes you want to say “it forwards” and lose the mark.

Reference table · select a row

Part 9

Timers and convergence

STP’s default timers are canonical numbers:

Put them end to end and the cost of classic STP convergence is visible: after a failure, a blocked port waits max age (20 s), then Listening (15 s), then Learning (15 s) — up to about 50 seconds before forwarding resumes. That wait exists to guarantee no loop, but it is glacial by modern standards and is exactly why Rapid PVST+ (Lesson 19) exists.

Note Why wait at all? If a port began forwarding immediately after a topology change, a temporary loop would form. Listening lets the candidate port verify there is no other BPDU claiming to be better; Learning primes the MAC table; only then does forwarding start. STP deliberately trades seconds of availability for guaranteed loop-freedom.
Part 10

Verification with show spanning-tree

S1# show spanning-tree
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     aaaa.aaaa.aaaa
             This bridge is the root
  Bridge ID  Priority    32768
             Address     aaaa.aaaa.aaaa

Interface     Role Sts Cost      Prio.Nbr Type
Gi0/1         Desg FWD 4         128.1    P2p
Gi0/2         Desg FWD 4         128.2    P2p
Gi0/3         Desg FWD 4         128.3    P2p

On SW1 (the root), every port is designated and forwarding. On SW2 the same command would show Root for the root port and Altn BLK (alternate/blocked) for the port toward the loop, which is how you read a network’s health at a glance: one switch shows all designated; other switches show exactly one root port. Any switch reporting two root ports has a misconfiguration.

Watch out The cost column shows the port’s cost in 802.1D terms on the type line location. Cost 4 means a 1 Gbps link. If a question gives you a topology of 100 Mbps legs and asks for the costs, expect 19 per leg — not 4. Mixing the two cost tables is a classic planted error.
Key terms

The vocabulary you need

Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.

Key terms · select a term

Part 11 · Your turn

Review

Check what you have learned with these review questions.

Review · 5 questions

Sources

Sources & references

  1. Cisco. CCNA (200-301) Exam Topics. cisco.com.
  2. IETF. Request for Comments (RFCs). rfc-editor.org.
  3. IANA. Internet Assigned Numbers Authority registries. iana.org.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.