Network Implementation · Topic 4 of 8

Spanning Tree and Link Aggregation

Understand how Spanning Tree Protocol prevents switching loops with a root bridge, port roles and states, and how LACP link aggregation bundles links.

  • 5 min
  • Includes a diagram
In a nutshell
  • STP prevents loops by blocking redundant links. Loops cause broadcast storms.
  • The root bridge is the switch with the lowest bridge ID (priority, then MAC address).
  • Root port, designated port and blocked port are the main roles. Each non root switch has one root port.

What it is

Redundant links between switches protect against failure, but they can create a loop. Ethernet frames have no hop count, so a broadcast frame in a loop can circle forever and bring the network down in a broadcast storm.

The Spanning Tree Protocol (STP) blocks some redundant links so that only one active path exists between any two switches. Link aggregation goes the other way and combines several links into one logical link for more bandwidth.

Switch Aroot bridgeforwardingSwitch Bnon rootblockedSwitch Cnon rootSwitch AforwardingSwitch C

How it works

Electing the root bridge

Switches exchange Bridge Protocol Data Units (BPDUs). Each switch has a bridge identifier (ID) made of a priority value and its Media Access Control (MAC) address.

The switch with the lowest bridge ID becomes the root bridge. If priorities are equal, the lowest MAC address wins, so administrators lower the priority of the switch they want as root, usually a core switch.

Port roles

Three switches in a triangle: Switch A is the root bridge with designated ports, B and C have root ports toward A, and the redundant link between B and C is blocked so no loop forms.

RoleDescription
Root portThe port on a non root switch with the best path to the root bridge
Designated portThe forwarding port on each segment that offers the best path to the root
Blocked (alternate) portA redundant port that does not forward, kept as a backup

Every non root switch has exactly one root port. The root bridge has only designated ports.

Port states

In the original STP, ports move through four working states.

StateBehavior
BlockingReceives BPDUs, does not forward frames
ListeningParticipates in the election, still does not forward
LearningBuilds the MAC address table, still does not forward
ForwardingSends and receives data

A fifth state, disabled, applies to ports that are administratively shut down. Original STP (Institute of Electrical and Electronics Engineers, IEEE, standard 802.1D) can take around 30 to 50 seconds to converge after a change.

Rapid Spanning Tree Protocol

Rapid Spanning Tree Protocol (RSTP, IEEE 802.1w) converges in seconds instead. It simplifies the states to discarding, learning and forwarding, and it adds alternate and backup port roles that can take over quickly.

Most modern switches use RSTP or a per VLAN version of it. The exam focuses on the idea of one active path and on the faster recovery.

Edge ports

A port connected only to an end device can be set to an edge (PortFast) mode so that it goes to forwarding at once. Such a port should not receive BPDUs, and switches can shut it down if one arrives. This protection is covered in the security chapter.

Link aggregation

Link aggregation bundles several physical links between two devices into one logical link. Spanning tree sees the bundle as a single link, so none of the member links is blocked.

FeatureDetail
StandardLink Aggregation Control Protocol (LACP), IEEE 802.3ad, now part of 802.1AX
BenefitMore bandwidth and redundancy if one member fails
Load sharingTraffic is spread by a hash of addresses, so one flow stays on one link
RequirementMatching speed, duplex and virtual LAN (VLAN) settings on all member ports
Switch Aports 1 to 4four links as one logical linkSwitch Bports 1 to 4

Because each conversation uses a single member link, one flow cannot exceed the speed of one member. The total capacity is only reached by many flows.

LACP negotiates the bundle dynamically, and a static bundle can also be configured with no protocol. A mismatch, such as one side using LACP and the other not, prevents the bundle from forming.

What to remember for the exam

  • STP prevents loops by blocking redundant links. Loops cause broadcast storms.
  • The root bridge is the switch with the lowest bridge ID (priority, then MAC address).
  • Root port, designated port and blocked port are the main roles. Each non root switch has one root port.
  • STP states: blocking, listening, learning, forwarding. RSTP uses discarding, learning and forwarding.
  • RSTP (802.1w) converges much faster than original STP (802.1D).
  • Link aggregation combines links into one logical link. LACP is the standard protocol, 802.3ad.
  • Member links must match in speed, duplex and VLAN configuration.
  • A single flow uses only one member link of a bundle.
Exam tip

To make a particular switch the root, lower its STP priority. Do not rely on the default, because the switch with the lowest MAC address could win, and that may be an old or badly placed switch.

Common mistakes

Thinking STP disables redundancy. The blocked links are standby paths that wake up when the active path fails.

Believing a four link bundle gives one flow four times the speed. The hash assigns each flow to one member, so a single transfer is limited to one link.

Leaving the root election to chance. An unplanned root can sit at the edge and cause inefficient paths.

Mismatching bundle settings. Different speed, duplex or VLAN settings on member ports stop the bundle from forming.

Confusing STP and LACP. STP blocks links to prevent loops. LACP combines links to add capacity.

Watch out

Removing STP from a network with redundant links, or connecting two switch ports together by mistake without it, can cause a loop and a broadcast storm within seconds.

Check yourself

Work through these three.

  • How does STP choose the root bridge?

    It picks the switch with the lowest bridge ID, which is the priority value followed by the MAC address.

  • What problem does STP prevent?

    Switching loops and the resulting broadcast storms on redundant links.

  • Which protocol bundles several links into one logical link?

    Link Aggregation Control Protocol (LACP), IEEE 802.3ad.

Topic 4 of 8 in Network Implementation

Test yourself on Network Implementation

The full CompTIA Network+ N10-009 question bank has 910 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by CompTIA. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.