Published On: September 20ᵗʰ, 2021 18:11

Layer 2 Configuration Guide, Cisco IOS XE Amsterdam 17.3.x (Catalyst 9500 Switches)

Contents

Restrictions for Configuring UDLD

The following are restrictions for configuring UniDirectional Link Detection (UDLD):

  • A UDLD-capable port can’t detect a unidirectional link if it’s connected to a UDLD-incapable port of another device.

  • When configuring the mode (normal or aggressive), make sure that the same mode is configured on both sides of the link.

  • In the initial phase, the number of ports on which Fast UDLD can be enabled is limited to 32. If this number is reached, then Fast UDLD isn’t enabled on additional ports and an error message is printed on the console:

    UDLD: hundredGigE <> not enabled for fast hello, maximum number of fast hello ports (4) reached
    
  • If you disable UDLD when Fast UDLD is configured, the entire UDLD configuration is removed.


Caution

Loop guard works only on point-to-point links. We recommend that each end of the link has a directly connected device that is running STP.


Information About UDLD

UniDirectional Link Detection (UDLD) is a Layer 2 protocol that enables devices connected through fiber-optic or twisted-pair Ethernet cables to monitor the physical configuration of the cables and detect when a unidirectional link exists. All connected devices must support UDLD for the protocol to successfully identify and disable unidirectional links. When UDLD detects a unidirectional link, it disables the affected port and alerts you. Unidirectional links can cause a variety of problems, including spanning-tree topology loops.

Fast UDLD

Fast UDLD supports timers in the few-hundred milliseconds range, which enables subsecond unidirectional link detection. With Fast UDLD, the time to detect a unidirectional link can vary from less than one second to a few seconds (the detection time also depends on how the timers are configured). Link status messages are exchanged every 200ms.

A transition from slow mode to fast mode occurs on the port when both sides of a link have Fast UDLD configured and have negotiated successfully to move into fast mode. A transition from fast mode to slow mode occurs when one of the Fast UDLD configured ports has its port-level Fast UDLD configuration removed.

Fast UDLD functionality has been made available on Catalyst Catalyst 9500 Series Switches High Performance devices starting with the Cisco IOS XE Fuji 16.9.1

Modes of Operation

UDLD and Fast UDLD support two modes of operation: normal (the default) and aggressive. In normal mode, UDLD can detect unidirectional links due to misconnected ports on fiber-optic connections. In aggressive mode, UDLD can also detect unidirectional links due to one-way traffic on fiber-optic and twisted-pair links and to misconnected ports on fiber-optic links.

In normal and aggressive modes, UDLD works with the Layer 1 mechanisms to learn the physical status of a link. At Layer 1, autonegotiation takes care of physical signaling and fault detection. UDLD performs tasks that autonegotiation cannot perform, such as detecting the identities of neighbors and shutting down misconnected ports. When you enable both autonegotiation and UDLD, the Layer 1 and Layer 2 detections work together to prevent physical and logical unidirectional connections and the malfunctioning of other protocols.

A unidirectional link occurs whenever traffic sent by a local device is received by its neighbor but traffic from the neighbor is not received by the local device.

Normal Mode

In normal mode, UDLD detects a unidirectional link when fiber strands in a fiber-optic port are misconnected and the Layer 1 mechanisms do not detect this misconnection. If the ports are connected correctly but the traffic is one way, UDLD does not detect the unidirectional link because the Layer 1 mechanism, which is supposed to detect this condition, does not do so. In this case, the logical link is considered undetermined, and UDLD does not disable the port.

When UDLD is in normal mode, if one of the fiber strands in a pair is disconnected, as long as autonegotiation is active, the link does not stay up because the Layer 1 mechanisms detects a physical problem with the link. In this case, UDLD does not take any action and the logical link is considered undetermined.

Aggressive Mode

In aggressive mode, UDLD detects a unidirectional link by using the previous detection methods. UDLD in aggressive mode can also detect a unidirectional link on a point-to-point link on which no failure between the two devices is allowed. It can also detect a unidirectional link when one of these problems exists:

  • On fiber-optic or twisted-pair links, one of the ports cannot send or receive traffic.

  • On fiber-optic or twisted-pair links, one of the ports is down while the other is up.

  • One of the fiber strands in the cable is disconnected.

In these cases, UDLD disables the affected port.

In a point-to-point link, UDLD hello packets can be considered as a heart beat whose presence guarantees the health of the link. Conversely, the loss of the heart beat means that the link must be shut down if it is not possible to reestablish a bidirectional link.

If both fiber strands in a cable are working normally from a Layer 1 perspective, UDLD in aggressive mode detects whether those fiber strands are connected correctly and whether traffic is flowing bidirectionally between the correct neighbors. This check cannot be performed by autonegotiation because autonegotiation operates at Layer 1.

Methods to Detect Unidirectional Links

UDLD operates by using two methods:

  • Neighbor database maintenance

  • Event-driven detection and echoing

Neighbor Database Maintenance

UDLD learns about other UDLD-capable neighbors by periodically sending a hello packet (also called an advertisement or probe) on every active port to keep each device informed about its neighbors.

When the device receives a hello message, it caches the information until the age time (hold time or time-to-live) expires. If the device receives a new hello message before an older cache entry ages, the device replaces the older entry with the new one.

Whenever a port is disabled and UDLD is running, whenever UDLD is disabled on a port, or whenever the device is reset, UDLD clears all existing cache entries for the ports affected by the configuration change. UDLD sends at least one message to inform the neighbors to flush the part of their caches affected by the status change. The message is intended to keep the caches synchronized.


Note

An interface does not support multiple UDLD neighbors. If an ingress UDLD protocol data unit (PDU) has multiple device IDs in echo type, length and value (TLV), the interface enters the error-disabled state.


Event-Driven Detection and Echoing

UDLD relies on echoing as its detection operation. Whenever a UDLD device learns about a new neighbor or receives a resynchronization request from an out-of-sync neighbor, it restarts the detection window on its side of the connection and sends echo messages in reply. Because this behavior is the same on all UDLD neighbors, the sender of the echoes expects to receive an echo in reply.

If the detection window ends and no valid reply message is received, the link might shut down, depending on the UDLD mode. When UDLD is in normal mode, the link might be considered undetermined and might not be shut down. When UDLD is in aggressive mode, the link is considered unidirectional, and the port is disabled.

UDLD Reset Options

If an interface becomes disabled by UDLD, you can use one of the following options to reset UDLD:

  • The udld reset interface configuration command.

  • The shutdown interface configuration command followed by the no shutdown interface configuration command restarts the disabled port.

  • The no udld {aggressive | enable} global configuration command followed by the udld {aggressive | enable} global configuration command reenables the disabled ports.

  • The no udld port interface configuration command followed by the udld port [aggressive] interface configuration command reenables the disabled fiber-optic port.

  • The errdisable recovery cause udld global configuration command enables the timer to automatically recover from the UDLD error-disabled state, and the errdisable recovery interval interval global configuration command specifies the time to recover from the UDLD error-disabled state.

The udld port disable command disables UDLD on fiber-optic LAN ports.


Note

This command is only supported on fiber-optic LAN ports.


Default UDLD Configuration

Table 1. Default UDLD Configuration

Feature

Default Setting

UDLD global enable state

Globally disabled

UDLD per-port enable state for fiber-optic media

Disabled on all Ethernet fiber-optic ports

UDLD per-port enable state for twisted-pair (copper) media

Disabled on all Ethernet 10/100 and 1000BASE-TX ports

UDLD aggressive mode

Disabled

Fast UDLD per-port enable state

Disabled on all ports

How to Configure UDLD

The following sections provide information about configuring UDLD:

Enabling UDLD Globally

Follow these steps to enable UDLD in the aggressive or normal mode and to set the configurable message timer on all fiber-optic ports on the device.

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

udld {aggressive | enable | message time message-timer-interval}

Example:

Device(config)# udld enable message time 10


Specifies the UDLD mode of operation:

  • aggressive —Enables UDLD in aggressive mode on all fiber-optic ports.

  • enable —Enables UDLD in normal mode on all fiber-optic ports on the device. UDLD is disabled by default.

    An individual interface configuration overrides the setting of the udld enable global configuration command.

  • message time message-timer-interval —Configures the period of time between UDLD probe messages on ports that are in the advertisement phase and are detected to be bidirectional. The range is from 1 to 90 seconds; the default value is 15.

    Note 

    This command affects fiber-optic ports only. Use the udld interface configuration command to enable UDLD on other port types.

Use the no form of this command, to disable UDLD.

Step 4

end

Example:

Device(config)# end

Returns to privileged EXEC mode.

Enabling UDLD on an Interface

Follow these steps either to enable UDLD in the aggressive or normal mode or to disable UDLD on a port.

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

interface interface-id

Example:

Device(config)# interface gigabitethernet 1/0/1

Specifies the port to be enabled for UDLD, and enters interface configuration mode.

Step 4

udld port [aggressive]

Example:

Device(config-if)# udld port aggressive

UDLD is disabled by default.

  • udld port —Enables UDLD in normal mode on the specified port.

  • udld port aggressive —(Optional) Enables UDLD in aggressive mode on the specified port.

Note 

Use the no udld port interface configuration command to disable UDLD on a specified fiber-optic port.

Step 5

end

Example:

Device(config-if)# end

Returns to privileged EXEC mode.

Enabling Fast UDLD on an Interface

Follow these steps to enable Fast UDLD on a port.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 2

interface interface-id

Example:

Device(config)# interface gigabitethernet 1/0/1

Specifies the port to be enabled for Fast UDLD, and enters interface configuration mode.

Step 3

udld fast-hello message time interval

Example:

Device(config-if)# udld fast-hello 200

Enables Fast UDLD on the specified port.

  • message time message-timer-interval —Configures the period of time between UDLD probe messages on ports that are in the advertisement phase and are detected to be bidirectional.

Note 

Fast UDLD can be enabled only if UDLD is already enabled on the specified port.

Step 4

end

Example:

Device(config-if)# end

Returns to privileged EXEC mode.

Enabling Fast UDLD Error Reporting

Follow these steps to enable Fast UDLD error reporting on the switch.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 2

udld fast-hello error-reporting

Example:

Device(config)# udld fast-hello error-reporting

Enables the display of console messages to report the error upon detection of a link failure.

Note 

The detected unidirectional link will not be disabled if udld fast-hello error-reporting has been enabled.

Step 3

end

Example:

Device(config)# end

Returns to privileged EXEC mode.

Disabling UDLD on Fiber-Optic LAN Interfaces

Before you begin

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal 

Enters global configuration mode.

Step 3

interface type number

Example:

Device(config)# interface gigabitethernet 0/1/1 

Configures an interface and enters interface configuration mode.

Step 4

udld port disable

Example:

Device(config-if)# udld port disable 

Disables UDLD on a fiber-optic LAN port.

  • The udld port disable command is only supported on fiber-optic LAN ports.

  • The no udld port disable command reverts to the udld enable global configuration command setting.

Step 5

end

Example:

Device(config-if)# end 

Exits interface configuration mode and returns to privileged EXEC mode.

Monitoring and Maintaining UDLD

Command Purpose

show udld [interface-id | neighbors]

Displays the UDLD status for the specified port or for all ports.

show udld fast-hello [interface-id]

Displays fast-hello information for the specified port or for all ports.

Console Error Messages For Fast UDLD

When a link failure is detected by fast UDLD, the unidirectional link is err-disabled by UDLD after displaying the following message on the console:

%UDLD-4-UDLD_PORT_DISABLED: UDLD disabled interface Hu1/0/10, unidirectional link detected

If the udld fast-hello error-reporting is configured, when fast UDLD detects a link failure, it prints the following console message instead of err-disabling the affected port:

%UDLD-SP-4-UDLD_PORT_FAILURE: UDLD failure reported per user request, interface HU1/0/10, fast udld unidirectional link detected

The udld reset command can be used to clear the UDLD port state in both the cases.

Additional References for UDLD

Related Documents

Related Topic Document Title

For complete syntax and usage information for the commands used in this chapter.

See the Layer 2/3 Commands section of the Command Reference (Catalyst 9500 Series Switches)

Feature History for UniDirectional Link Detection

This table provides release and related information for features explained in this module.

These features are available on all releases subsequent to the one they were introduced in, unless noted otherwise.

Release

Feature

Feature Information

Cisco IOS XE Everest 16.5.1a

UniDirectional Link Detection (UDLD)

UDLD is a Layer 2 protocol that enables devices connected through fiber-optic or twisted-pair Ethernet cables to monitor the physical configuration of the cables and detect when a unidirectional link exists.

Support for this feature was introduced only on the C9500-12Q, C9500-16X, C9500-24Q, C9500-40X models of the Cisco Catalyst 9500 Series Switches.

Cisco IOS XE Fuji 16.8.1a

UniDirectional Link Detection (UDLD)

Support for this feature was introduced only on the C9500-32C, C9500-32QC, C9500-48Y4C, and C9500-24Y4C models of the Cisco Catalyst 9500 Series Switches.

Cisco IOS XE Fuji 16.9.1

Fast UDLD

Enables subsecond UDLD. The UDLD protocol helps monitor a physical connection (such as monitoring wrong cabling) to detect unidirectional links to avoid spanning-tree topology loops or silent drop traffic.

Support for this feature was introduced only on the C9500-12Q, C9500-16X, C9500-24Q, C9500-40X models of the Cisco Catalyst 9500 Series Switches.

Use Cisco Feature Navigator to find information about platform and software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn.