What are CDP and LLDP, and how do they differ?
Show the answer
Say this first
Both are one-way layer 2 discovery protocols: a device advertises its name, port, platform, addresses
and capabilities, and each neighbor caches it. CDP is Cisco proprietary, sent every 60 seconds with a
180-second holdtime to 0100.0ccc.cccc. LLDP is IEEE 802.1AB, sent every 30 seconds with a 120-second
TTL to 0180.c200.000e, EtherType 0x88CC. I use LLDP in multi-vendor networks and turn both off on
untrusted ports.
Go deeper
Side by side
| CDP | LLDP | |
|---|---|---|
| Standard | Cisco | IEEE 802.1AB |
| Timer / hold | 60 s / 180 s | 30 s / 120 s (4 x 30) |
| Destination MAC | 0100.0ccc.cccc | 0180.c200.000e |
| Default on Cisco IOS | On | Off until lldp run |
| Phones | Voice VLAN, power | LLDP-MED: network policy, power, location |
LLDP has four mandatory TLVs (chassis ID, port ID, TTL, end) and optional ones such as system name,
port description, capabilities and management address. CDPv2 also carries native VLAN and duplex, and
logs %CDP-4-NATIVE_VLAN_MISMATCH and %CDP-4-DUPLEX_MISMATCH when neighbors disagree.
Defaults elsewhere
NX-OS runs CDP by default and needs feature lldp. Arista EOS and Junos on EX switches run LLDP by default.
Configuration
lldp run
interface GigabitEthernet1/0/1
no cdp enableSW1# show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW2 Gig 1/0/48 157 S I C9300-48P Gig 1/0/48They will ask next
How does an IP phone learn its voice VLAN?
A Cisco phone reads it from CDP. Other phones read the LLDP-MED network policy TLV, which carries the VLAN plus the CoS and DSCP to use. On a mixed fleet you run both on phone ports.
Why disable them on edge or internet-facing ports?
They hand out platform, software version and management IP to anyone listening, which is free reconnaissance. Keep them on infrastructure links and phone ports.
Traps
- Saying LLDP needs a reply from the neighbor. Neither protocol has requests or acknowledgments.
- Assuming LLDP is on by default on Cisco IOS. It is off until
lldp run.