Catalyst 2950 Desktop Switch Software Configuration Guide, 12.1(9)EA1
Configuring UDLD
Downloads: This chapterpdf (PDF - 149.0KB) The complete bookPDF (PDF - 6.38MB) | Feedback

Configuring UDLD

Table Of Contents

Configuring UDLD

Understanding UDLD

Configuring UDLD

Default UDLD Configuration

Enabling UDLD Globally

Enabling UDLD on an Interface

Resetting an Interface Shut Down by UDLD

Displaying UDLD Status


Configuring UDLD


This chapter describes how to configure the UniDirectional Link Detection (UDLD) protocol on your switch.


Note For complete syntax and usage information for the commands used in this chapter, refer to the Catalyst 2950 Desktop Switch Command Reference for this release.


This chapter consists of these sections:

Understanding UDLD

Configuring UDLD

Displaying UDLD Status

Understanding 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. All connected devices must support UDLD for the protocol to successfully identify and disable unidirectional links. When UDLD detects a unidirectional link, it administratively shuts down the affected port and alerts you. Unidirectional links can cause a variety of problems, including spanning-tree topology loops.

UDLD works with the Layer 1 mechanisms to determine 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 interfaces. When you enable both autonegotiation and UDLD, 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 the local device is received by the neighbor but traffic from the neighbor is not received by the local device. If one of the fiber strands in a pair is disconnected, as long as autonegotiation is active, the link does not stay up. In this case, the logical link is undetermined, and UDLD does not take any action. If both fibers are working normally from a Layer 1 perspective, UDLD at Layer 2 determines whether those fibers 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.

UDLD operates by using two mechanisms:

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 interface to keep each device informed about its neighbors.

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

Whenever an interface is disabled and UDLD is running, whenever UDLD is disabled on an interface, or whenever the switch is reset, UDLD clears all existing cache entries for the interfaces 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.

Event-driven detection and echoing

UDLD relies on echoing as its detection mechanism. 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 is considered unidirectional, and the interface is shut down.

Figure 18-1 shows an example of a unidirectional link condition.

Figure 18-1 UDLD Detection of a Unidirectional Link

Configuring UDLD

This section describes how to configure UDLD on your switch. It contains this configuration information:

Default UDLD Configuration

Enabling UDLD Globally

Enabling UDLD on an Interface

Resetting an Interface Shut Down by UDLD

Default UDLD Configuration

Table 18-1 shows the default UDLD configuration.

Table 18-1 Default UDLD Configuration 

Feature
Default Setting

UDLD global enable state

Globally disabled

UDLD per-interface enable state for fiber-optic media

Disabled on all Ethernet fiber-optic interfaces

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

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


A UDLD-capable interface also cannot detect a unidirectional link if it is connected to a UDLD-incapable port of another switch.

Enabling UDLD Globally

Beginning in privileged EXEC mode, follow these steps to enable UDLD globally on all fiber-optic interfaces on the switch:

 
Command
Purpose

Step 1 

configure terminal

Enter global configuration mode.

Step 2 

udld enable

Enable UDLD on all fiber-optic interfaces on the switch. UDLD is disabled by default.

This command affects fiber-optic interfaces only. Use the udld interface configuration command to enable UDLD on other interface types. For more information, see the "Enabling UDLD on an Interface" section.

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

Step 3 

end

Return to privileged EXEC mode.

Step 4 

show udld

Verify your entries.

Step 5 

copy running-config startup-config

(Optional) Save your entries in the configuration file.

To disable UDLD globally on fiber-optic interfaces, use the no udld enable global configuration command.

Enabling UDLD on an Interface

Beginning in privileged EXEC mode, follow these steps to enable UDLD on an interface:

 
Command
Purpose

Step 1 

configure terminal

Enter global configuration mode.

Step 2 

interface interface-id

Enter interface configuration mode, and specify the interface to be enabled for UDLD.

Step 3 

udld enable

Enable UDLD on the specified interface.

On a fiber-optic interface, this command overrides the udld enable global configuration command setting.

Step 4 

end

Return to privileged EXEC mode.

Step 5 

show udld interface-id

Verify your entries.

Step 6 

copy running-config startup-config

(Optional) Save your entries in the configuration file.

To disable UDLD on a non-fiber-optic interface, use the no udld enable interface configuration command.


Note On fiber-optic interfaces, the no udld enable command reverts the interface configuration to the udld enable global configuration command setting.


To disable UDLD on a fiber-optic interface, use the udld disable command to revert to the udld enable global configuration command setting. This command is not supported on non-fiber-optic interfaces.

Resetting an Interface Shut Down by UDLD

Beginning in privileged EXEC mode, follow these steps to reset all interfaces shut down by UDLD:

 
Command
Purpose

Step 1 

udld reset

Reset all interfaces shut down by UDLD.

Step 2 

show udld

Verify your entries.

Step 3 

copy running-config startup-config

(Optional) Save your entries in the configuration file.

You can also bring up the interface by using these commands:

The no shutdown interface configuration command restarts the disabled interface.

The no udld enable global configuration command re-enables UDLD globally.

The udld disable interface configuration command re-enables UDLD on the specified interface.

Displaying UDLD Status

To display the UDLD status for the specified interface or for all interfaces, use the show udld [interface-id] privileged EXEC command.