46. Cisco Discovery Protocol

Опубликовано: 15 Октябрь 2024
на канале: ITProDan
10
2

CISCO DISCOVERY PROTOCOL (CDP)
CISCO prorietary protocol
gives a user an idea on its connected devices based on the device perspective
not configured on all cisco devices as it is turned on by default
CDP is a Cisco proprietary protocol that is used for collecting directly connected neighbor
device information like hardware, software, device name details and many more

CDP versions

1. CDPV1
-The initial version which is capable only to collect device information connected to next end

2. CDPV2
Is the most recent release of the protocol and provides more intelligent device tracking
features like instances of mismatch native VLAN IDs on 802.1Q trunks, and mismatch in
duplex states between connecting devices.

How CDP Works

All Cisco devices transmit CDP packets periodically (default time interval value
is 60 seconds though this is adjustable). These packets advertise a time-to-live (TTL)
value in seconds, which indicates the number of seconds that the packet must be retained
before it can be discarded (default value is 180 seconds).
CDP packets are sent with a time-to-live value that is nonzero after an interface is enabled and
With a time-to-live value of zero immediately before an interface is down. This provides quick state discovery.

All Cisco devices receive CDP packets, process them and cache the information in the packet. Cisco devices never
forward a CDP packet. If any information changes from the last received packet, the new information is cached and
the older information is discarded even if its time-to-live value has not yet expired.

Notes for CDP
CDP only works on directly connected interfaces.
CDP messages are generated every 60 second, hold-down timer is 180 seconds.
Messages are destined to L2 multicast address 01:00:0C:CC:CC:CC
Device that receives CDP messages on an interface from other devices the information
using the show cdp neighbors command.
CDP table information is refreshed each time an announcement is received from neighbor,
and the holdtime for that entry is reinitialized.
The holdtime specifies the lifetime of an entry in the table - if no announcements are
received from a device for a period in excess of the holdtime, the device information is discarded and wiped out.
CDP runs on all media that support Subnetwork Access Protocol (SNAP),
including local-area network (LAN), Frame Relay, and Asynchronous Transfer Mode (ATM) physical media.
CDP runs over the data link layer only. Therefore, two systems that support different network-layer
protocols can learn about each other.
CDP Version-2 (CDPv2) is the most recent release of the protocol and provides more
intelligent device tracking features. These features include a reporting mechanism, which allows more rapid
error tracking, thereby reduces costly downtime. Errors reported includes
Mismatched native VLAN IDs (IEEE 802.1Q) on connected ports and
Mismatched Port-duplex states between connected devices.
CDP can be enabled on GRE tunnel which is useful in DMVPN. A central hub can use "router odr" to insert a default route into
the spoke so spoke can route via the hub. In addition odr can be redistributed to other routing protocols
Finally show cdp entry * pro can show all the IPs of connected devices.
CDP support on GRE tunnel interfaces was integrated in 12.3(5) and 12.3(6)T via CSCec01500.
CDP is used in output power negotiations for POE capable devices; like IP Phones, AccessPoints etc.

CDP Configuration:

CDP is enabled by default on Cisco Device.
Disabling CDP globally and enabling on an interface is not possible.
If on and interface CDP is disabled and then the encapsulation of the interface is changed,
CDP is re-enabled automatically on that interface even if CDP was previously disabled.

(config)# cdp run //Enables CDP globally on device.

(config)# no cdp run //Disables CDP globally on device.

(config-if)# cdp enable //Enables CDP on an interface device if CDP is enabled globally.

(config-if)# no cdp enable //Disables CDP on an interface device.

(config)# cdp timer (seconds) //Specifies CDP packets transmission frequency. Default 60 sec.

(config)# cdp holdtime (seconds) //Specifies time limit for which a receiving device should hold information before discarding.

Default 180 sec

CDP Monitoring and Maintenance Commands

clear cdp counters
clear cdp table
show cdp
show cdp entry device-name (protocol | version)
show cdp interface (type number)
show cdp neighbors (type number) (detail)
show cdp traffic


recommended
to disable CDP on interfaces that connects non cisco devices , user station.