Featured image

Table of Contents Link to heading

Discovery Protocol Link to heading

Info
A discovery protocol is used by network devices to advertise their identity and capabilities to other devices and receive the information from a directly connected Layer 2 device - called a neighbour.

Neighbouring information shows the ID/IP address of devices, types of devices connected, the router interfaces they are connected to, the interfaces used to make the connections, and the model numbers of the devices.

Two systems can learn about each other, even if they are using different network layer protocols.

Cisco Discovery Protocol (CDP) Link to heading

Info
A proprietary protocol, media and protocol independent, that is only compatible with Cisco devices.
Note

To enable CDP globally on the router (enabled by default):
Router(config)# cdp run

To enable CDP on an interface:
Router(config-if)# cdp enable

Obtaining Information with CDP Link to heading

  • The primary use of CDP is to discover all Cisco devices that are directly connected to a local device.
  • A CDP frame can be small, yet can retrieve many useful information about neighbouring routers and switches.
Note
To display a single cached CDP entry:
Router# show cdp entry device_name

Showing CDP Neighbours Link to heading

  • CDP provides information about each CDP neighbour device by transmitting Type Length Values (TLVs).
  • TLVs are blocks of information embedded in CDP advertisements.
  • CDP advertisements are periodic messages that are sent and received on each of its active interfaces.
Note
To display device TLVs:
Router# show cdp neighbors [detail]

Information included in a device TLV include:

  • Device ID
  • Local Interface
  • Holdtime
  • Capability
  • Platform
  • Port ID
  • VTP Management Domain Name (CDPv2 only)
  • Native VLAN (CDPv2 only)
  • Full/Half-Duplex (CDPv2 only)
Example

To obtain CDP information about a device that is not directly connected, the administrator needs to telnet to a router that is directly connected to that device.

This example shows the benefit of exploring CDP as it helps to gain full knowledge about the devices that are on the network, which provides a better understanding of the physical topology.

Disabling and Troubleshooting CDP Link to heading

Sometimes, it might be helpful to disable CDP for security purposes when you do not want information made available about a particular device.

Cisco IOS CommandDescription
clear cdp tableDeletes the CDP table of information about neighbours
clear cdp countersResets the traffic counters to zero
show cdp trafficDisplays CDP counters, including the number of packets sent and received and checksum errors
show debuggingDisplays information about the types of debugging that are enabled for your router
debug cdp adjacencyDisplays information about CDP neighbours
debug cdp eventsDisplays information about CDP events
debug cdp ipDisplays information about CDP IP information
debug cdp packetsDisplays information about CDP packet-related information
cdp timersSpecifies how often Cisco IOS Software sends CDP updates
cdp holdtimeSpecifies the holdtime the receiving device should hold a CDP packet from your router before discarding
show cdpDisplays information about CDP update packets

Link Layer Discovery Protocol (LLDP) Link to heading

Info
A standards-based, vendor-neutral protocol defined in IEEE standard 802.1AB that is compatible with all vendors.

LLDP is a more powerful and flexible protocol than CDP:

  • Simplifies network management and troubleshooting in a multi-vendor environment.
  • Supports optional system name, description, and management address.
  • Has an extension called LLDP-MED that provides support for voice over IP (VoIP) applications.

Main Differences Link to heading

  1. CDP is a proprietary protocol, whereas LLDP is a open-standard protocol.
  2. CDP is enabled on an interface using two commands, whereas LLDP requires only one command.
  3. CDP is always enabled by default on Cisco routers and switches, but with LLDP, it depends on the switch and version, whether it will be enabled or disabled by default.
  4. CDP can gather information from routers, switches, and wireless APs, whereas LLDP can only gather information from routers and switches.
  5. CDP can obtain both Layer 2 and Layer 3 information, whereas LLDP can only obtain Layer 2 information.