IT141 · SESSION 4 · FIELD NOTES

STP: The Loop

A second cable is a backup. A second cable that makes a circle is a disaster waiting to happen, because Ethernet frames have no TTL and will go round forever. This session, S2 gets its own link to D1, the three HQ switches form a triangle, and nothing melts, because Spanning Tree quietly closed one door before anyone noticed. This session is about how they choose which door to close, which switch ends up in charge, and what happens when a cable is cut.

Exam Module group 1–4 New material Module 5 — STP Concepts Network change S2 G0/1 ↔ D1 G1/0/3 closes the triangle Next session Module 6 — EtherChannel; Rapid PVST+

Module 5

What Session 4 covers

The module-group exam on Modules 1–4 comes first. Then one module, in NetAcad's order: why Layer 2 loops are dangerous and what STP does about them; how STP elects a root bridge and gives every port a role; and how STP evolved into the faster and smarter versions you'll use from next session on.

Cold open · Local Dispatch, after the exam

"Single point of failure," says the crew chief, tapping last week's diagram. "If S1's uplink dies, the whole HQ floor loses its gateway." She hands the Rookie a cable. "S2, port G0/1, straight to D1. Now every switch has two ways out." The Rookie plugs it in and waits for the alarms. Three switches, three cables, a perfect circle: every broadcast should be going round it forever. Nothing happens. The Surveyor is reading a screen. "They held an election while you were plugging it in," she says. "They picked a boss and closed one door. The question is whether they picked the boss we want, because right now the winner is whichever switch has the lowest serial number."

Topology used on this page HQ as it stood at the end of Session 3, plus one new trunk: S2 G0/1 to D1 G1/0/3. That closes a triangle. S1–D1 and S2–D1 are Gigabit links (G0/1 on each 2960, G1/0/1 and G1/0/3 on D1), and S1–S2 is the Fast Ethernet trunk from Session 2 (F0/23 at both ends). The examples use the tree HQ is designed to have: D1 is the root bridge and S1 is the backup, so the one blocked port is S2 F0/23. The MAC addresses in the output are made up.

Module group exam

Modules 1–4: cross-module review

The exam covers basic device configuration, switching, VLANs, and inter-VLAN routing. If you can answer these cold, Sessions 1–3 have landed. It's recall, not new material.

Where to actually study Each session page has its own checkpoint, flashcards, and quiz: Session 1, Session 2, Session 3. Together, those three checkpoints are the review.

Module 5.1

Why STP: what a loop does

Redundant links are good: if one cable fails, traffic takes another. But at Layer 2, two paths between the same switches form a loop, and switches flood broadcasts out every port. Without something to stop them, frames go round and round.

CCNA 1 callback In CCNA 1 you learned that every router lowers a packet's TTL (IPv6: hop limit) and drops it at zero, so a routing loop eventually ends. That's a Layer 3 field. An Ethernet frame has no TTL, and a switch never changes anything in it. A frame in a Layer 2 loop never dies.
ProblemWhat happens on our triangle without STP
Broadcast stormPC-A sends one ARP broadcast. S1 floods it toward both S2 and D1. Each of them floods its copy onward, including toward the other, and two copies circle the triangle in opposite directions forever. Every new broadcast adds more. The links fill up and the switches stop coping.
MAC table instabilityS2 learns PC-A's MAC on F0/23 (the copy straight from S1), then on G0/1 (the copy that went round through D1), then on F0/23 again, many times a second. S2 can't decide where PC-A is.
Duplicate framesA unicast to a MAC no switch has learned yet is flooded, so it reaches the destination by both paths. PC-C gets two copies or more.
Multicast tooMulticast is flooded like a broadcast. IPv6 neighbor discovery uses multicast, so IPv6 melts as well.
THREAT LEVEL: STORM

CASE FILE D-04

The Loop

Lives in every redundant cable. Give it two paths between the same switches and no Spanning Tree, and one broadcast becomes thousands. Frames circle forever because Ethernet has no TTL, MAC tables flip between ports, and hosts get the same frame twice.

Tell: in Simulation mode, an event list that never ends, with copies of the same ARP request crossing in both directions. In a config, a no spanning-tree vlan line. On real switches, MAC-flap log messages and link LEDs that never stop blinking.

See also: How STP decides · BPDU guard

Debrief STP is on by default. So how does The Loop ever get in? (someone turns STP off for a VLAN, or someone cables a loop through desk ports: a patch cable from one wall jack to another, or a small unmanaged switch plugged into two desk ports. That's why BPDU guard, Session 9, shuts a PortFast port the moment any BPDU arrives on it, even the switch's own BPDU coming back around the loop)

Spanning Tree Protocol fixes all four the same way. It logically blocks just enough ports that there's exactly one active path between any two switches, so the cabling is a loop but the forwarding is a tree. If an active link fails, STP unblocks a port to restore a path. Two hallways are safer than one, as long as nobody walks in circles.

STP runs the Spanning Tree Algorithm (STA), which Radia Perlman invented at Digital Equipment Corporation and published in 1985: pick one switch as the reference point, find every other switch's best path to it, and block the rest.

PVST+, the version on our switches, runs a separate tree for every VLAN, so a loop left open in one VLAN (for example, with STP turned off there) doesn't automatically melt the others. On real switches the storm still fills the trunks and the CPUs they share, so the other VLANs suffer too.

Module 5.2

How STP decides: the election

STP is an election followed by a seating plan. Every switch starts out claiming to be the boss, the root bridge, and sends BPDUs (bridge protocol data units) every 2 seconds saying so. The best claim wins, and then every port is given a job based on how close it is to the winner.

Step 1 · The root bridge: lowest bridge ID wins

A switch's bridge ID (BID) is its priority followed by its MAC address. Lower wins at every step: lowest priority, and if that ties, lowest MAC.

Step 2 · One root port on every other switch

Each non-root switch picks the one port with the lowest root path cost: the total of the port costs on the way to the root, counting the cost of each port that receives the root's BPDUs. A port's cost comes from its speed. Faster is cheaper.

Link speedShort cost (our switches)Long cost
10 Gbps22,000
1 Gbps420,000
100 Mbps (Fast Ethernet)19200,000
10 Mbps1002,000,000

The short values are the classic 802.1D costs and the 2960's default. The long values come from a newer edition of the standard, with room for faster links. Every switch in a network should use the same method, or their totals can't be compared.

Step 3 · One designated port on every link

Each link gets one designated port: the end on the switch that's closer to the root (lower root path cost). Every port on the root bridge is designated, and so is every port facing a host.

Step 4 · Whatever's left blocks

Any port that's neither a root port nor a designated port is an alternate port, and it blocks. It still listens to BPDUs, so it can take over if something fails.

Ties, in order When two candidates have the same root path cost, STP compares, in order: the lower sender bridge ID, then the lower sender port ID (port priority, default 128, then port number). Notice sender: it's the neighbor's numbers that count, not the receiving switch's own. With one cable between each pair of switches, the bridge ID always settles it. The port ID only matters when two cables run between the same two switches.

The election on HQ

HQ's priorities: D1 24576, S1 28672, S2 the default 32768 (Choosing the root explains why those three). In VLAN 10 they show as 24586, 28682 and 32778.

D1 · ROOT priority 24576 S1 28672 S2 32768 D · G1/0/1 D · G1/0/3 R · G0/1 R · G0/1 D · F0/23 ALT BLK · F0/23 Gi, cost 4 Gi, cost 4 Fa, cost 19: the backup path R root port · D designated · ALT alternate, blocking
Figure 1. HQ's tree for VLAN 10. Both S1 and S2 reach the root for a cost of 4. On the S1–S2 link they tie, S1's lower bridge ID wins, and S2's end blocks. VLANs 30, 99 and 900 have the same roles.
SwitchPortRoleStateWhy
D1G1/0/1DesignatedFWDEvery port on the root is designated
D1G1/0/3DesignatedFWDSame
S1G0/1RootFWDCost 4, against 23
S1F0/23DesignatedFWDTied at cost 4; S1's bridge ID is lower
S2G0/1RootFWDCost 4, against 23
S2F0/23AlternateBLKLost the tie on bridge ID

One consequence: PC-A to PC-C, both in VLAN 10, goes S1 → D1 → S2, not straight across the cable that connects their switches. The direct link is the backup.

Module 5.2

Reading show spanning-tree

show spanning-tree vlan 10 shows one switch's view of one tree. Here is HQ's VLAN 10 tree from two sides: D1, the root, and S2, the switch with the blocked port.

D1 · the root
D1# show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 24586 Address 00D0.97CC.00D1 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 00D0.97CC.00D1 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Desg FWD 4 128.1 P2p Gi1/0/3 Desg FWD 4 128.3 P2p
S2
S2# show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 24586 Address 00D0.97CC.00D1 Cost 4 Port 25(GigabitEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address 0002.16AA.0012 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/1 Desg FWD 19 128.1 P2p Fa0/23 Altn BLK 19 128.23 P2p Gi0/1 Root FWD 4 128.25 P2p

How to read it

Part of the outputWhat it tells you
VLAN0010This is one tree. VLANs 30, 99 and 900 each have their own (that's PVST+).
protocol ieeePVST+, using 802.1D rules. Rapid PVST+ says rstp (Session 5).
Root ID blockWho this switch believes is the root, and how far away it is. The same Root ID on all three switches means they agree.
Bridge ID blockThis switch itself. (priority 32768 sys-id-ext 10) shows the split: the configured priority plus the VLAN.
This bridge is the rootOnly on the root, in place of Cost and Port. Quickest test: the Root ID address equals the Bridge ID address.
Cost 4 (in the Root ID block)This switch's root path cost, the total to the root
Port 25(GigabitEthernet0/1)This switch's root port
Role columnRoot root port · Desg designated · Altn alternate
Sts columnFWD forwarding · BLK blocking · LSN listening · LRN learning
Cost columnThis port's own cost: 19 for Fast Ethernet, 4 for Gigabit. Not the path cost.
Prio.NbrThe port ID: port priority (128) and port number. On a 2960, Gi0/1 is port 25.
The two misreadings 1. Root ID vs Bridge ID. On S2, "Root ID Priority 24586" is the root's priority, as S2 heard it. S2's own is in the Bridge ID block: 32778. 2. The Cost column vs the root path cost. The column is per port. The root path cost is the Cost line in the Root ID block.

What HQ's output says

S2 · the trunk table tells the same story
S2# show interfaces trunk ... Port Vlans in spanning tree forwarding state and not pruned Fa0/23 none Gig0/1 10,30,99,900

The last block of show interfaces trunk lists the VLANs each trunk actually forwards. Fa0/23 is a working trunk that STP has blocked in every VLAN, so it shows none. In Packet Tracer's topology view, its link light is amber.

Module 5.2

Choosing the root bridge

Left alone, every switch has priority 32768, so the switch with the lowest MAC address becomes root. A MAC address is basically a serial number, so the default root is luck. It might be the oldest, slowest switch in the closet.

Why the default root matters: an example

Suppose HQ's switches all kept the default priority, and S2 happened to have the lowest MAC. S2 would be root, and every one of its ports would be designated. Then:

That tree has no loops, so it works. But its center is S2, an access switch with no gateways on it, and a different MAC would have given a different tree. Nobody chose it.

Where the root should be

The root should be the switch at the center of traffic. At HQ that's D1: it holds every gateway, so every frame that leaves a VLAN goes there anyway. S1 is the natural backup. The way to get that tree is the priority, the one part of the bridge ID an administrator sets: give D1 a lower priority than anyone else, and S1 the next lowest. D1 at 24576 and S1 at 28672 produce the tree in The election on HQ.

Beyond Module 5: the commands Module 5 explains the priority; it doesn't configure it. The commands are here because HQ uses them, and Session 5's Rapid PVST+ builds on this tree.
D1 · become root for every VLAN on the triangle
D1# configure terminal ! ! The distribution switch, where the gateways live, becomes root for every VLAN the triangle carries. D1(config)# spanning-tree vlan 10,30,99,900 root primary D1(config)# end D1# copy running-config startup-config
S1 · the backup root
S1# configure terminal ! ! S1 takes over if D1 fails. S1(config)# spanning-tree vlan 10,30,99,900 root secondary S1(config)# end S1# copy running-config startup-config

root primary vs typing the priority

root primary / root secondarypriority 24576 / priority 28672
What it isA macro that runs once, when you type itA plain setting
What it sets24576, unless the current root is already at 24576 or lower: then 4096 below it. Secondary sets 28672.Exactly what you typed
Saved in the config asThe resulting priority line, not "root primary"The same line
If someone later sets a lower priority elsewhereDoesn't react: the other switch takes overSame
D1 · what the macro actually saved
D1# show running-config | include spanning-tree spanning-tree mode pvst spanning-tree extend system-id spanning-tree vlan 10,30,99,900 priority 24576

Many engineers type the priority directly, because it says exactly what you'll get. Either way, the saved config is the same.

Drill

Election drill

A random triangle of three switches, A, B and C, all in VLAN 10. Work out the root bridge, then the one port that blocks. Every answer comes with its working.

Drill · Who's the root, and which port blocks?

Module 5.2

Port states and timers

A port doesn't jump straight from blocking to forwarding. If it did, it could open a loop for a moment before every switch agreed on the new tree. It goes through two waiting states first.

StateBPDUsLearns MACsForwards dataHow long
BlockingReceives onlyNoNoUntil STP decides otherwise
ListeningSends and receivesNoNoForward delay, 15 s
LearningSends and receivesYesNoForward delay, 15 s
ForwardingSends and receivesYesYesSteady state
DisabledNoneNoNoThe port is shut down

Learning fills the MAC table before the port forwards, so it doesn't start by flooding everything.

TimerDefaultWhat it does
Hello time2 sHow often the root sends BPDUs (the other switches pass them on)
Forward delay15 sTime spent in listening, and again in learning
Max age20 sHow long a switch keeps a port's last BPDU without hearing a new one before it decides that path is gone

The timers are set on the root, and every other switch uses the root's values, because they're carried in its BPDUs. Don't change them in this course.

EventTime to forwardingWhy
A new link comes up, or a switch sees its own link failabout 30 sListening 15 + learning 15
A switch has to work out that the best path is gone somewhere elseup to about 50 sMax age 20 (waiting for the old information to expire) + 15 + 15

Thirty to fifty seconds of silence is a long time on a network. That's the number Rapid PVST+ fixes next session. Packet Tracer may run these timers faster than real switches do; learn the real numbers.

Module 5.2

When a link fails

STP's job isn't finished once the tree is built. When an active link fails, a blocked port has to take over, and 802.1D's timers decide how long that takes. Take HQ's tree and cut the S1–D1 link, which was Session 3's single point of failure.

What happens, in order (real 802.1D timing)

  1. S1 loses its root port. Its only other trunk, F0/23, is a designated port: S1 sends BPDUs there but hears none, because S2's end is blocking. So S1 announces that it is now the root.
  2. S2 ignores S1's claim at first. It's worse than what S2 last heard on that port (root = D1). S2 keeps the old, better information until it ages out: max age, 20 s.
  3. After about 20 s, S2 makes F0/23 the designated port for that link, because S2 knows a better root (D1, through its own G0/1) than the one S1 is claiming. S2 starts passing D1's BPDUs to S1.
  4. S1 learns that D1 is reachable through S2, makes F0/23 its root port (cost 19 + 4 = 23), and stops claiming to be root.
  5. S2 F0/23 goes listening (15 s), then learning (15 s), then forwarding. That's the port that unblocks.
  6. Total: about 50 seconds with no path for S1's hosts.
SwitchPortRoleStateNote
D1G1/0/1—downShut; it disappears from the STP output
S1G0/1—downOther end of the shut link; also gone from S1's output
D1G1/0/3DesignatedFWDStill the root
S2G0/1RootFWDUnchanged
S2F0/23DesignatedFWDWas Altn BLK. Now S1's way to the root.
S1F0/23RootFWDRoot path cost now 23

And when the link comes back

S1 hears D1 directly again, so G0/1 becomes its root port straight away, and S2 F0/23 goes back to blocking at once. But S1 G0/1 is a newly up port, so it has to go through listening and learning first. Fixing the cable causes a second outage of about 30 seconds. Slow recovery in both directions is the main reason Session 5 moves HQ to Rapid PVST+.

Module 5.3

The evolution of STP

Original STP is slow, and it runs one tree for the whole network. Every later version fixes one or both of those.

VersionWhoTreesSpeedIn one line
STPIEEE 802.1D (1998 and earlier)One for all VLANsSlow, 30–50 sThe original algorithm
PVST+CiscoOne per VLANSlowCisco's per-VLAN version of 802.1D STP. Today's default. Adds Cisco extras such as PortFast and BPDU guard.
RSTPIEEE 802.1wOneFast, often under a secondThe fast-converging successor to STP. Same election, new states and roles, and a quick handshake instead of waiting on timers.
Rapid PVST+CiscoOne per VLANFastCisco's per-VLAN version of RSTP. Next session.
MSTPIEEE 802.1sOne per instance; you map groups of VLANs to eachFastThe IEEE standard that cuts the number of trees: many VLANs share one
MSTCiscoSame as MSTPFastCisco's implementation of MSTP
A naming trap The 2004 edition of the 802.1D standard is RSTP: it replaced the original STP algorithm with 802.1w's. So when this course says "802.1D" or "STP", it means the original, slow algorithm from the 1998 and earlier editions. Some materials describe 802.1D-2004 as just "an updated STP"; it's more than that.

RSTP's states and roles (a preview of Session 5)

802.1D state (today)RSTP state (Session 5)
Disabled, blocking, listeningDiscarding
LearningLearning
ForwardingForwarding

Module 5.3

PortFast and BPDU guard

Know them today; you'll apply them across the network in Session 9, with the rest of switch security. They aren't part of today's lab.

S1 · syntax only, don't apply today
S1# configure terminal S1(config)# interface range f0/1 - 20 ! ! Access ports only. Never on F0/23-24 or G0/1-2. S1(config-if-range)# spanning-tree portfast S1(config-if-range)# spanning-tree bpduguard enable S1(config-if-range)# end
S1 · or on every access port at once
S1(config)# spanning-tree portfast default S1(config)# spanning-tree portfast bpduguard default
S1 · check, and recover a port BPDU guard shut down
S1# show spanning-tree interface f0/1 portfast S1# show interfaces status err-disabled ! ! After removing whatever sent the BPDU: S1(config)# interface f0/1 S1(config-if)# shutdown S1(config-if)# no shutdown

Module 5.3

Alternatives to STP

STP's price: a whole link sits idle, failover takes time, and the result depends on settings people forget. Two ways to need it less:

AlternativeThe ideaIn this course
EtherChannel (Module 6)Bundle parallel links into one logical link. STP sees one port, so no member blocks, and the bandwidth adds up. If one member fails, the bundle just shrinks.Next session. Our triangle stays a triangle, though: one bundle will still block.
Layer 3 (routed) linksMake the links between switches routed (no switchport). Routing protocols can use every path, and IP packets have a TTL. STP shrinks to inside each access switch.D1's link to R1 is already one: no STP runs on it. The catch: a VLAN can no longer stretch across two access switches.
Coming up in CCNA 3 Network design in layers (access, distribution, core), and when to route instead of switch between them. Today's triangle is the access and distribution layers in miniature.

Watch for this

Common Module 5 mistakes

Most STP mistakes are reading mistakes, not typing ones.

1 · Root on only one VLAN

spanning-tree vlan 10 root primary makes D1 root for VLAN 10 only. VLANs 30, 99 and 900 keep their random default root. show spanning-tree vlan 30: the Root ID address isn't D1's. Fix: re-enter it with the whole list, 10,30,99,900.

2 · Primary and secondary swapped

root primary typed on S1 and root secondary on D1. show spanning-tree vlan 10 on D1 has no This bridge is the root. Fix: swap them.

3 · A priority that isn't a multiple of 4096

spanning-tree vlan 10 priority 25000 is rejected, and IOS lists the values it accepts. Use 24576, or another multiple of 4096.

4 · Checking too soon

Ports show LSN or LRN, and pings fail. That's not a fault: wait 30 to 50 seconds after any change.

5 · Reading the wrong block

"S2's priority is 24586": that's the Root ID block, which is D1's. S2's own priority is in the Bridge ID block. And the Cost column is each port's cost, not the path cost.

6 · Using the receiving switch's port ID to break a tie

When two links to the same switch tie, it's the sender's port ID that decides, not the receiving switch's.

End of session

What works now, and what doesn't

No Layer 3 changes today: everything that worked at the end of Session 3 still works. What's new is what happens when something breaks. The rows assume HQ's designed tree: D1 the root, S1 the backup.

TestResultWhy
Everything that worked at the end of Session 3WorksNo Layer 3 change today
HQ if D1 G1/0/1 or S1 G0/1 failsRecovers in about 50 sS2 F0/23 unblocks, and S1 reaches D1 through S2. Session 3's "all of HQ is cut off" row is fixed.
HQ if D1 G1/0/3 or S2 G0/1 failsRecovers in about 30 sNot quite the mirror image: S2's blocked port already holds good information from S1, so S2 doesn't wait out max age. Why 20 seconds faster? That's a good exam-style question.
HQ if the S1–S2 link failsNo outageIt was blocking anyway. Only the backup is gone.
D1's SVIs if one D1 uplink failsStay upEach VLAN is still active on the other trunk
HQ if D1 failsNo gatewaysS1 becomes STP root, so S1 and S2 still switch, but nothing routes. That's a job for Session 7.
Failover speedSlow, 30–50 s802.1D timers. Rapid PVST+ fixes it in Session 5.
DHCP, VLAN 40NoSessions 6 and 10
Coming up in Session 5: two cables per hallway, no waiting The building survives a cut cable now, but it takes most of a minute to notice. Next session doubles every link and bundles each pair into an EtherChannel, then switches the whole triangle to Rapid PVST+, which recovers in about a second.

Recurring segment

The Ticket

Turn it into steps before you open the answer.

Ticket #141-04 · Priority: low · From: the crew chief

Someone in the network meeting asked why, now that the new S2–D1 cable is in, the cable between S1 and S2 "shows orange and never carries anything." Is it broken? Should we replace it? Also, if D1 goes down, which switch takes over, and does that mean we still have internet?

One way to break it down
  1. "Orange and never carries anything": an amber link light in Packet Tracer usually means STP is blocking that port. Check it: show spanning-tree vlan 10 on S2. If F0/23 shows Altn BLK, the cable is fine. It's the backup path, on purpose.
  2. Explain why it's that link: D1 is root, S1 and S2 both reach it directly for a cost of 4, and the S1–S2 link is the long way round. On that link, S1 wins the tie because it's root secondary, so S2's end blocks.
  3. Prove it's a working backup: shut D1 G1/0/1 and watch S2 F0/23 go to forwarding. Then restore it.
  4. "If D1 goes down, which switch takes over?" S1 becomes the STP root, because it's root secondary. show spanning-tree vlan 10 on S1 would say This bridge is the root.
  5. "Do we still have internet?" No. STP root and gateway are different jobs. S1 can't route, so with D1 down, every HQ VLAN loses its gateway. That's a job for a first-hop redundancy protocol, which arrives in Session 7.

Before Session 5

Checkpoint: Module 5

If you can do these cold, you're ready for EtherChannel and Rapid PVST+.

Study

Flashcards

Click to flip. Double-click to mark as known.

Check yourself

Sample questions

Pick an answer to see if you're right. Same style as the module-group exam.

Applied

Worked examples

Think it through before you expand the answer.

Bridge ID

Which number is the priority?

On S1, show spanning-tree vlan 30 shows Bridge ID Priority 28702 (priority 28672 sys-id-ext 30). A classmate says S1's priority is 28702. Are they right, and what would S1 show in VLAN 99?

Show answer

The configured priority is 28672, the value root secondary set. The 28702 on the line is that plus the VLAN number (the extended system ID), 30. In VLAN 99 the same switch shows 28771 (28672 + 99). The VLAN number never decides an election: every switch adds the same number in the same VLAN.

Path cost

The long way round

D1 is root. What is S1's root path cost through its G0/1 port, and through its F0/23 port? Which becomes its root port?

Show answer

Through G0/1, straight to D1: 4 (one Gigabit port, S1's own). Through F0/23: 19 + 4 = 23 (S1's Fast Ethernet port, then S2's Gigabit port into D1). Lower wins, so G0/1 is the root port. Costs are counted on the ports that receive the root's BPDUs on the way in, so D1's own ports add nothing.

Tie-breakers

Why S2, and not S1?

After the design, S1 and S2 both have a root path cost of 4. So why does S2's end of the F0/23 link block, and not S1's?

Show answer

The link needs one designated port. Both ends advertise the same cost (4), so the next tie-breaker is the bridge ID. S1's is 28682 (root secondary), S2's is 32778 (the default). S1 is lower, so S1 F0/23 is designated, and S2 F0/23 is left over: alternate, blocking. Without root secondary, both would be 32778, and the lower MAC would decide.

The root macro

The boss who didn't fight back

D1 was made root with root primary last week. Today a classmate types spanning-tree vlan 10 priority 20480 on S2. What happens in VLAN 10?

Show answer

S2 becomes the root for VLAN 10. root primary is a one-time macro: when it ran, it set D1 to 24576 and saved that as a plain priority 24576 line. It doesn't watch the network afterwards. 20480 is lower than 24576, so S2 wins. The fix is to set D1 lower again (for example, 16384), or remove S2's line.

Traceroute vs STP

The path tracert can't see

After the design, PC-A runs tracert 192.168.10.11 (PC-C). It shows one hop. Does that prove the frames go straight across F0/23?

Show answer

No. Traceroute only shows routers (Layer 3 hops). PC-A and PC-C are in the same VLAN, so there are none. With S2 F0/23 blocking, the frames actually go S1 → D1 → S2. To prove the Layer 2 path, use show spanning-tree (which ports forward) and show mac address-table (which port each switch learned PC-A on).

Reference

Glossary & index

Every term from this session. Search, or jump by letter.