Tuesday, March 8, 2011

Cisco UDLD - Unidirectional Link Detection Protocol

Cisco Proprietary Transmit/Receive link failure Detection protocol.
UDLD can be used for both the Fiber Links as well as the Copper Links.
As for Fiber it is obvious that there is no need of loop, because Light as a carrying medium doesn't require closed circuit to operate. Copper i.e. Twisted pair based communication requires loop to operate as the circuit needs to be closed.
It works by sending UDLD packets to a multicast mac-address as destination with it’s own device and port ID encapsulated. If it's doesn't get an echo of it's packet the link is considered unidirectional.
This Protocol is only Point-to-Point Links & not for multi-point environment.
It can detect the single link failure on the Remote end also, when media converters are deployed in between the nodes as the media converters are not able to propagate the fault detection of the Single link failure. The two switches involved in UDLD sends out the UDLD advertisements.

By default, UDLD is disabled on all interfaces. We can enable UDLD on devices as follows.

Switch(config)# interface f0/7
Switch(config-if)# udld port

Also set this on the interface connected to this respective interface on the other switch.
After that, we can check that the local switch interface has detected its neighbor and updated the link's status to bidirectional.

Switch# show udld f0/7
Interface Fa0/7
---
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: CAT0746Z1WN
Port ID: Fa0/16
Neighbor echo 1 device: CAT1042NJ69
Neighbor echo 1 port: Fa0
Message interval: 15
Time out interval: 5
CDP Device name: S2

Normal Mode can take 15+5 = 20 seconds to react to the Link fault ( Message interval : 15 Time out Interval : 5 ).
In Normal Mode, link failure detection doesn't put the port into disable state, this results in devices still trying to transmit on faulty links. To overcome this we can use the aggressive mode.
Normal Mode can detect the Fiber mis-connection problem, such as Single Strand broken or not connected.
In aggressive mode, if a link is detected as being unidirectional, that particular interface is placed into the error-disabled state. This state is much more noticeable to administrators.
To enable UDLD in aggressive mode, use following on the both ends of the link.

Switch(config)# interface f0/7
Switch(config-if)# udld port aggressive

We can verify that UDLD is now operating in aggressive mode:

Switch# show udld f0/7
Interface Fa0/13
---
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: CAT0746Z1WN
Port ID: Fa0/16
Neighbor echo 1 device: CAT1042NJ69
Neighbor echo 1 port: Fa0/7
Message interval: 15
Time out interval: 5
CDP Device name: S2

The port disabled by the err-disabled condition will show the port status down in show interface command.
After resolving the error condition, we can restore that particular interface to normal operation by using the "no shutdown" and then "shutdown" in the config, or by issuing the command udld reset. This command will reset all the ports made down by udld

Switch# udld reset
1 ports shutdown by UDLD were reset.

No comments:

Post a Comment