Configuring and Verifying Layer 2 Discovery Protocols

In this section, we will describe configuring and verifying Layer 2 discovery protocols (CDP & LLDP). Layer 2 discovery protocols are the data link layer protocols that are used by network devices to discover information about neighbouring devices within the same local area network. The key layer 2 discovery protocols are –

  • CDP (Cisco Discovery Protocol) – Cisco proprietary
  • LLDP (Link Layer Discovery Protocol) – Vendor-neutral (IEEE 802.1AB)

Both protocols operate in similar way, although they are vendor specific.


Introduction to Layer 2 Discovery Protocol

Layer 2 Discovery Protocols are special network protocols used by devices within the same local area network (LAN) to advertise and discover information about each other. They operate at the Data Link Layer (Layer 2) of the OSI model and allow devices such as switches, routers, and access points to share details like device ID, port ID, VLAN information, IP addresses, and system capabilities.

Some common Layer 2 Discovery Protocols include:

  • CDP (Cisco Discovery Protocol): Cisco proprietary protocol.
  • LLDP (Link Layer Discovery Protocol): IEEE standard, vendor-neutral protocol.

By using these protocols, network devices can automatically learn about their neighbours, simplifying tasks like verifying connections, detecting misconfigurations, and monitoring device roles.


Cisco Discovery Protocol (CDP)

Definition:
Cisco Discovery Protocol (CDP) is a proprietary Layer 2 protocol developed by Cisco. It allows Cisco devices, such as routers and switches, to automatically share and discover information about directly connected Cisco devices, even if they are running different network layer protocols.

Key Features of CDP

  1. Layer 2 Protocol: It works at the Data Link Layer (Layer 2) of OSI Model, so it does not depend on IP or any other Layer 3 protocol.
  2. Cisco Proprietary: It is supported only on Cisco devices (though some third-party devices may interpret CDP information).
  3. Hello Packets: Devices send CDP packets (hello messages) periodically to share information.
  4. Advertisement Content: CDP messages include important details such as:
    • Device ID (hostname of the device)
    • Port ID (interface used to send the CDP message)
    • IP address of the device
    • Capabilities (switch, router, bridge, phone, etc.)
    • Platform (hardware model and version)
    • VLAN and Duplex information (in some cases)
  5. Neighbor Discovery: CDP helps network administrators identify directly connected Cisco devices, even if IP configuration is missing or misconfigured.

Benefits of CDP

  • CDP simplifies network troubleshooting like identifying incorrect cabling or duplex mismatches.
  • It provides network topology details without logging into every device.
  • It helps in verifying VoIP phone connectivity (since Cisco IP Phones use CDP to learn about VLANs and power requirements).

Configuring and Verifying CDP (Layer 2 Discovery Protocol)

  • Enable CDP (globally):
    • Router(config)# cdp run
  • Disable CDP (globally):
    • Router(config)#no cdp run
  • Enable/Disable CDP on an interface:
    • Router(config-if) #cdp enable Router(config-if)# no cdp enable
  • Show CDP neighbors:
    • Router# show cdp neighbors
  • Show detailed neighbor info:
    • Router# show cdp neighbors detail
  • Shows CDP status per interface:
    • Router# show cdp interface
  • Displays CDP packet statistics:
    • Router#show cdp traffic
  • Adjust CDP Timers:
    • Router(config)# cdp timer 60 //Updates sent every 60 sec (default: 90)
    • Router(config)# cdp holdtime 180 //Holds info for 180 sec (default: 240)

Link Layer Discovery Protocol (LLDP)

Definition:
LLDP (Link Layer Discovery Protocol) is an open standard Layer 2 discovery protocol defined by IEEE 802.1AB. Unlike Cisco Discovery Protocol (CDP), which is proprietary, LLDP is vendor-neutral and supported by many networking vendors (Cisco, HP, Juniper, etc.). It enables network devices to advertise and discover information about directly connected neighbors, making it useful in multi-vendor environments.

Key Features of LLDP

  1. Standards-Based: LLDP is defined by IEEE 802.1AB, ensuring interoperability across different vendors.
  2. Layer 2 Protocol: It works at the Data Link Layer of the OSI model, independent of IP addressing.
  3. Advertisement Messages: Devices send LLDP advertisements (similar to CDP hello packets) to share information.
  4. Information Shared in LLDP packets:
    • Device ID (hostname or chassis ID)
    • Port ID (the interface sending the LLDP message)
    • System Name and Description (OS, software version)
    • Management IP address
    • Capabilities (bridge, router, WLAN AP, phone, etc.)
    • VLAN information (optional via LLDP-MED extension)
  5. LLDP-MED (Media Endpoint Discovery): An extension for voice over IP (VoIP) devices, providing extra information such as VLAN, power requirements, and QoS settings.

Benefits of LLDP

  • LLDP is open source and works in multi-vendor networks, unlike CDP which is Cisco-only.
  • It simplifies network troubleshooting and topology mapping.
  • It is useful in VoIP deployments (via LLDP-MED).
  • It provides detailed device information without requiring Layer 3 configuration.

Configuring and Verifying LLDP (Layer 2 Discovery Protocol)

  • Enable LLDP (globally):
    • Switch(config)# lldp run
  • Disable LLDP (globally):
    • Switch(config)# no lldp run
  • Enable LLDP on an interface:
    • Switch(config-if)# lldp transmit Switch(config-if)# lldp receive
  • Disable LLDP on an interface:
    • Switch(config-if)# no lldp transmit Switch(config-if)# no lldp receive
  • Show LLDP neighbors:
    • Switch# show lldp neighbors
  • Detailed neighbor info:
    • Switch# show lldp neighbors detail
  • Shows LLDP status per interface
    • Shows LLDP status per interface
  • Displays LLDP packet stats:
    • show lldp traffic
  • Adjust LLDP timers:
    • Switch(config)# lldp timer 30 //Updates every 30 sec (default: 30)
    • Switch(config)# lldp holdtime 120 //Holds info for 120 sec (default: 120)

CDP vs. LLDP Comparison

FeatureCDPLLDP
Vendor SupportVendor Specific, Cisco-proprietaryMulti-vendor (IEEE 80.1AB Standard)
Configuration StatusEnabled by default on most Cisco devices; requires configuration for specific functionalities Not enabled by default on all devices;
must be enabled and configured on devices.
EncapsulationLayer 2 (SNAP)Ethernet II
Information ExchangeDevice ID, port ID, capabilities, software version, platform, IP address, VLAN information, etc.Device ID, port ID, capabilities, system name, system description, system capabilities, management address, etc.
Security RiskCan be a security risk if not properly managed due to the detailed information it providesCan be a security risk if not properly managed due to the detailed information it provides
Protocol ExtensionsSupports extensions specific to Cisco devicesSupports LLDP-MED for enhanced network device discovery
ApplicationBest suited for Cisco-dominated environmentsSuitable for diverse, multi-vendor network environments

Conclusion

Layer 2 discovery protocols are essential tools for network visibility and operational efficiency, provided they are implemented securely and appropriately within a network’s design and policy frameworks. Both CDP and LLDP are used network devices for discovering information about neighbouring devices within the same local area network.

3 thoughts on “Configuring and Verifying Layer 2 Discovery Protocols”

  1. whoah this weblog is fantastic i really like studying your posts. Keep up the great paintings! You know, many people are looking around for this info, you can help them greatly.

  2. Нейросетевые онлайн-сервисы для анализа данных становятся всё более удобными.
    Они позволяют собирать открытые данные из разных источников.
    Такие инструменты подходят для аналитики.
    Они способны оперативно систематизировать большие объёмы контента.
    тг бот глаз бога официальный
    Это помогает сформировать более точную картину событий.
    Многие системы также включают удобные отчёты.
    Такие боты широко используются среди исследователей.
    Развитие технологий позволяет сделать поиск информации более точным и наглядным.

Comments are closed.