Configuring UDLD
This chapter describes how to configure the UniDirectional Link Detection (UDLD) protocol on the Catalyst 3750 switch. Unless otherwise noted, the term switch refers to a standalone switch and to a switch stack.
Note For complete syntax and usage information for the commands used in this chapter, refer to the 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 disabling misconnected interfaces that are down. 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 disabled.
Figure 21-1 shows an example of a unidirectional link condition.
Figure 21-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 Disabled by UDLD
Default UDLD Configuration
Table 21-1 shows the default UDLD configuration.
Table 21-1 Default UDLD Configuration
|
|
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 |
UDLD aggressive mode |
Disabled |
UDLD is not supported on ATM 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 in the aggressive or normal mode and to set the configurable message timer on all fiber-optic interfaces on the switch and all members in the switch stack:
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
udld {aggressive | enable | message time message-timer-interval} |
Specify the UDLD mode of operation: •aggressive—Enables UDLD in aggressive mode on all fiber-optic interfaces. For details on the usage guidelines for the aggressive mode, refer to the command reference guide. •enable—Enables UDLD in normal mode on all fiber-optic interfaces on the switch. 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 determined to be bidirectional. The range is from 7 to 90 seconds. Note The global UDLD setting is automatically applied to switches that join the switch stack. Note 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. |
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, use the no udld enable global configuration command to disable normal mode UDLD on all fiber-optic ports. Use the no udld aggressive global configuration command to disable aggressive mode UDLD on all fiber-optic ports.
Enabling UDLD on an Interface
Beginning in privileged EXEC mode, follow these steps either to enable UDLD in the aggressive or normal mode or to disable UDLD on an interface:
|
|
|
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 port {aggressive | disable} |
UDLD is disabled by default. •udld port—Enables UDLD on the specified interface. •udld port aggressive—Enables UDLD in aggressive mode on the specified interface. For details on the usage guidelines for the aggressive mode, refer to the command reference guide. •udld port disable—Disables UDLD on the specified fiber-optic interface. This command overrides the UDLD global setting and is available only on fiber-optic interfaces. Note When a switch joins a switch stack, it retains its interface-specific UDLD settings. |
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. |
Resetting an Interface Disabled by UDLD
Beginning in privileged EXEC mode, follow these steps to reset all interfaces disabled by UDLD:
|
|
|
Step 1 |
udld reset |
Reset all interfaces disabled by UDLD. |
Step 2 |
show udld |
Verify your entries. |
You can also bring up the interface by using these commands:
•The shutdown interface configuration command followed by the no shutdown interface configuration command restarts the disabled interface.
•The no udld enable global configuration command followed by the udld enable global configuration command re-enables the disabled interfaces.
•The udld port disable interface configuration command followed by the udld port interface configuration command re-enables the disabled fiber-optic 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.
For detailed information about the fields in the display, refer to the command reference for this release.