You are on page 1of 5

Cisco Discovery Protocol

Understanding How CDP Works


CDP is a media and protocol independent protocol that runs on all Cisco-manufactured equipment including routers, bridges, access and communication servers, and switches. Using CDP, you can view information about all the Cisco devices directly attached to the switch. In addition, CDP detects native VLAN and port duplex mismatches.

CDP can also be used for On-Demand Routing, which is a method of including routing information in CDP announcements so that dynamic routing protocols do not need to be used in simple network.
Network management applications can retrieve the device type and SNMP-agent address of neighboring Cisco devices using CDP. This enables applications to send SNMP queries to neighboring devices. CDP allows network management applications to discover Cisco devices that are neighbors of already known devices, in particular, neighbors running lower-layer, transparent protocols. CDP runs on all media that support Subnetwork Access Protocol (SNAP), including LAN and Frame Relay. CDP runs over the Data Link layer only. Cisco devices never forward CDP packets. When new CDP information is received, Cisco devices discard old information. The LLC header is 3 octets, and the SNAP header is 5 octets, so the LLC+SNAP headers are 8 octets long in total. Cisco devices send CDP announcements to the multicast destination address 01-00-0c-cc-cc-cc, out each connected network interface.
It is important to understand that because CDP operates at Layer 2 (data link layer of the OSI model), it functions independently of the Layer 3 (network) protocol (IP or IPX). CDP is on by default, but it can be disabled. In many cases, CDP is disabled on dial backup links, such as ISDN, so as to not keep the link up constantly.

CDP Default Configuration

Feature
CDP global enable state CDP port enable state CDP message interval CDP holdtime

Default Value
Enabled Enabled on all ports 60 seconds 180 seconds

Getting CDP Timer and Holdtime Information


The following command shows the CDP timer which is how often CDP packets are sent and the CDP holdtime which is the amount of time that the device will hold packets from neighbor devices. Router_2#sho cdp Global CDP information: Sending CDP packets every 60 seconds Sending a holdtime value of 180 seconds

Setting the Holdtime and Timer


Use the following commands to set CDP timer and holdtime values. Router_2#conf t Enter configuration commands, one per line. Router_2(config)#cdp timer 90 Router_2(config)#cdp holdtime 360

End with CNTL/Z.

CDP can be disabled with the no cdp run command in global configuration mode (conf t).

Getting Neighbor Information


Because the router stores the CDP information in its cache memory, you can view it with a show command. It will only show information about directly connected devices since CDP packet aren't passed through the device. Router_2#sho cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater Device ID ID Router3 Ser 1 Router1 Eth 1 Switch1 Eth 0 CDP Neighbor Information includes Neighbor's device ID Local port type and number Holdtime value (in seconds) Neighbor's network device capability Neighbor's hardware platform Neighbor's remote port type and number 120 180 240 R R S 2500 2500 1900 Ser 0 Eth 0 2 Local Intrfce Holdtme Capability Platform Port

Show CDP Entry


The sho cdp entry [device id] command shows more information about the specified neighbor.

Router_2#sho cdp entry Router1 ------------------------Device ID: Router1 Entry address(es): IP address: 192.168.1.2 Platform: cisco 2500, Capabilities: Router Interface: Ethernet1, Port ID (outgoing port): Ethernet0 Holdtime : 180 sec Version: Cisco Internetwork Operating System Software IOS (tm) 2500 Software (2500-JS-L), Version 11.2(15) RELEASED SOFTWARE (fcl) Copyright (c) 1986-1998 by Cisco Systems, Inc. Compiled Mon 06-Jul-98 22:22 by tmullins

Show CDP Neighbors Detail


The following is a sample output for one neighbor from the show cdp neighbors detail command. Additional detail is shown about neighbors, including network address, enabled protocols, and software version. router#show cdp neighbors detail Device ID: 008024 1EEB00 (milan-sw-1-cat9k) Entry address(es): IP address: 1.15.28.10 Platform: CAT5000, Capabilities: Switch Interface: Ethernet1/0, Port ID (outgoing port): 2/7 Holdtime : 162 sec Version : Cisco Catalyst 5000 Duplex Mode: full Native VLAN: 42 VTP Management Domain: `Accounting Group' show cdp neighbors detail Field Descriptions

Field
Device ID Entry address(es) [network protocol] address Platform Capabilities

Definition
The name of the neighbor device and either the MAC address or the serial number of this device. A list of network addresses of neighbor devices. The network address of the neighbor device. The address can be in IP, IPX, AppleTalk, DECnet, or CLNS protocol conventions. The product name and number of the neighbor device. The device type of the neighbor. This device can be a router, a bridge, a transparent bridge, a source-routing bridge, a switch, a host, an IGMP device, or a repeater.

Interface Holdtime Version Duplex Mode Native VLAN VTP Management Domain

The protocol and port number of the port on the current device. The remaining amount of time, in seconds, the current device will hold the CDP advertisement from a transmitting router before discarding it. The software version of the neighbor device. The duplex state of connection between the current device and the neighbor device. The ID number of the VLAN on the neighbor device. A string that is the name of the collective group of VLANs associated with the neighbor device.

Show CDP Traffic


The following example specifies information associated with the show cdp traffic command: router# show cdp traffic Total packets output: 543, Input: 333 Hdr syntax: 0, Chksum error: 0, Encaps failed: 0 No memory: 0, Invalid: 0, Fragmented: 0 CDP version 1 advertisements output: 191, Input: 187 CDP version 2 advertisements output: 352, Input: 146 show cdp traffic Fields

Field
Total packets output

Definition
The number of CDP advertisements transmitted by the local device. Note this value is the sum of the CDP Version-1 advertisements output and CDP Version-2 advertisements output fields. The number of CDP advertisements received by the local device. Note this value is the sum of the CDP Version-1 advertisements input and CDP Version-2 advertisements input fields. The number of CDP advertisements with bad headers, received by the local device. The number of times the checksum (verifying) operation failed on incoming CDP advertisements. The number of times CDP failed to transmit advertisements on an interface because of a failure caused by the local device's bridge port. The number of times the local device did not have enough memory to store the CDP advertisements in the advertisement cache table when the device was attempting to assemble advertisement packets for transmission and parse them when receiving them. The number of invalid CDP advertisements received and transmitted by the local device. The number of times fragments or portions of a single CDP advertisement were received by the local device instead of the complete advertisement.

Input

Hdr syntax Chksum error Encaps failed No memory

Invalid Fragmented

CDP version 1 advertisements output Input CDP version 2 advertisements output Input

The number of CDP Version-1 advertisements transmitted by the local device.

The number of CDP Version-1 advertisements received by the local device. The number of CDP Version-2 advertisements transmitted by the local device.

The number of CDP Version-2 advertisements received by the local device.

Show CDP Interface


To display information about the interfaces on which CDP is enabled, use the show cdp interface privileged EXEC command. Router#sh cdp interface [type number] type (Optional) Type of interface about which you want information. number (Optional) Number of the interface about which you want information. Router_2#sho cdp interface Ethernet0 is up, line protocol is up Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime is 180 seconds Serial0 is up, line protocol is up Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds Serial1 is up, line protocol is up Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds

You might also like