Protocol 4 of 81Layer 2FrameAssembly v3.1.2
llms-full.txt
lldpIEEE 802.1AB Link Layer Discovery Protocol

Fake a Neighboring Switch (sw1 -> sw2 lldp) Without Hauling Sheet Metal

Default Port / Protocol
EtherType 0x88cc
Host Endpoint Rule
MAC-Only or IP
Wireshark Display Filter
lldp
Standards & Specs
IEEE 802.1AB
Wire Stack:Ethernet IILLDP (EtherType 0x88cc)

What It Does on the Wire

Want your NMS or test bench to think a 400G core chassis is plugged into Gi0/1? One sw -> peer lldp frame advertises Chassis ID, Port ID, TTL, and System Name TLVs to 01:80:c2:00:00:0e.

Link Layer Discovery Protocol (lldp) is the vendor-neutral IEEE 802.1AB neighbor discovery protocol sent over Ethernet II (0x88cc) to the bridge multicast MAC 01:80:c2:00:00:0e. Switches, routers, hypervisors, and VoIP phones advertise their hostname and interface port via Type-Length-Value (TLV) fields.

FrameAssembly builds a complete IEEE 802.1AB LLDPDU—Chassis ID (TLV 1), Port ID (TLV 2), Time-To-Live (TLV 3), optional System Name (TLV 5) and System Description (TLV 6), plus the required End of LLDPDU marker (TLV 0)—from a single line.

Topology Discovery & NMS Inventory Parsers

Feed deterministic multi-vendor sysname and sysdesc LLDP captures into NetBox, LibreNMS, Checkmk, or custom topology crawlers.

Passive Recon & Rogue Device Detection Rules

Test Zeek/Suricata OT and enterprise asset-discovery rules that alert when unexpected OS strings appear in sysdesc TLVs on access ports.

LLDP Shutdown / Fast-Expire Testing (ttl 0)

Emit lldp ttl 0 shutdown LLDPDUs to verify switch neighbor-table aging and fast topology convergence.

Minimal Quickstart (lldp_quickstart.frasm)

Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.

lldp_quickstart.frasm6 lines
Open in Playground
host leaf_sw { mac 00:1c:73:aa:01:01 }
host spine_sw { mac 00:1c:73:bb:02:01 }
compile {
leaf_sw -> spine_sw lldp
}

What the Compiler Calculates So You Don't Have To

  • Sets Ethernet II EtherType to 0x88cc and defaults the destination MAC to IEEE nearest-bridge multicast 01:80:c2:00:00:0e.
  • Encodes TLV 1 (Chassis ID, subtype 4 MAC or 7 Locally Assigned), TLV 2 (Port ID, subtype 5 Interface Name), and TLV 3 (16-bit ttl, default 120 seconds) with exact 7-bit type + 9-bit length bitfields.
  • Appends TLV 5 (sysname) and TLV 6 (sysdesc) when specified, always terminating with the 2-byte End of LLDPDU (0x0000).
Multi-Frame Lab · Ready to Compile

Bidirectional Leaf-Spine LLDP Neighbor Exchange Plus Shutdown Frame

Captures mutual LLDP advertisements between an Arista-class spine and an access switch, followed by an IEEE 802.1AB ttl 0 neighbor withdrawal frame.

lldp_leaf_spine.frasm9 lines
Open in Playground
host leaf_01 { mac 00:1c:73:11:22:01 }
host spine_01 { mac 00:1c:73:99:88:01 }
compile {
leaf_01 -> spine_01 lldp chassisid "leaf-01.dc1" portid "Ethernet49/1" ttl 120 sysname "leaf-01.dc1.internal" sysdesc "EOS 4.32.1F" wait 5ms
spine_01 -> leaf_01 lldp chassisid "spine-01.dc1" portid "Ethernet1/1" ttl 120 sysname "spine-01.dc1.internal" sysdesc "EOS 4.32.1F" wait 10ms
// Graceful LLDP port shutdown advertisement (TTL = 0)
leaf_01 -> spine_01 lldp chassisid "leaf-01.dc1" portid "Ethernet49/1" ttl 0
}
Terminal Commands (FrameAssembly CLI v3.1.2)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show lldp_leaf_spine.frasm

# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly lldp_leaf_spine.frasm lldp_leaf_spine.pcap
frameassembly lldp_leaf_spine.frasm lldp_leaf_spine.pcapng

# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse lldp_leaf_spine.pcap lldp_leaf_spine_edited.frasm

All lldp 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 lldp:

src_host -> dst_host lldp [chassisid "<text>"] [portid "<text>"] [ttl <0..65535>] [sysname "<text>"] [sysdesc "<text>"]
Keyword / OptionAccepted ValueDefaultEffect on Packet
chassisid "<text>"Quoted string or identifier"switch"Encodes Mandatory TLV Type 1 (Chassis ID) with Locally Assigned subtype.
portid <str|u16>Interface string or port number"eth0"Encodes Mandatory TLV Type 2 (Port ID, e.g. "Gi1/0/48" or "Ethernet1").
ttl <0..65535>Whole number (0..65535) (seconds)120Encodes Mandatory TLV Type 3 (Time To Live in seconds; 0 signals neighbor entry deletion). Note: on lldp, ttl sets the 16-bit LLDP Hold TTL rather than an IPv4 TTL.
sysname "<text>"Quoted string or identifierOmitted unless setAppends Optional TLV Type 5 (System Name).
sysdesc "<text>"Quoted stringOmitted unless setAppends Optional TLV Type 6 (System Description).

Cross-Layer Wrappers Valid with lldp

802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol

6 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).
payload "<text>" | hexpayload "<hex>"Quoted text or hex bytes (choose one)OmittedAppends or overrides raw payload bytes ("deadbeef" or "de:ad:be:ef") and updates packet lengths and checksums.
srcmac <mac> | dstmac <mac>Colon, hyphen, or Cisco dot MACHost MAC / RFC multicast MACOverrides the 14-byte Ethernet II source or destination MAC address for this single packet.
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> [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>]Label 0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255Unlabeled (at most 1 mpls tag per packet)Inserts a 32-bit MPLS label header (0x8847) ahead of the Layer 3 header.

Gotchas & Quick Fixes

Contextual ttl Meaning on lldp

Valid v3.1.2 Syntax
sw1 -> sw2 lldp chassisid "sw1" portid "eth1" ttl 180

Because lldp is a pure Layer 2 protocol with no IP header, ttl sets the 16-bit LLDP Time-To-Live TLV (0..=65535 seconds, allowing values > 255 such as ttl 300), not an 8-bit IPv4 TTL.

Quote Interface Names Containing Slashes

Avoid
sw1 -> sw2 lldp portid Gi1/0/48
Valid v3.1.2 Syntax
sw1 -> sw2 lldp portid "Gi1/0/48"

Slash characters (/) are not part of bare identifiers—always wrap interface names like "Gi1/0/48" or "Ethernet49/1" in double quotes.

Field Guide 07
Physical Hardware Labs: Blasting .pcap Captures onto Real Copper & Fiber (tcpreplay)