When a loop occurs on a network, broadcast, multicast, and unknown unicast packets are repeatedly transmitted on the network. This wastes network resources and may even cause a network breakdown. To minimize the impact of loops on a Layer 2 network, a detection technology that quickly notifies users of loops is required. When a loop occurs, users are requested to check network connections and configurations, and control the problematic interface.
Trap: The device reports a trap to the NMS and records a log, but does not take any action on the interface.
Block: The device blocks this interface, and can forward only BPDUs.
No learning: The interface is disabled from learning MAC addresses.
Quitvlan: The interface is removed from the VLAN where a loop occurs.
The problematic interface continues to send LBDT packets. After the configured recovery time expires, the system attempts to restore the problematic interface. If the device receives no LBDT packets from the problematic interface within the next recovery time, it considers that the loop is eliminated on the interface and restores the interface.
LBDT can only detect loops on a single node, but cannot eliminate loops on the entire network in the same manner as ring network technologies of ERPS, RRPP, SEP, Smart Link, and STP/RSTP/MSTP/VBST.
In V200R008C00 and earlier versions, LBDT does not take effect in dynamic VLANs. In V200R008C00 and later versions, the LBDT-enabled switch can detect loops in dynamic VLANs, but the Quitvlan action is invalid for dynamic VLANs.
LBDT needs to send a large number of LBDT packets to detect loops, occupying system resources. Therefore, disable LBDT if loops do not need to be detected.
In versions earlier than V200R019C00, LBDT cannot be configured on an Eth-Trunk or its member interfaces. In V200R019C00 and later versions, LBDT can be configured on an Eth-Trunk but cannot be configured on its member interfaces.
On the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720S-EI, S6720-HI, S6730S-H, S6730-H, S6730-S, and S6730S-S, manual LBDT can be configured on a maximum of 64 Eth-Trunks; on other models, manual LBDT can be configured on a maximum of 32 Eth-Trunks.
An interface can send LBDT packets with the specified VLAN tag only when the specified VLAN has been created.
When the PVID of the interface in the loop is the detected VLAN ID or the interface joins the detected VLAN in untagged mode, VLAN tags of LBDT packets are removed. As a result, the packet priority changes and the system may fail to detect loops.
When the Quitvlan action is used, the configuration file remains unchanged.
The LBDT action and MAC address flapping action affect each other, and cannot be configured simultaneously.
The Quitvlan action of LBDT conflicts with dynamic removal from VLANs (for example, GVRP and HVRP), and cannot be configured simultaneously.
On a modular switch, LBDT and loop detection (LDT) cannot be configured simultaneously.
In Figure 1, a small-scale enterprise uses Layer 2 networking and belongs to VLAN 100. Because employees often move, the network topology changes frequently. Loops occur due to incorrect connections or configurations during the change. As a result, broadcast storms occur and affect communication of the Switch and entire network.
To detect loops on the network where the Switch is deployed, configure LBDT on GE1/0/1 and GE1/0/2 of the Switch. In this example, untagged LBDT packets sent by the Switch will be discarded by other switches on the network. As a result, the packets cannot be sent back to the Switch, and LBDT fails. Therefore, LBDT is configured in a specified VLAN. The configuration roadmap is as follows:
Configure interfaces on other switching devices as trunk or hybrid interfaces and configure these interfaces to allow packets from corresponding VLANs to pass through to ensure Layer 2 connectivity.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] loopback-detect enable //Enable LBDT on the interface. [Switch-GigabitEthernet1/0/1] quit [Switch] interface gigabitethernet 1/0/2 [Switch-GigabitEthernet1/0/2] loopback-detect enable //Enable LBDT on the interface. [Switch-GigabitEthernet1/0/2] quit
[Switch] vlan 100 [Switch-vlan100] quit [Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] port link-type hybrid //In V200R005C00 and later versions, the default link type of a switch interface is not hybrid. You can choose run the port link-type hybrid command to configure the link type of the interface as hybrid. [Switch-GigabitEthernet1/0/1] port hybrid tagged vlan 100 [Switch-GigabitEthernet1/0/1] loopback-detect packet vlan 100 //Enable LBDT to detect loops in VLAN 100. [Switch-GigabitEthernet1/0/1] quit [Switch] interface gigabitethernet 1/0/2 [Switch-GigabitEthernet1/0/2] port link-type hybrid [Switch-GigabitEthernet1/0/2] port hybrid tagged vlan 100 [Switch-GigabitEthernet1/0/2] loopback-detect packet vlan 100 //Enable LBDT to detect loops in VLAN 100. [Switch-GigabitEthernet1/0/2] quit
[Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] loopback-detect action block //Configure the Block action to be taken after a loop is detected. [Switch-GigabitEthernet1/0/1] loopback-detect recovery-time 30 //Set the recovery time to 30s. [Switch-GigabitEthernet1/0/1] quit [Switch] interface gigabitethernet 1/0/2 [Switch-GigabitEthernet1/0/2] loopback-detect action block //Configure the Block action to be taken after a loop is detected. [Switch-GigabitEthernet1/0/2] loopback-detect recovery-time 30 //Set the recovery time to 30s. [Switch-GigabitEthernet1/0/2] quit
Run the display loopback-detect command to check the LBDT configuration.
[Switch] display loopback-detect Loopback-detect sending-packet interval: 5 ---------------------------------------------------------------------------------- Interface RecoverTime Action Status ---------------------------------------------------------------------------------- GigabitEthernet1/0/1 30 block NORMAL GigabitEthernet1/0/2 30 block NORMAL ----------------------------------------------------------------------------------
The preceding command output shows that the LBDT configuration is successful.
After about 5s, run the display loopback-detect command to check whether GE1/0/1 or GE1/0/2 is blocked.
[Switch] display loopback-detect Loopback-detect sending-packet interval: 5 ---------------------------------------------------------------------------------- Interface RecoverTime Action Status ---------------------------------------------------------------------------------- GigabitEthernet1/0/1 30 block NORMAL GigabitEthernet1/0/2 30 block BLOCK(Loopback detected) ----------------------------------------------------------------------------------
The preceding command output shows that GE1/0/2 is blocked.
Shut down GE1/0/1. After 30s, run the display loopback-detect command to check whether GE1/0/2 is restored.
[Switch] display loopback-detect Loopback-detect sending-packet interval: 5 ---------------------------------------------------------------------------------- Interface RecoverTime Action Status ---------------------------------------------------------------------------------- GigabitEthernet1/0/1 30 block NORMAL GigabitEthernet1/0/2 30 block NORMAL ----------------------------------------------------------------------------------
The preceding command output shows that GE1/0/2 is restored.
Switch configuration file
# sysname Switch # vlan batch 100 # interface GigabitEthernet1/0/1 port link-type hybrid port hybrid tagged vlan 100 loopback-detect recovery-time 30 loopback-detect packet vlan 100 loopback-detect enable loopback-detect action block # interface GigabitEthernet1/0/2 port link-type hybrid port hybrid tagged vlan 100 loopback-detect recovery-time 30 loopback-detect packet vlan 100 loopback-detect enable loopback-detect action block # return