Steven Bassi, a network administrator recently hired by the university. Your duties include improving and maintaining a large campus network. Although you have been granted credentials to log in to all devices, there is no documentation about how they are physically connected. Your first task is to document network topology. What next?
[figure 1 — undocumented network]
To this?
V
[figure 2- Documented network]
This problem can be solved by the Cisco Discovery Protocol (CDP). It is often difficult and inefficient to physically inspect devices in order to document a network. You can quickly view information about connected devices using CDP by using a few show commands. Depending on the device type and IOS version, you can view information such the host name, local and remote ports, as well as the device platform.
Let’s look at the example to show you the commands you would use for documenting devices and connected interfaces. You might see this if you run the command show cdp neighbor from the privileged mode on P2R3.
P2R3#show cdp neighboursCapability Codes: T – Trans Bridge, R – Router, B – Source Route BridgeSwitch, H Host, i IGMP, r — RepeaterDevice Identification Local Intrfce Holdtme Capability Plate Port IDSwitch2 Fas0/0 176 S 3550 Fas 0/2
[figure 3 – show cdp neighbours ouptut]
You can see that P2R3 has been connected to port Fa0/2 via a 3550 switch. This information can be used to expand your documentation.
[figure 4- Expanding network documentation]
You can document the entire network by continuing to do this on each device you discover.
How does CDP work?
One way to explain CDP is that every device running CDP will send announcements on each connected interface; each announcement includes basic information about the device as well as the interface. Devices that are notified by CDP will process the announcements and keep them for a certain amount of time. CDP announcements are sent via multicast addresses. Because CDP is a Layer 2 protocol all packets are not routed.
Configuring CDP
CDP announcements are typically sent every 60 seconds. However, you can verify the frequency using the show CDP Interface command. P2R3#show cdp interfaceFastEthernet0/0 is up, line protocol is upencapsulation ARPASending CDP packets every 60 secondsHoldtime is 180 seconds
[figure 5 – Show cdp interface output]
You can change the frequency and duration of announcements using the cdptimer seconds command in global configuration mode.
Figure 5 shows that the holdtime value for CDP packets is 180 seconds. This is the time the device will keep the CDP packet for before it is discarded. The CDP information will remain visible even if a neighboring device is disconnected. You can change the holdtime value using the global configuration mode command cdp holdtime second.
CDP can be disabled or enabled globally on the device or per interface. To disable CDP on a device, use the command no CDP run from global configuration mode. You can disable CDP per interface by using the no cdp allow command in interface configuration mode. Figure 6 shows how to disable and enable CDP globally on P2R3 as well as on FastEthernet0/0.
P2R3(config)#no cdp runP2R3(config)#cdp runP2R3(config)#interface fa0/0P2R3(config-if)#no cdp enableP2R3(config-if)#cdp enable
[figure 6: Disable/Enable CDP globally or per Interface]
Restrictions and Prerequisites for CDP
CDP has some limitations and prerequisites. This protocol is proprietary to Cisco. You may have problems if you use devices from other vendors. Frame Relay multipoint interfaces don’t support CDP, and interfaces that don’t support Subnetwork Access Protocol headers won’t work with CDP.
Use the info