Page Content

Tutorials

Cisco Discovery Protocol, How CDP Works, And Benefits of CDP

Cisco Discovery Protocol

Cisco Discovery Protocol
Cisco Discovery Protocol

Developed to collect data on directly connected Cisco equipment on the same data link, the Cisco Discovery Protocol (CDP) is a proprietary Layer 2 protocol. The majority of Cisco-made hardware, such as switches, routers, and access servers, can operate on it.

How CDP Works

Because CDP operates at the data link layer (Layer 2), it can function even in devices without specified Layer 3 (IP) addresses. This allows two systems that support distinct Layer 3 protocols to find one another.

In order for CDP to function, devices that are directly connected must receive recurring messages or advertising. Using a particular Ethernet multicast destination MAC address, these messages are transmitted as multicast packets (0100.0CCC.CCCC). When a device receives a CDP message, it processes it but does not send it to its neighbors. By doing this, CDP is guaranteed to only offer data about neighbors who are directly connected.

By default, CDP sends packets every 60 seconds. If no new ads are received, the neighbor’s information is stored for 180 seconds, or the holdtime, before being deleted.

You can also read Cisco Gateway load balancing protocol GLBP, How GLBP works

Information Advertised by CDP:

Device ID: The hostname of the neighboring device.

Addresses: Internet Protocol Version 4 and Internet Protocol Version 6 addresses used by the device.

Port ID: The name of the local port or the remote port on the neighboring device.

Capabilities: Whether the device is a router, switch, or has other capabilities (e.g., IGMP, source-route bridge, phone).

Version: The Cisco IOS Software version running on the device.

Platform: The hardware model of the device (e.g., Cisco 1941 router, 2960 switch).

Duplex: Full or half-duplex status (CDPv2 only).

Native VLAN: (CDPv2 only).

VTP Management Domain Name: (CDPv2 only).

Benefits of CDP

Benefits of CDP
Benefits of CDP

Network Discovery and Documentation: When documentation is lacking or insufficient, CDP is a very useful tool for network engineers to learn about devices and the network topology. All Cisco devices linked to the network can be mapped out using CDP.

Troubleshooting: Finding duplex mismatches is one way that CDP helps with network troubleshooting.

Cisco IP Phones: The access switch’s data and voice VLAN IDs are learnt by Cisco IP Phones via CDP.

Integration with Network Management: By logging into a device and tracking its discovery information across the network, or by querying IP ranges, platforms such as Cisco DNA Centre can use CDP (and LLDP) information to dynamically find and add devices to their inventory.

Drawbacks of CDP

Cisco proprietary: CDP is limited to usage on Cisco-made equipment, making it less suitable for multi-vendor setups where the open standard Link Layer Discovery Protocol (LLDP) (IEEE 802.1AB) is favoured.

Security Exposure: The wealth of data that CDP promotes about a device, including its hostname, IP addresses, platform, and iOS version, may lead to a security risk. For the purpose of preventing reconnaissance by attackers, Cisco advises turning off CDP on any interface that is not in use, particularly on user-facing ports or connections to unmanaged networks.

Limited Scope: CDP does not forward packets past the first hop and only learns about neighbors that are directly connected.

Types/Versions

Cisco IOS software supports two versions of CDP:

CDP Version 1 (CDPv1): Globally enabled by default with Cisco IOS Software Release 10.3 or later is CDP Version 1 (CDPv1).

CDP Version 2 (CDPv2): Cisco IOS Software Release 12.0(3)T or later supports CDP Version 2 (CDPv2), the most recent version. It is turned on by default. The VTP Management Domain Name, Native VLAN, and Full/Half-Duplex status are among the extra details that CDPv2 offers.

You can also read What is Virtual Router Redundancy Protocol & How VRRP Works

Configuration and Verification

Global Configuration

Enable CDP globally: CDP is enabled globally by default on most Cisco devices. If disabled, use cdp run.

Disable CDP globally: no cdp run.

Adjust CDP timer: cdp timer seconds (default 60 seconds, range 5-254).

Adjust CDP holdtime: cdp holdtime seconds (default 180 seconds, range 10-255).

Interface Configuration

Enable CDP on an interface: cdp enable (interfaces are typically enabled by default).

Disable CDP on an interface: no cdp enable.

Verification Commands (The show command is the most popular Cisco IOS command for status information):

show cdp: Displays global CDP information, including the timer, holdtime, and CDP version.

show cdp neighbors (or sh cdp nei): Lists summary information about directly connected neighbors, including Device ID, Local Interface, Holdtime, Capability, Platform, and Port ID.

show cdp neighbors detail (or sh cdp nei de): Provides more detailed information about each directly connected neighbor, including IP address, Cisco IOS version, platform model, and capabilities.

show cdp entry [name] or show cdp entry *: Displays the same detailed information as show cdp neighbors detail, either for a specific named neighbor or all neighbors.

show cdp interface [type number]: Shows CDP status and configuration for all interfaces or a specific one, including encapsulation, timer, and holdtime.

show cdp traffic: Displays global statistics for CDP packets sent and received, as well as errors.

Applications of CDP

CDP’s primary applications revolve around network administration:

Initial Setup and Verification: CDP helps with device identification and connectivity verification while launching a new network.

Documentation and Inventory: It assists in creating a precise network topology map by identifying interfaces, IP addresses, and device kinds.

Troubleshooting: Identifies connectivity problems between Cisco equipment, including duplex mismatches, quickly.

Voice VLAN Configuration: Voice and data VLAN IDs are obtained by Cisco IP phones using CDP.

Network Management Platforms: Cisco DNA Centre and other tools use CDP to find network devices for inventory and administration.

More Details

No Layer 3 Address Required: An interface can send or receive CDP ads without a Layer 3 address; it just has to be enabled with the no shutdown command.

Duplex Mismatch Detection: CDP can identify and report duplex mismatches between Cisco devices that are connected, presenting error messages in logging buffers or on the console.

Comparison with LLDP: In contrast to CDP, which is proprietary to Cisco, LLDP (IEEE 802.1AB) is an open standard that is vendor-neutral and offers comparable neighbor discovery features. LLDP is different since it separates the sending and receiving of messages and usually found on Cisco devices.

Management Plane: CDP helps control switches and routers on the SDN model’s management plane without having an effect on the data plane.

You can also read What Is First Hop Redundancy Protocols CISCO & FHRP History

Index