One evening the home network stops working altogether. The Wi-Fi is there but nothing loads, the switch LEDs are flashing wildly, the router cannot be reached. You restart everything and the problem comes back after a few seconds. Then you discover that a child, while playing, plugged a cable between two wall jacks, or that someone inserted both ends of a patch cord into the same switch. It is a network loop, and its consequence has a name: a broadcast storm.
Why a loop brings the network down
A home Ethernet network is designed as a tree: links run from the router to the switches and from these to the devices, with no alternative paths. Each switch learns which port each device is on and forwards packets accordingly.
Some packets, however, called broadcasts, are meant for everyone: for example the request with which a device asks who has a certain IP address, or the one it uses to look for a DHCP server. The switch forwards them on every port except the one they came in on.
If there is a loop, the broadcast leaves through one port, goes round and comes back in through another, and the switch forwards it again. Ethernet frames have no counter that makes them expire, so they circulate forever, multiplying at every pass. Within seconds the network's entire capacity is taken up by copies of the same packet, and normal traffic no longer gets through.
How a loop is created at home
The most common causes are trivial:
- a cable connected between two wall jacks in the same room or in different rooms;
- both ends of a patch cord plugged into the same switch;
- two switches connected to each other with two cables, perhaps in the hope of doubling the speed;
- a mesh access point connected by cable while its radio link is still active, on systems that do not handle this situation well;
- a powerline adapter and a cable linking the same two points.
Recognising a broadcast storm
The symptoms are fairly typical:
- the network locks up completely, wired and Wi-Fi, not just one device;
- the switch activity LEDs flash continuously and in sync;
- the router or the switch becomes slow or unreachable;
- the problem returns right after a restart;
- unplugging one specific cable makes everything go back to normal instantly.
The quickest diagnosis is precisely the last one: unplug cables from the switch one at a time, watching the LEDs. When the frantic flashing stops, you have found one end of the loop.
The protection: Spanning Tree Protocol
Professional networks often use redundant links on purpose, to have a backup path. To avoid loops there is the Spanning Tree Protocol (STP), defined in the IEEE 802.1D standard, and its faster version RSTP (802.1w). Switches that support it exchange messages, discover loops and block the ports needed to turn the network into a tree. If a link fails, they automatically re-enable the backup one.
| Switch type | Loop protection |
|---|---|
| Cheap unmanaged switch | Usually none |
| Some recent unmanaged switches | Basic loop detection, port disabled |
| Managed or smart switch | Configurable STP or RSTP, often loop protection too |
| Router with built-in switch | Varies, check the documentation |
How to protect your home network
- Use at least one switch with STP or loop detection at the centre of the network, where the cables from the rooms arrive.
- Enable RSTP on managed switches, if it is not already on, and check that all managed switches use the same protocol.
- Label jacks and cables, so it is clear what connects to what.
- Do not connect two switches with two cables, unless you configure link aggregation (LACP) on both.
- Disconnect unused wall jacks at the patch panel, or leave them on isolated ports, if there are small children in the house.
A typical case
In my work the most frequent case is the mesh system. Someone adds a cable between two nodes to improve the backhaul, but a cheap switch in between and an outdated setting create a double path, by cable and by radio. The network runs for hours, then locks up intermittently. Updating the mesh firmware and replacing the switch with one that handles loops solves the problem for good.
In short
- A network loop makes broadcast packets circulate endlessly and brings the whole network down.
- A cable between two jacks or a patch cord with both ends in the same switch is enough.
- You can spot it from LEDs flashing non-stop and a total, recurring lock-up.
- STP and RSTP find loops and block the surplus ports.
- At home it pays to have at least one central switch with loop protection.