UDLD - Packet Life

http://packetlife.net/blog/2011/mar/7/udld/ Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only.

UDLD
By stretch | Monday, March 7, 2011 at 3:49 a.m. UTC

Unidirectional Link Detection (UDLD) is a Cisco-proprietary layer two protocol devised to automatically detect the loss of bidirectional communication on a link. It is often mentioned in discussion of spanning tree, but has no direct relation to IEEE 802.1D. UDLD can be run on both fiber optic and twisted-pair copper links. Although UDLD is a proprietary protocol, its operation and packet format are defined in RFC 5171. The benefit of enabling UDLD on fiber interfaces is obvious. Fiber employs light to carry data, which does not require a looped path to complete a circuit as does an electrical medium like twisted-pair Ethernet (wherein each pair in the cable is a physical circuit). As such, it is possible for the link to fail in only one direction.

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.

Configuration
By default, UDLD is disabled on all interfaces. We can enable UDLD globally on the device, or individually on specific interfaces with the command udld port. This enables UDLD in normal mode.

Switch(config)# interface f0/13 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

1 of 7

3/10/2011 1:24 AM

we can see that the local switch has detected its neighbor and updated the link's status to bidirectional. Using the default values for the advertisement timer (15 seconds) and hold timer (5 seconds).foxitsoftware.Packet Life http://packetlife. UDLD can take up to 20 seconds to respond to an error. We can simulate an error on the far end of the link to see how UDLD responds.com For evaluation only.UDLD . which is not necessarily an error condition. Switch# show udld f0/13 Interface Fa0/13 --Port enable administrative configuration setting: Enabled Port enable operational state: Enabled Current bidirectional state: Bidirectional Current operational state: Advertisement .net/blog/2011/mar/7/udld/ Generated by Foxit PDF Creator © Foxit Software http://www. but this isn't typically necessary in the real world. Switch# show udld f0/13 Interface Fa0/13 --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 UDLD on the connected interface of the other switch. 2 of 7 3/10/2011 1:24 AM . UDLD is first enabled and does not detect a neighbor the link state is considered unknown.Single neighbor detected Message interval: 15 Time out interval: 5 Entry 1 --Expiration time: 40 Device ID: 1 Current neighbor state: Bidirectional Device name: CAT0746Z0WN Port ID: Fa0/16 Neighbor echo 1 device: CAT1032NJ69 Neighbor echo 1 port: Fa0/13 Message interval: 15 Time out interval: 5 CDP Device name: S2 UDLD is capable of tracking multiple neighbors per interface.

foxitsoftware. (Fa0/13) 00:18:07: Phase set from ADV to LUP because all neighbors aged out (Fa0/13) 00:18:07: prev = 0 entry = 3790AEC next = 0 exp_time = 0 (Fa0/13) 00:18:07: udsb->cache = 0x2F80128 (Fa0/13) 00:18:07: timeout timer = 7 (Fa0/13) 00:18:08: timeout timer = 6 (Fa0/13) 00:18:09: timeout timer = 5 (Fa0/13) 00:18:10: timeout timer = 4 (Fa0/13) 00:18:11: timeout timer = 3 (Fa0/13) 00:18:12: timeout timer = 2 (Fa0/13) 00:18:13: timeout timer = 1 (Fa0/13) 00:18:14: timeout timer = 0 (Fa0/13) 00:18:14: Phase set to udld_advertisement from phase udld_link_up. that isn't terribly helpful: the interface is still considered operational by upper-layer protocols and the switch may still be attempting to send traffic to the distant end. (Fa0/13) Switch# show udld f0/13 Interface Fa0/13 --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 As evidenced by the debugging output above. Aggressive mode differs in that. Of course. As an alternative to normal mode. upon detecting the loss of a neighbor. If still no reply is received. simply append the argument aggressive to the earlier configuration command. the link's bidirectional status transitions to unknown.UDLD . the interface is placed into the errordisabled state and ceases sending traffic. This state is much more visible to administrators as a problem.com For evaluation only. if a link is detected as being unidirectional. (Fa0/13) 00:18:14: Phase set to udld_advertisement after timer_expired.net/blog/2011/mar/7/udld/ Generated by Foxit PDF Creator © Foxit Software http://www. it should be enabled on both ends of the link. When enabling aggressive mode. Switch(config)# interface f0/13 Switch(config-if)# udld port aggressive We can verify that UDLD is now operating in aggressive mode: 3 of 7 3/10/2011 1:24 AM .Packet Life http://packetlife. To enable UDLD in aggressive mode. UDLD will send seven additional advertisements (one per second). we can configure UDLD in aggressive mode. Switch# debug udld events UDLD events debugging is on Switch# 00:18:07: allNeighborsAgedOutEvent during link up.

BW 10000 Kbit. 4 of 7 3/10/2011 1:24 AM .Single neighbor detected Message interval: 7 Time out interval: 5 Entry 1 --Expiration time: 43 Device ID: 1 Current neighbor state: Bidirectional Device name: CAT0746Z0WN Port ID: Fa0/16 Neighbor echo 1 device: CAT1032NJ69 Neighbor echo 1 port: Fa0/13 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. After resolving the error condition.. or by issuing the global command udld reset to automatically restore all interfaces placed in the error-disabled state by a UDLD failure. line protocol is down (err-disabled) Hardware is Fast Ethernet.688f (bia 0018. DLY 1000 usec.ba98. reliability 255/255.net/blog/2011/mar/7/udld/ Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.ba98. rxload 1/255 Encapsulation ARPA.com For evaluation only.Packet Life http://packetlife. address is 0018. txload 1/255. no shutdown).688f) MTU 1500 bytes.. Switch# show udld f0/13 Interface Fa0/13 --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/13 FastEthernet0/13 is down. Switch# udld reset 1 ports shutdown by UDLD were reset. Switch# show udld f0/13 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 . we can restore the interface to normal operation either by administratively taking it down and then back up (shutdown. loopback not set Keepalive set (10 sec) .UDLD .

and runs a free Cisco lab out of his basement for fun.net/InfoCenter/index?page=content&id=KB13314 @My_Bits (guest) commented on Monday. Finally. thumbs up! yeled commented on Monday. March 7. a unidirectional link would 5 of 7 3/10/2011 1:24 AM .m.m.net.juniper. Although primarily an R&S guy. This type of configuration means that just one side of the link will be errdisabled once “Unidirectional” condition has been detected. on the edge of the Washington. UTC If you're looking for UDLD interoperability other vendors.m. UTC Nice article. UTC @My_Bits: Although the two modes will inter-operate. he likes to get into everything. He currently lives in Fairfax. DC metro area. March 7.Packet Life http://packetlife. March 7.ine. Juniper has a KB with a lateral (and neat) workaround: Use LACP in a single member LAG. You can contact him by email or follow him on Twitter.com For evaluation only.UDLD . Link: http://blog. http://kb. 2011 at 12:15 p. Virginia.net/blog/2011/mar/7/udld/ Generated by Foxit PDF Creator © Foxit Software http://www. About the Author Jeremy Stretch is a freelance networking engineer. UTC UDLD “Aggressive” inteoperates with UDLD “Normal” on the other side of a link. 2011 at 9:48 a. and the maintainer of PacketLife. instructor.m.foxitsoftware. 2011 at 4:04 p. March 7. 2011 at 1:54 p.com/2008/07/05/udld-modes-of-operation/ stretch commented on Monday. Posted in Switching Comments Aki (guest) commented on Monday. you can check out this packet capture to see what UDLD looks like on the wire.

UTC Is UDLD suitable to detect a failure in MetroE circuits? We frequently have issues where a circuit is down but still shows up since they are connected to intermediate switches. Thanks!! seandickson (guest) commented on Tuesday. Killian (guest) commented on Tuesday. Venkat (guest) commented on Tuesday.m. Running the same mode on both ends ensures consistent behavior and is recommended by Cisco (see "Configuration Guidelines"). March 8. March 8. It really helped me understand UDLD better.UDLD . It also peeked my interest in it. March 8. March 8. March 7. 2011 at 7:01 p.m.foxitsoftware. 6 of 7 3/10/2011 1:24 AM . UTC Great explanation. 2011 at 7:00 a. CJ (guest) commented on Monday.m.com For evaluation only.net/blog/2011/mar/7/udld/ Generated by Foxit PDF Creator © Foxit Software http://www. errdisable recovery cause udld errdisable recovery interval 30 Helps for remote devices. UTC Another great post Jeremy. May want to look at recovery from the errdisable to happen automatically. UTC That was a solid piece. 2011 at 12:58 p.Packet Life http://packetlife. Your explanation has helped me. 2011 at 11:50 a.m. 2011 at 4:09 a. UTC short and precise. though a routing protocol would be preferred.m. xzatech commented on Tuesday. result in a different error condition on either end. A subject that has come up before.

UDLD . Could you explain de differences between UDLD and spanning-tree loop guard. March 9. Sorry if the wording is not very good but I'm from Venezuela and my English is not very good. Leave a Comment 7 of 7 3/10/2011 1:24 AM . 2011 at 12:56 a.foxitsoftware. UTC Hi Stretch.m. it seem to be very similar and use for the same purpose.com For evaluation only. gsulbaran commented on Wednesday.net/blog/2011/mar/7/udld/ Generated by Foxit PDF Creator © Foxit Software http://www.Packet Life http://packetlife.

Sign up to vote on this title
UsefulNot useful