📘 CCNA 200-301 v1.1
2.3 Configure and verify Layer 2 discovery protocols (Cisco Discovery Protocol and LLDP)
1. What are Layer 2 Discovery Protocols?
Layer 2 Discovery Protocols are network protocols that help network devices identify and learn about directly connected devices.
They allow switches, routers, IP phones, and other network devices to share basic information with their neighbors automatically.
These protocols work at Layer 2 (Data Link Layer) of the OSI model, so they do not require IP addresses to operate — they use frames, not packets.
🔹 2. Purpose of Discovery Protocols in IT Networks
In real IT networks, engineers use discovery protocols to:
- Find out which devices are connected to each switch port.
- Troubleshoot network connections.
- Document or verify network topology.
- Identify device types and interfaces automatically (for example, Cisco IP phones connected to switches).
They help in day-to-day network operations by making network discovery and maintenance easier.
🔹 3. Two Discovery Protocols You Must Know
There are two main Layer 2 discovery protocols for the CCNA exam:
| Protocol | Full Name | Vendor | Default Enabled | Layer | Standard |
|---|---|---|---|---|---|
| CDP | Cisco Discovery Protocol | Cisco proprietary | Yes (on Cisco devices) | Layer 2 | Proprietary |
| LLDP | Link Layer Discovery Protocol | Open standard (IEEE 802.1AB) | No (must be enabled manually) | Layer 2 | IEEE 802.1AB |
🔹 4. Cisco Discovery Protocol (CDP)
a. Definition:
CDP is a Cisco proprietary Layer 2 protocol that is used by Cisco devices (like switches, routers, IP phones) to share information with other Cisco devices directly connected on the same network segment.
b. Information shared by CDP:
Each Cisco device advertises the following details to its neighbors:
| Information | Description |
|---|---|
| Device ID | Hostname of the device |
| IP Address | Management or interface IP |
| Port ID | Interface used for connection |
| Platform | Device type/model (e.g., Cisco 2960) |
| Capabilities | Whether it’s a router, switch, phone, etc. |
| Software version | IOS version running |
c. CDP Operation:
- CDP sends advertisements (CDP packets) every 60 seconds by default.
- Devices store the received information in a CDP neighbor table.
- Each CDP entry has a holdtime (default 180 seconds) — if no new CDP message is received before the timer expires, that neighbor is removed from the table.
d. CDP Configuration Commands
➤ Enable CDP (Globally)
Switch(config)# cdp run
➤ Disable CDP (Globally)
Switch(config)# no cdp run
➤ Enable/Disable CDP on an Interface
Switch(config-if)# cdp enable
Switch(config-if)# no cdp enable
e. CDP Verification Commands
| Command | Description |
|---|---|
show cdp | Shows CDP status (enabled/disabled, timer values) |
show cdp neighbors | Lists all directly connected Cisco neighbors |
show cdp neighbors detail | Shows detailed info (IP, IOS version, platform, capabilities) |
show cdp interface | Displays interfaces where CDP is active |
f. CDP Example Output
Switch# show cdp neighbors
Device ID Local Intf Holdtime Capability Platform Port ID
R1 Fa0/1 141 R S I 2811 Fa0/0
Explanation:
- Device ID: R1 (neighbor’s hostname)
- Local Intf: Fa0/1 (your switch interface)
- Port ID: Fa0/0 (neighbor’s interface)
- Platform: Cisco 2811 router
- Capability: Router, Switch, IP (R S I)
g. Security Consideration:
CDP can reveal detailed device information (like model, software version), which can be misused if attackers connect to the network.
👉 Therefore, disable CDP on interfaces not used for network management (like user-facing ports or internet connections).
🔹 5. Link Layer Discovery Protocol (LLDP)
a. Definition:
LLDP (Link Layer Discovery Protocol) is an open-standard discovery protocol defined in IEEE 802.1AB.
It works similarly to CDP but can be used between different vendors (e.g., Cisco switch and HP switch).
b. LLDP Information Shared:
Like CDP, LLDP advertises:
- Device name (System name)
- Port ID
- Port description
- System capabilities
- Management IP address
c. LLDP Operation:
- LLDP frames are sent every 30 seconds by default.
- Each device maintains an LLDP neighbor table.
- Holdtime (time neighbor entry remains valid): 120 seconds by default.
d. LLDP Configuration Commands
➤ Enable LLDP (Globally)
Switch(config)# lldp run
➤ Disable LLDP (Globally)
Switch(config)# no lldp run
➤ Enable/Disable LLDP on Interface
Switch(config-if)# lldp transmit
Switch(config-if)# lldp receive
Switch(config-if)# no lldp transmit
Switch(config-if)# no lldp receive
(You can choose to only send, only receive, or both.)
e. LLDP Verification Commands
| Command | Description |
|---|---|
show lldp | Displays LLDP global status |
show lldp neighbors | Lists LLDP neighbors |
show lldp neighbors detail | Shows detailed info including system name, IP, capabilities |
show lldp interface | Displays interfaces with LLDP enabled |
f. Example Output
Switch# show lldp neighbors
Device ID Local Intf Holdtime Capability Port ID
HP-Switch1 Gi0/1 110 B,R Gi0/24
Explanation:
- Device ID: HP-Switch1 (neighbor’s hostname)
- Local Intf: Gi0/1 (your switch interface)
- Capability: Bridge (Switch), Router
- Port ID: Gi0/24 (neighbor’s interface)
🔹 6. CDP vs LLDP (Comparison Table)
| Feature | CDP | LLDP |
|---|---|---|
| Type | Cisco proprietary | IEEE 802.1AB (open standard) |
| Supported Devices | Cisco only | Cisco + other vendors |
| Default Status on Cisco | Enabled | Disabled |
| Timer (advertisement) | 60 seconds | 30 seconds |
| Holdtime | 180 seconds | 120 seconds |
| Commands | cdp run / no cdp run | lldp run / no lldp run |
| Interface control | cdp enable / no cdp enable | lldp transmit/receive |
| Works at | Layer 2 (Data Link) | Layer 2 (Data Link) |
🔹 7. Practical Use in IT Networks
- Network Mapping: Automatically identify connections between routers, switches, and IP phones.
- VoIP Networks: Switches use CDP/LLDP to detect IP phones and assign correct VLANs (e.g., voice VLANs).
- Troubleshooting: If a link goes down, you can use
show cdp neighborsorshow lldp neighborsto confirm what device is (or was) connected to that interface. - Multi-vendor environments: LLDP ensures interoperability between different vendor devices.
🔹 8. Common Exam Tips
✅ CDP is enabled by default on Cisco devices; LLDP is not — you must enable LLDP manually.
✅ Both operate at Layer 2 and do not require IP addresses.
✅ Remember CDP timer = 60s, Holdtime = 180s, and LLDP timer = 30s, Holdtime = 120s.
✅ Disable CDP/LLDP on untrusted or user-facing interfaces for security.
✅ Know how to verify neighbors and interpret output in exam simulations.
🔸 Summary
| Key Point | Description |
|---|---|
| Purpose | Discover directly connected devices on the same Layer 2 network |
| Protocols | CDP (Cisco only), LLDP (multi-vendor) |
| Layer | Data Link (Layer 2) |
| Use Cases | Troubleshooting, network mapping, VoIP configuration |
| Exam Focus | Commands, output interpretation, differences, timers, and security practices |
