Principles
If detection packets are received by the same interface, a loopback occurs on the interface or a loop occurs on the downstream network or device connected to the interface.
If detection packets are received by another interface on the same device, a loop occurs on the device or network connected to the interface.
Once a loop is detected, a Huawei switch sends a trap to the NMS and records a log. It then takes a preconfigured action on the interface (see Action Taken After a Loop Is Detected) to minimize the impact of the loop on the device and entire network.
When the device does not receive detection packets from the interface within the recovery time, the device considers that the loop is eliminated and restores the interface (see Automatic Recovery of an Interface).
Detection Packet
- Detection packets sent from an interface are sent back to the local device when a loop occurs on an interface, or network connected to the interface.
- The system identifies detection packets sent from the local device, and detection packets that the interface sends.
Detection packets sent from a device carry the device's MAC address and outbound interface number. The device can identify the packets sent by itself as well as the source interface. The packets also carry the broadcast or multicast destination MAC address to ensure that the packets can be sent back to the local device when a loop occurs on the interface or network connected to the interface. Figure 20-1 shows the format of LDT and LBDT packets.
Item |
Description |
---|---|
DMAC |
Destination MAC address
The broadcast destination MAC address, multicast destination MAC address, or BPDU MAC address ensures that the detection packet can be sent back to the local device when a loop occurs on the interface or network connected to the interface. |
SMAC |
Source MAC address. The value is the system MAC address of the device, which identifies packets sent from the local device. |
802.1Q Tag |
Tag Protocol Identifier (TPID). The value of the TPID is 0x8100, representing the 802.1Q tagged frame. |
LDT-Type |
Detection packet type, including the protocol number and subprotocol number. The protocol number is 0x9998. The subprotocol number is as follows:
|
PortInfo |
Information about the interface that sends detection packets, which is used by the device to determine whether packets are sent from the interface. |
Flag |
Untagged detection packet flag:
|
LDT can detect loops based on VLANs only, because it sends only tagged detection packets. LBDT sends both tagged and untagged detection packets, so it can detect loops based on interfaces and VLANs.
Action Taken After a Loop Is Detected
When the system detects a loop on an interface, it can take a preconfigured action on the interface. Table 20-3 describes these preconfigured actions.
Action |
Description |
Usage Scenario |
---|---|---|
Trap |
The device only sends a trap to the NMS and records a log. |
Select this action when only traps need to be reported without affecting traffic forwarding on the interface. This action cannot suppress broadcast storms. |
Block |
The device sends a trap to the NMS, blocks the interface, and allows only BPDUs to pass through. |
Select this action when the interface needs to be disabled from forwarding data packets and needs to forward BPDUs such as Link Layer Discovery Protocol Data Units (LLDPDUs). This action can suppress broadcast storms. |
Shutdown |
The device sends a trap to the NMS and shuts down the interface. |
Select this action to prevent broadcast storms when the interface does not participate in any calculation or forwarding. This action can suppress broadcast storms. |
No learning |
The device sends a trap to the NMS and disables the interface from learning new MAC addresses. |
Select this action when the interface needs to process data packets and send them to the correct link. This action cannot suppress broadcast storms. |
Quitvlan |
The device sends a trap to the NMS and removes the interface from the VLAN where the loop occurs. |
Select this action when loops in a VLAN need to be eliminated without affecting traffic forwarding in other VLANs. This action can suppress broadcast storms. |
LDT and LBDT can only detect loops on a single node, but cannot eliminate loops on the entire network. After a loop is detected, you are advised to eliminate the loop immediately.
Automatic Recovery of an Interface
The automatic recovery mechanism of LDT and LBDT allows the looped interface to be restored immediately after a loop is eliminated.
- LDT: If the device does not receive detection packets from the looped interface within the recovery time, it considers that the loop is eliminated on the interface and restores the interface.
- LBDT: After the configured recovery time expires, the device attempts to restore the looped interface. If the device does not receive detection packets from the problematic interface within the next recovery time, it considers that the loop is eliminated on the interface and restores the interface.
The interface that is disabled by LBDT cannot be restored after the recovery time.
After the LBDT action of an interface is changed, the interface is restored. Then the changed LBDT action is taken when a loop is detected.
- When VLAN-based LDT or LBDT is configured on an interface:
If detection of this VLAN is canceled, the interface is restored automatically.
If GVRP is not enabled on the interface and the interface is removed from the VLAN manually, the interface is restored automatically.
If GVRP is enabled on the interface, the interface is manually removed from the VLAN or dynamically removed from the VLAN through GVRP, and the action to be taken is not shutdown, the interface can be restored automatically.
If GVRP is enabled on the interface, the interface is manually removed from the VLAN or dynamically removed from the VLAN through GVRP, and the action to be taken is shutdown, the interface cannot be restored automatically. In the alarm periodically reported by the device, information about the VLAN where loops are detected is empty. You must run the shutdown and undo shutdown commands to manually restore the interface or run the restart command to enable the interface again.