Unidirectional Link Detection (UDLD) is basically a Cisco proprietary protocol which is used to monitor the cables and determine unidirectional link failures. In this lesson, we will focus on what is UDLD, why we use this network protocol and what are the differences between UDLD, BFD(Bidirectional Forwarding Detection) and STP Loop Guard. By the way, this lesson is an updated CCNA 200-301 v1.1 lesson.
Table of Contents
Unidirectional Link Detection is a layer ½ network protocol typically used in fiber optic connections. It is a Cisco proprietary protocol developed to detect unidirectional link in the network. A unidirectional link can cause a loop in the network. And to avoid loops in a network, Spanning Tree Protocol works. Here, UDLD is a complementary protocol beside Spanning Tree.
Spanning Tree also has other mechanisms to protect the network towards any network loop. One of them is Loop Guard.
By the way, what is unidirectional link? Think about fiber optic cables. As you know in a fiber optic cable, there are two different connectors for transmit and receive. We plug these cables to SFPs and then, we plug it to the device. Here, if one of these cables, transmit or receive cable, fails, this is unidirectional link. In other words, the transmission from one side is working and it is not working on the other side. In normal connection, there must be bidirectional traffic.
Unidirectional Link Detection is defined detailly in RFC 5171.
Yes, UDLD is a Cisco proprietary protocol. But some of the other vendors has similar technologies with different names. HP (Hewlett Packard) use Device Link Detection Protocol (DLDP) for this purpose. Extreme Networks uses Extreme Link Status Monitoring (ELSM). AVAYA use Link-state Tracking.
UDLD is a link failure detection mechanism or link failure detection protocol. By using Unidirectional Link Detection, our main purpose is bidirectional link failure detection.
Think about a fiber optic connection again with two cables, one for transmission and one for receiving. In normal situation, this is bidirectional link. But what if a failure occurs in one of them? Then, this bidirectional link become unidirectional. Here, we need a detection mechanism to detect this one-way failure. This is the role of Unidirectional Link Detection.
UDLD is a layer 2 protocol but it works also with layer 1 of OSI Reference Model, with physical layer to detect physical status of the links. To do this, at each end UDLD protocol must be configured and enabled. After that, UDLD peers discover each other by exchanging frames sent to well-known MAC address 01:00:0C:CC:CC:CC. UDLD Messages are sent in regular intervals. The default interval value is 15 seconds.
How does this packet exchange? Here, one end sends UDLD packets which contains port device/port ID and neighbor device/port ID. When this message is received at the other end, neighbor device sees its own device/port ID in the message. This means that the connection is bidirectional. If it does not see this information, at that time this means that the connection is unidirectional and this is a problem.
If a unidirectional link failure is detected, then the below error is rised:
UDLD-3-DISABLE: Unidirectional link detected on port 1/5. Port disabled
Here, the port is shutdown until we manually enable it again. The other option is the expire of the error disabled time.
Unidirectional Link Detection has two different operation modes. These UDLD operation modes are given below:
Normal Mode is the default operation mode. In this mode, UDLD detects unidirectional links due to misconfigured interfaces on fiber links. When a unidirectional link is detected in this mode, the port states is marked as undetermined. And the port behaves according to Spanning Tree state.
Aggressive Mode is the other mode of UDLD. In aggressive mode, Unidirectional Link Detection can detect unidirectional traffic because of both misconfigured interfaces on fiber links and one-way traffic on fiber or twisted-pair links. Here, if one end stops receiving UDLD packets, it tries to reestablish the connection again. If a unidirectional link failure is detected, UDLD attempts to re-establish state of the port, if it is unable to reestablish the state, the it puts the port in errdisable state.
UDLD and STP Loop Guard seem similar but if we look closer, they differ in functionality and how they approach to the problem.
The key difference between UDLD and Loop Guard is the absence of protection towards STP failures in Unidirectional Link Detection. Loop Guard is a protection towards STP failures, but UDLD not. In other words, STP Loop Guard has protection towards software failures but UDLD has not.
On the other hand, UDLD is powerful on unidirectional links on EtherChannel. Here, UDLD disables failed links in EtherChannel. But if we use STP Loop Guard here, it blocks whole port.
Unidirectional Link Detection is also good for miswiring detection. But STP Loop Guard has no such mechanism.
We configure both of these features on port based. But the action granularity is different on both. Thi is per-port for UDLD and it is per-vlan for Loop Guard.
Like STP loop guard, BFD (Bidirectional Forwarding Detection) is also another protocol that seem similar to UDLD. But UDLD and BFD has some differences in common.
First of all, Unidirectional Link Detection is a mechanism for Layer 2 while BFD is a layer 3 mechanism. In other words, Unidirectional Link Detection tries to detect layer 2 failures while BFD tries to detect layer 3 failure.
The second difference between UDLD and BFD is the detection range. Unidirectional Link Detection detects unidirectional links between directly connected nodes. For BFD, directly connection is not necessary. It can detect failures in the undirect connections.
Another difference is about behavior after the failure. Unidirectional Link Detection puts the interface into err-disabled shutdown. But Bidirectional Forwarding Detection does not do such a thing.
To use Unidirectional Link Detection in a Cisco router port, firstly we should enable UDLD. There are two ways to enable Unidirectional Link Detection: Globally and Port based. Both of them are disabled by default.
All Cisco Router & Switch Configuration Examples With Cisco Packet Tracer!
To enable UDLD globally, you can use “udld enable” or “udld aggressive” commands on global configuration mode. Here, “udld enable” command enables udld in normal mode on all fiber optic ports of the switch. “udld aggressive” command enables aggressive mode on all fiber optic ports.
Switch# configure terminal
Switch(config)# udld enable
Or
Switch(config)# udld aggressive
To disable, you can use “no udld enable” or “no udld aggressive” commands globally.
To enable UDLD port based, you can use “udld port enable” or “udld port aggressive” commands under interface configuration mode.
Switch# configure terminal
Switch(config)# interface Gi1/1/1
Switch(config-if)# udld port enable
Or
Switch(config-if)# udld port aggressive
To disable, you can use “no udld port” command under the port.
We can configure error disabled timer and set its time. With “errdisable recovery cause udld” command, we can enable this timer for automatically recover from Unidirectional Link Detection. To set the time, we can use “errdisable recovery interval” command.
By the way, it is disabled by default and the default value is 300 seconds.
Switch# configure terminal
Switch(config)# errdisable recovery cause udld
Switch(config)# errdisable recovery interval 500
To reset all the ports disabled by UDLD, you can use “udld reset” command.
Switch# udld reset
To verify the status of Unidirectional Link Detection, we can use “show udld” or “show udld interface-name” commands.
Switch# show udld
Switch# show udld Gi1/1/1
Leave a Reply