bridging loop

term

networking

Kept in this browser · My desk

Two or more active paths between the same switches at layer 2, around which flooded frames circulate without end because the Ethernet header carries no hop count.

RFC 6325: "The Ethernet header does not contain a hop count (or Time to Live (TTL)) field. This is dangerous when there are temporary loops". Radia Perlman's 1985 paper warned of "infinitely circulating packets" brought on "merely by plugging a cable into the wrong place". A loop needs no exotic fault: a second patch cable between two switches, both ends of one cable in the same switch, or a blocked port that stops hearing BPDUs. Cisco calls unidirectional links a common cause.

What it is. A bridging loop is a layer 2 topology with two or more active paths between the same switches, so that a frame flooded by one switch can come back to it. Because a transparent bridge floods broadcasts, unknown unicasts and multicasts out of every port but the arrival port, and because the Ethernet header carries no hop count, nothing in the frame ever ends its journey: RFC (Request for Comments) 6325 (July 2011) puts it plainly, the Ethernet header does not contain a hop count or Time to Live (TTL) field, which is dangerous when there are temporary loops. Radia Perlman's 1985 paper for Digital already warned of infinitely circulating packets brought on merely by plugging a cable into the wrong place.

How it starts. A loop needs no exotic fault: a second patch cable between two switches, both ends of one cable in the same switch, a small unmanaged switch under a desk cabled back to the wall twice, or a blocked port that stops hearing BPDUs (bridge protocol data units) and moves to forwarding. Cisco calls unidirectional links a common cause, and warns that a native VLAN (virtual local area network) that differs between the two ends of an 802.1Q trunk can produce spanning-tree loops.

Growth depends on shape, and follows from the flooding rule: a switch turns each looping copy into as many copies as it has other ports in the loop. In a ring (two switches with two cables, a triangle, any cycle) each switch has two loop ports, so a broadcast becomes two copies circling forever in opposite directions, and every new broadcast adds two more: the loop fills. In a full mesh of four switches each has three loop ports, so copies double every hop, 3, 6, 12, until by hop 20 one ARP (Address Resolution Protocol) request is 1,572,864 copies, more than a 1 Gb/s link's roughly 1,488,095 minimum frames a second. The arithmetic is 3 times 2 to the power 19: each hop doubles the count, and switches forward at line rate, so the limit is reached almost at once.

What the network shows. Meanwhile the source's address flaps between loop ports and unicast joins the flood, and broadcast on the administrative VLAN starves the CPU (central processing unit) of BPDUs, which, Cisco notes, makes blocked ports forward. The second effect is the cruel one: the protocol that should stop the loop loses its messages to the loop, so a contained fault becomes a network-wide one. MAC (media access control) flapping logs, link utilization pinned at the maximum on several ports at once, and the same packets seen many times in a capture are the signs Cisco tells engineers to look for, adding that a single host such as a server is not likely to bring a network down through broadcasts alone.

A case to read carefully. On 11 August 2007 the United States customs network at Los Angeles International Airport failed for about 10 hours; the Department of Homeland Security's inspector general (OIG-08-58, May 2008) counts up to 17,000 passengers affected by the agency's estimate and response times of 2 to 3 minutes, about 30 times slower than normal. The press (Information Age, September 2007) reported that a single network interface card had malfunctioned, with a domino effect; the inspector general found the evaluation of the workstations involved inconclusive, noting that rebooting one may have erased critical information. The lesson for loops and floods alike is that the evidence disappears when the fault is cleared, so capture before you reboot.

Defences. Spanning tree with edge ports, BPDU guard and loop guard; loop detection protocols for unmanaged segments, which send a probe and act if it returns (Fortinet's FortiSwitchOS loop guard, for example, broadcasts loop guard data packets and can also act on a high rate of MAC moves); storm control to bound the flood; and console or out-of-band access, because Cisco's advice is to break a loop by disabling redundant paths one at a time from outside the network. Each layer covers a hole in the one before: spanning tree cannot see loops through devices that drop BPDUs, loop detection acts only after its probe comes back, and storm control only limits the damage while someone finds the cable.

The longer answer. RBridges (RFC 6325), designed with Perlman among the authors, encapsulate traffic with a header that includes a hop count and terminate the bridge spanning tree, so a transient loop costs bandwidth for a bounded number of hops rather than forever. Neighbours: broadcast storm, spanning tree, STP (Spanning Tree Protocol), loop guard, loop detection, MAC flapping, storm control and BUM (broadcast, unknown unicast and multicast) traffic.

Also known as: switching loop, layer 2 loop, l2 loop, loop de camada 2, loop de switching

Sources

← Back to B Back to the glossary