Layer 2 Network Discovery Method.
The most common layer 2 Network Discovery Method is The Cisco Discovery Protocol (CDP). This is a proprietary Data Link Layer protocol developed by Cisco Systems. It is used to share information about other directly connected Cisco equipment, such as the operating system version and IP address. 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 networks.
Cisco discovery protocol (CDP) is primarily used to obtain protocol addresses of neighbouring devices and discover the platform of those devices. CDP can also be used to show information about the interfaces your router uses. CDP is media-and protocol-independent, and runs on all Cisco-manufactured equipment including routers, bridges, access servers and switches.
CDP can help determine which devices are connected to a particular router.
CDP is run at layer 2 of the OSI model and is therefore able to work with all devices e.g. switches, firewalls, security devices and layer 3 devices regardless of the protocols it isrunning on layer 3.
When a device is configured for CDP, the process begins when the device is booting up. Each device sends out messages, which can also be called advertisements to all the other devices via a multicast IP address. IP Multicast is a bandwidth-conserving technology that reduces traffic by simultaneously delivering a single stream of information to all listening devices
When you are logged on to the router, you enter the command: Router# show CDP neighbors
(note the American spelling)
The information gathered as shown above includes:
• Device ID.
• Local interface.
• Port ID.
Device ID: This is the name of the device to which the router is connected.
Local interface: The interface on this router to which the neighbouring device is connected.
Holdtime: The amount of time this router should hold the information from the CDP advert before deleting it.
Capability: This is the kind of device that is connected to this router.
Platform: This is the description of the device which is connected. For example, if the connected device was a 2600 series router then we would expect 2600 to be displayed here.
Port ID: This is the port on the connected device which has sent the advertisement.
There are several other CDP commands that can be used and they are described in the table below. The most important of these are the enable and the show versions which are the most useful when it comes to troubleshooting on a router.
Enables cdp on this interface.
show cdp (i.e. without the word neighbors)
Shows the cdp status of this device.
clear cdp counters
Clears all counters and sets holdtime etc to 0.
show cdp interface fa0/0
Shows cdp information for that particular interface.eg fa0/0