Everyday Guidebooks
Cover of CCNA

Cybersecurity & IT

CCNA: How to Get Comfortable with Spanning Tree

An Unofficial Guide to Root Bridges, Port Roles, Path Costs, and Topology Changes

by Todd Michael

Available now

If your search history includes “ccna how to get” a better handle on spanning tree, this focused guide gives you a place to start. Instead of asking you to memorize isolated facts, it walks you through the decisions switches make to keep a redundant Ethernet network free of forwarding loops.

Learn how bridge IDs influence root elections, how switches compare path costs, and how port roles emerge when several links compete. Follow worked text examples that progress from small networks to more demanding tie-break scenarios. Then test your reasoning with original questions and explanations, including cases where a link fails or the topology changes.

Designed for CCNA candidates who already know basic switching, this book concentrates on one subject rather than attempting to replace a complete exam guide. Build a repeatable approach you can use when the topology on the page looks unfamiliar.

This independent guide is not affiliated with or endorsed by Cisco.

Contents
  1. 1. Why Switched Networks Need Spanning Tree
  2. 2. A Repeatable Method for Solving STP
  3. The Worksheet
  4. Set Up a Three-Switch Example
  5. Step 1: Elect the Root
  6. Step 2: Calculate the Root Path Costs
  7. Step 3: Select Root Ports
  8. Step 4: Select Designated Ports
  9. Step 5: Check the Finished Topology
  10. Add One Complication: A Cost Change
  11. What to Do When the Facts Are Incomplete
  12. Make the Sequence a Habit
  13. 3. Bridge IDs and the Root Election
  14. 4. Path Costs from Each Switch to the Root
  15. The Cost Advertised by a Neighbor
  16. A Three-Switch Calculation
  17. Direct Does Not Always Mean Better
  18. Costs Are Inputs, Not Universal Constants
  19. A Four-Switch Topology
  20. Why Circular Arithmetic Is Dangerous
  21. When a Port Cost Changes
  22. A Practical Worksheet for Cost Problems
  23. Try It Before Looking
  24. Carry the Costs Forward
  25. 5. Choosing Root Ports
  26. 6. Designated Ports and Blocked Paths
  27. 7. Port States and Network Convergence
  28. 8. Rapid Spanning Tree in Context
  29. 9. VLANs and Per-VLAN Decisions
  30. 10. When a Link or Switch Fails
  31. 11. Topology Changes and MAC Address Learning
  32. 12. Reading Switch Output
  33. 13. Mixed Topology Challenges
  34. 14. Original Practice Questions and Review
  35. Other Books by Todd Michael

Read a sample: 1. Why Switched Networks Need Spanning Tree

A redundant link looks like an obvious improvement. If two switches have more than one possible path between them, a single cable failure need not isolate part of the network. The difficulty is that Ethernet switches do not automatically treat one path as the primary path and another as a quiet spare. Without a mechanism to control the active paths, redundancy can create a loop.

Spanning Tree Protocol, or STP, makes physical redundancy usable by establishing a loop-free forwarding topology. Some links can remain physically connected while selected ports do not forward ordinary traffic. If the topology changes, spanning tree can recalculate which paths should be used.

This distinction between the physical topology and the forwarding topology is the foundation of the book. The physical topology describes the switches and cables that exist. The forwarding topology describes the paths currently available for ordinary Ethernet traffic within a spanning tree instance. They need not be identical.

Before learning to predict root bridges, path costs, and port roles, it helps to see the problem those decisions solve.

Imagine three switches named Alder, Birch, and Cedar. Each switch has two interswitch connections:

- Alder port 1 connects to Birch port 1. - Birch port 2 connects to Cedar port 1. - Cedar port 2 connects to Alder port 2.

Together, the links form a triangle. A host named H1 connects to Alder, and a host named H2 connects to Cedar. Assume the relevant ports belong to the same Ethernet broadcast domain and that all three interswitch links can carry its traffic.

The triangle is valuable because it provides alternative routes. H1 can reach H2 through the direct Alder–Cedar link, or traffic can travel from Alder through Birch to Cedar. If one link fails, another physical route may remain.

But now suppose all three interswitch links forward Ethernet frames and no effective loop-prevention mechanism is operating. The same triangle that offers resilience also gives some frames a path back to a switch that has already handled them.

The notation in this book will state connections in plain text, such as “Alder port 1 connects to Birch port 1.” A port name belongs to the switch immediately before it: Alder port 1 is not the same interface as Birch port 1. When an example requires real-looking interface names, they will be supplied explicitly. Port labels alone do not imply a preferred path or a particular spanning tree role.

A segment is the network portion to which one or more switch ports connect. In the common point-to-point examples in this book, an interswitch link forms a segment with one switch port at each end. Keeping the two ends separate matters: spanning tree assigns roles to ports, not simply to cables.

To understand the loop, review two ordinary switching behaviors: learning and forwarding.

When a switch receives an Ethernet frame, it examines the source MAC address and associates that address with the receiving port in its MAC address table. If a later frame is destined for that learned address, the switch can normally send it toward the associated port instead of flooding it everywhere.

The destination address influences what happens next. A switch generally floods a broadcast frame out other eligible ports in the same VLAN. It also generally floods an unknown unicast frame—a unicast frame whose destination is not currently in the relevant MAC table. “Eligible” matters: the switch does not send the frame back out the port on which it arrived, and VLAN membership, spanning tree state, and other controls can limit where it forwards.

Flooding is useful. A host’s Address Resolution Protocol request, for example, may need to reach every device in its IPv4 broadcast domain. Unknown unicast flooding also allows traffic to reach a destination before the switch has learned where that destination resides.

The problem is not flooding by itself. The problem is flooding through a topology that allows copies to return.

Suppose H1 sends a broadcast frame into Alder. With all three interswitch links forwarding, a simplified sequence looks like this:

1. Alder receives the frame from H1 and learns H1’s source MAC address on the host-facing port. 2. Alder floods the frame toward both Birch and Cedar. 3. Birch receives its copy on the Alder link, learns H1’s address there, and floods the frame toward Cedar. 4. Cedar receives the copy sent directly by Alder and floods it toward Birch and H2. 5. Cedar also receives a copy from Birch and can flood that copy toward Alder and H2.

The exact order in which the copies arrive depends on timing. The important result does not: switches can receive copies from different directions and continue flooding them around the loop. Copies may also reach the hosts more than once.

Ordinary Ethernet frames do not have a general-purpose hop limit that switches decrement to stop this Layer 2 circulation. In a loop with continuing forwarding, frames can persist and multiply through the available paths. The resulting traffic can consume link capacity and switch resources, interfering with useful communication. A severe accumulation of broadcast traffic is often called a broadcast storm.

The word storm describes an effect, not a special kind of frame. Broadcasts are normal and necessary; uncontrolled repeated forwarding is the trouble. Unknown unicast traffic can also be repeatedly flooded, and some multicast traffic may be flooded depending on how the network handles it. The triangle demonstrates why a loop is…

More Cybersecurity & IT

Cover of The White Hat Bible, Volume 1The White Hat Bible, Volume 1Available nowCover of The White Hat Bible, Volume 2The White Hat Bible, Volume 2Available nowCover of The White Hat Bible, Volume 3The White Hat Bible, Volume 3Available nowCover of The White Hat Bible, Volume 4The White Hat Bible, Volume 4Available nowThe White Hat Bible, Volume 5Available nowCover of The White Hat Pocket GuideThe White Hat Pocket GuideAvailable now

About Todd Michael

Todd Michael is an American author and the founder of ToddMichael.tv. He writes practical, plain-English books on money, health, preparedness, technology, games, humor and more.

About the author Todd Michael · Todd Michael’s author site

Part of the ToddMichael.tv network.