Using Cisco Discovery Protocol

Last Updated: April 11, 2012

Cisco Discovery Protocol (formerly known as CDP) is a Layer 2 media-independent and network-independent protocol that runs on Cisco devices. Cisco Discovery Protocol enables networking applications to learn about nearby and directly connected devices. Cisco Discovery Protocol facilitates the management of Cisco devices by discovering devices, determining their configuration, and allowing systems using different network-layer protocols to learn about one another.

This module describes Cisco Discovery Protocol and how it functions with Simple Network Management Protocol (SNMP).

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the Feature Information Table at the end of this document.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.

Prerequisites for Using Cisco Discovery Protocol

  • Interfaces must support Subnetwork Access Protocol (SNAP) headers.

Restrictions for Using Cisco Discovery Protocol

  • Cisco Discovery Protocol functions only on Cisco devices.
  • Cisco Discovery Protocol is not supported on Frame Relay multipoint subinterfaces.

Information About Using Cisco Discovery Protocol

VLAN Trunking Protocol

VLAN Trunking Protocol (VTP) is a discovery technique used by switches. A switch advertises its management domain, configuration revision number, VLANs, and their specific parameters on its trunk ports. A VTP domain is made up of a single device or interconnected devices that share the same VTP domain name. A switch can belong to only one VTP domain.

Type, Length, Values

Type, length, values (TLVs) fields are blocks of information embedded in Cisco Discovery Protocol advertisements. Information in advertisements varies. The TLV frame format allows extension of advertisements when required. The table below summarizes the TLV field definitions.

Table 1 Type, Length, Values Field Definitions for Cisco Discovery Protocol

TLV Field

Definition

Address TLV

Contains the network addresses of both receiving and sending devices.

Application TLV

Provides a mechanism to send an application-specific TLV through Cisco Discovery Protocol.

Capabilities TLV

Identifies the device type. The device type indicates the functional capability of the device; for example, a switch.

Device-ID TLV

Identifies the device name in the form of a character string.

Full/Half Duplex TLV

Indicates the duplex configuration of the Cisco Discovery Protocol broadcast interface. This field is used by network operators to diagnose connectivity problems between adjacent network devices.

IP Network Prefix TLV

Contains a list of network prefixes to which the sending device can forward IP packets. A prefix includes the interface protocol and port number; for example, Gigabit Ethernet 0/0/0.1.

Location TLV

Delivers location-based information to endpoint devices through switches, routers, or access devices using the Cisco Discovery Protocol. The Location TLV can send the following types of information:

  • Civic location information--Provides the civic address information and postal information; for example, street address, road name, and postal community information.
  • ELIN location information--Provides the location information of a caller. The location is determined by the emergency location identifier number (ELIN), which is a phone number that routes an emergency call to the local public safety answering point (PSAP). The PSAP uses this information to call back the emergency caller.

You must configure the location TLV on the device before Cisco Discovery Protocol can deliver location-based information to the endpoint devices.

Location-server TLV

Provides a mechanism for location servers to transfer the required information to the neighbor devices.

Native VLAN TLV

Indicates, per interface, the assumed VLAN for untagged packets on the interface. Cisco Discovery Protocol learns the native VLAN for an interface.

This field is implemented only for interfaces that support the IEEE 802.1Q protocol.

Platform TLV

Identifies the hardware platform of the device.

Port-ID TLV

Identifies the port on which a Cisco Discovery Protocol packet is sent.

Version TLV

Contains information about the software release that is running on the device.

VTP Management Domain TLV

Advertises the VTP domain name of the system. This field is used by network operators to verify the VTP domain configuration in adjacent network nodes.

Cisco Discovery Protocol

Cisco Discovery Protocol (formerly known as CDP) is a Layer 2 media-independent, network-independent protocol. The networking devices use Cisco Discovery Protocol to learn about the nearby, and directly connected devices. Cisco Discovery Protocol is enabled by default in all Cisco devices except in Cisco ASR 1000 Series Aggregation Services Router. Each device that supports Cisco Discovery Protocol advertises at least one address at which it can receive announcements from neighbors. The device also sends periodic announcements (messages) to the multicast address 01:00:0C:CC:CC:CC. Devices discover each other by listening to the address specified to receive announcements. By listening to announcements, the devices also learn the interface status (up or down) of other devices.

Each device that supports Cisco Discovery Protocol stores the received announcements in a table. The information in the Cisco Discovery Protocol table is refreshed each time an announcement is received. By default, the Cisco Discovery Protocol announcements are sent every 60 seconds on the interfaces that support Subnetwork Access Protocol (SNAP) headers. The Cisco Discovery Protocol announcements contain the time-to-live information or the hold time, which specifies the lifetime of an entry in the Cisco Discovery Protocol table. The Cisco Discovery Protocol table information is refreshed each time an announcement is received, and the hold time for that entry is reinitialized. If no announcements are received from a device for a period in excess of the hold time, the device information is discarded. By default, the hold time is 180 seconds.

The information contained in Cisco Discovery Protocol announcements depends on the device type and the version of the operating system running on it. The following are examples of the types of information that can be contained in Cisco Discovery Protocol announcements:

  • Cisco IOS XE version running on a Cisco device
  • Duplex setting
  • Hardware platform of the device
  • Hostname
  • IP addresses of the interfaces on devices
  • Interfaces active on a Cisco device, including encapsulation type
  • Locally connected devices advertising Cisco Discovery Protocol
  • Native VLAN
  • VTP domain

Cisco Discovery Protocol Version 2 provides more intelligent device tracking features than Version 1. Version 2 of the protocol supports an enhanced reporting mechanism for more rapid error tracking, which helps to reduce network downtime. Errors reported include mismatched native VLAN IDs (IEEE 802.1Q) on connected ports and mismatched port duplex states between connected devices. Messages about reported errors can be sent to the console or to a logging server.

The show cdp command can provide detailed output on VLAN Trunking Protocol (VTP) management domains and duplex modes of neighboring devices, counters related to Cisco Discovery Protocol, and VLAN IDs of connecting ports.

Cisco Discovery Protocol and SNMP

Using Cisco Discovery Protocol with SNMP allows network management applications to learn the device type and the SNMP agent address of neighboring devices and to send SNMP queries to the devices.

The SNMP management application learns the protocol addresses and types of neighboring devices by retrieving Cisco Discovery Protocol tables from SNMP agents in those devices. When enabled, the network management module (NMM) SNMP agent discovers neighboring devices and builds a local cache with device information. A management workstation can retrieve the local cache by sending SNMP requests to access the CISCO-CDP-MIB.

Cisco Discovery Protocol and On-Demand Routing Support for ATM PVCs

Cisco Discovery Protocol and On-Demand Routing (ODR) support is available for ATM point-to-point permanent virtual circuits (PVCs). ODR uses Cisco Discovery Protocol to propagate IP address information in hub-and-spoke topologies. When ODR is enabled, spoke routers automatically advertise their subnets using Cisco Discovery Protocol.

Cisco Discovery Protocol is disabled by default on ATM PVC interfaces. To enable Cisco Discovery Protocol, use the cdp run command in global configuration mode and the cdp enable command in interface configuration mode on both ends of the PVC.

To enable ODR, use the router odr command in global configuration mode on the hub router and turn off all dynamic routing protocols in the spoke routers.

Cisco Discovery Protocol Support in IPv6

Cisco Discovery Protocol in IPv6 functions the same as IPv4 and offers the same benefits as in IPv4. IPv6 enhancements allow Cisco Discovery Protocol to exchange IPv6 and neighbor addressing information, provide IPv6 information to network management products, and provide troubleshooting tools.

Cisco Discovery Protocol Enhancements for Location Support

The CDP Medianet Support feature allows Cisco Discovery Protocol to identify the endpoint devices and provides the ability to exchange the medianet location information between the endpoint and switch. Location information can be provisioned statically by the user on the platform, can be received through updates from the location server, or can be received from the endpoint itself through Cisco Discovery Protocol.

The Propagation of Location Information over CDP feature ensures location information to be transmitted from wired switches to the attached end devices.

Cisco Discovery Protocol allows only one wired switch to report the location information by identifying and indicating the location of neighbor ports, thereby ensuring that there is no duplicate location information of the same device.

When you configure Cisco Discovery Protocol location information on a per-port basis, remote devices can send medianet location information to the switch.

Benefits of Cisco Discovery Protocol

  • Allows systems using different network layer protocols to learn about the other systems.
  • Facilitates Cisco device management by discovering the devices and their configuration.
  • Assists with troubleshooting TLV fields.
  • Functions with SNMP to learn SNMP agent addresses and to send SNMP queries.

How to Use Cisco Discovery Protocol

Disabling and Enabling Cisco Discovery Protocol on a Supported Device

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    [no] cdp run

4.    end


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Device> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Device# configure terminal

 

Enters global configuration mode.

 
Step 3
[no] cdp run


Example:

Device(config)# cdp run

 

Disables or enables Cisco Discovery Protocol on a supported device.

 
Step 4
end


Example:

Device(config)# end

 

Returns to privileged EXEC mode.

 

Disabling and Enabling Cisco Discovery Protocol on a Supported Interface


Note


If the encapsulation for an interface is changed, Cisco Discovery Protocol is enabled back on that interface, even if Cisco Discovery Protocol was previously disabled. For example, when interface encapsulation changes from Point-to-Point (PPP) to High-Level Data Link Control (HDLC), Cisco Discovery Protocol becomes active even if it is explicitly disabled with the no cdp run command on that interface. This behavior is by design. The encapsulation changes the Layer 2 protocol configured for that interface and resets the interface configuration to its default Cisco Discovery Protocol state of enabled, assuming Cisco Discovery Protocol is enabled globally on the device.
SUMMARY STEPS

1.    enable

2.    configure terminal

3.    interface slot/subslot/port[.subinterface]

4.    [no] cdp enable

5.    end


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Device> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Device# configure terminal

 

Enters global configuration mode.

 
Step 3
interface slot/subslot/port[.subinterface]


Example:

Device(config)# interface FastEthernet 0/0/0.1

 

Configures the specified interface and enters interface configuration mode.

 
Step 4
[no] cdp enable


Example:

Device(config-if)# no cdp enable

 

Disables or enables Cisco Discovery Protocol on the interface.

 
Step 5
end


Example:

Device(config-if)# end

 

Returns to privileged EXEC mode.

 

Setting the Transmission Timer and Hold Time for Cisco Discovery Protocol Packets

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    cdp timer seconds

4.    cdp holdtime seconds

5.    end


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Device> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Device# configure terminal

 

Enters global configuration mode.

 
Step 3
cdp timer seconds


Example:

Device(config)# cdp timer 30

 

Specifies the frequency of transmission of Cisco Discovery Protocol packets in seconds.

 
Step 4
cdp holdtime seconds


Example:

Device(config)# cdp holdtime 90

 

Specifies the hold time (duration, in seconds, for which a receiving device should hold information before discarding it).

 
Step 5
end


Example:

Device(config)# end

 

Returns to privileged EXEC mode.

 

Disabling and Reenabling Broadcast of Cisco Discovery Protocol Version 2 Advertisements

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    [no] cdp advertise-v2

4.    end


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Device> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Device# configure terminal

 

Enters global configuration mode.

 
Step 3
[no] cdp advertise-v2


Example:

Device(config)# cdp advertise-v2

 

Disables or reenables the broadcasting of CDP Version 2 advertisements.

 
Step 4
end


Example:

Device(config)# end

 

Returns to privileged EXEC mode.

 

Enabling Location TLV


Note


When you configure location information from various modules, you can use the location prefer command to configure the priority.
SUMMARY STEPS

1.    enable

2.    configure terminal

3.    location {admin-tag string | civic-location identifier id | elin-location string identifier id}

4.    exit

5.    interface slot/subslot/port[.subinterface]

6.    location {additional-location-information word | civic-location-id id [port-location] | elin-location-id id}

7.    end


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Device> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Device# configure terminal

 

Enters global configuration mode.

 
Step 3
location {admin-tag string | civic-location identifier id | elin-location string identifier id}


Example:

Device(config)# location civic-location location1

 

Specifies the location information for an endpoint and enters civic location configuration mode.

 
Step 4
exit


Example:

Device(config-civic)# exit

 

Returns to global configuration mode.

 
Step 5
interface slot/subslot/port[.subinterface]


Example:

Device(config)# interface fastethernet 0/0/0.1

 

Specifies the interface on which you are configuring the location information and enters interface configuration mode.

 
Step 6
location {additional-location-information word | civic-location-id id [port-location] | elin-location-id id}


Example:

Device(config-if)# location civic-location-id 1 port-location

 

Specifies location information for an interface and enters civic location port configuration mode.

  • You can configure port-specific information in civic location port configuration mode.
 
Step 7
end


Example:

Device(config-if-port)# end

 

Returns to privileged EXEC mode.

 

Configuring Location Support on Cisco Discovery Protocol

Perform this task to configure location support on Cisco Discovery Protocol.

Before You Begin

You must configure the location TLV before configuring location support on Cisco Discovery Protocol.


SUMMARY STEPS

1.    enable

2.    configure terminal

3.    cdp tlv {app | location | location-server}

4.    interface type number

5.    cdp tlv {app [tlvtype tlvtype value value] | location | server-location}

6.    end


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Device> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Device# configure terminal

 

Enters global configuration mode.

 
Step 3
cdp tlv {app | location | location-server}


Example:

Device(config)# cdp tlv app

 

Configures location support.

 
Step 4
interface type number


Example:

Device(config)# interface fastethernet 0

 

Specifies the interface on which you are configuring the location support and enters interface configuration mode.

 
Step 5
cdp tlv {app [tlvtype tlvtype value value] | location | server-location}


Example:

Device(config-if)# cdp tlv tlvtype 20 value test12

 

Configures location support on a specified interface.

 
Step 6
end


Example:

Device(config-if)# end

 

Returns to privileged EXEC mode.

 

Monitoring and Maintaining Cisco Discovery Protocol

To monitor and maintain Cisco Discovery Protocol on your device, perform the following steps.

SUMMARY STEPS

1.    enable

2.    clear cdp counters

3.    clear cdp table

4.    show cdp

5.    show cdp entry device-name [protocol | version]

6.    show cdp interface [type number]

7.    show cdp neighbors [type number] [detail]

8.    show cdp traffic

9.    show debugging


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Device> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
clear cdp counters


Example:

Device# clear cdp counters

 

Resets the traffic counters to zero.

 
Step 3
clear cdp table


Example:

Device# clear cdp table

 

Deletes the Cisco Discovery Protocol table.

 
Step 4
show cdp


Example:

Device# show cdp

 

Displays the interval between advertisements, the hold time, and the version of the advertisement.

 
Step 5
show cdp entry device-name [protocol | version]


Example:

Device# show cdp entry device-name protocol

 

Displays information about a specific neighbor.

  • The output can be limited to protocol or version information.
Note    Enter * for the device name to show all Cisco Discovery Protocol neighbor entries.
 
Step 6
show cdp interface [type number]


Example:

Device# show cdp interface

 

Displays information about interfaces on which Cisco Discovery Protocol is enabled.

 
Step 7
show cdp neighbors [type number] [detail]


Example:

Device# show cdp neighbors

 

Displays the type of device that has been discovered, the name of the device, the number and type of the local interface (port), the number of seconds the Cisco Discovery Protocol advertisement is valid for the interface, the device type, the device product number, and the port ID.

  • Issuing the detail keyword displays information about the native VLAN ID, the duplex mode, and the VTP domain name associated with neighbor devices.
 
Step 8
show cdp traffic


Example:

Device# show cdp traffic

 

Displays Cisco Discovery Protocol counters, including the number of packets sent and received and checksum errors.

 
Step 9
show debugging


Example:

Device# show debugging

 

Displays information about the types of debugging that are enabled for the device.

 

Configuration Examples for Using Cisco Discovery Protocol

Example: Disabling and Enabling Cisco Discovery Protocol on a Supported Interface

The following examples show that when the encapsulation for an interface is changed, Cisco Discovery Protocol is reenabled on the interface, even if Cisco Discovery Protocol was previously disabled.

The following example shows that Cisco Discovery Protocol is disabled for an interface with encapsulation PPP:

interface fastethernet 3/0/0.1
no ip address
encapsulation ppp
shutdown
no cdp enable <<<<<<<<<<CDP Disabled
end

The following example shows that the encapsulation for the interface is changed from PPP to HDLC:

Device# configure terminal
 
Enter configuration commands, one per line.  End with CNTL/Z.
Device(config)# interface pos 3/0/0.1
Device(config-if)# encapsulation hdlc
    <<<<<<<<<<Encapsulation changed from ppp to hdlc.
Device(config-if)# do show running interface fastethernet 3/0/0.1
Current configuration : 49 bytes
!

The following example shows that Cisco Discovery Protocol is enabled after the encapsulation for the interface is changed:

interface fastethernet 3/0      
no ip address
shutdown        <<<<<<<<<<<<CDP is now back on. You don't see it here previously disabled.
end

Example: Setting the Transmission Timer and Hold Time for Cisco Discovery Protocol Packets

In the following example, the timer is set to send updates every 30 seconds and a show cdp interface command is issued to show that the update is effective:

Device# configure terminal 
Device(config)# cdp timer 30 
Device(config)# end 
Device# show cdp interface gi0/0/0

GigabitEthernet0/0/0 is up, line protocol is up 
Encapsulation ARPA 
Sending CDP packets every 30 seconds 
Holdtime is 120 seconds 
Device# 

In the following example, the hold time is set to 90 seconds and a show cdp interface command is issued to show that the update is effective:

Device# configure terminal 
Device(config)# cdp holdtime 90
Device(config)# end 
Device# show cdp interface gi0/0/0

GigabitEthernet0/0/0 is up, line protocol is up 
Encapsulation ARPA 
Sending CDP packets every 30 seconds 
Holdtime is 90 seconds

Example: Monitoring and Maintaining Cisco Discovery Protocol

The following example shows a typical series of commands you can issue to display Cisco Discovery Protocol information:

Device# show cdp

Global CDP information:
        Sending CDP packets every 60 seconds
        Sending a holdtime value of 180 seconds
        Sending CDPv2 advertisements is enabled
 
Device# 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
C2950-1          Fas 0/0            148         S I       WS-C2950T-Fas 0/15
RX-SWV.cisco.com Fas 0/1            167         T S       WS-C3524-XFas 0/13

Device# show cdp neighbors detail

-------------------------
Device ID: C2950-1
Entry address(es): 
Platform: Cisco WS-C2950T-24,  Capabilities: Switch IGMP 
Interface: FastEthernet0/0,  Port ID (outgoing port): FastEthernet0/15
Holdtime : 139 sec
Version :
Cisco IOS XE C2950 Software (C2950-I6Q4L2-M), Version 12.1(9)EA1, RELEASE SOFTWARE
 .
 .
 .
Device# show cdp traffic

CDP counters :
        Total packets output: 81684, Input: 81790
        Hdr syntax: 0, Chksum error: 0, Encaps failed: 0
        No memory: 0, Invalid packet: 0, Fragmented: 0
        CDP version 1 advertisements output: 0, Input: 0
        CDP version 2 advertisements output: 81684, Input: 81790

Additional References

Related Documents

Related Topic

Document Title

Cisco IOS commands

Cisco IOS Master Commands List, All Releases

Cisco IOS XE Cisco Discovery Protocol commands

Cisco IOS Cisco Discovery Protocol Command Reference

Debugging commands

Configuring SNMP support

Configuring SNMP Support

Configuring On-Demand Routing

Configuring On-Demand Routing

Standards

Standard

Title

IEEE 802.1Q

Virtual LANS

MIBs

MIB

MIBs Link

  • CISCO-CDP MIB

To locate and download MIBs for selected platforms, Cisco software releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs

Technical Assistance

Description

Link

The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.

http://www.cisco.com/cisco/web/support/index.html

Feature Information for Configuring Cisco Discovery Protocol

The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.

Table 2 Feature Information for Configuring Cisco Discovery Protocol

Feature Name

Releases

Feature Information

Configuring Cisco Discovery Protocol

Cisco IOS XE Release 2.1

Cisco Discovery Protocol is a Layer 2, media-independent and network-independent protocol that runs on Cisco devices and enables networking applications to learn about nearby, directly connected devices.

In Cisco IOS XE Release 2.1, this feature was introduced on Cisco ASR 1000 Series Aggregation Services Router .

Duplication Location Reporting Issue

Cisco IOS XE Release 3.2.0SG

The Duplication Location Reporting Issue feature allows only one wired switch to report the location information.

Propagation of Location Information over Cisco Discovery Protocol

Cisco IOS XE Release 3.2.0SG

The Propagation of Location Information over Cisco Discovery Protocol ensures that location information is transmitted from wired switches over Cisco Discovery Protocol to the attached end devices.

The following commands were introduced or modified: cdp tlv, debug cdp events, show cdp tlv.

Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)

Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.

© 2012 Cisco Systems, Inc. All rights reserved.