CCIE 400-101: Layer 2 Technologies - CDP, LLDP, UDLD

CDP 

  • The Cisco Discovery Protocol (CDP) is a proprietary Layer 2 protocol used to share information about other directly connected Cisco equipment.
  • CDP runs on all of the following Cisco manufactured equipment: routers, switches, bridges, and access servers.
  • A Cisco device enabled with CDP sends out periodic interface updates every 60 seconds to a multicast address 01-00-0c-cc-cc-cc in order to make itself known to neighbors.
  • The holdtime specifies the lifetime of an entry in the table - if no announcements are received from a device for a period in excess of the holdtime, the device information is discarded (default 180 seconds).
  • Cisco devices never forward CDP packets.
  • CDP can also be used for On-Demand Routing (ODR), which is a method of including routing information in CDP announcements so that dynamic routing protocols do not need to be used in simple networks.
  • CDP is enabled by default, but can be globally disabled with the no cdp run command or per interface with the no cdp enable command.
  • The show cdp neighbors command displays this information:
    • type of device that is discovered
    • name of the device
    • number and type of the local interface (port)
    • number of seconds the CDP advertisement is valid for the port
    • device type
    • device product number
    • port ID
  • The details contained in CDP announcements is easily extended due to the use of the type-length-value (TLV) frame format.

Example:

Router#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R2-AGS           Ser 1              129          R        2500      Ser 0
R6-2500          Eth 0              144          R        4000      Eth 0
Router#


  • The show cdp neighbors detail and show cdp entry commands displays additional information about the neighboring devices that include network-layer protocol information and version.

Example:

router#show cdp neighbors detail
-------------------------
Device ID: lab-7206
Entry address(es):
IP address: 172.19.169.83
Platform: cisco 7206VXR, Capabilities: Router
Interface: Ethernet0, Port ID (outgoing port): FastEthernet0/0/0
Holdtime : 123 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) 5800 Software (C5800-P4-M), Version 12.1(2)
Copyright (c) 1986-2002 by Cisco Systems, Inc.
advertisement version: 2
Duplex: half
-------------------------
Device ID: lab-as5300-1
Entry address(es):
IP address: 172.19.169.87
Platform: cisco AS5300, Capabilities: Router
--More--

 

router#show cdp entry lab-7206
-------------------------
Device ID: lab-7206
Entry address(es):
IP address: 172.19.169.83
Platform: cisco 7206VXR, Capabilities: Router
Interface: Ethernet0, Port ID (outgoing port): FastEthernet0/0/0
Holdtime : 123 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) 5800 Software (C5800-P4-M), Version 12.1(2)
Copyright (c) 1986-2002 by Cisco Systems, Inc.
advertisement version: 2
Duplex: half



  • CDP can also be enabled/disabled per interface with the [no] cdp enable command.
  • To enable Cisco Discovery Protocol Version 2 (CDPv2) advertising functionality on a device, use the cdp advertise-v2 command.
  • CDPv2 has three additional type-length values (TLVs): VTP Management Domain Name, Native VLAN, and full/half-Duplex.

LLDP

  • The Link Layer Discovery Protocol (LLDP) is basically a standards-based (IEEE 802.1AB) equivalent of the Cisco proprietary CDP. 
  • Similar to CDP, LLDP also advertises and receives information about identity and capabilities between Layer 2 peers. 
  • LLDP Data Units (LLDPDUs) are sent to the multicast destination MAC address01:80:c2:00:00:0e.
    This address is defined within a range of addresses reserved by the IEEE for protocols that are to be constrained to an individual LAN. 
  • LLPDUs are not forwarded to other switches. 
  • See: Tutorial on the Link Layer Discovery Protocol.

UDLD

  • Problem:  If a blocking port stops receiving BPDUs from its upstream (designated) switch on the port, STP eventually ages out the STP information for the port and moves it to the forwarding state. This creates a forwarding loop. 
  • How is it possible for the switch to stop receiving BPDUs while the port is up? The reason is unidirectional link. 
  • A link is unidirectional when both sides of the connection are up but the local side is not receiving the packets sent by the remote side while remote side receives packets sent by local side. 
  • To detect a unidirectional link before a forwarding loop is created, Cisco developed the (aptly named) UDLD protocol. 
  • UDLD is a Layer 2 protocol that works with the Layer 1 mechanisms to determine the physical status of a link. At Layer 1, auto-negotiation takes care of physical signaling and fault detection. UDLD performs tasks that auto-negotiation cannot perform, such as detecting the identities of neighbors and shutting down misconnected ports. 
  • UDLD works by exchanging protocol packets between the neighboring devices using the multicast MAC address 01:00:0C:CC:CC:CC. 
  • Both devices on the link must support UDLD and have it enabled on respective ports. 
  • Each switch port configured for UDLD sends UDLD protocol packets that contain 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. 
  • UDLD can operate in two modes: normal and aggressive. 
  • In normal mode, if the link state of the port was determined to be bi-directional and the UDLD information times out, no action is taken by UDLD. The port state for UDLD is marked as undetermined. The port behaves according to its STP state. 
  • In aggressive mode, if the link state of the port is determined to be bi-directional and the UDLD information times out while the link on the port is still up, UDLD tries to re-establish the state of the port by sending a UDLD frame 8 times every 1 second. If not successful, the port is put into the errdisable state. 
  • UDLD should be able to detect an unidirectional link before STP would unblock the port due to missed BPDUs. Thus, when you configure UDLD timers, make sure your values are set so that unidirectional link is detected before “STP MaxAge + 2xForwardDelay” expires.
  • In order for a link to become “Bidirectional”, UDLD process should first hear an echo packet with it’s own ID from a peer on the other side.
  • This prevents link from becoming errdisabled when you configure aggresive mode just on one side. The UDLD state of such link will be “Unknown”.

Example:

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


  • The problem of unidirectional links usually occurs on fiber-optic links and is not common on copper connections.
  • To enable UDLD on all fiber-optic interfaces, use the global command udld enable (normal mode) or udld aggressive (aggressive mode).
  • To enable UDLD individually on specific ports (copper or fiber), use the udld port [aggressive] command.

Example:

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

 

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 - Single neighbor detected
Message interval: 7
Time out interval: 5



  • To restore interfaces from the error-disabled state, you can use either the udld reset command or configure errdisable autorecovery as described in a previous post.

References

CDP on Cisco Routers and Switches Running IOS
Link Layer Discovery Protocol (LLDP, IEEE 802.1AB)
Understanding and Configuring UDLD 
UDLD Modes of Operation
UDLD

Comments

Post a Comment