Redundancy is a good thing
Situation: an office has three switches, connected in a line: SW2 – SW1 – SW3. If one cable breaks, half the office is cut off. So the designer adds a third cable, SW2 – SW3. Now the switches form a triangle. Any one cable can break, and every switch can still reach every other switch.
This is called redundancy: a spare path that takes over when the main one fails. Almost every business network has it. For example, each access switch has two uplinks, and there are two core switches. But redundancy causes a big problem for Ethernet.
What happens without protection
Follow a single broadcast frame, such as an ARP request from PC A:
- 1. One frame. PC A sends one broadcast.
- 2. Flooded. A switch sends a broadcast out of every port except the one it came in on. This is called flooding. So SW2 sends one copy to SW1 and one to SW3.
- 3. Flooded again. SW1 sends its copy on to SW3. SW3 sends its copy on to SW1 (and to PC B).
- 4. Back where it started. Both copies come back to SW2, and SW2 floods them again. Nothing ever stops them.
Why the frames never stop
An IP packet has a TTL (time to live) number. Every router lowers it by one. When it reaches zero, the packet is thrown away. So a packet stuck in a routing loop dies after a while. An Ethernet frame has no TTL. Switches pass it on without changing it. So in a loop, the frame goes round and round until the loop is removed.
The three problems a loop causes
| Problem | What you see | Why |
|---|---|---|
| Broadcast storm | Links are 100% busy, switches are overloaded, and the whole network stops working | Every switch copies every broadcast again and again. New broadcasts keep adding more. |
| MAC table instability | The same MAC address keeps jumping between ports ("MAC flapping"), and the switch logs it | Copies of PC A's frame arrive on different ports, so the switch keeps changing its mind about where PC A is |
| Duplicate frames | Hosts receive the same unicast frame several times | A frame for an unknown MAC address is flooded around the loop and arrives more than once |
⚠️ A broadcast storm can stop a whole network within seconds. It can happen very easily: for example, someone plugs both ends of one cable into the same switch, or connects two wall sockets together.
So the network needs both
You want the spare links, so the network survives a broken cable. You also want no loops, so the network stays stable. Spanning Tree Protocol (STP) gives you both. All the cables stay connected, but STP turns off just enough ports to remove every loop. The next lesson shows how.
Check yourself
Why can a routing loop eventually clear itself, while a switching loop can't?
A switch logs that PC A's MAC address keeps moving between Gi1/0/1 and Gi1/0/2. What's the most likely cause?