Free tech learning for everyone, from basics to pro

Transport Network DesignNetworking SecurityIntermediate

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

  1. Switches exchange BPDUs (bridge protocol data units).
  2. 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.
  3. The switch with the lowest bridge ID becomes the root bridge. Set it deliberately by lowering the priority on your core switch.
  4. Every other switch picks a root port: its lowest-cost path to the root.
  5. Each link gets one designated port that forwards towards that segment.
  6. Any remaining port is blocked (called alternate in RSTP), breaking the loop. If a link fails, a blocked port can take over.
Spanning tree blocks one link to remove the loopSW1root bridge (24576)SW2priority 32768SW3priority 32768RPDPDPRPDPXblocked (alternate) port: no loop
Figure 1. The lowest bridge ID wins root. Each other switch picks a root port (RP); each link has one designated port (DP); one port blocks.

Versions of spanning tree

VersionStandardKey points
STPIEEE 802.1DThe original. One tree for all VLANs; slow, 30 to 50 seconds to converge.
RSTPIEEE 802.1wConverges in about a second. Port states are discarding, learning and forwarding. Works with STP switches.
MSTIEEE 802.1sMaps groups of VLANs to a few tree instances. Scales well in large networks.
PVST+CiscoA separate 802.1D tree per VLAN, so different VLANs can use different links.
Rapid PVST+CiscoRSTP 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.

MethodModesForms a bundle when
LACP (IEEE 802.3ad, now 802.1AX)active, passiveat least one side is active
PAgP (Cisco)desirable, autoat least one side is desirable
Staticonboth 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?
The one with the lower MAC address wins, because the bridge ID is priority plus MAC.
LACP is passive on both ends. Does the bundle form?
No: at least one side must be active.
Why doesn’t spanning tree block EtherChannel members?
The bundle appears to STP as one logical link.

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.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

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.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.