Sometimes you believe the network is cabled in a certain way
whereas in reality it's cabled differently
so you may think that 1 device is connected to another device
but that’s not actually how it's cabled.
Cisco discovery protocol or CDP
and the industry standard version Link Layer Discovery Protocol or LLDP
are protocols that run at layer 2 in the OSI model
and allow you to discover how devices are connected to each other
this runs independently of protocol such as IPv4 and IPv6
CDP and LLDP are a great way to discover how devices are connected
and allow you to verify documentation as well as great new documentation.
CDP is Cisco propriety and well typical only discover other Cisco devices.
please be aware that some vendors such as HPE do not send CDP messages
but will receive CDP messages
and hence they can see which Cisco devices are connected directly to them
but a Cisco devices will not be able to see the switches
and routers from other vendors
such as HPE unless the Cisco devices are enabled for LLDP.
CDP uses multicast frames which I'll demonstrate in a moment
but once again doesn’t rely on higher layer protocols.
We'll start with the simple GNS3 topology
and then I’ll show you a more complex 1 in a different video.
In this GNS3 topology, I’ve got 3 Cisco routers.
one of them is connected to a hub which is bridge to my Local Area Network
which will allow me to see physical devices in the network.
Router 1 and router 2 are configured with IP addresses
on their FastEthernet 0 interfaces, router 2 is using DHCP on this interface
but this network hasn’t been configured.
So let’s see how that affects CDP.
Firstly on router 1, sh cdp neighbors
What you'll notice is it sees the directly connected neighbor router 2
but no others neighbors.
I could also use the details command
to see detailed information about that neighboring router.
you can see as an example the IP address of the neighbor
the platform, the capabilities, in other words, this supports routing
it supports switching and it supports IGMP
IGMP is used in multicast applications.
We could see the version of operating system that that router is using.
on router 2 sh cdp neighbors this shows a lot more detail
we can see router 1 once again, connected via FastEthernet 0/0
we can see its a 3725 router
but in addition, we can see a Cisco Unified Communication Manager
this is a Linux server that runs the Cisco Unified Communication Manager software
that’s running within the VMware and is using Ethernet 0
somewhere in the cloud here to connect back through the hub to router 2.
Now CDP only shows you directly connected devices that are running CDP
so as an example, router 1 doesn’t see these devices
because router 1 is separated from them by router 2
but CDP messages are sent through a hub
and any other layer 2 switches in the topology that are not running CDP
so there are actually some Cisco switches in this cloud
that connect router 2 to some of these devices such as the IP phones
but those Cisco switches are not running CDP
and hence are not seen in the topology.
So be careful CDP shows you directly connected devices that are running CDP.
This hub as an example is not running CDP
it's layer 1 device so CDP messages are transparently sent through it
to devices in the cloud
and they transparently send CDP messages back to router 2.
In addition, there are layer 2 Cisco switches
these are small personal switches that are not running CDP
and they don’t show up in the topology
these 2 phones as an example are powered by Cisco switch.
So CDP does show you directly connected neighbors
that would be the exam answer, in the real world, it’s not as simple as that.
Let’s look at some details so sh cdp neighbor detail
We can see some information about the Cisco Unified Communication Manager server
you can see as an example that it’s running on Linux
we can see a Cisco 3750 switch here
scrolling down, we can see a Cisco IP phone
notice it's Cisco DX650 that’s it's IP address.
We could as an example, open up a web browser to that phone.
In this case, the phone is supporting a web browser
so we can see details about the phone including its telephone number.
CDP is great for discovering devices on the network
but also is a security risk because you can discover the devices on the network.
That may be good for you but maybe bad if you have a hacker
or someone inquisitive to find out what you’re running.
So as an example, I can connect to the Cisco Communication Manager
and if I knew the username and password or hack it
I could then discover other devices in the topology.
So back on router 2, there’s a CUCM, there’s a 3750
here’s my Cisco phone DX650, I can see as an example
the power that's drawn by that phone
I can see the operating system that it's running
I can see which port it's using to connect back to router 2
so router 2 is using F0/1 that phone is using port 1.
Here’s another phone Cisco 7970, its port is 1
the local interface on the router is FastEthernet 0/1
here’s router 1 its outgoing port is FastEthernet 0/0
and router 2 is local interface is FastEthernet 0/0.
In this case, the router can see itself
because CDP message is being loop back to the router in the cloud
but once again sh cdp neighbors
we can see the local interface that's receiving CDP messages
and we can see devices
and their local interfaces is used to connect back to this local router.
now, what about R3? It’s not showing in the topology
and that’s because the interface isn't up, this interface is shutdown
so I’m gonna no shut that interface
but I’m not going to enable an IP address on the interface.
So we'll enable this link but configure no IP addresses.
So interface f0/0 no shut but that’s all we’ve done.
sh cdp neighbor
no neighbors are shown yet
it takes a while for CDP messages to be sent
you might have to wait 30 seconds before you see any CDP messages.
but sh ip int brief
will allow us to see the state of the interface, FastEthernet 0/0 is up up
on router 3, router 3 is connected and FastEthernet 0/0 to router 1
and FastEthernet 0/1 to router 3
router 3 is connected using FastEthernet 0/0
to router 2 is fast Ethernet interface 1/0.
sh cdp neighbors
we can now see router 2
the reason why the domain is showing up is I've configured
a domain name of cisco.com on router 2
so the local router interface is F0/0 and the interface of router 2 is F1/0
but please be aware that there are no IP addresses configured on this router.
so sh run int f0/0 sh ip int brief
what you’ll see is no IP addresses are assigned to any interfaces on this router
but CDP still works because CDP does not rely on IP.
Let’s have a look at detail
so on router 3 sh cdp neighbor detail
we're seeing router 2, we're seeing it's IP address
the local interface of router 3 is F0/0
and the interface used on router 2 is F1/0
the outgoing port is the port of the remote device in this output
which can be very confusing
That’s a basic example of CDP and the next video I'll do a Wireshark capture
and then on subsequent videos, we'll look at a more complex topology.