Layer 2 Loop Detection Fundamentals

Networks are prone to loops, and loops may occur due to a variety of reasons, such as incorrect link connection, loop prevention protocol failure, and optical module failure. On a ring network (for example, an Ethernet ring network), a loop prevention protocol, such as the Spanning Tree Protocol (STP), is configured. However, if the loop prevention protocol fails due to network attacks or overload, Layer 2 loops may occur. On a non-ring network, loop prevention protocols are not configured and Layer 2 loops may occur due to incorrect link connection. If a loop occurs, broadcast, multicast, and unknown unicast packets on a Layer 2 network will be continuously replicated and sent to the router's CPU.

As shown in Figure 1, the interface where a loop has occurred will receive a large number of packets. If these packets are protocol packets, such as Address Resolution Protocol (ARP) and Virtual Router Redundancy Protocol (VRRP) packets, they will be replicated and sent to the router's CPU. The traffic burst overloads the CPU, causing normal protocol packets to fail to be sent to the CPU. As a result, normal services will be interrupted.

Figure 1 Diagram of Layer 2 loops
Layer 2 loop detection determines whether a loop has occurred based on information about packets sent to the CPU. After a loop is detected, the system can be configured to take one of the following responsive actions to an existing or potential Layer 2 loop on an interface:
  • Shut down the interface: The system will shut down the interface only after detecting an existing Layer 2 loop on the interface. This action stops the interface from sending numerous packets to the CPU.
  • Send a trap: The system will send a trap after detecting an existing or potential Layer 2 loop. The trap message can help a user locate the interface where the Layer 2 loop has occurred or may occur.
  • Send a trap and shut down the interface: The system will send a trap and shut down the interface after detecting an existing Layer 2 loop on the interface.
  • Ignore Layer 2 loops: The system will stop Layer 2 loop detection, but not shut down the interface or send a trap.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.