This episode discusses the problems of redundant Layer 2 topologies: broadcast storms, multiple frame transmission, and CAM table instability. You understand how STP IEEE 802.1D works from root bridge selection, port roles, and port state transitions, then the advantages of RSTP 802.1w along with PortFast and BPDU Guard.

In episode 5 you built dual trunks between switches. Redundant topologies like that are good for reliability, but at Layer 2, uncontrolled redundancy is a disaster: frames can spin forever and take down the network. Episode 7 discusses the protocol that saves a network from itself: Spanning Tree Protocol (STP).
We start with the problems loops cause, then break down how STP 802.1D works, followed by Rapid STP 802.1w, and close with the Cisco optimization features PortFast and BPDU Guard that must exist on access ports.
Without STP, a Layer 2 loop causes three serious problems:
Try it in PNETLab: assemble three switches in a triangle, connect a PC, and leave it for a few seconds. The CPU and links will swell — that is a real broadcast storm.
STP builds one loop-free logical topology over physically redundant links. The first step: selecting the Root Bridge, the switch that becomes the center of the calculation. The Root Bridge is chosen by the lowest Bridge Priority, and if tied, by the lowest MAC address.
Show the results in PNETLab:
SW1# show spanning-tree vlan 10
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0050.7966.6800
This bridge is the root
Bridge ID Priority 32769 (priority 32768 sys-id-ext 10)
Address 0050.7966.6800
Interface Role Sts Cost Prio.Nbr Type
--------- ----------- -------- --------- -------- --------------
Gi0/0 Desg FWD 4 128.1 P2p
Gi0/1 Desg FWD 4 128.2 P2pThe show spanning-tree output shows the Root ID and the role of
each port. The root bridge always makes all of its ports Designated Ports
(DP).
STP ports move through four states: Blocking (only listening to BPDUs), Listening, Learning (populating the MAC table), then Forwarding. This transition takes about 30 seconds on classic STP — the long delay that led to RSTP being developed.
RSTP (IEEE 802.1w) speeds up convergence by introducing new ports: Alternate Port (a backup root port, going straight to forwarding when the RP fails) and Backup Port (a backup designated port). These new roles make failover almost instant without waiting for the 30-second timer.
Enable RSTP on all switches in your lab:
configure terminal
spanning-tree mode rapid-pvst
exitspanning-tree mode rapid-pvst replaces classic PVST+ with Rapid
PVST+, the per-VLAN version of RSTP used by Cisco.
An access port connected to a PC does not need to wait through the 30-second convergence process. PortFast makes the port go straight to the Forwarding state when the link comes up:
configure terminal
interface range g0/1 - 5
switchport mode access
spanning-tree portfast
spanning-tree bpduguard enable
exitspanning-tree portfast skips the listening and learning phases on
access ports. Remember: PortFast is only for access ports facing end devices,
not for switch-to-switch links.
BPDU Guard monitors ports that should never receive BPDUs. If an incoming BPDU frame is detected — for example, a user plugged in a rogue switch — the port automatically goes into err-disable state and shuts down. Verify:
SW1# show interfaces status | include err-dis
Gi0/5 err-disabledshow interfaces status displays ports that went into err-disable
because of BPDU Guard. Re-enable it with shutdown then no shutdown
after the source of the BPDUs has been cleaned up.
In the lab, manually determine which switch becomes root with
spanning-tree vlan 10 root primary or by setting spanning-tree vlan 10 priority 4096. The root bridge should be the switch with the best performance,
not a random switch that happens to have the lowest MAC. Consistency between
STP and your VLAN design from episode 5 will help a lot during
troubleshooting in episode 20.
Key takeaways:
In the next episode, episode 8, we discuss link aggregation: EtherChannel with LACP and PAgP — combining up to 8 physical links into a single logical channel, the active passive desirable auto negotiation modes, Layer 2 and Layer 3 EtherChannel configuration, and verification with show etherchannel summary.