Cisco Discovery Protocol

The Cisco Discovery Protocol (CDP) discovers basic information about neighboring routers and switches, without needing to know the passwords for the neighboring devices. CDP supports any LAN, HDLC, Frame Relay, and ATM interface—in fact, it supports any interface that supports the use of SNAP headers. The router or switch can discover Layer 2 and Layer 3 addressing details of neighboring routers without even configuring that Layer 3 protocol—this is because CDP is not dependent on any particular Layer 3 protocol.

When Cisco first developed the proprietary CDP, it was used mainly between routers. Today most Cisco products support CDP, including Cisco switches and Cisco IP Phones.

Devices that support CDP advertise their own information and learn information about others by listening for their advertisements. On media that support multicasts at the data link layer, CDP uses multicast; on other media, CDP sends a copy of the CDP update to any known data-link addresses. So, any CDP-supporting device that shares a physical medium with another CDP-supporting device can learn about the other device.

CDP discovers several useful details from the neighboring device:

■ Device identifier—Typically the host name

■ Address list—Network and data-link addresses

■ Port identifier—Text that identifies the port, which is another name for an interface

■ Capabilities list—Information on what type of device it is—for instance, a router or a switch

■ Platform—The model and OS level running in the device

CDP is enabled in the configuration by default. The no cdp run global command disables CDP for the entire device, and the cdp run global command re-enables CDP.

Likewise, the no cdp enable interface subcommand disables CDP just on that interface, and the cdp enable command switches back to the default state of CDP being enabled.

A variety of show cdp command options are available. Example 13-11 lists the output of the commands, with some commentary following.

Example 13-11 show cdp Command Options

Seville#show cdp ?

entry Information for specific neighbor entry interface CDP interface status and configuration neighbors CDP neighbor entries traffic CDP statistics

| Output modifiers

Seville#show cdp neighbor

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

fred

Ser 1

172

R

2500

Ser 1

Yosemite

Ser 0.2

161

R

2500

Ser 0.2

Switch

Eth 0

123

S I

WS-C3550-

-2Fas 0/4

Seville#show cdp entry fred

Seville#show cdp entry fred

Device ID: fred Entry address(es):

IP address: 163.5.8.3 Platform: cisco 2500, Capabilities: Router Interface: Seriall, Port ID (outgoing port): Seriall Holdtime : 168 sec

Version :

Cisco Internetwork Operating System Software

IOS (tm) 2500 Software (C2500-DS-L), Version 12.2(3), RELEASE SOFTWARE (fc1)

Example 13-11 show cdp Command Options (Continued)

Copyright 1986-2001 by cisco Systems, Inc. Compiled Wed 18-Jul-01 21:10 by pwade advertisement version: 2

Seville#show cdp neighbor detail

Device ID: fred Entry address(es):

IP address: 163.5.8.3 Platform: cisco 2500, Capabilities: Router Interface: Serial1, Port ID (outgoing port): Serial1 Holdtime : 164 sec

Version :

Cisco Internetwork Operating System Software

IOS (tm) 2500 Software (C2500-DS-L), Version 12.2(3), RELEASE SOFTWARE (fc1) Copyright 1986-2001 by cisco Systems, Inc. Compiled Wed 18-Jul-01 21:10 by pwade advertisement version: 2

Device ID: Yosemite Entry address(es):

IP address: 10.1.5.252 Platform: cisco 2500, Capabilities: Router Interface: Serial0.2, Port ID (outgoing port): Serial0.2 Holdtime : 146 sec

Version :

Cisco Internetwork Operating System Software

IOS (tm) 2500 Software (C2500-DS-L), Version 12.2(3), RELEASE SOFTWARE (fc1) Copyright 1986-2001 by cisco Systems, Inc. Compiled Wed 18-Jul-01 21:10 by pwade advertisement version: 2

Device ID: Switch Entry address(es):

Platform: cisco WS-C3550-24,

Capabilities: Switch IGMP

Interface: Ethernet0,

Port ID (outgoing port): FastEthernet0/4

Holdtime : 160 sec Version :

Cisco Internetwork Operating System Software

Holdtime : 160 sec Version :

Cisco Internetwork Operating System Software

Example 13-11 show cdp Command Options (Continued)

IOS (tm) C3550 Software (C3550-I5Q3L2-M), Version 12.1(11)EA1, RELEASE SOFTWARE (fc1)

Copyright 1986-2002 by cisco Systems, Inc. Compiled Wed 28-Aug-02 10:03 by antonino advertisement version: 2

Protocol Hello: OUI=0x00000C, Protocol ID=0x0112; payload len=27, value=0000000

0FFFFFFFF010231FF000000000000000AB7DCB780FF0000

VTP Management Domain: 11

Native VLAN: 1

Duplex: half

Seville#show cdp interface

Ethernet0 is up, line protocol is down Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime is 180 seconds Serial0.2 is up, line protocol is up Encapsulation FRAME-RELAY 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

Seville#show cdp traffic

CDP counters :

Total packets output: 31, Input: 41 Hdr syntax: 0, Chksum error: 0, Encaps failed: 9 No memory: 0, Invalid packet: 0, Fragmented: 0 CDP version 1 advertisements output: 0, Input: 0 CDP version 2 advertisements output: 31, Input: 41

The commands provide information about both the neighbors and the behavior of the CDP protocol itself. The show cdp command has four options, as shown at the beginning of the example. For instace, the show cdp neighbor command lists each neighbor, with one line of output per neighbor. Notice that Seville has two router neighbors, denoted by the R, and one switch, in this case a 3550, denoted with an S.

Next in the example, you see two commands that list details per neighbor. The show cdp entry fred command lists the details learned by CDP about the neighbor whose host name is fred. (Before using the command, you would just use the show cdp neighbor command to find the host names of any neighbors that CDP already has found.) Another command that lists the detailed information is the show cdp neighbor detail command, which is in the same format as show cdp entry but lists the information for every neighbor.

You actually can draw a network diagram by using CDP, exercising a little patience, and issuing the right commands on all the devices in a network. Whether you are using the briefer output of show cdp neighbor or the more complete output of show cdp neighbor detail or show cdp entry, the output lists both the local interface and the port ID. The port ID is the interface number, as designated by the other device. For instance, the switch uses port 0/4 to connect to this device. So, you literally could piece together the network diagram from the CDP output.

Was this article helpful?

0 0

Post a comment