cdp — Cisco Discovery Protocol v2 LLC/SNAP Neighbor Frames
- Default Port / Protocol
- 802.3 SNAP 0x2000
- Host Endpoint Rule
- MAC-Only or IP
- Wireshark Display Filter
- cdp
- Standards & Specs
- Cisco CDP v2, IEEE 802.2 LLC/SNAP
What It Does on the Wire
Because half the campus closet still speaks fluent Cisco 01:00:0c:cc:cc:cc over 802.3 LLC/SNAP 0x2000: cdp packs Device ID, Port ID, Platform, and Native VLAN mismatch TLVs with exact big-endian checksums.
Cisco Discovery Protocol (cdp) advertises neighbor identity, hardware platform, IOS/NX-OS software version, management IP addresses, port capabilities, and native VLAN mismatches over IEEE 802.3 LLC/SNAP (DSAP=0xaa, SSAP=0xaa, Ctrl=0x03, Cisco OUI 00:00:0c, Protocol ID 0x2000) to multicast destination MAC 01:00:0c:cc:cc:cc.
FrameAssembly encodes complete CDP v2 TLV sequences (0x0001 Device ID, 0x0002 Addresses, 0x0003 Port ID, 0x0004 Capabilities, 0x0005 Software Version, 0x0006 Platform, and 0x000a Native VLAN) and computes the 16-bit RFC 1071 CDP header checksum automatically over MAC-only or IP-enabled switch endpoints.
Native VLAN Mismatch & Trunk Audit Reproduction
Emit paired cdp frames with conflicting nativevlan TLVs across switch ports to test NOC syslog parsers, NetBox topology discovery scripts, and Wireshark trunk audits.
Information-Disclosure & Rogue Switch Detection Rules
Generate cdp advertisements carrying specific swversion, platform, and capabilities bitmasks to validate Suricata/Zeek Layer 2 recon and CDP-flooding signatures.
VoIP Desk Phone & Campus Access Switch Lab Fixtures
Simulate Cisco Catalyst and Nexus neighbor tables alongside lldp and vlan frames without powering physical rack switches.
RFC Wire Header Layout (cdp)
Select any 32-bit wire word or field slice below to inspect which .frasm modifiers control those octets and what defaults the compiler writes.
Minimal Quickstart (cdp_quickstart.frasm)
Select Preview Packets to compile in-browser and inspect timestamps + wire byte lengths, or open directly in the Playground.
host access_sw { mac 00:1b:21:aa:00:01 }
host core_sw { mac 00:1b:21:bb:00:02 }
compile {
access_sw -> core_sw cdp deviceid "access-sw-01" portid "Gi1/0/48" platform "C9300-48P" nativevlan 10
}Handled Automatically on the Wire
- Encapsulates the frame in IEEE 802.3 length framing + 8-byte LLC/SNAP header (
aa:aa:03:00:00:0c:20:00) and targets Cisco multicast MAC01:00:0c:cc:cc:ccwhendstmacis omitted. - Serializes big-endian 16-bit Type + 16-bit Length TLV headers for every configured attribute (
deviceid,addr,portid,capabilities,swversion,platform,nativevlan). - Calculates the 16-bit ones'-complement CDP checksum across the entire CDP header and TLV payload.
Bidirectional Catalyst-to-Nexus Trunk Discovery & Native VLAN Check
Captures two switches exchanging CDP v2 neighbor advertisements with management IPv4 addresses, Router/Switch capability flags, and a Native VLAN 99 trunk tag.
host dist_nxos { ip 10.20.0.1 mac 00:2a:6a:10:00:01 }
host edge_ios { ip 10.20.0.2 mac 00:1c:73:20:00:02 }
compile {
// 1. Distribution Nexus switch advertises capabilities 0x29 (Router + Switch + IGMP)
dist_nxos -> edge_ios cdp version 2 ttl 180 deviceid "dist-n9k-01.corp" addr 10.20.0.1 portid "Ethernet1/1" capabilities 0x29 platform "N9K-C93180YC-FX" swversion "NX-OS 10.4(2)" nativevlan 99 wait 5ms
// 2. Access Catalyst switch replies with matching Native VLAN 99
edge_ios -> dist_nxos cdp version 2 ttl 180 deviceid "edge-c9300-04.corp" addr 10.20.0.2 portid "TenGigabitEthernet1/1/1" capabilities 0x28 platform "C9300-48U" swversion "IOS-XE 17.12.3" nativevlan 99
}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show cdp_trunk_neighbors.frasm
# 2. Compile .frasm -> classic .pcap, nanosecond .pcapng, or pipe via '-'
frameassembly cdp_trunk_neighbors.frasm cdp_trunk_neighbors.pcap
frameassembly cdp_trunk_neighbors.frasm cdp_trunk_neighbors.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse cdp_trunk_neighbors.pcap cdp_trunk_neighbors_edited.frasm
# 4. Verify dissected protocol fields in tshark
tshark -r cdp_trunk_neighbors.pcap -Y "cdp"All cdp Keywords & Header Options
Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after cdp:
src_host -> dst_host cdp [version <0..255>] [ttl <0..255>] [deviceid "<text>"] [addr <ip>] [portid "<text>"] [capabilities <number>] [swversion "<text>"] [platform "<text>"] [nativevlan <0..65535>]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| version <0..255> | Whole number (0..255) | 2 | Sets the 8-bit CDP Version byte (2 for CDP v2 rapid TLV extensions; 1 for legacy CDPv1). |
| ttl <0..255> | Holdtime in seconds (0..255) | 180 | Sets the 8-bit CDP Time-To-Live (neighbor holdtime in seconds) inside the 4-byte CDP header. |
| deviceid "<text>" | Quoted text or identifier | "switch" | Encodes TLV 0x0001 (Device-ID hostname string). |
| addr <ip> | IPv4 or IPv6 literal | Source host IP when present | Encodes TLV 0x0002 (Management Address list entry with NLPID protocol header). |
| portid "<text>" | Quoted text or interface name | "GigabitEthernet0/1" | Encodes TLV 0x0003 (outgoing interface name such as "Gi1/0/48"). |
| capabilities <number> | 32-bit capability bitmask | 0x00000028 (Switch + IGMP) | Encodes TLV 0x0004 (0x01 Router, 0x08 Switch, 0x10 Host, 0x20 IGMP, 0x80 VoIP Phone). |
| swversion "<text>" | Quoted text | Omitted unless set | Encodes TLV 0x0005 (NOS release banner string). |
| platform "<text>" | Quoted text | "Cisco" | Encodes TLV 0x0006 (hardware chassis model string such as "C9300"). |
| nativevlan <0..65535> | VLAN ID (0..4095) | Omitted unless set | Encodes TLV 0x000a (16-bit Native VLAN ID for trunk mismatch detection). |
Cross-Layer Wrappers Valid with cdp
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
8 options
Cross-Layer Wrappers Valid with cdp
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
| Option | Range / Format | Default | Effect on Packet |
|---|---|---|---|
| wait <number><ns|us|ms|s|m> | Time gap (ns, us, ms, s, m) | 10ms | Advances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back). |
| comment "<text>" | Quoted UTF-8 annotation | Omitted | Attaches an Enhanced Packet Block opt_comment annotation when compiling to .pcapng (Wireshark pkt_comment filter). |
| payload "<text>" | hexpayload "<hex>" | Quoted text or hex bytes (choose one) | Omitted | Appends or overrides raw payload bytes ("deadbeef", "de:ad:be:ef", or "\x01\x02") and updates packet lengths and checksums. |
| srcmac <mac> | dstmac <mac> | ethertype <0..65535> | Colon/hyphen/Cisco MAC · EtherType 0..65535 (e.g. 0x0800) | Host MAC / RFC multicast MAC / auto EtherType | Overrides the 14-byte Ethernet II source MAC, destination MAC, or standalone Layer 2 16-bit EtherType. |
| fcs | badfcs | Ethernet CRC-32 trailer flags (choose one) | Omitted | fcs appends a valid IEEE 802.3 4-byte CRC-32 Frame Check Sequence trailer; badfcs XOR-corrupts the CRC-32 for NIC/tap negative tests. |
| vlan <0..4095> [pcp <0..7>] [dei <0|1>] | VLAN ID 0..4095, PCP 0..7, DEI 0..1 | Untagged | Wraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority. |
| qinq <0..4095> [innervlan <0..4095>] | Outer S-VLAN 0..4095, Inner C-VLAN 0..4095 | Untagged (innervlan 1 when qinq is set) | Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100). |
| mpls <0..1048575> [label <0..1048575>] [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>] | Repeatable label stack (0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255) | Unlabeled (auto bos=0 on outer labels, bos=1 on bottom) | Prepends one or more 32-bit MPLS label shims (0x8847, e.g. mpls 16000 mpls 24010) ahead of Layer 2 EoMPLS or Layer 3 payloads. |
Gotchas & Quick Fixes
Use nativevlan for the CDP TLV vs vlan for Outer 802.1Q Tagging
sw1 -> sw2 cdp native_vlan 10sw1 -> sw2 cdp nativevlan 10 vlan 10nativevlan 10 writes CDP TLV 0x000a inside the CDP payload, whereas cross-layer vlan 10 wraps the outer Ethernet frame in an IEEE 802.1Q tag.
CDP ttl Is an 8-Bit Holdtime (0..255 Seconds)
sw1 -> sw2 cdp ttl 600sw1 -> sw2 cdp ttl 180Unlike lldp (which carries a 16-bit TTL TLV up to 65535), the CDP header Holdtime field is a single byte (0..255 seconds, Cisco default 180).
Companion Guides & Neighboring Protocols
.pcap Captures onto Copper & Fiber