PracticeLabs
Week 3Lesson 5Required42 min estimated0% progress

STP and Rapid PVST+ Basics

Explain why redundant switch links need loop prevention, work a root election and port-role assignment by hand, and read Rapid PVST+ roles and states in show spanning-tree.

Lesson orientation

What you'll learn (5 objectives)~42 min: video → lesson → check → apply → lab prep

Learning objectives

  • Explain how a Layer 2 loop causes a broadcast storm because Ethernet frames have no TTL
  • Elect a root bridge from bridge IDs — priority then MAC — and justify per-VLAN priority
  • Assign root, designated, and blocking/discarding ports using path cost and the tie-break order
  • Distinguish classic STP states from Rapid PVST+ roles and discarding/learning/forwarding states
  • Read show spanning-tree to confirm the root, the local port roles, and per-VLAN behaviour

Terms you will see

Broadcast stormBPDUBridge IDRoot bridgeRoot portDesignated portBlocking / discardingPath costExtended system IDPortFastBPDU Guard

Time breakdown

  • Read the notes20 min
  • Rapid PVST+ Visual Lab10 min
  • Build-the-tree practice6 min
  • Lab stage — read and steer the tree6 min

Assigned video

Opens on YouTube
Recommended video

Spanning Tree Protocol Part 1 (Day 20)

By Jeremy's IT Lab · Opens externally on YouTube

Assigned watch
~10 min

The link opens in a new browser tab. Return here when you finish watching.

Watch for these concepts

  • The lowest-bridge-ID root election playing out
  • Each non-root switch selecting one root port by lowest cumulative cost
  • The leftover redundant port ending in blocking or discarding

Go beyond the video

The assigned video introduces the idea. CCNA Practice Labs completes the learning path: clarify core concepts, explore how each device behaves, visualize the communication path, check your understanding, and prepare for hands-on lab work.

Watch the concept → understand it → visualize it → practice it → apply it.

Ethernet has no TTL

An IP packet carries a TTL that each router decrements until it reaches zero, which kills packets caught in a routing loop. An Ethernet frame has no such field. If a Layer 2 loop exists, a frame can circulate indefinitely — there is no mechanism in the frame itself to stop it.

Now combine that with the flooding behaviour from Lesson 1. A broadcast floods out both links of a redundant pair. Each copy reaches the other switch, which floods it again, back across both links. Copies multiply on every pass. Within seconds the links saturate, switch CPUs spike, and the MAC table flaps as the same source MAC keeps appearing on different ports on each lap. That is a broadcast storm, and it takes the entire Layer 2 network down.

What the spanning tree does
Spanning Tree Protocol builds one loop-free logical tree over the physical topology. It keeps the redundant link cabled but blocks it from forwarding, so exactly one active path exists between any two points. If the active path fails, STP unblocks the standby link and converges onto it. STP is on by default on Cisco switches — which is precisely why the storm described above does not happen when you cable a redundant pair on defaults.

Convergence follows five moves. Switches exchange Bridge Protocol Data Units and agree on one root bridge as the reference point. Every non-root switch then picks its single root port, its best path toward the root. Each link segment gets one designated port, the forwarding port onto that segment. Any remaining redundant port is put into blocking — the classic name — or discarding, the rapid name. If the topology changes, the tree recomputes and a standby port takes over. Classic 802.1D can take around 50 seconds to do this: max-age 20 seconds plus two 15-second forward-delay stages. Modern switches run the rapid version and converge in seconds.

Root election: lowest Bridge ID wins

The Bridge ID is the bridge priority followed by the switch's MAC address. The switch with the lowest Bridge ID becomes root. Priority is compared first — the range is 0 to 65535, the default is 32768, and it is configured in steps of 4096. Lower wins. If priorities tie, the MAC address breaks it, and again lower wins.

Two traps in one rule
The first is direction: it is lowest that wins, not highest. The second is what happens when nobody sets anything. If every switch keeps the default 32768, the tie falls to MAC address, so the oldest switch — often the lowest MAC — becomes root by accident. That is rarely the switch you want at the centre of your network, and it is why setting priority deliberately is a configuration step rather than an optional refinement.

Cisco runs a separate spanning tree per VLAN, called PVST+ or Rapid PVST+. To keep Bridge IDs distinct per VLAN, the switch adds the VLAN ID to the base priority — the extended system ID — so the effective priority is normally the base plus the VLAN number. The practical consequence is useful: VLAN 10 and VLAN 20 can elect different roots and therefore block different physical ports, which lets you load-balance traffic across redundant links instead of leaving one idle.

Port roles and how they are chosen

The three port roles
RoleWhere it appearsState
Root portOne per non-root switch — its best path to the rootForwarding
Designated portOne per segment, including every port on the root bridgeForwarding
Alternate / blockedThe leftover redundant portBlocking (802.1D) / Discarding (Rapid)
  1. Every port on the root bridge is designated and forwarding. The root never blocks — this alone answers many exam questions.
  2. On each non-root switch, the root port is the port with the lowest cumulative path cost to the root.
  3. On each segment, whichever end has the lower cost to the root owns the designated port.
  4. The remaining port — the higher-cost side of the redundant link — blocks or discards.

Path cost is speed-based and cumulative: each link adds a cost according to its speed, and the switch sums them along the path to the root. Lower total wins.

Common short-mode STP port costs
Link speedSTP port cost
10 Mbps100
100 Mbps19
1 Gbps4
10 Gbps2
Cost is not priority
When path costs are equal the tie-breakers apply in order: lowest sender Bridge ID, then lowest sender port priority, then lowest sender port ID. Cost and priority are a favourite source of confusion. Cost is the cumulative path metric that decides the winner; port priority only breaks a tie between two paths that already cost the same.

Reading show spanning-tree

show spanning-tree vlan 10, on the root switch
VLAN0010
  Spanning tree enabled protocol rstp
  Root ID    Priority    24586
             Address     0011.1111.1111
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24586  (priority 24576 sys-id-ext 10)
             Address     0011.1111.1111

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

Read it top-down. The protocol line confirms rstp, meaning Rapid PVST+. Compare Root ID against Bridge ID: when they match and the output says this bridge is the root, this switch is the root for VLAN 10. On a non-root switch you would instead see the neighbour's address as Root ID, one interface with Role Root and status FWD, and the redundant interface with Role Altn and status BLK. The priority 24576 sys-id-ext 10 line shows the per-VLAN arithmetic: 24576 plus VLAN 10 gives the 24586 above it.

Setting the root deliberately
! Make THIS switch the root for VLAN 10 (lowers priority to 24576)
Switch(config)# spanning-tree vlan 10 root primary

! Equivalent explicit form
Switch(config)# spanning-tree vlan 10 priority 24576

root primary lowers the priority so this switch wins the election instead of leaving it to the lowest MAC. Do it per VLAN — that is exactly how you split VLAN 10 and VLAN 20 across different roots for load balancing. There is a matching root secondary for the backup core.

PortFast and BPDU Guard — awareness level
On a pure access port where no switch will ever attach, spanning-tree portfast skips the listening and learning delay and forwards immediately. That is appropriate for a single host or a phone-plus-PC port, and never for a switch-to-switch link. Pair it with BPDU Guard so the port err-disables if a BPDU — meaning a rogue switch — ever arrives on it.

When the tree reorganises around the wrong switch

Troubleshooting — traffic hairpins after adding a switch
Symptom: after a new switch is added, VLAN 10 traffic takes an unexpected path and one uplink sits idle even though both uplinks are up. Diagnosis: show spanning-tree vlan 10 shows the new switch became root by lowest MAC, because every priority is still the default 32768. The tree reorganised around the wrong centre and blocked a different port than intended. Fix: set the intended core as root with spanning-tree vlan 10 root primary, and root secondary on the backup core. The tree re-converges with the blocked port back on the correct redundant link. The lesson generalises: a root elected by accident is a design problem, not a fault.

What you should retain

  • Ethernet has no TTL, so a Layer 2 loop becomes a broadcast storm; STP blocks redundant paths to leave one active path.
  • The root is the lowest Bridge ID — priority first, then MAC — and every port on the root bridge is designated and forwarding.
  • Each non-root switch has exactly one root port, the lowest cumulative cost to the root; the leftover port blocks or discards.
  • Cost is speed-based and cumulative: 1 Gbps is 4, 100 Mbps is 19.
  • Ties break on sender Bridge ID, then sender port priority, then sender port ID.
  • Rapid PVST+ is a fast per-VLAN tree with states discarding, learning, and forwarding.
Pause and predictNot scored — nothing is recorded

Before you read on

Three switches, all at default priority 32768, base MACs ending SW1 …1111, SW2 …2222, SW3 …3333. All links are 1 Gbps (cost 4), wired as a triangle. (1) Which switch is root, and why? (2) SW2 has one port direct to SW1 and one reaching SW1 via SW3 — which is its root port? (3) On the SW2–SW3 segment, which end is designated and which port blocks?

Interactive tool
Required~10 min

Rapid PVST+ Visual Lab

Run an election and watch the port roles resolve, then change a priority and watch the tree re-converge around a different root. Root election and role assignment are the hardest part of this lesson to hold in your head from prose, and this is the one place where watching it happen genuinely beats reading about it.

Lab preparation

Prepare for the lab

Available nowWeek 3

Week 3 Lab — VLAN and Trunk (stage 3 of 4)

The redundant trunk links you built in Lesson 3 are a ready-made loop. This stage reads and then steers the tree over that same topology — no new cabling, just a second link between SW1 and SW2 with the default STP already running on it.

This lesson prepares you to:

  • Identifying the root bridge and local port roles from show spanning-tree vlan 10
  • Predicting the root from the bridge IDs before running the command
  • Setting a deterministic root with spanning-tree vlan 10 root primary
  • Observing that VLAN 20 stays rooted elsewhere — per-VLAN spanning tree in practice

Keep the topology: Lesson 6 bundles these same two links into an EtherChannel.

Open the lab

Study deeper

Topic guides extend this lesson — they do not replace the first-party walkthrough above.

STP & EtherChannel

For broadcast storms, BPDU format, and the STP version history in depth — the background this lesson compresses into one paragraph