Cisco Router & Switch Basics

CDP - Cisco Discovery Protocol

Sections:

Overview:

  • CDP is a proprietary layer 2 protocol allowing Cisco devices to discover and share information about other Cisco devices directly connected to them in the network
  • Cisco devices capable of utilizing CDP include devices such as routers, switches, and IP-phones
  • CDP does not rely on IP connectivity between devices as it is a Data Link Layer protocol 

Use Case Scenarios:

  • Network Topology Discovery
  • Troubleshooting
  • Verifying Network Configurations

Lab Topology

How CDP Works

CDP uses multicast frames addressed to '01.00.0c.cc.cc.cc' to send periodic advertisements from a Cisco device to its directly connected neighbors. The multicast frames contain information such as the device's identity hostname, IP address, capabilities, and other information including software image, native VLAN, duplex, etc. Cisco devices listen for these CDP advertisements and use this information to build a map of the network topology. It is important to note that Cisco devices never forward CDP packets received from its neighbors. All Cisco devices receive these packets, process them and cache the information in the packet.

CDP Packet Capture

Enabling CDP

CDP is enabled by default on most Cisco devices including routers and switches and is typically enabled globally for all interfaces on the device. Although CDP is enabled globally, it can be disabled on individual interfaces if needed. In this lab example, CDP is enabled by default on the virtual switches but let's demonstrate enabling CDP on the Access switch globally and follow up with disabling CDP globally and lastly enabling CDP globally but disabling CDP on unused interfaces. While CDP can be useful for network topology discovery and troubleshooting, there may be cases to disable CDP globally or on unused interfaces for secure environments.

Enabling CDP Globally

Disabling CDP Globally

Enabling CDP globally but disabling CDP on unused interfaces 

Verifying CDP Neighbors

There are various CDP show commands available to verify neighbors on a Cisco device. In this lab example, let's demonstrate the multitude of ways to monitor and maintain CDP on the Access switch. CDP show commands provide valuable insights into the topology of a network and helps in troubleshooting, and verifying network configuration changes.

Display information about a specific neighbor

Display information about overall traffic statistics 

Display information about interfaces 

Display detailed or summarized information about neighbors 

Adjust CDP Timers

Cisco Discovery Protocol uses several timers to control the frequency and timing of CDP advertisements and their hold times. These timers are configurable, and understanding them can help troubleshoot issues. Below let's demonstrate the advertise and hold timers and change the timers on the Access switch in the lab topology.

Hold Timer

  • The hold timer determines how long the information about a neighboring device will be retained after it was last heard
  • The hold timer resets after a new advertisement is received and discards the information if no new advertisement is received during the duration of the hold timer
  • By default, the hold timer is set to 180 seconds
  • The hold timer can be changed from its default value to best suit the environment 

Advertise Timer

  • The advertise timer determines how often a Cisco device sends a CDP advertisement packet announcing its presence and information to its neighbors
  • By default, the advertise timer is set to 60 seconds
  • The advertise timer can be changed to best suit small or dense environments

Configuring Advertise and Hold Timers

Summarizing CDP Advertise and Hold timers, it is important to note if the timers are changed on one switch, it is recommended to change the timers on all devices. This helps to minimize the risk of errors and performance degradation due to mismatched timer values. The goal of changing the timers is to lead to a more stable and efficient network environment.

Analyze CDP Error Types

While CDP itself is not directly associated with many errors, there are some common issues that may occur when using CDP and can be broken down into various causes:

  • Probable Causes
    • One probable cause of a device not receiving advertisements from its neighbors is CDP maybe disabled globally or disabled directly on an interface
    • A second probable cause could be a physical issue with the link
    • A third probable cause is a possible misconfiguration of the CDP timers and is recommended to ensure all devices on the network are using consistent timers
    • A fourth probable cause is the neighbor may not be a Cisco device and in these cases, it is recommended to configure the open standard LLDP as this protocol is supported by Cisco and non Cisco devices

Aside from the CDP show commands to troubleshoot probable issues, issuing a debug command is an alternative way to analyze what is occurring behind the scenes. On the Access switch in the lab topology, let's demonstrate a debug command to ensure the switch is sending out CDP packets out of its interfaces.

Debug Commands