Protocol 9 of 81Layer 2FrameAssembly v3.3.0
Raw .mdllms-full.txt
cdpCisco Discovery Protocol v2 (IEEE 802.3 LLC/SNAP)

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
Wire Stack:Ethernet IICisco CDP v2 (802.3 SNAP 0x2000)
L2 Tagging: vlan · qinq · repeatable mpls · fcsHost Family: MAC-Only or IPL3 QoS & TTL: N/A (Pure L2)L4 State: L2 Ethernet

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.

01. Application

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.

02. Application

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.

03. Application

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.

Fig. 1 · RFC Octet & Bit Schematic

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.

0 ··············· 15 · 16 ··············· 31 bit
Selected Wire Segment
Cisco CDP v2 Wire PDU & Payload (Variable)
Controlling .frasm Modifiers
cdp version · ttl · deviceid · addr · portid · payload · hexpayload
Compiler Default Behavior
RFC-compliant Cisco CDP v2 defaults (Cisco CDP v2)

Minimal Quickstart (cdp_quickstart.frasm)

Select Preview Packets to compile in-browser and inspect timestamps + wire byte lengths, or open directly in the Playground.

cdp_quickstart.frasm6 lines
Open in 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 MAC 01:00:0c:cc:cc:cc when dstmac is 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.
Multi-Frame Example

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.

cdp_trunk_neighbors.frasm9 lines
Open in Playground
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
}
Terminal Commands (FrameAssembly CLI v3.3.0)
# 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 / OptionAccepted ValueDefaultEffect on Packet
version <0..255>Whole number (0..255)2Sets 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)180Sets 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 literalSource host IP when presentEncodes 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 bitmask0x00000028 (Switch + IGMP)Encodes TLV 0x0004 (0x01 Router, 0x08 Switch, 0x10 Host, 0x20 IGMP, 0x80 VoIP Phone).
swversion "<text>"Quoted textOmitted unless setEncodes 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 setEncodes 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
OptionRange / FormatDefaultEffect on Packet
wait <number><ns|us|ms|s|m>Time gap (ns, us, ms, s, m)10msAdvances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back).
comment "<text>"Quoted UTF-8 annotationOmittedAttaches 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)OmittedAppends 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 EtherTypeOverrides the 14-byte Ethernet II source MAC, destination MAC, or standalone Layer 2 16-bit EtherType.
fcs | badfcsEthernet CRC-32 trailer flags (choose one)Omittedfcs 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..1UntaggedWraps 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..4095Untagged (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

Rejected
sw1 -> sw2 cdp native_vlan 10
Valid v3.3.0 Syntax
sw1 -> sw2 cdp nativevlan 10 vlan 10

nativevlan 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)

Rejected
sw1 -> sw2 cdp ttl 600
Valid v3.3.0 Syntax
sw1 -> sw2 cdp ttl 180

Unlike 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).

Field Guide 07
Physical Hardware Labs: Blasting .pcap Captures onto Copper & Fiber