Pcornel
Networking · Switching › STP › Spanning Tree Fundamentals

Path Cost

Cheat sheet · https://pcornel.dk/topic.php?topic=1022

Back to the Topic

Answer

Path cost is the STP cost of a port, based on its speed. The root path cost is the sum of the port costs from a switch to the root, and decides root and designated ports.

Remember

Short method (default on older IOS): 10 Mb/s = 100, 100 Mb/s = 19, 1 Gb/s = 4, 10 Gb/s = 2. Long method (spanning-tree pathcost method long) scales to faster links: 1 Gb/s = 20 000, 10 Gb/s = 2 000. Use the same method on every switch. An EtherChannel's cost depends on its bandwidth.

First checks

  • show spanning-tree vlan <id> — root ID, local bridge ID, and each port's role, state and cost.
  • show spanning-tree root — the root bridge, root cost and root port per VLAN.
  • show spanning-tree vlan <id> detail — BPDUs sent and received, topology changes and their source.
  • show spanning-tree summary — mode, enabled features and port counts per state.
  • show spanning-tree inconsistentports — ports blocked by root guard, loop guard or type inconsistency.

Commands

spanning-tree vlan <vlan-list> cost <cost>
Changes STP path cost on an interface for selected VLANs.
show spanning-tree vlan <vlan>
show spanning-tree vlan <id>

Verify in this order

port speed → port cost (short or long method) → costs summed towards the root → lowest root path cost decides root and designated ports

Where it usually breaks

physical link → switchport/bundle membership → VLAN/instance state → STP/LAG decision → MAC forwarding → end-to-end frame path

Path Cost operational reference

Cost decisionKnown-goodFailure signatureNext boundary
Root bridgeIntended root fixedWrong root invalidates comparisonBridge priority
Local port costMatches design/operational linkUnexpected override/speedInterface config
Total root costPreferred path lowerHigher path selectedTie-break/state
Equal-cost tieDeterministic IDs decideAssumed random behaviorBridge/port ID
Forwarding pathMatches selected treeSTP correct, traffic differsMAC/L3 path

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=1022

Confirmation

Confirm action

Continue?