Use it for classic-STP timer analysis, convergence timing, stale-BPDU questions and cases where ports remain non-forwarding longer than expected.
Spanning Tree Fundamentals
Classic STP builds a loop-free tree by electing a root, selecting roles and using timers to age information and move ports through transitional states. Timer values propagate from the root in standard operation.
1. Classic STP elects a root and blocks redundant ports.
2. Timers: hello 2 s, max age 20 s, forward delay 15 s (from root).
3. Convergence up to 30–50 s.
4. Don't tune timers casually.
5. Prefer RSTP.
root election → root ports → designated ports → blocked ports → timers → forwarding
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification and known-good state Verify boundary
First establish the active spanning-tree mode and current root. For the same VLAN/instance, inspect root-originated timer values and verify BPDUs arrive at the expected cadence on root/designated paths. During a controlled topology event, timestamp role/state changes and compare them to the protocol mode: classic STP may legitimately wait on timer boundaries, whereas RSTP should use rapid handshakes where eligible. Correlate topology-change counters and interface events so an apparently “slow timer” is not actually intermittent link/BPDU loss. Known-good means stable root information, expected BPDU cadence and convergence consistent with the selected STP flavor. Treat each command output, counter, packet capture and state display as an observation from its own boundary. Keep the same VLAN, VRF, interface, prefix, flow or control-plane instance throughout the investigation so evidence from different contexts is not accidentally combined. When a change is made, preserve the original failing test, allow the relevant protocol to converge, re-run that same test, and check one adjacent known-good case for regression before closing the issue.
Step 2 Verification and output interpretation Verify boundary
Use show spanning-tree for the relevant VLAN/instance to identify the root bridge, local root path cost, port roles and states. Confirm the expected device is root and that blocked/alternate ports align with the intended redundant topology. Compare root-port changes over time with topology changes rather than treating any non-forwarding port as a failure. BPDU counters/detail can help show that control information is being received. To validate actual endpoint forwarding, combine STP state with VLAN/trunk/MAC evidence because STP forwarding is only one prerequisite for data delivery.
Step 3 Verification & troubleshooting Narrow the fault
Find the root → identify each switch root port → identify designated port per segment → verify remaining redundant ports are intentionally non-forwarding.
Step 4 Failure signatures and troubleshooting branches Narrow the fault
Repeated max-age expiry indicates lost or filtered superior BPDUs, not necessarily a need for a larger timer. Excessive forward-delay waits may be expected under classic STP but suspicious if the network claims to run RSTP and the link is eligible for rapid transition. Inconsistent timers across a mixed or misconfigured environment can create unpredictable convergence. If the root changes unexpectedly, solve election/BPDU reachability first. If one port alone is slow, inspect role, edge/point-to-point classification and physical stability before changing global timers. Treat each command output, counter, packet capture and state display as an observation from its own boundary. Keep the same VLAN, VRF, interface, prefix, flow or control-plane instance throughout the investigation so evidence from different contexts is not accidentally combined. When a change is made, preserve the original failing test, allow the relevant protocol to converge, re-run that same test, and check one adjacent known-good case for regression before closing the issue.
Step 5 When the problem is really fixed Narrow the fault
Reproduce the original topology event and measure convergence with the intended root and stable BPDUs. Confirm no loop, duplicate forwarding path or prolonged black hole occurs, and verify an adjacent VLAN/instance follows its own expected timer/state model. If timer configuration changed, document the design rationale and test both failure and restoration. Authored timer expectations are not observed production timings; only separately captured timestamps or device outputs can establish actual behavior. Closure means the original failure is no longer reproducible for a technically explained reason and a bounded regression check is clean. Authored guidance, expected output and relation metadata are not observed Evidence, human review or verification timestamps; those truth states must only be created by their dedicated workflows when real observations exist. Treat each command output, counter, packet capture and state display as an observation from its own boundary. Keep the same VLAN, VRF, interface, prefix, flow or control-plane instance throughout the investigation so evidence from different contexts is not accidentally combined. When a change is made, preserve the original failing test, allow the relevant protocol to converge, re-run that same test, and check one adjacent known-good case for regression before closing the issue.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
The Bridge ID (BID) identifies a spanning-tree bridge and participates in root election.
Subtopic Root BridgeThe STP root bridge is the bridge with the lowest effective Bridge ID for the spanning-tree instance; all other bridge and port-role decisions are calculated relative to that root.
Subtopic Root PortThe STP root port is a non-root bridge’s best forwarding path toward the root for a spanning-tree instance, selected by the superior received BPDU/root-path vector and tie-breakers.
Subtopic Designated PortAn STP designated port is the port selected to provide the best path from a shared segment toward the root bridge; one designated forwarding role exists per segment and STP instance.
Subtopic Alternate PortAn RSTP alternate port is a discarding backup path toward the root that receives superior BPDU information from another bridge and can rapidly replace a failed root path.
Subtopic Path CostSTP path cost is the additive metric used to compare paths toward the root bridge; lower total root path cost is preferred before later bridge/port tie-breakers are considered.
Subtopic Bridge PrioritySTP bridge priority is the configurable component of the Bridge ID used in root election; on common Cisco PVST+/Rapid-PVST+ implementations it combines with the VLAN system-ID extension and MAC address.
Subtopic Port PrioritySTP port priority contributes to the Port ID and acts as a late tie-breaker when competing paths have otherwise equal root-path information; it should be tuned only after understanding cost and upstream Bridge IDs.
Subtopic BPDUSpanning Tree BPDUs carry bridge/root identity, root-path information and timer/control data that switches compare to build a loop-free Layer-2 topology.
Recognize the symptom, then prove the boundary
Observed symptom → candidate boundary → discriminating check → original-test closure. A signature narrows the search; it never proves root cause by itself.
MAC address flaps between switch ports
The same source MAC is learned repeatedly on different interfaces.
L2 loop · mispatched link · multi-homed endpoint/appliance · port-channel inconsistency
identify exact ports/VLAN → check STP role/state → check EtherChannel membership before shutting links
MAC flapping is a location symptom, not automatic proof of an STP defect.
Repeat the original failing test after the minimum controlled change before calling recovery verified.Frequent STP topology changes
Topology-change counters/timestamps rise repeatedly during instability.
flapping edge/uplink · root instability · loop-protection event · port-channel member instability
find the source interface → check root consistency → correlate interface and EtherChannel events
Topology changes do not prove an STP loop; they report topology churn.
Repeat the original failing test after the minimum controlled change before calling recovery verified.Do not tune hello, max-age or forward-delay independently to “make STP faster” without validating diameter and platform constraints. RSTP accelerates convergence with different mechanisms rather than simply shrinking 802.1D timers.
show spanning-tree vlan <vlan>— root, timers, port statesshow spanning-tree vlan <vlan> detail | include changes|occurr— topology changes
ReferenceWhat it is1 section · depth on demand
What it is
Spanning Tree fundamentals describe how bridges exchange BPDUs, elect a root, calculate path cost and choose one loop-free forwarding topology.
ReferenceWhy it matters1 section · depth on demand
Why it matters
Use these rules to predict why a port forwards or blocks and to distinguish correct redundancy from an actual Layer 2 failure.
ReferenceImportant terms & boundaries6 sections · depth on demand
Key points
The decision chain starts with root Bridge ID, then total root path cost, then upstream sender Bridge ID/port identifiers when ties must be broken. Exact tie-break detail depends on the comparison being made.
In depth
Spanning tree fundamentals: bridge ID, root election, port roles
Every spanning-tree decision comes down to comparing bridge IDs, path costs and port IDs, in a fixed order.
Bridge ID (from the Catalyst 9300 STP guide)
The bridge ID is 8 bytes. The first 2 bytes hold a 4-bit priority and a 12-bit extended system ID equal to the VLAN number. The remaining 6 bytes are the switch MAC address. That's why priorities can only be set in steps of 4096, and why VLAN 10 with the default priority shows 32778 (32768 + 10).
Election steps
| Step | Rule |
|---|---|
| 1 | Root bridge: lowest bridge ID (priority first, then MAC) |
| 2 | Root port on each non-root switch: lowest total path cost to the root |
| 3 | Designated port on each segment: the port with the lowest cost to the root |
| 4 | All other ports: blocked (alternate or backup in RSTP) |
Ties are broken by the lowest sender bridge ID, then the lowest sender port ID (port priority, then port number).
C9300# show spanning-tree vlan 10
VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address a4bb.6d11.2200
Cost 2
Port 2081 (Port-channel10)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
Address a4bb.6d33.4400
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po10 Root FWD 2 128.2081 P2p
Po11 Altn BLK 2 128.2082 P2p
Gi1/0/10 Desg FWD 4 128.10 P2p Edge
Reading the example
| Line | Meaning |
|---|---|
| Root priority 24586 | The root has priority 24576 (set by root primary) + VLAN 10 |
| Cost 2 | This switch is one 10 Gb/s hop from the root |
| Po10 Root FWD | Best path to the root |
| Po11 Altn BLK | Backup path to the root, blocked |
| Gi1/0/10 Desg FWD Edge | Access port towards a host (PortFast) |
Path cost
The guide's default (short) costs are 4 for 1 Gb/s and 2 for 10 Gb/s, with 25 and 40 Gb/s both 1. With faster links, the long method (spanning-tree pathcost method long) separates speeds better. Use the same method on every switch.
Timers (802.1D)
Hello 2 s, forward delay 15 s and max age 20 s are the documented defaults. In classic STP a blocked port takes up to 50 s to start forwarding (20 s max age + 2 × 15 s). RSTP avoids most of that wait.
Documented example, not captured output.
Quick reference
Spanning Tree Protocol prevents Layer 2 loops in redundant topologies. Switches elect a root bridge (lowest bridge ID), each non-root switch picks its best path to the root (root port), each segment gets one designated port, and all other ports block.
| Element | Selection rule |
|---|---|
| Root bridge | Lowest priority + MAC |
| Root port | Lowest cost to root, then lowest sender bridge ID, then port ID |
| Designated port | Best port on each segment towards the root |
| Blocked/alternate | Everything else |
Set root and backup root priorities deliberately on distribution/core switches; otherwise the oldest switch (lowest MAC) may become root.
Mechanics and state ownership
Classic IEEE 802.1D STP uses periodic configuration BPDUs and timer-governed state transitions to maintain a loop-free topology. The root originates timer values carried through the tree: hello time controls BPDU cadence, max age limits how long superior information can be retained without refresh, and forward delay controls listening/learning transitions before forwarding. These values interact with topology diameter and BPDU propagation. A non-root switch should not be diagnosed from local timer text alone; the effective root information and received BPDUs determine behavior. Rapid STP changes the convergence model with explicit rapid transition mechanisms, so mixing 802.1D timer expectations with RSTP is a common analysis error. Treat each command output, counter, packet capture and state display as an observation from its own boundary. Keep the same VLAN, VRF, interface, prefix, flow or control-plane instance throughout the investigation so evidence from different contexts is not accidentally combined. When a change is made, preserve the original failing test, allow the relevant protocol to converge, re-run that same test, and check one adjacent known-good case for regression before closing the issue. This section is authored reference guidance for Spanning Tree Fundamentals in the STP Fundamentals context.
State model and protocol mechanics
Spanning Tree Protocol prevents persistent Layer-2 loops by exchanging BPDUs and building a logical tree across redundant Ethernet links. The bridge with the lowest bridge ID becomes root. Non-root switches select the port with the best path toward the root as the root port, while each segment elects a designated port; redundant alternatives can be placed in a non-forwarding role. Path selection uses root path cost plus tie-breakers such as bridge and port identifiers. Classic 802.1D moves ports through listening and learning before forwarding, while rapid variants improve convergence with additional roles and handshake behavior. STP does not calculate IP routes and does not understand application intent; it only determines which Layer-2 links may forward for the relevant spanning-tree instance/VLAN.
Limits and common misconceptions
A blocking/alternate STP port is often healthy and necessary; it is not equivalent to a failed link. Conversely, all links physically up with incorrect STP protection can create a loop and broadcast storm. Root bridge status does not mean the root is a Layer-3 gateway. STP also does not protect against every kind of Layer-2 fault, especially if BPDUs are filtered or links are outside the same STP domain. Keep physical link state, STP role/state, VLAN forwarding and endpoint/application health separate. Topology-change activity is also context, not root cause by itself: a legitimate link transition can generate changes, while repeated unexpected changes may indicate instability elsewhere in the Layer-2 topology.
ReferenceConfiguration & state1 section · depth on demand
Design and configuration model
Design root placement intentionally instead of accepting arbitrary bridge-MAC tie-breakers. Set bridge priority so the preferred distribution/core device is root and define a secondary where appropriate. Keep redundant links available rather than disabling them manually, allowing STP to select a loop-free topology. Edge features such as PortFast and guards should be applied according to port role, not globally without thought. On per-VLAN or MST designs, remember that different VLANs/instances can have different roots and forwarding paths. EtherChannels should be formed correctly so STP sees the logical bundle instead of independent parallel links.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Switching → STP → Spanning Tree Fundamentals. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%Quick lookup tables
STP election and role quick map
High-level decision sequence for a loop-free tree
| Decision | Preferred value |
|---|---|
| Root bridge | Lowest Bridge ID |
| Root port on non-root bridge | Best received BPDU / lowest total root path cost, then tie-breakers |
| Designated port on a segment | Port advertising the best path toward root, then tie-breakers |
| Redundant path | Non-forwarding role/state until needed |
Spanning Tree Fundamentals · operational reference
Compact state and interpretation boundaries for fast lookup.
| STP concept | Meaning |
|---|---|
| Root bridge | Reference point for tree |
| Root port | Best local path to root |
| Designated port | Forwarding port for segment |
| Alternate/blocking | Redundant loop-prevention path |
Spanning Tree Fundamentals operational reference
Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.
| Check | Known-good | Failure signature | Next boundary |
|---|---|---|---|
| STP mode | Known 802.1D/RSTP flavor | Mode assumption wrong | Protocol mode |
| Hello | Stable root BPDU cadence | Missing/intermittent BPDUs | L2/control plane |
| Max age | No unexpected expiry | Superior info ages out | BPDU path |
| Forward delay | Matches classic transition | Unexpected prolonged block | Port state |
| Topology event | Bounded convergence | Loop/black hole/oscillation | STP design |