UDLD – UNIDIRECTIONAL LINK DETECTION

Unidirectional Link Detection (UDLD) is a data link layer protocol to monitor the physical configuration of the cables and detect unidirectional links. UDLD complements the STP which is used to eliminate switching loops. Its periodically tests ports to ensure bi-directional communication is maintained. UDLD sends out ID frames on a port, and waits for the remote switch to respond with its own ID frame. If the remote switch does not respond, then it assumes the interface has malfunctioned and become unidirectional.
It can be run on both fiber optic and twisted-pair copper links. By default, it sends out ID frames every 15 seconds, and must be enabled on both sides of a link.

UDLD can run in two modes:


• Normal Mode– If a unidirectional link is detected, the port is notshut down, but merely flagged as being in an undetermined state.
• Aggressive Mode– If a unidirectional link is detected, the port is placed in an errdisable state. It can be enabled globally (but only for Fiber ports on the switch):

 udld-unidirectional-link-detection-01

UDLD is intended to detect such a condition. UDLD can also be just as useful on copper links traversing intermediate “dumb” devices, such as media converters.

 

In the above example, the endpoint at left cannot tell that the distant media converter has failed, as its link to the local media converter remains up (of course, this behavior is dependent on the media converter). UDLD is able to detect the far end failure by the lack of incoming UDLD advertisements from the neighboring device.

UDLD can help prevent these problems:

  • Spanning tree topology loops caused by unidirectional links
  • Incorrect cabling of unbundled fiber strands
  • Transceiver or link hardware malfunction
  • Incorrect or excessive flooding of packets
  • Loss of traffic without notice (also known as black holing)


Configuration

By default, UDLD is disabled on all interfaces. We can enable it globally on the device, or individually on specific interfaces with the command udld port. This enables of the same in normal mode.
Switch(config)# interface f0/19
Switch(config-if)# udld port
It would be prohibitively difficult to coordinate the configuration of UDLD on both ends of a link at the same time, so when it is first enabled and does not detect a neighbor the link state is considered unknown, which is not necessarily an error condition.
Switch# show udld f0/19

Interface Fa0/19

Port enable administrative configuration setting: Enabled
Port enable operational state: Enabled
Current bidirectional state: Unknown
Current operational state: Advertisement
Message interval: 7
Time out interval: 5
No neighbor cache information stored

After enabling the same on the connected interface of the other switch, we can see that the local switch has detected its neighbor and updated the link’s status to bidirectional.
Switch# show udld f0/19

Interface Fa0/19

Port enable administrative configuration setting: Enabled
Port enable operational state: Enabled
Current bidirectional state: Bidirectional
Current operational state: Advertisement – Single neighbor detected
Message interval: 15
Time out interval: 5

Entry 1

Expiration time: 40
Device ID: 1
Current neighbor state: Bidirectional
Device name: CAT9211KG32
Port ID: Fa0/16
Neighbor echo 1 device: CAT8272NJ13
Neighbor echo 1 port: Fa0/19

Message interval: 15
Time out interval: 5
CDP Device name: S2
Aggressive mode differs in that, if a link is detected as being unidirectional, the interface is placed into the “error-disabled”state and ceases sending traffic. This state is much more visible to administrators as a problem.
To enable UDLD in aggressive mode, simply append the argument “aggressive” to the earlier configuration command. When enabling aggressive mode, it should be enabled on both ends of the link.
Switch(config)# interface f0/19
Switch(config-if)# udld port aggressive
We can verify that UDLD is now operating in aggressive mode:
Switch# show udld f0/19

Interface Fa0/19

Port enable administrative configuration setting: Enabled / in aggressive mode
Port enable operational state: Enabled / in aggressive mode
Current bidirectional state: Bidirectional
Current operational state: Advertisement – Single neighbor detected
Message interval: 7
Time out interval: 5

Entry 1

Expiration time: 43
Device ID: 1
Current neighbor state: Bidirectional
Device name: CAT9211KG32
Port ID: Fa0/16
Neighbor echo 1 device: CAT8272NJ13
Neighbor echo 1 port: Fa0/19

Message interval: 15
Time out interval: 5
CDP Device name: S2

After again simulating a failure at the far end, we can see that now UDLD responds by placing the local interface into the error-disabled state.
Switch# show udld f0/19

Interface Fa0/19

Port enable administrative configuration setting: Enabled / in aggressive mode
Port enable operational state: Enabled / in aggressive mode
Current bidirectional state: Unknown
Current operational state: Disabled port
Message interval: 7
Time out interval: 5
No neighbor cache information stored
Switch# show interfaces f0/19
FastEthernet0/19 is down, line protocol is down (err-disabled)
Hardware is Fast Ethernet, address is 0018.ba98.688f (bia 0018.ba98.688f)
MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)

After resolving the error condition, we can restore the interface to normal operation either by administratively taking it down and then back up (shutdown, no shutdown), or by issuing the global command udld reset to automatically restore all interfaces placed in the error-disabled state by a UDLD failure.
Switch# udld reset
1 ports shutdown by UDLD were reset.


To summarize:-

UDLD (Unidirectional Link Detection) is –

  • Cisco proprietary
  • Uses UDLD hellos to prevent unidirectional link loops, by detecting a bidirectional link failure.That is why UDLD has to be configured on both sides of a link.
  • Peers discover each other by exchanging frames sent to the MAC-address 0100:0CCC:CCCC .
  • The global command “udld enable” only applies to fiber ports.
  • To enable UDLD for copper ports, use the interface command“udld port aggressive”
  • UDLD works in 2 modes:
            a.  Normal – Informational mode, generates a log entry, but doesn’t disable or shutdown the port.
            b.  Aggressive – Will place a port into the ERR-Disable state.
Please follow and like us:
error

Tags: ,

Related Posts

Add Comment

Social Media Auto Publish Powered By : XYZScripts.com
Select your currency
USD United States (US) dollar

Checkout : E-STORE for latest release "JUNOS JNCIA Interview Q&A " Dismiss