Layer 2 discovery protocols are used to learn about neighboring devices on a network. Two of the most common protocols are Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP). Both protocols have their own strengths and weaknesses, which will be discussed in this blog of CCNA course series.
In the previous blog of our CCNA 200-301 series , we talked about the extended ACLs. I recommend you go through it before you jump to this blog.
The Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) are two different layer 2 discovery protocols that can be used to learn information about neighboring devices. Both protocols can be used to detect the presence of other devices and to collect various pieces of information about them, such as the device’s name, model, and operating system.
CDP is a proprietary protocol that is specific to Cisco devices, while LLDP is an industry-standard protocol that can be used with any type of device. In general, LLDP is a more powerful and flexible protocol than CDP. This blog provides a brief overview of the two protocols and explains the key differences between them.
CDP is a proprietary protocol that is used by Cisco devices to learn about their neighbors. CDP has been around for a long time and is included in most Cisco devices. LLDP is a standards-based protocol that is used by many different vendors.
So, CDP vs LLDP- which protocol is better? The answer depends on your specific needs. Keep reading to learn more about these two protocols and how they can be used to benefit your network.
What are Layer 2 Discovery Protocols?
- Layer 2 discovery protocols such as CDP and LLDP share information with and discover information about neighboring devices that are connected to each other.
- They are called ‘Layer 2’ discovery protocols because the protocols themselves operate at Layer 2. They do not use IP addresses.
- This means that there are no IP packets inside the frames sent by CDP and LLDP in a network.
- They can also be used to share Layer 3 information such as IP addresses.
- The shared information consists of a host name, IP address, device type, etc.
- CDP is a Cisco proprietary protocol developed for Cisco devices by Cisco itself.
- LLDP is an industry-standard protocol (IEEE 802.1AB).
- Therefore, if your network is a mix of vendors such as Juniper switches, Cisco routers, and Palo Alto firewalls, you will need to use LLDP as your Layer 2 discovery protocol in your network.
- Since these protocols share information about the devices in a network, they are considered a security risk and are often not used. It depends on the Network Engineer/Administrator to decide if he wants to use them in the network or not.
Let us now discuss each one of these discovery protocols one by one!
CDP (Cisco Discovery Protocol)
CDP is a Cisco proprietary protocol that has been around for a long time. This protocol is used for discovering information about Cisco devices on the network.
CDP can tell you what type of device it is, what version of IOS it is running, and even what type of interfaces the device has. CDP has the advantage of being included in most Cisco devices. This means that you don’t have to configure anything in order to use CDP.
It also has the advantage of being able to tell you a lot of detailed information about the device. This can be useful for troubleshooting and monitoring the network. However, the biggest downside of CDP is that it is proprietary and only works with Cisco devices. This means that if you have any devices from other vendors, CDP won’t work.
The following are the salient features of the Cisco Discovery Protocol:
- CDP is a Cisco Proprietary protocol.
- It is enabled on Cisco devices such as routers, switches, firewalls, IP phones, etc. by default.
- CDP messages are periodically sent to multicast MAC address 0100. 0CCC. CCCC.
- When a device receives a CDP message, it processes and then dumps the message. It does NOT forward it to other devices.
- CDP messages are sent once every 60 seconds by default.
- The CDP hold time is 180 seconds by default. This means that if a message is not received from a neighbor in 180 seconds, the neighbor is removed from the CDP neighbor table.
- CDPv2 messages are sent by default.
- The CDPv1 is very old and not in use anymore.
You can learn about some useful CDP commands here.
LLDP (Link Layer Discovery Protocol)
LLDP is a standards-based protocol that is used by many different vendors. It is similar to CDP in that it is used to discover information about other devices on the network. However, the big difference is that LLDP is designed to be compatible with all vendors.
This means that you can use it to discover information about devices from any vendor, not just Cisco. Like CDP, LLDP is a good protocol for troubleshooting and monitoring the network.
It is also relatively easy to configure and configure. The downside of LLDP is that it doesn’t provide as much detail as CDP. It can tell you what type of device it is and what type of interfaces it has, but not what version of IOS it is running.
The following are the important features of the Link Layer Discovery Protocol:
- LLDP is an industry-standard protocol (IEEE 802.1AB).
- It is usually disabled on Cisco devices by default. Therefore, it needs to be enabled by the user himself.
- A device can run CDP and LLDP at the same time.
- LLDP messages are periodically sent to multicast MAC address 0180. C200. 000 E.
- When a device receives an LLDP message, it processes and discards the message. It does NOT forward it to other devices. Therefore, it works the same as a CDP.
- LLDP messages are sent once every 30 seconds by default.
- The LLDP hold time is 120 seconds by default.
- LLDP has an additional timer called the ‘reinitialization delay’. If LLDP is enabled globally or on an interface, this timer will delay the actual reinitialization of the LLDP which is 2 seconds by default.
You can learn about the important LLDP commands here.
CDP vs LLDP- Comparison
So, which one should you use? Well, the answer completely depends on what you need.
If you only have Cisco devices, then CDP might be the better option because of its detailed information. However, if you have devices from other vendors, then LLDP is the better choice because of its compatibility.
It’s also important to consider the size of your network and the type of devices you have when making this decision.
How The Discovery Protocols Can Benefit Your Network?
Here are some of the significant benefits of Discovery protocols in a network:
- The network discovery protocols such as CDP and LLDP help you to create and maintain an inventory of network assets. This helps tech professionals to understand their networks in a better way.
- These protocols collect information about virtual computers and networks.
- They also gather information about a network’s hardware, software, and the relationship between network assets.
- These protocols provide more visibility to the networks.
- They allow different network layer protocols to discover the devices and their configuration.
- They allow the discovery of IP addresses of misconfigured routers or switches.
- They help in troubleshooting Type-Length-Value (TLV) fields.
Conclusion
CDP and LLDP are two of the most common layer two discovery protocols. CDP is a proprietary protocol that is only compatible with Cisco devices, while LLDP is a standards-based protocol that is compatible with all vendors. The choice of which protocol to use depends on the size of your network and the types of devices you have. Choosing the right protocol can help you troubleshoot and monitor your network more efficiently.