Black Friday SaleIT 360 Bundle complimentary with every master programSee the offer
NETWORK KINGS / ARTICLES

Layer 2 discovery protocols (CDP and LLDP)

Demystifying Layer 2 Discovery Protocols : CDP vs. LLDP. Learn How These Protocols Power Network Visibility in this blog. Dive into Networking Excellence!

Layer 2 discovery protocols (CDP and LLDP)

In this lesson, we will discuss the Layer 2 discovery protocol.

  1. CDP (Cisco Discovery Protocols)

  2. LLDP (Link Layer Discovery Protocol)

The main function of these protocols is to collect and share information with neighboring devices. Shared information includes host name, IP address, and device type, etc. When a device receives a CDP/LLDP message, it adds the neighbor information to the neighbor table and discards the message. It doesn’t forward the message to other devices. So, this way, you can see that only directly connected devices can become CDP/LLDP neighbors.

CDP (Cisco Discovery Protocol)

It is a Cisco proprietary protocol. By default, CDP is enabled on all Cisco devices (routers, switches, firewalls).
CDP message timer = 60 sec, CDP holddown timer = 180 sec
After sending the CDP message, it waits for 180 seconds. If there is no response within this time from the neighbor side, then it deletes the neighbor from the neighbor table.
CDP messages are periodically sent (after 60 seconds) to multicast address 0100.0ccc.cccc

By default, CDP is enabled on the device. To disable the CDP, use no cdp run command in global configuration mode.

R1(config) # no cdp run     -—to disable the cdp

R1(config) # cdp run           -—to enable the cdp

By default, CDP is enabled on each interface. To disable CDP, use the no cdp enable command in interface mode.

R1(config-if) no cdp enable  —-— to disable the cdp

R1(config-if) cdp enable  —-— to enable the cdp

R1# show cdp neighbors  –— this command will show a list of LLDP neighbors and some basic information.

CDP neighbor table

LLDP (Link Layer Discovery Protocol)

It is an industry standard protocol. By default, LLDP is disabled on all devices.
LLDP message timer = 30 sec and LLDP hold-down timer =120 sec.
LLDP messages use multicast MAC address = 0180.C200.000E.
A device can run CDP and LLDP at the same time.

Here are some useful commands-

  1. R1(config)# lldp run   –— to enable the lldp on the device.

2. R1(config)# no lldp run   –— to disable the lldp on device.

3. R1(config-if)# lldp transmit  –— allow interface to transmit lldp messages.

4. R1(config-if)# lldp receive –— allow interface to receive lldp messages.

5. R1# show lldp neighbors  –— this command will show a list of lldp neighbors and some basic information.

MAKE YOUR NEXT MOVE

Put your next idea into practice.

Find a course, explore a career path, or talk it through with our team.

Request career guidance

Why learn from the top 1% of engineers?

Because passing an exam and doing the job are different skills, and only experience closes the gap. Network Kings mentors have spent 11 to 20+ years building and running networks, cloud platforms and pipelines at companies like Apple, Juniper Networks, IBM and CDAC. They teach what breaks in production, why, and how engineers fix it under pressure.

  • Atul Sharma, Founder & CEO mentor at Network KingsAtul Sharma, Founder & CEO
  • Lazaro (Laz) Diaz, Networking mentor at Network KingsLazaro (Laz) Diaz, Networking
  • Sanjay Sharma, AWS mentor at Network KingsSanjay Sharma, AWS
  • Vikas Kumar, Azure mentor at Network KingsVikas Kumar, Azure
  • Ajay, Azure mentor at Network KingsAjay, Azure
  • Amit Bhatt, Linux & DevOps mentor at Network KingsAmit Bhatt, Linux & DevOps

Atul Sharma (Founder & CEO, 12+ yrs), Lazaro (Networking), Sanjay Sharma (AWS, 20+ yrs) and more. Meet the mentors

Same problem, two answers. Pick a track:

On the job: Two routers' OSPF neighbours are stuck in ExStart and never reach Full.

The textbook answer

OSPF moves through Down, Init, 2-Way, ExStart, Exchange, Loading and Full. Memorise the neighbour states for the exam.

Correct. Not enough to fix it.

How a production engineer teaches it

  1. Suspect an MTU mismatch first. ExStart and Exchange stalls usually come down to it.
  2. Compare show ip ospf interface on both ends and fix the interface MTU.
  3. Use ip ospf mtu-ignore only as a stopgap, and say so in the change record.
  4. Write down why it happened, so the next engineer finds it in minutes.
  • The why behind every command, not just the syntax.
  • Hands-on labs for every topic, so the first fault you fix is not at work.
  • Doubts answered by someone who has fixed it in a live network, cloud or pipeline.