04-Layer 2 - LAN Switching Configuration Guide

HomeSupportSwitchesS7500E SeriesConfigure & DeployConfiguration GuidesH3C S7500E Switch Series Configuration Guides-R757X-GL-6W10004-Layer 2 - LAN Switching Configuration Guide
09-Loop detection configuration
Title Size Download
09-Loop detection configuration 119.41 KB

Configuring loop detection

Overview

Incorrect network connections or configurations can create Layer 2 loops, which results in repeated transmission of broadcasts, multicasts, or unknown unicasts. The repeated transmissions can waste network resources and can paralyze networks. The loop detection mechanism immediately generates a log when a loop occurs so that you are promptly notified to adjust network connections and configurations. You can configure loop detection to shut down the looped port. Logs are maintained in the information center. For more information, see Network Management and Monitoring Configuration Guide.

Loop detection mechanism

The device detects loops by sending detection frames and then checking whether these frames return to any port on the device. If they do, the device considers that the port is on a looped link.

Loop detection usually works within a VLAN. If a detection frame is returned with a different VLAN tag than it was sent out with, an inter-VLAN loop has occurred. To remove the loop, examine the QinQ or VLAN mapping configuration for incorrect settings. For more information about QinQ and VLAN mapping, see "Configuring QinQ" and "Configuring VLAN mapping."

Figure 1 Ethernet frame header for loop detection

 

The Ethernet frame header for loop detection contains the following fields:

·     DMACDestination MAC address of the frame, which is the multicast MAC address 010f-e200-0007. When a loop detection-enabled device receives a frame with this destination MAC address, it performs the following operations:

¡     Sends the frame to the CPU.

¡     Floods the frame in the VLAN from which the frame was originally received.

·     SMACSource MAC address of the frame, which is the bridge MAC address of the sending device.

·     TPIDType of the VLAN tag, with the value of 0x8100.

·     TCIInformation of the VLAN tag, including the priority and VLAN ID.

·     TypeProtocol type, with the value of 0x8918.

Figure 2 Inner frame header for loop detection

 

The inner frame header for loop detection contains the following fields:

·     CodeProtocol sub-type, which is 0x0001, indicating the loop detection protocol.

·     VersionProtocol version, which is always 0x0000.

·     LengthLength of the frame. The value includes the inner header, but excludes the Ethernet header.

·     ReservedThis field is reserved.

Frames for loop detection are encapsulated as TLV triplets.

Table 1 TLVs supported by loop detection

TLV

Description

Remarks

End of PDU

End of a PDU.

Optional.

Device ID

Bridge MAC address of the sending device.

Required.

Port ID

ID of the PDU sending port.

Optional.

Port Name

Name of the PDU sending port.

Optional.

System Name

Device name.

Optional.

Chassis ID

Chassis ID of the sending port.

Optional.

Slot ID

Slot ID of the sending port.

Optional.

Sub Slot ID

Sub-slot ID of the sending port.

Optional.

 

Loop detection interval

Loop detection is a continuous process as the network changes. Loop detection frames are sent at the loop detection interval to determine whether loops occur on ports and whether loops are removed.

Loop protection actions

When the device detects a loop on a port, it generates a log but performs no action on the port by default. You can configure the device to take one of the following actions:

·     Block—Disables the port from learning MAC addresses and blocks the port.

·     No-learning—Disables the port from learning MAC addresses.

·     Shutdown—Shuts down the port to disable it from receiving and sending any frames.

Port status auto recovery

When the device configured with the block or no-learning loop action detects a loop on a port, it performs the action and waits three loop detection intervals. If the device does not receive a loop detection frame within three loop detection intervals, it performs the following operations:

·     Automatically sets the port to the forwarding state.

·     Notifies the user of the event.

When the device configured with the shutdown action detects a loop on a port, the following events occur:

1.     The device automatically shuts down the port.

2.     The device automatically sets the port to the forwarding state after the detection timer set by using the shutdown-interval command expires. For more information about the shutdown-interval command, see Fundamentals Command Reference.

3.     The device shuts down the port again if a loop is still detected on the port when the detection timer expires.

This process is repeated until the loop is removed.

 

 

NOTE:

Incorrect recovery can occur when loop detection frames are discarded to reduce the load. To avoid this, use the shutdown action, or manually remove the loop.

 

Loop detection configuration task list

Tasks at a glance

(Required.) Enabling loop detection

(Optional.) Setting the loop protection action

(Optional.) Setting the loop detection interval

 

Enabling loop detection

You can enable loop detection globally or on a per-port basis. When a port receives a detection frame in any VLAN, the loop protection action is triggered on that port, regardless of whether loop detection is enabled on it.

Enabling loop detection globally

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Globally enable loop detection.

loopback-detection global enable vlan { vlan-id--list | all }

Disabled by default.

 

Enabling loop detection on a port

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter Layer 2 Ethernet or aggregate interface view.

interface interface-type interface-number

N/A

3.     Enable loop detection on the port.

loopback-detection enable vlan { vlan-id--list | all }

Disabled by default.

 

Setting the loop protection action

You can set the loop protection action globally or on a per-port basis. The global setting applies to all ports. The per-port setting applies to individual ports. The per-port setting takes precedence over the global setting.

Configuration restrictions and guidelines

IMPORTANT

IMPORTANT:

To avoid unexpected issues, do not specify the block action on ports when loop detection is enabled globally. To use this action on a port, first disable loop detection globally.

 

The shutdown action does not take effect on an interface configured with internal loopback testing or a fiber port forcibly brought up. For more information about internal loopback testing and forcibly bringing up a fiber port, see Ethernet interface configuration in Interface Configuration Guide.

Setting the global loop protection action

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Set the global loop protection action.

loopback-detection global action shutdown

By default, the device generates a log but performs no action on the port on which a loop is detected.

 

Setting the loop protection action on a Layer 2 Ethernet interface

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter Layer 2 Ethernet interface view.

interface interface-type interface-number

N/A

3.     Set the loop protection action on the interface.

loopback-detection action { block | no-learning | shutdown }

By default, the device generates a log but performs no action on the port on which a loop is detected.

 

Setting the loop protection action on a Layer 2 aggregate interface

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter Layer 2 aggregate interface view.

interface interface-type interface-number

N/A

3.     Set the loop protection action on the interface.

loopback-detection action shutdown

By default, the device generates a log but performs no action on the port on which a loop is detected.

 

Setting the loop detection interval

With loop detection enabled, the device sends loop detection frames at the loopback detection interval. A shorter interval offers more sensitive detection but consumes more resources. Consider the system performance and loop detection speed when you set the loop detection interval.

To set the loop detection interval:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Set the loop detection interval.

loopback-detection interval-time interval

The default setting is 30 seconds.

 

Displaying and maintaining loop detection

Execute display commands in any view.

 

Task

Command

Display the loop detection configuration and status.

display loopback-detection

 

Loop detection configuration example

Network requirements

As shown in Figure 3, configure loop detection on Device A to meet the following requirements:

·     Device A generates a log as a notification.

·     Device A automatically shuts down the port on which a loop is detected.

Figure 3 Network diagram

Configuration procedure

1.     Configure Device A:

# Create VLAN 100, and globally enable loop detection for the VLAN.

<DeviceA> system-view

[DeviceA] vlan 100

[DeviceA-vlan100] quit

[DeviceA] loopback-detection global enable vlan 100

# Configure GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2 as trunk ports, and assign them to VLAN 100.

[DeviceA] interface gigabitethernet 1/0/1

[DeviceA-GigabitEthernet1/0/1] port link-type trunk

[DeviceA-GigabitEthernet1/0/1] port trunk permit vlan 100

[DeviceA-GigabitEthernet1/0/1] quit

[DeviceA] interface gigabitethernet 1/0/2

[DeviceA-GigabitEthernet1/0/2] port link-type trunk

[DeviceA-GigabitEthernet1/0/2] port trunk permit vlan 100

[DeviceA-GigabitEthernet1/0/2] quit

# Set the global loop protection action to shutdown.

[DeviceA] loopback-detection global action shutdown

# Set the loop detection interval to 35 seconds.

[DeviceA] loopback-detection interval-time 35

2.     Configure Device B:

# Create VLAN 100.

<DeviceB> system-view

[DeviceB] vlan 100

[DeviceB–vlan100] quit

# Configure GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2 as trunk ports, and assign them to VLAN 100.

[DeviceB] interface gigabitethernet 1/0/1

[DeviceB-GigabitEthernet1/0/1] port link-type trunk

[DeviceB-GigabitEthernet1/0/1] port trunk permit vlan 100

[DeviceB-GigabitEthernet1/0/1] quit

[DeviceB] interface gigabitethernet 1/0/2

[DeviceB-GigabitEthernet1/0/2] port link-type trunk

[DeviceB-GigabitEthernet1/0/2] port trunk permit vlan 100

[DeviceB-GigabitEthernet1/0/2] quit

3.     Configure Device C:

# Create VLAN 100.

<DeviceC> system-view

[DeviceC] vlan 100

[DeviceC–vlan100] quit

# Configure GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2 as trunk ports, and assign them to VLAN 100.

[DeviceC] interface gigabitethernet 1/0/1

[DeviceC-GigabitEthernet1/0/1] port link-type trunk

[DeviceC-GigabitEthernet1/0/1] port trunk permit vlan 100

[DeviceC-GigabitEthernet1/0/1] quit

[DeviceC] interface gigabitethernet 1/0/2

[DeviceC-GigabitEthernet1/0/2] port link-type trunk

[DeviceC-GigabitEthernet1/0/2] port trunk permit vlan 100

[DeviceC-GigabitEthernet1/0/2] quit

Verifying the configuration

# View the system logs on devices, for example, Device A.

[DeviceA]

%Feb 24 15:04:29:663 2013 DeviceA LPDT/4/LPDT LOOPED: Loopback exists on GigabitEthernet1/0/1.

%Feb 24 15:04:29:667 2013 DeviceA LPDT/4/LPDT LOOPED: Loopback exists on GigabitEthernet1/0/2.

%Feb 24 15:04:44:243 2013 DeviceA LPDT/5/LPDT RECOVERED: Loopback on GigabitEthernet1/0/1 recovered.

%Feb 24 15:04:44:248 2013 DeviceA LPDT/5/LPDT RECOVERED: Loopback on GigabitEthernet1/0/2 recovered.

The output shows the following information:

·     Device A detected loops on GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2 within a loop detection interval.

·     Loops on GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2 were removed.

# Use the display loopback-detection command to display the loop detection configuration and status on devices, for example, Device A.

[DeviceA] display loopback-detection

Loop detection is enabled.

Loop detection interval is 35 second(s).

Loopback is detected on following interfaces:

 Interface                    Action mode     VLANs

 GigabitEthernet1/0/1         Shutdown        100

 GigabitEthernet1/0/2         Shutdown        100

The output shows that the device has removed the loops from GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2 by shutting them down.

# Display the status of GigabitEthernet 1/0/1 on devices, for example, Device A.

[DeviceA] display interface gigabitethernet 1/0/1

GigabitEthernet1/0/1 current state: DOWN (Loop detection down)

...

The output shows that GigabitEthernet 1/0/1 is already shut down by the loop detection module.

# Display the status of GigabitEthernet 1/0/2 on devices, for example, Device A.

[DeviceA] display interface gigabitethernet 1/0/2

GigabitEthernet1/0/2 current state: DOWN (Loop detection down)

...

The output shows that GigabitEthernet 1/0/2 is already shut down by the loop detection module.

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网