Achievable logoAchievable logo
CCNA
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Introduction to networking
2. Administering Ethernet LANs
3. IP connectivity
4. Network services
5. IPv6
6. Wireless networking
7. Network management and administering network devices
7.1 Remote access to network devices using Telnet and Secure Shell (SSH)
7.2 Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP)
7.3 Syslog
7.4 Simple Network Management Protocol (SNMP)
8. Network security fundamentals
9. Network automation and programmability
Wrapping up
Achievable logoAchievable logo
7.2 Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP)
Achievable CCNA
7. Network management and administering network devices
Our CCNA course is currently in development and is a work-in-progress.

Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP)

6 min read
Font
Discuss
Share
Feedback

Understanding your network’s physical and logical topology is a core skill for any network engineer. Whether you’re troubleshooting, planning an expansion, or documenting an existing environment, you need accurate information about which devices are connected and how. Manually mapping a large network is time-consuming and easy to get wrong. That’s where Layer 2 discovery protocols like Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) help.

These protocols operate at Layer 2 of the TCP/IP or OSI model, so they work independently of IP addressing. Devices use them to advertise identity, capabilities, and connectivity details to directly connected neighbors.

Cisco Discovery Protocol (CDP)

Cisco Discovery Protocol (CDP) is a proprietary Layer 2 protocol developed by Cisco. Its main purpose is to discover basic information about directly connected Cisco devices, even if those devices are running different Network Layer (Layer 3) protocols. CDP lets you learn a lot about a Cisco network’s topology without logging into every device.

How CDP works

CDP-enabled devices periodically send multicast advertisements out of each active interface. Each advertisement includes information about the sending device. When a neighboring Cisco device receives a CDP advertisement, it processes the information and stores it in its local CDP table.

One key point: CDP messages are not forwarded beyond the directly connected link. The receiving device processes the message and then discards it. As a result, CDP only discovers immediate neighbors.

CDP frames use a specific multicast destination MAC address in the Ethernet header: 0100.0CCC.CCCC. This allows CDP-enabled devices on the segment to receive and process the advertisements.

Device parameters learned by CDP

CDP can report many details about neighboring Cisco devices, including:

  • Device Identifier: Typically the hostname of the neighboring device.
  • Address List: Network Layer (for example, IP) and Data Link Layer (for example, MAC) addresses configured on the neighboring device.
  • Port Identifier: The interface on the remote device that connects to the local device.
  • Capabilities List: The type of device (for example, Router, Switch, IP phone, Host).
  • Platform: The device model and its operating system (OS) level.

CDP is commonly used for two purposes:

  1. Supporting device functions: For example, Cisco IP Phones learn the Voice VLAN from the switch they’re connected to through CDP. This allows the phones to tag the frames containing the VoIP packets they originate, send them to the switch, and receive tagged VoIP frames from the switch.
  2. Aiding Network Engineers: CDP helps you map topology, verify connections, and troubleshoot by showing detailed information about neighboring devices.

Verifying CDP neighbors and information

You view CDP information using show commands. These commands are consistent across Cisco routers and switches.

show cdp neighbors

This command provides a concise summary of each directly connected CDP neighbor. The output typically includes:

  • Device ID: The hostname of the neighboring device.
  • Local Intrfce: The local interface on your device connected to the neighbor.
  • Holdtme: The time (in seconds) remaining before the neighbor’s entry is removed from the CDP table if no further advertisements are received.
  • Capability: A single-character code indicating the neighbor’s capabilities (for example, ‘R’ for Router, ‘S’ for Switch, ‘H’ for Host, ‘I’ for IGMP).
  • Platform: The model number and OS level of the neighboring device.
  • Port ID: The interface on the neighboring device connected to your local interface.

Consider the example in the image below:

Image

Image Title - SW1, connected to SW2 and R1

SW1 is connected to SW2 and R1. The show cdp neighbors command on SW1 reveals the following entries:

  • SW2 connected via SW1’s GigabitEthernet1/0/1 to SW2’s GigabitEthernet1/0/48. SW2 is identified as a Switch (S) with a platform like C9300.
  • R1 connected via SW1’s GigabitEthernet1/0/2 to R1’s GigabitEthernet0/0/0. R1 is identified as a Router ® with a platform like C8000.

Image

Image Title - show cdp neighbors output on SW1

This output is useful for topology mapping. By matching the local interface to the remote interface, you can draw the physical connections between devices.

show cdp neighbors detail

For a more complete view, show cdp neighbors detail provides additional information for each neighbor, including:

  • IP Address: The Layer 3 address(es) configured on the neighbor’s interface.
  • Platform: A more detailed device model description (for example, cisco C9300-48P).
  • Capabilities: A list of capabilities, often more explicit than the summary output.
  • Version: The full Cisco IOS Software version, including release name, version number, and build date.
  • VTP Management Domain: If applicable, the VLAN Trunking Protocol (VTP) domain name.

VTP is outside of the scope of the CCNA v1.1 exam.

  • Native VLAN: The native VLAN configured on the trunk link.
  • Duplex: The duplex setting (full or half) of the link.

This detailed output helps you verify software versions, IP addressing, and other configuration details without logging into the neighboring device.

Several other show commands help you check CDP operation:

  • show cdp: Displays global CDP information, including whether it’s enabled, the current update and holdtime timers, and whether CDPv2 advertisements are enabled.
  • show cdp interface [slot/port number]: Shows CDP status for all interfaces or a specific interface, including whether CDP is enabled on that port and the current timers.
  • show cdp traffic: Displays global statistics for CDP advertisements sent and received, including errors.

Configuring CDP and verifying operations

By default, CDP is typically enabled globally on Cisco devices and on all interfaces. You might disable it for security reasons, or re-enable it if it was previously turned off.

In Global Configuration Terminal mode:

  • To disable CDP globally:

    no cdp run

  • To enable CDP globally:

    cdp run

Interface-specific CDP configuration:

  • To disable CDP on a specific interface:

    interface gigabitethernet0/0
    no cdp enable

  • To enable CDP on a specific interface:

    interface gigabitethernet0/0
    cdp enable

CDP advertisements are sent every 60 seconds by default, and a neighbor’s entry is held for 180 seconds (holdtime) before being removed if no new advertisements arrive. You can adjust these timers in Global Configuration mode:

  • To change the update interval:

    cdp timer [seconds]

    For example:

    cdp timer 30

  • To change the holdtime:

    cdp holdtime [seconds]

    For example:

    cdp holdtime 240

Layer 2 discovery protocols overview

  • Operate at Layer 2, independent of IP addressing
  • Discover directly connected neighbors only
  • Used for topology mapping, troubleshooting, and device documentation

Cisco Discovery Protocol (CDP)

  • Cisco proprietary Layer 2 protocol

  • Discovers only directly connected Cisco devices

  • Sends multicast advertisements (MAC: 0100.0CCC.CCCC)

    • Device parameters learned:

      • Device ID (hostname), Address List (IP/MAC), Port ID, Capabilities, Platform
    • Common uses:

      • Device functions (e.g., Voice VLAN for IP phones)
      • Network mapping and troubleshooting

CDP verification and show commands

  • show cdp neighbors: Summary of directly connected Cisco neighbors
    • Device ID, Local Interface, Holdtime, Capability, Platform, Port ID
  • show cdp neighbors detail: Detailed info (IP address, platform, version, VLAN, duplex)
  • Other commands: show cdp, show cdp interface, show cdp traffic

CDP configuration

  • Enabled globally and per-interface by default
  • Disable globally: no cdp run; enable: cdp run
  • Disable/enable per interface: no cdp enable / cdp enable
  • Default timers: 60s advertisement, 180s holdtime
    • Adjust with cdp timer [seconds] and cdp holdtime [seconds]

Link Layer Discovery Protocol (LLDP)

  • IEEE 802.1AB standard, vendor-neutral
  • Layer 2 protocol, similar to CDP
  • Sends LLDP Data Units (LLDPDUs) to multicast MAC 0180.C200.000E
  • Uses Type-Length-Value (TLV) elements for information

LLDP verification and show commands

  • show lldp neighbors: Summary (Device ID, Local Intf, Hold-time, Capability, Port ID)
    • Platform info not shown in summary
    • Distinguishes system vs. enabled capabilities
  • show lldp neighbors detail: Detailed info (System Name, Chassis ID, Port ID, Description, Capabilities, Management Addresses)
  • Other commands: show lldp, show lldp interface, show lldp traffic

LLDP configuration

  • Disabled by default on Cisco devices
  • Enable globally: lldp run; disable: no lldp run
  • Interface control: enable/disable transmit (lldp transmit / no lldp transmit) and receive (lldp receive / no lldp receive) separately
  • Default timers: 30s advertisement, 120s holdtime
    • Adjust with lldp timer [seconds], lldp holdtime [seconds]
    • Reinit delay: lldp reinit [seconds]

LLDP-MED (Media Endpoint Discovery)

  • Extension of LLDP (TIA-1057) for endpoint devices (e.g., IP phones)

  • Uses TLVs for modular information exchange

    • Key functions:
      • Voice VLAN discovery (advertises voice VLAN to phones)
      • Power over Ethernet (PoE) negotiation
      • Inventory and location information
  • Supported by Cisco and non-Cisco IP phones (non-Cisco use LLDP-MED exclusively)

Sign up for free to take 10 quiz questions on this topic

Previous
Next  | 7.3 Syslog
All rights reserved ©2016 - 2026 Achievable, Inc.

Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP)

Understanding your network’s physical and logical topology is a core skill for any network engineer. Whether you’re troubleshooting, planning an expansion, or documenting an existing environment, you need accurate information about which devices are connected and how. Manually mapping a large network is time-consuming and easy to get wrong. That’s where Layer 2 discovery protocols like Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) help.

These protocols operate at Layer 2 of the TCP/IP or OSI model, so they work independently of IP addressing. Devices use them to advertise identity, capabilities, and connectivity details to directly connected neighbors.

Cisco Discovery Protocol (CDP)

Cisco Discovery Protocol (CDP) is a proprietary Layer 2 protocol developed by Cisco. Its main purpose is to discover basic information about directly connected Cisco devices, even if those devices are running different Network Layer (Layer 3) protocols. CDP lets you learn a lot about a Cisco network’s topology without logging into every device.

How CDP works

CDP-enabled devices periodically send multicast advertisements out of each active interface. Each advertisement includes information about the sending device. When a neighboring Cisco device receives a CDP advertisement, it processes the information and stores it in its local CDP table.

One key point: CDP messages are not forwarded beyond the directly connected link. The receiving device processes the message and then discards it. As a result, CDP only discovers immediate neighbors.

CDP frames use a specific multicast destination MAC address in the Ethernet header: 0100.0CCC.CCCC. This allows CDP-enabled devices on the segment to receive and process the advertisements.

Device parameters learned by CDP

CDP can report many details about neighboring Cisco devices, including:

  • Device Identifier: Typically the hostname of the neighboring device.
  • Address List: Network Layer (for example, IP) and Data Link Layer (for example, MAC) addresses configured on the neighboring device.
  • Port Identifier: The interface on the remote device that connects to the local device.
  • Capabilities List: The type of device (for example, Router, Switch, IP phone, Host).
  • Platform: The device model and its operating system (OS) level.

CDP is commonly used for two purposes:

  1. Supporting device functions: For example, Cisco IP Phones learn the Voice VLAN from the switch they’re connected to through CDP. This allows the phones to tag the frames containing the VoIP packets they originate, send them to the switch, and receive tagged VoIP frames from the switch.
  2. Aiding Network Engineers: CDP helps you map topology, verify connections, and troubleshoot by showing detailed information about neighboring devices.

Verifying CDP neighbors and information

You view CDP information using show commands. These commands are consistent across Cisco routers and switches.

show cdp neighbors

This command provides a concise summary of each directly connected CDP neighbor. The output typically includes:

  • Device ID: The hostname of the neighboring device.
  • Local Intrfce: The local interface on your device connected to the neighbor.
  • Holdtme: The time (in seconds) remaining before the neighbor’s entry is removed from the CDP table if no further advertisements are received.
  • Capability: A single-character code indicating the neighbor’s capabilities (for example, ‘R’ for Router, ‘S’ for Switch, ‘H’ for Host, ‘I’ for IGMP).
  • Platform: The model number and OS level of the neighboring device.
  • Port ID: The interface on the neighboring device connected to your local interface.

Consider the example in the image below:

Image

Image Title - SW1, connected to SW2 and R1

SW1 is connected to SW2 and R1. The show cdp neighbors command on SW1 reveals the following entries:

  • SW2 connected via SW1’s GigabitEthernet1/0/1 to SW2’s GigabitEthernet1/0/48. SW2 is identified as a Switch (S) with a platform like C9300.
  • R1 connected via SW1’s GigabitEthernet1/0/2 to R1’s GigabitEthernet0/0/0. R1 is identified as a Router ® with a platform like C8000.

Image

Image Title - show cdp neighbors output on SW1

This output is useful for topology mapping. By matching the local interface to the remote interface, you can draw the physical connections between devices.

show cdp neighbors detail

For a more complete view, show cdp neighbors detail provides additional information for each neighbor, including:

  • IP Address: The Layer 3 address(es) configured on the neighbor’s interface.
  • Platform: A more detailed device model description (for example, cisco C9300-48P).
  • Capabilities: A list of capabilities, often more explicit than the summary output.
  • Version: The full Cisco IOS Software version, including release name, version number, and build date.
  • VTP Management Domain: If applicable, the VLAN Trunking Protocol (VTP) domain name.

VTP is outside of the scope of the CCNA v1.1 exam.

  • Native VLAN: The native VLAN configured on the trunk link.
  • Duplex: The duplex setting (full or half) of the link.

This detailed output helps you verify software versions, IP addressing, and other configuration details without logging into the neighboring device.

Several other show commands help you check CDP operation:

  • show cdp: Displays global CDP information, including whether it’s enabled, the current update and holdtime timers, and whether CDPv2 advertisements are enabled.
  • show cdp interface [slot/port number]: Shows CDP status for all interfaces or a specific interface, including whether CDP is enabled on that port and the current timers.
  • show cdp traffic: Displays global statistics for CDP advertisements sent and received, including errors.

Configuring CDP and verifying operations

By default, CDP is typically enabled globally on Cisco devices and on all interfaces. You might disable it for security reasons, or re-enable it if it was previously turned off.

In Global Configuration Terminal mode:

  • To disable CDP globally:

    no cdp run

  • To enable CDP globally:

    cdp run

Interface-specific CDP configuration:

  • To disable CDP on a specific interface:

    interface gigabitethernet0/0
    no cdp enable

  • To enable CDP on a specific interface:

    interface gigabitethernet0/0
    cdp enable

CDP advertisements are sent every 60 seconds by default, and a neighbor’s entry is held for 180 seconds (holdtime) before being removed if no new advertisements arrive. You can adjust these timers in Global Configuration mode:

  • To change the update interval:

    cdp timer [seconds]

    For example:

    cdp timer 30

  • To change the holdtime:

    cdp holdtime [seconds]

    For example:

    cdp holdtime 240

Key points

Layer 2 discovery protocols overview

  • Operate at Layer 2, independent of IP addressing
  • Discover directly connected neighbors only
  • Used for topology mapping, troubleshooting, and device documentation

Cisco Discovery Protocol (CDP)

  • Cisco proprietary Layer 2 protocol

  • Discovers only directly connected Cisco devices

  • Sends multicast advertisements (MAC: 0100.0CCC.CCCC)

    • Device parameters learned:

      • Device ID (hostname), Address List (IP/MAC), Port ID, Capabilities, Platform
    • Common uses:

      • Device functions (e.g., Voice VLAN for IP phones)
      • Network mapping and troubleshooting

CDP verification and show commands

  • {`show cdp neighbors`}: Summary of directly connected Cisco neighbors
    • Device ID, Local Interface, Holdtime, Capability, Platform, Port ID
  • {`show cdp neighbors detail`}: Detailed info (IP address, platform, version, VLAN, duplex)
  • Other commands: {`show cdp`}, {`show cdp interface`}, {`show cdp traffic`}

CDP configuration

  • Enabled globally and per-interface by default
  • Disable globally: {`no cdp run`}; enable: {`cdp run`}
  • Disable/enable per interface: {`no cdp enable`} / {`cdp enable`}
  • Default timers: 60s advertisement, 180s holdtime
    • Adjust with {`cdp timer [seconds]`} and {`cdp holdtime [seconds]`}

Link Layer Discovery Protocol (LLDP)

  • IEEE 802.1AB standard, vendor-neutral
  • Layer 2 protocol, similar to CDP
  • Sends LLDP Data Units (LLDPDUs) to multicast MAC 0180.C200.000E
  • Uses Type-Length-Value (TLV) elements for information

LLDP verification and show commands

  • {`show lldp neighbors`}: Summary (Device ID, Local Intf, Hold-time, Capability, Port ID)
    • Platform info not shown in summary
    • Distinguishes system vs. enabled capabilities
  • {`show lldp neighbors detail`}: Detailed info (System Name, Chassis ID, Port ID, Description, Capabilities, Management Addresses)
  • Other commands: {`show lldp`}, {`show lldp interface`}, {`show lldp traffic`}

LLDP configuration

  • Disabled by default on Cisco devices
  • Enable globally: {`lldp run`}; disable: {`no lldp run`}
  • Interface control: enable/disable transmit ({`lldp transmit`} / {`no lldp transmit`}) and receive ({`lldp receive`} / {`no lldp receive`}) separately
  • Default timers: 30s advertisement, 120s holdtime
    • Adjust with {`lldp timer [seconds]`}, {`lldp holdtime [seconds]`}
    • Reinit delay: {`lldp reinit [seconds]`}

LLDP-MED (Media Endpoint Discovery)

  • Extension of LLDP (TIA-1057) for endpoint devices (e.g., IP phones)

  • Uses TLVs for modular information exchange

    • Key functions:
      • Voice VLAN discovery (advertises voice VLAN to phones)
      • Power over Ethernet (PoE) negotiation
      • Inventory and location information
  • Supported by Cisco and non-Cisco IP phones (non-Cisco use LLDP-MED exclusively)

More from Network management and administering network devices

  • Remote access to network devices using Telnet and Secure Shell (SSH)
  • Syslog
  • Simple Network Management Protocol (SNMP)