Concepts / Loops and bonded links

Loops and bonded links

Broadcast storm

Also called switching loop, layer 2 loop, storm control, MAC flapping

A broadcast copied round a loop of switches for ever, because Ethernet frames have no hop limit.

The problem

Three switches cabled in a triangle give every frame two ways round, and a broadcast never stops going round.

  1. coreSwitch, floorA and floorB are cabled in a triangle, with spanning tree off. Alice is on floorA, bob on floorB.
  2. Alice sends one ARP broadcast for the printer, 10.0.1.12. floorA floods it to both other switches.
  3. Each switch floods every copy it gets out of its other ports, so one copy goes round each way, for ever.
  4. An Ethernet frame has no hop limit to run out, so nothing removes the copies: each lap adds more work.
  5. Alice's frames now reach floorB from both sides, so floorB keeps moving her MAC between two ports (MAC flapping).
One question, two copies, no end
One question, two copies, no end

Each switch floods correctly, and the ring turns correct flooding into a lap that never finishes. Every new broadcast joins in. From the Spanning tree: cable a ring without melting the network lab.

What you'd see

$ timeout 3 tcpdump -nn -i eth0 -w /dev/null arp
1029095 packets captured
1029805 packets received by filter
0 packets dropped by kernel
  • Run on bob for 3 seconds, after alice sent one single ARP request.
  • 1029095 packets captured: over a million copies of that one frame reached bob's card.
  • With spanning tree on, the same test captures 1 packet.

Guess first

During the storm, floorB's table is read six times in a row. Which port is alice's MAC behind?

Show answer

It keeps changing: dev coreSwitch, then dev floorA, then dev coreSwitch again. Her frames arrive from both sides of the loop, so the switch relearns her on each.

In short

Each switch floods every copy it receives, so a single broadcast in a loop never dies, and every new broadcast adds to it until the links and the switches' CPUs are full. Frames from one device arrive from two directions, so switches keep moving its MAC address between ports (MAC flapping) and send unicast traffic the wrong way. Storm control caps the broadcasts per port and second, which limits the damage; only spanning tree, blocking a port, removes the loop.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab