Questions? Call 1.800.716.8955

Chapter 15

Spanning Tree Protocol

Exam topics covered

2.5 Interpret basic operations of Rapid PVST+ Spanning Tree Protocol

2.5.a Root port, root bridge (primary/secondary), and other port names 2.5.b Port states and roles

Foundation. Well-designed switched networks have redundant links so that one failed cable or switch does not isolate users. Redundancy, however, creates physical loops, and Ethernet cannot survive a loop on its own. The Spanning Tree Protocol (STP) logically blocks just enough ports to turn a looped topology into a loop-free tree, and unblocks them automatically when something fails. This chapter covers the IEEE 802.1D algorithm and Cisco's per-VLAN implementation (PVST+): the root bridge election, port roles, timers and port states, configuration, and how to read show spanning-tree . The election logic, roles and commands are exactly what Rapid PVST+ uses too; Chapter 16 shows how the rapid version converges in seconds instead of up to 50 seconds.

15.1 Why Spanning Tree Is Needed

A switch floods broadcasts, multicasts and unknown unicasts out every port in the VLAN except the one the frame arrived on. In a tree-shaped network a flooded frame reaches the edges and stops. In a network with a loop, the frame comes back and is flooded again. The underlying problem is that the Ethernet header has no Time-to-Live (TTL) field: an IP packet in a routing loop eventually expires, but an Ethernet frame in a switching loop is forwarded forever. Three symptoms follow.

Broadcast storms. In Figure 15-1, PC A sends a single ARP broadcast. SW2 floods it to SW1 and SW3; each of them floods its copy to the other, and back to SW2, which floods them again. One copy circles clockwise and another counter-clockwise. Within seconds the links are saturated, every host must process every looping broadcast, switch CPUs spike, and the whole VLAN becomes unusable.

  • SW2 SW3
  • PC A sends ONE broadcast
  • copy 1: clockwise
  • copy 2: counter-clockwise

Ethernet has no TTL.

Each switch floods the

broadcast out every other

port, forever.

Figure 15-1 A broadcast storm. A single broadcast from PC A loops in both directions around the triangle and is re-flooded by every switch indefinitely.

MAC address table instability. Switches learn from source addresses. When copies of PC A's frame reach SW3 from two directions, SW3 learns PC A's MAC on Gi0/1, then Gi0/2, then Gi0/1 again (Figure 15-2). The entry "flaps", frames to PC A go out the wrong port, and IOS logs %SW_MATM-4-MACFLAP_NOTIF messages.

Duplicate frames. If the switches have not learned Server B's MAC, both SW1 and SW2 flood PC A's unicast toward it, and Server B receives two copies, which many applications handle poorly.

SW3 twice: a duplicate frame.

Figure 15-2 MAC table instability and duplicate frames. SW3 receives the same source MAC on two ports and keeps relearning it.

15.2 How STP Solves the Problem

STP is a distributed algorithm. Switches exchange Bridge Protocol Data Units (BPDUs), agree on a single reference point called the root bridge, and each calculates its best path to it. Any port that is not on a best path and not needed to serve a link is placed in the blocking state: it forwards no user frames and learns no MAC addresses, but it keeps listening to BPDUs so it can be brought back into service if the topology changes. ("Bridge" is the historical name for a switch; treat the words as synonyms.)

The family has several members. The original IEEE 802.1D STP runs one tree for all VLANs. Cisco PVST+ runs 802.1D separately in every VLAN. RSTP (802.1w) converges much faster, and Cisco's Rapid PVST+, the default on current Catalyst switches, runs RSTP per VLAN. MST (802.1s) maps groups of VLANs to a few instances. Chapter 16 covers RSTP and MST.

15.3 Bridge IDs and BPDUs

15.3.1 The bridge ID

Every switch has an 8-byte bridge ID (BID), and the lowest BID becomes the root bridge. To give each VLAN its own BID without needing a different MAC per VLAN, the 16-bit priority field is split into two parts (Figure 15-3):

Priority (4 bits): the part you configure. Only the four high-order bits are available, so values must be multiples of 4096, from 0 to 61440. The default is 32768.

System ID extension (12 bits): automatically set to the VLAN number.

MAC address (48 bits): the switch's base MAC, the same in every VLAN.

ridge Priority field (16 bits) — shown by IOS as one decimal number 1 0 0 0

Figure 15-3 Bridge ID format. The configurable priority occupies the top 4 bits of the 16-bit priority field; the VLAN number fills the remaining 12.

IOS displays the first two bytes as one decimal number, priority + VLAN ID: a default switch shows 32769 in VLAN 1 and 32778 in VLAN 10. To find the root, compare that number first; only if it ties, compare MAC addresses. Lowest wins.

Exam alert

spanning-tree vlan 10 priority 100 is rejected: "% Bridge Priority must be in increments of 4096". A displayed priority of 28682 means configured priority 28672 plus VLAN 10. Questions often show only the displayed number and expect you to work out the VLAN or configured value.

15.3.2 BPDUs

In 802.1D, the root bridge originates a Configuration BPDU every hello time (2 seconds). Each non-root switch receives it on its root port, updates the cost and sender fields, and relays it out its designated ports. The four highlighted fields in Figure 15-4 drive every STP decision: the root ID the sender believes in, the sender's root path cost, the sender's own bridge ID, and the sender's port ID (port priority, default 128, plus port number).

Shaded blue: the four fields used to elect the root bridge and choose port roles. Timer fields are in 1/256 s units on the wire.

Figure 15-4 The 35-byte 802.1D Configuration BPDU.

A second type, the Topology Change Notification (TCN) BPDU, is sent toward the root when a port starts or stops forwarding. The root then flags a topology change in its BPDUs, and every switch ages out MAC entries after forward delay (15 seconds) instead of 300 seconds, flushing stale entries. IEEE BPDUs go to multicast MAC 0180.c200.0000 ; Cisco PVST+ BPDUs for non-native VLANs are tagged and sent to 0100.0ccc.cccd .

15.4 Port Cost and Root Path Cost

Each port has a port cost based on its speed. A switch's root path cost (RPC) is the sum of the costs of the ports through which the root's BPDU entered on its way down: add the cost of each port you receive the BPDU on. The root advertises 0; a switch receiving that on a gigabit port adds 4 and advertises 4 onward.

Table 15-1 Default STP port costs

Interface speed Short (802.1D-1998) Long (802.1t / 802.1D-2004)

  • 10 Mbps 100 2,000,000
  • 100 Mbps 19 200,000
  • 1 Gbps 4 20,000
  • 10 Gbps 2 2,000
  • 100 Gbps 1 (lowest possible) 200

Most Catalyst switches use the short 16-bit values by default (some newer IOS XE releases default to long); spanning-tree pathcost method long changes it, and every switch should use the same method. CCNA questions use short values unless told otherwise: memorize 100, 19, 4, 2. An EtherChannel (Chapter 17) counts as one port with a lower cost than a single member.

15.5 The STP Election Process

Every switch runs the same four steps (Figure 15-5). Learn them as an algorithm; you will apply it to diagrams on the exam.

  • 1. Elect ONE root bridge

Lowest bridge ID in the

whole network (per VLAN)

  • 2. Choose ONE root port

per non-root switch:

lowest cost to the root

  • 3. Choose ONE designated

port per link (segment):

lowest advertised cost

  • 4. Block everything else
  • Ports that are neither
  • root nor designated
  • Tie-breaker order (used at every step where costs are equal)

lowest root path cost → lowest neighbor (sender) bridge ID → lowest neighbor port priority → lowest neighbor port nu

Figure 15-5 The four steps of the spanning tree calculation and the tie-breakers used when costs are equal.

Step 1: Elect the root bridge. Each switch boots claiming to be root. When it hears a BPDU with a lower root ID (a superior BPDU), it stops claiming and relays the better information. Soon all switches agree on the lowest BID: lowest priority, then lowest MAC. Every port on the root is a designated port; the root has no root port.

Watch out

With default priorities, the lowest MAC wins, which is often the oldest switch in the building. Always choose the root deliberately with root primary and root secondary (Section 15.9).

Step 2: Each non-root switch chooses one root port (RP), the port with the lowest root path cost. On a tie, the switch prefers (in order) the lowest neighbor BID, the lowest neighbor port priority, and the lowest neighbor port number. The last two use the port ID received in the neighbor's BPDU, not the local port, and matter only for parallel links (Figure 15-6). Gi0/1 (128.25)

4 alt

Figure 15-6 Parallel links. SW2 hears equal costs from the same neighbor on both ports; it picks the port connected to the neighbor's lower port ID (128.25).

Step 3: Each link chooses one designated port (DP), the port that forwards onto that segment. The switch advertising the lower root path cost on the link wins; on a tie, the lower BID wins; then the lower port priority and port number. A root port is never the designated port on its own link.

Step 4: Block everything else. Any port that is neither root nor designated blocks. IOS labels it an alternate port ( Altn BLK ), even in classic PVST+; older 802.1D texts call it a non-designated port.

Exam alert

Port-role questions reduce to three facts: the root bridge has only designated ports; every non-root switch has exactly one root port; every link has exactly one designated port. Whatever is left blocks.

15.6 Worked Example: Three Switches

All three switches in Figure 15-7 use the default priority in VLAN 1 (32769), and every link is gigabit (cost 4).

  • Gi0/1 4
  • Gi0/2
  • Gi0/1 4
  • Gi0/2 Gi0/2

Root bridge

lowest MAC wins the tie

Figure 15-7 Step 1. Priorities are equal, so SW1, with the lowest MAC address, becomes the root bridge. Blue numbers are link costs.

Root bridge: priorities tie, and SW1's MAC (ending 1111) is lowest. Root ports: SW2 reaches SW1 directly via Gi0/1 (4) or through SW3 (8), so Gi0/1 is its RP; SW3 likewise picks Gi0/1. Designated ports: SW1's two ports are designated. On the SW2–SW3 link both switches advertise cost 4, a tie broken by BID: SW2 (2222) beats SW3 (3333), so SW2 Gi0/2 is designated. Blocked: SW3 Gi0/2 (Figure 15-8). If the SW1–SW2 link fails, SW2 starts using the path through SW3 and SW3 Gi0/2 eventually forwards.

  • Gi0/1
  • DP
  • Gi0/1
  • RP
  • Gi0/2
  • DP
  • Gi0/1
  • RP
  • Gi0/2
  • DP
  • Gi0/2

4 alt

Figure 15-8 Steps 2 to 4. Root ports (RP) point to the root; the SW2–SW3 link's designated port is on SW2 (lower BID); SW3 Gi0/2 is an alternate, blocking port.

15.7 Worked Example: Four Switches with Mixed Speeds

In Figure 15-9, SW1 was configured with spanning-tree vlan 10 root primary , giving priority 24576 + 10 = 24586; the others use 32778. The SW1–SW3 link is FastEthernet (19); the others are gigabit (4).

Gi0/1 Gi0/1

Fa0/1

Fa0/1

Gi0/2

Gi0/2

Gi0/2 Gi0/1

Gi0/3

Gi0/3

Root

Figure 15-9 Four-switch topology for VLAN 10 with bridge IDs (priority, MAC) and port costs.

Step 1. SW1 has the lowest priority, so it is root regardless of MACs. Step 2. Work outward from the root (Table 15-2). The key result is SW3: although it is cabled directly to the root, the FastEthernet path (19) costs more than two gigabit hops through SW2 (8). STP chooses by cost, not by hop count.

Table 15-2 Root path cost calculation for VLAN 10

Switch Candidate paths (cost) Root port, RPC

SW2 Gi0/1 direct (4); via SW3 or SW4 (12 or more) Gi0/1, 4

SW3 Fa0/1 direct (19); Gi0/3 via SW2 (4+4 = 8); Gi0/2 via SW4 and SW2 (12) Gi0/3, 8 SW4 Gi0/2 via SW2 (4+4 = 8); Gi0/1 via SW3 and SW2 (12) Gi0/2, 8 Step 3. SW1 is designated on both its links. On SW2–SW3 and SW2–SW4, SW2 advertises 4 against 8, so SW2's Gi0/3 and Gi0/2 are designated. On SW3–SW4 both advertise 8; priorities tie and SW3's MAC (…3300) is lower than SW4's (…4400), so SW3 Gi0/2 is designated. Step

  • 4. SW3 Fa0/1 and SW4 Gi0/1 have no role and block (Figure 15-10).
  • DP
  • Gi0/1
  • RP

Fa0/1 DP

Fa0/1 ALT

DP Gi0/2

RP Gi0/2

  • Gi0/2
  • DP
  • Gi0/1

Alt

  • Gi0/3
  • DP
  • Gi0/3
  • RP
  • SW1
  • root
  • SW2

Rpc 4

SW3

Rpc 8

SW4

Rpc 8

Figure 15-10 Final VLAN 10 topology. Red dashed links have a blocking (alternate) port at one end; the forwarding links form a tree rooted at SW1.

Tip

Check your answer by counting: a loop-free topology of N switches has exactly N − 1 forwarding links. Here five links join four switches, so exactly two must be blocked.

15.8 Port Roles, Port States and Timers

15.8.1 Port roles and other port names

Table 15-3 STP port roles and the names you will see

Role IOS Description Stable state

Root port Root The one port on a non-root switch with the best path to the root

Forwarding

Designated port Desg The port that forwards onto a link; all root bridge ports are designated

Forwarding

Alternate (non-designated)Altn Receives a better BPDU from another switch; a backup path to the root

Blocking

Backup port Back Receives a better BPDU from another port on the same switch (shared media only)

  • Blocking
  • Disabled — Administratively down or no link Disabled
  • 15.8.2 Port states

A role says what a port is for; its state says what it is doing with frames right now. A port that should forward cannot start immediately, or a temporary loop could form before other switches hear about the change, so 802.1D passes it through two transitional states.

Table 15-4 802.1D port states

  • State Forwards data? Learns MACs? BPDUs Duration
  • Disabled No No None Stable (shut down)
  • Blocking No No Receives Stable
  • Listening No No Sends and receives Forward delay (15 s)
  • Learning No Yes Sends and receives Forward delay (15 s)
  • Forwarding Yes Yes Sends and receives Stable
  • 15.8.3 Timers and convergence

Three timers, all advertised by the root and used by every switch, control convergence: hello (2 s) between BPDUs; max age (20 s, ten hellos), how long a switch keeps the last BPDU heard on a port before assuming the path is gone; and forward delay (15 s), the time spent in each of listening and learning. Change them only on the root (for example spanning-tree vlan 10 hello-time 1 ), and in practice prefer Rapid PVST+ to tuning.

If a switch's own root port fails (a direct failure), it reacts immediately and needs about 30 seconds of listening and learning. If the failure is elsewhere (an indirect failure), the switch notices only because BPDUs stop; it waits for max age to expire first, for about 50 seconds in total (Figure 15-11). The same 30-second delay hits a PC plugged into an access port, which can make DHCP time out; PortFast (Chapter 16) fixes that.

Direct failure (the switch's own root port goes down): skip the 20 s max-age wait, move the alternate port straight to Listening, and forward after 2 x 15 = 30 s.

Figure 15-11 Worst-case 802.1D convergence after an indirect failure: 20 s max age + 15 s listening + 15 s learning = 50 s.

15.9 PVST+ and Configuring STP

15.9.1 One spanning tree per VLAN

A single Common Spanning Tree blocks the same ports for every VLAN, leaving redundant links idle. PVST+ runs a separate instance per VLAN, each with its own root and blocked ports, so you can load-balance: one uplink forwards for some VLANs and the other for the rest (Figure 15-12). This is why the BID includes the VLAN. The price is overhead: 500 VLANs mean 500 instances and 500 sets of BPDUs per trunk. Rapid PVST+ keeps exactly the same per-VLAN model and commands.

VLAN 10 instance VLAN 20 instance

Rp alt

  • DS1
  • root VLAN 10
  • DS2
  • secondary VLAN 10
  • AS1

Alt rp

Figure 15-12 PVST+ load balancing. DS1 is root for VLAN 10 and DS2 for VLAN 20, so AS1 forwards on a different uplink in each VLAN.

15.9.2 Configuration commands

Select the mode with spanning-tree mode {pvst | rapid-pvst | mst} . To choose the root bridge, set an explicit priority or use the macro:

DS1(config)# spanning-tree vlan 10 root primary
DS2(config)# spanning-tree vlan 10 root secondary
DS2(config)# spanning-tree vlan 20,30-35 priority 4096 ! lists and ranges allowed

root primary sets the priority to 24576 if the current root's priority is higher than that; otherwise it sets it 4096 below the current root's. root secondary sets 28672, which beats the default but not a primary root.

Exam alert

The root keywords are one-time macros: the running configuration stores spanning-tree vlan 10 priority 24576 . If a lower-priority switch is added later, it becomes root. Know the values: primary 24576 (or 4096 below the current root), secondary 28672, default 32768. To influence port roles without moving the root, change the port cost (changes the local RPC and what the switch advertises) or the port priority (changes the port ID that neighbors use as a tie-breaker):

SW3(config)# interface fastethernet0/1
SW3(config-if)# spanning-tree vlan 10 cost 2 ! or "spanning-tree cost 2" for all

VLANs

SW1(config)# interface gigabitethernet0/2
SW1(config-if)# spanning-tree vlan 10 port-priority 64 ! 0-240 in steps of 16, default 128

In the four-switch example, that cost change would make SW3's RPC 2 via Fa0/1; SW3 Gi0/3 would then advertise 2 against SW2's 4, become designated, and SW2 Gi0/3 would block. Small changes ripple, so always re-check roles.

15.10 Verifying STP

show spanning-tree (optionally vlan x ) is the key command. Figure 15-13 shows the root bridge from the four-switch example; Figure 15-14 shows SW3. Output in this chapter is illustrative of Cisco IOS 15 / IOS XE.

SW1 — console

SW1# show spanning-tree vlan 10

Vlan0010

  • Spanning tree enabled protocol ieee
  • Root ID Priority 24586
  • Address 001a.2b00.1100
  • 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 001a.2b00.1100
  • Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  • Aging Time 300 sec
  • Interface Role Sts Cost Prio.Nbr Type

------------------- ---- --- --------- -------- -------------------------------- Fa0/1 Desg FWD 19 128.1 P2p

Gi0/1 Desg FWD 4 128.25 P2p

Figure 15-13 On the root bridge the Root ID equals the Bridge ID and IOS says "This bridge is the root". All ports are designated and forwarding.

SW3# show spanning-tree vlan 10

Vlan0010

  • Spanning tree enabled protocol ieee
  • Root ID Priority 24586
  • Address 001a.2b00.1100
  • Cost 8
  • Port 27 (GigabitEthernet0/3)
  • Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  • Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
  • Address 001a.2b00.3300
  • Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  • Aging Time 300 sec
  • Interface Role Sts Cost Prio.Nbr Type

------------------- ---- --- --------- -------- -------------------------------- Fa0/1 Altn BLK 19 128.1 P2p

Gi0/2 Desg FWD 4 128.26 P2p

Gi0/3 Root FWD 4 128.27 P2p

Figure 15-14 SW3 reaches the root with cost 8 through Gi0/3; Fa0/1 is an alternate port in the blocking state, matching Figure 15-10.

Table 15-5 Reading show spanning-tree, field by field (Figure 15-14)

  • Field Meaning
  • VLAN0010 The STP instance (one per VLAN in PVST+)
  • enabled protocol ieee = PVST+; rstp = Rapid PVST+; mstp = MST

Root ID Priority / Address The root's BID: 24586 = 24576 + VLAN 10, SW1's MAC Root ID Cost / Port This switch's root path cost (8) and root port (Gi0/3) Hello, Max Age, Forward Delay Timers; those under Root ID are learned from the root and in effect Bridge ID Priority This switch's BID: 32778 = 32768 + sys-id-ext 10 Aging Time MAC aging, 300 s (15 s during a topology change)

Role / Sts Root, Desg, Altn, Back / BLK, LIS, LRN, FWD (BKN = inconsistent) Cost That port's own cost, not the total to the root

Prio.Nbr Port ID: port priority 128 and port number

Type P2p (full duplex), Shr (half duplex); "Edge" for PortFast ports show spanning-tree root lists each VLAN's root, this switch's root cost and root port, making an unexpected root easy to spot; show spanning-tree summary shows the mode, the VLANs this switch is root for, and the cost method (Figure 15-15, where SW2 has been made root for VLAN 20).

SW2# show spanning-tree root

Root Hello Max Fwd

Vlan Root ID Cost Time Age Dly Root Port

---------------- -------------------- --------- ----- --- --- ------------ VLAN0001 32769 001a.2b00.1100 4 2 20 15 Gi0/1

VLAN0010 24586 001a.2b00.1100 4 2 20 15 Gi0/1

VLAN0020 24596 001a.2b00.2200 0 2 20 15

SW2# show spanning-tree summary | include mode|Root bridge|Pathcost

Figure 15-15 SW2 is root for VLAN 20 only; for VLANs 1 and 10 its root port is Gi0/1 with cost 4.

15.11 Practice: Determining Port Roles

Use short costs (Gig = 4, Fast = 19). For each topology, find the root bridge, each root port and RPC, each link's designated port, and the blocked ports. Solutions follow. Gi0/1 Gi0/1

Swa

32769

0000.0c00.000a

Swb

32769

0000.0c00.000b

Swd

32769

0000.0c00.000d

Swc

4097

0000.0c00.000c

Figure 15-16 Exercise 1. Bridge priority and MAC beside each switch; link speeds on each link. Gi0/3

Swy

32769

0000.0c00.0001

Swx

32769

0000.0c00.0005

Swz

32769

0000.0c00.0009

Figure 15-17 Exercise 2. SWX and SWZ are joined by two cross-connected gigabit links: SWX Gi0/1 to SWZ Gi0/2 and SWX Gi0/2 to SWZ Gi0/1. All port priorities are 128.

Exercise 1 solution. SWC's priority 4097 is lowest, so SWC is root despite its higher MAC. SWB Gi0/2 is its RP (4). SWA can go via SWB (8) or via SWD (4 + 19 = 23): RP Gi0/1, RPC 8. SWD can go directly over FastEthernet (19) or via SWA (12): RP Gi0/1, RPC 12. Designated: SWC's two ports; SWB Gi0/1 (4 beats SWA's 8); SWA Gi0/2 (8 beats SWD's 12). SWD Fa0/1 blocks: the slow link is blocked at SWD's end, never at the root's.

Exercise 2 solution. Priorities tie and SWY has the lowest MAC, so SWY is root. SWX's RP is Gi0/3 (4). SWZ can use Fa0/1 directly (19) or either parallel link via SWX (8). The parallel paths tie on cost and neighbor BID, so the neighbor's port ID decides: SWX Gi0/1 (128.25) is lower, and it connects to SWZ Gi0/2, the root port. SWX Gi0/1 and Gi0/2 are designated (4 beats 8), and SWY's Fa0/1 is designated. SWZ Gi0/1 and Fa0/1 block. Choosing SWZ Gi0/1 because of its own lower number is the classic trap.

LAB Control the root bridge with PVST+

Goal: In the triangle of Figure 15-18, all switches carry VLANs 10 and 20 on gigabit trunks with default STP settings, so SW1 (lowest MAC) is root for both VLANs. Make SW2 root for VLAN 10 and SW3 root for VLAN 20, each secondary for the other VLAN, so both of SW1's uplinks carry traffic.

Figure 15-18 Lab topology. SW1 has the lowest MAC address; all links are 802.1Q trunks.

  • 1. Record the starting state with show spanning-tree root on each switch (SW1: root for both VLANs, no root port).
  • 2. Set the same mode on all three switches: spanning-tree mode pvst .
  • 3. Configure the roots:
SW2(config)# spanning-tree vlan 10 root primary
SW2(config)# spanning-tree vlan 20 root secondary
SW3(config)# spanning-tree vlan 20 root primary
SW3(config)# spanning-tree vlan 10 root secondary
  • 4. Check show running-config | include spanning-tree on SW2: you should see priority 24576 and priority 28672 lines, not the root keywords.
  • 5. Predict: in VLAN 10, SW1 and SW3 use their direct links to SW2 as root ports; on SW1–SW3 both advertise 4 and SW3 (28682) beats SW1 (32778), so SW1 Gi0/2 blocks. In VLAN 20, by the same logic, SW1 Gi0/1 blocks.

Verify:

SW1, SW2 — console

SW2# show spanning-tree vlan 10 | include Root ID|Priority|This bridge
  • Root ID Priority 24586
  • This bridge is the root
  • Bridge ID Priority 24586 (priority 24576 sys-id-ext 10)
SW1# show spanning-tree vlan 10 | begin Interface

Interface Role Sts Cost Prio.Nbr Type

------------------- ---- --- --------- -------- -------------------------------- Gi0/1 Root FWD 4 128.25 P2p

Gi0/2 Altn BLK 4 128.26 P2p

SW1# show spanning-tree vlan 20 | begin Interface

Interface Role Sts Cost Prio.Nbr Type

------------------- ---- --- --------- -------- -------------------------------- Gi0/1 Altn BLK 4 128.25 P2p

Gi0/2 Root FWD 4 128.26 P2p

Figure 15-19 Verification. SW2 is root for VLAN 10; SW1 forwards on Gi0/1 for VLAN 10 and on Gi0/2 for VLAN 20.

Expected results: SW1 Gi0/2 is Altn BLK in VLAN 10 and Gi0/1 is Altn BLK in VLAN 20. Power off SW2 and time how long VLAN 10 takes to recover with SW3 as root (up to 50 s); then repeat with spanning-tree mode rapid-pvst and compare.

Bpdu

Tcn bpdu

Pvst+

Review questions

  • 1. Why do Layer 2 loops cause frames to circulate indefinitely?
  • A. The FCS is recalculated by each switch
  • B. The Ethernet header has no TTL field
  • C. BPDUs are flooded to all ports
  • D. 802.1Q tags are removed at each hop
  • 2. A switch shows Bridge ID Priority 28682 (priority 28672 sys-id-ext 10) . Which statement is true?
  • A. It was probably configured with root secondary for VLAN 10.
  • B. It is the root bridge for VLAN 10.
  • C. It uses the default priority.
  • D. It was configured with spanning-tree vlan 10 priority 28682 .
  • 3. Which VLAN 1 bridge ID becomes the root bridge?
  • A. 32769 0000.0c11.1111
  • B. 32769 0000.0c00.0001
  • C. 24577 0050.56ff.ffff
  • D. 28673 0000.0c00.0000
  • 4. What is the default short-method STP cost of a 100 Mbps interface?
  • A. 4
  • B. 10
  • C. 19
  • D. 100
  • 5. Which two statements about the root bridge are true? (Choose two.)
  • A. All of its ports are designated ports.
  • B. It has exactly one root port.
  • C. It advertises a root path cost of 0.
  • D. It always has the lowest MAC address.
  • E. Its ports block until the election finishes.
  • 6. A non-root switch has two equal-cost ports connected to the same neighbor. What decides its root port?
  • A. The lowest local port number
  • B. The highest local port priority
  • C. The neighbor's advertised port priority, then port number
  • D. The port that came up first
  • 7. On a link between two non-root switches, both advertise root path cost 8. Which port is designated?
  • A. The port on the switch with the lower bridge ID
  • B. The port with the lower local cost
  • C. Neither; both block
  • D. The port on the switch with the higher MAC
  • 8. What is the worst-case 802.1D convergence time after an indirect failure with default timers?
  • A. 2 seconds
  • B. 15 seconds
  • C. 30 seconds
  • D. 50 seconds
  • 9. The current root for VLAN 30 shows priority 24606. You enter spanning-tree vlan 30 root primary on another switch. What priority is configured?
  • A. 24576
  • B. 20480
  • C. 28672
  • D. 4096
  • 10. Which two statements describe PVST+? (Choose two.)
  • A. It runs one STP instance per VLAN.
  • B. It is the IEEE 802.1s standard.
  • C. Different VLANs can block different ports, enabling load balancing.
  • D. It sends one BPDU for all VLANs.
  • E. It removes the need for the system ID extension.
  • 11. In Altn BLK 4 128.25 P2p , what does 128.25 represent?
  • A. Root path cost and VLAN
  • B. Port priority and port number
  • C. The neighbor's priority and port
  • D. Bridge priority and system ID extension
  • 12. Which two commands could make SW5 root for VLAN 50 if all other switches use defaults? (Choose two.)
  • A. spanning-tree vlan 50 priority 4096
  • B. spanning-tree vlan 50 cost 1
  • C. spanning-tree vlan 50 root primary
  • D. spanning-tree vlan 50 port-priority 0
  • E. spanning-tree vlan 50 priority 36864

Answers

  • 1. B. With no TTL, nothing ever discards a looping frame; STP prevents the loop instead.
  • 2. A. 28672 is the root secondary value; 28682 adds VLAN 10. 28682 is not a multiple of 4096, and the default is 32768.
  • 3. C. Priority is compared before MAC, and 24577 is lowest.
  • 4. C. 10 Mbps = 100, 100 Mbps = 19, 1 Gbps = 4, 10 Gbps = 2.
  • 5. A, C. The root has no root port, advertises 0, and all its ports are designated. Priority is compared before MAC.
  • 6. C. After cost and neighbor BID, the neighbor's port ID from the received BPDU decides.
  • 7. A. Equal advertised costs are broken by the lower BID.
  • 8. D. 20 s max age + 15 s listening + 15 s learning.
  • 9. B. The root is already at 24576, so the macro goes 4096 lower: 20480.
  • 10. A, C. PVST+ is Cisco's per-VLAN STP (802.1s is MST) and depends on the system ID extension.
  • 11. B. Prio.Nbr is the port ID: priority 128, port number 25.
  • 12. A, C. Both lower the priority below 32768. Cost and port priority do not affect the root election; 36864 is higher than the default.
Use ← → to move between sections