Layer 2 redundancy: spanning tree and EtherChannel
In short: Redundant switch links prevent single points of failure but create loops that cause broadcast storms. Spanning tree elects a root bridge and blocks just enough ports to remove loops. EtherChannel bundles parallel links into one logical link, so they add bandwidth without being blocked.
Why redundancy creates loops
Extra links between switches keep the network running when a cable or switch fails. But Ethernet frames have no time-to-live, so with two active paths a broadcast circulates forever, multiplying until links and switches are overwhelmed: a broadcast storm. MAC address tables also flap as the same address appears on different ports. Loop prevention is therefore essential.
How spanning tree builds a loop-free tree
- Switches exchange BPDUs (bridge protocol data units).
- Each switch has an 8-byte bridge ID: a 2-byte priority (default 32768, changed in steps of 4096) plus its 6-byte MAC address.
- The switch with the lowest bridge ID becomes the root bridge. Set it deliberately by lowering the priority on your core switch.
- Every other switch picks a root port: its lowest-cost path to the root.
- Each link gets one designated port that forwards towards that segment.
- Any remaining port is blocked (called alternate in RSTP), breaking the loop. If a link fails, a blocked port can take over.
Versions of spanning tree
| Version | Standard | Key points |
|---|---|---|
| STP | IEEE 802.1D | The original. One tree for all VLANs; slow, 30 to 50 seconds to converge. |
| RSTP | IEEE 802.1w | Converges in about a second. Port states are discarding, learning and forwarding. Works with STP switches. |
| MST | IEEE 802.1s | Maps groups of VLANs to a few tree instances. Scales well in large networks. |
| PVST+ | Cisco | A separate 802.1D tree per VLAN, so different VLANs can use different links. |
| Rapid PVST+ | Cisco | RSTP speed with a tree per VLAN. The common choice on Cisco campus networks. |
EtherChannel (link aggregation)
EtherChannel bundles 2 to 8 parallel physical links into one logical link. Spanning tree sees a single link, so none of the members are blocked: you get more bandwidth, load sharing and instant failover if one member fails.
| Method | Modes | Forms a bundle when |
|---|---|---|
| LACP (IEEE 802.3ad, now 802.1AX) | active, passive | at least one side is active |
| PAgP (Cisco) | desirable, auto | at least one side is desirable |
| Static | on | both sides are on (no negotiation, so mistakes can cause loops) |
All member ports must match in speed, duplex, VLANs and trunk settings. Prefer LACP: it is an open standard and checks the other end before bundling.
Configuration
! make the core switch the root for VLANs 10 and 20
spanning-tree mode rapid-pvst
spanning-tree vlan 10,20 priority 24576
! protect edge ports
interface range gigabitEthernet 1/0/1 - 24
spanning-tree portfast
spanning-tree bpduguard enable
! LACP bundle of two uplinks
interface range gigabitEthernet 1/0/49 - 50
channel-group 1 mode active
interface port-channel 1
switchport mode trunk
Real-world example: a loop in a warehouse office
Staff in a distribution warehouse office plugged a spare patch cable between two wall sockets while tidying up, creating a loop between two access switches. Because spanning tree was running, one of the ports moved to the blocking state within seconds and the network carried on as normal. The engineer later found the blocked port in show spanning-tree and removed the cable.
The same site had two 1 Gbps uplinks from each access switch to the distribution switch. Previously, spanning tree blocked one of them, wasting half the capacity. The engineer bundled the links into an LACP EtherChannel, so both carry traffic as one logical link, and spanning tree treats them as a single path. When one cable was later damaged by a forklift, the channel kept running on the remaining link and the office noticed nothing.
Practice
Two switches have priority 32768. How is the root chosen?
LACP is passive on both ends. Does the bundle form?
Why doesn’t spanning tree block EtherChannel members?
Key takeaways
- Redundant Layer 2 links without STP cause broadcast storms.
- Lowest bridge ID (priority + MAC) becomes root; set it on purpose.
- Port roles: root, designated and blocked/alternate.
- Prefer Rapid PVST+ or MST over legacy STP for fast convergence.
- EtherChannel bundles links; LACP needs at least one active side.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.