To detect the unidirectional links before the forwarding loop is created,
Cisco designed and implemented the UDLD protocol.
UDLD is a Layer 2
protocol that works with the Layer 1 mechanisms to determine the physical
status of a link. When UDLD is enabled, it works with autonegotiation to
prevent physical and logical unidirectional connections from forming and
causing other protocols to malfunction.
UDLD works by exchanging
protocol packets between the neighboring devices. To work, both devices on the
link must support UDLD and have it enabled on respective ports.
Each
switch port configured for UDLD will send UDLD protocol packets containing the
port's own device/port ID, and the neighbor's device/port IDs seen by
UDLD on that port. Neighboring ports should see their own device/port ID (echo)
in the packets received from the other side.
If the port does not see its own device/port ID in the incoming UDLD packets
for a specific duration of time, the link is considered unidirectional. This
echo-algorithm allows detection of several issues:
- Link is up on both sides, but packets only received by one side.
- Wiring mistakes, when receive and transmit fibers are not connected to the
same port on the remote side.
Once the unidirectional link is detected by UDLD, the respective port
is disabled and the following message is printed on the console:
UDLD-3-DISABLE: Unidirectional link detected on port 1/2.
Port disabled
Port shutdown by UDLD remains disabled
until it is manually reenabled, or until errdisable timeout expires if
configured.
The following commands detail configuring UDLD on Catalyst
switches running Cisco IOS. By default, UDLD is disabled. UDLD is supported on
fiber- and copper-based Ethernet ports. UDLD can be enabled globally on all
fiber interfaces using the command:
Switch(config)#udld enable
By
default, this command will enable UDLD on all interfaces.
UDLD can be
enabled on a specific interface by issuing the following command:
Switch(config-if)#udld port
The
interface command overrides the global configuration command. Prior to Release
12.1(14)EA1, the enable keyword was used instead of the
port keyword. UDLD can be verified with the following
command:
Switch#show udld
interface
See Figure
for an example
of the output produced.
Should it be necessary to override the UDLD
configuration on individual interfaces, this can be accomplished from the
interface configuration mode:
Switch(config)#interface
fastethernet 0/12
Switch(config-if)#udld
enable