Protocol 10 of 81Layer 3FrameAssembly v3.1.2
llms-full.txt
ndpIPv6 Neighbor Discovery Protocol

IPv6 Neighbor Discovery & Rogue Router Advertisements (ndp)

Default Port / Protocol
ICMPv6 NextHdr 58 (Hop Limit 255)
Host Endpoint Rule
IPv6-Only
Wireshark Display Filter
icmpv6.type >= 133 && icmpv6.type <= 137
Standards & Specs
RFC 4861
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv6IPv6 NDP (ICMPv6 NextHdr 58 (Hop Limit 255))

What It Does on the Wire

IPv6 threw ARP in the bin and replaced it with ICMPv6 Neighbor Discovery at Hop Limit 255. ndp builds neighborsolicit, neighboradvert, and rogue routeradvert frames to test switch RA Guard.

IPv6 Neighbor Discovery Protocol (ndp) replaces IPv4 ARP, ICMP Router Discovery, and ICMP Redirect with five ICMPv6 message types (133..137) carried over IPv6 Next Header 58. Per RFC 4861, routers and hosts validate that incoming NDP packets arrive with IPv6 Hop Limit 255 so off-link spoofing attempts are dropped immediately.

FrameAssembly defaults ndp Hop Limit (ttl) to 255, encodes Source and Target Link-Layer Address options (slla Type 1, tlla Type 2) padded to 8-octet boundaries, and computes the full IPv6 pseudo-header checksum automatically.

IPv6 RA Guard & Rogue Router Advertisement Testing

Emit ndp routeradvert routerlifetime 1800 frames on access VLANs to verify switch IPv6 RA Guard policies drop unauthorized SLAAC gateways.

Duplicate Address Detection (DAD) & Neighbor Cache Verification

Craft neighborsolicit and neighboradvert exchanges with explicit target, slla, and tlla MACs to test IPv6 First-Hop Security (ND Inspection).

Off-Link Hop-Limit Spoofing Negative Tests

Override ttl 64 on an ndp neighboradvert packet to verify host stacks and Suricata RFC 4861 rules flag non-255 NDP packets.

Minimal Quickstart (ndp_quickstart.frasm)

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

ndp_quickstart.frasm7 lines
Open in Playground
host host_v6 { ip 2001:db8:cafe::25 mac 00:1b:21:aa:00:25 }
host router_v6 { ip 2001:db8:cafe::1 mac 00:1c:73:bb:00:01 }
compile {
host_v6 -> router_v6 ndp neighborsolicit target 2001:db8:cafe::1 slla 00:1b:21:aa:00:25 wait 1ms
host_v6 <- router_v6 ndp neighboradvert target 2001:db8:cafe::1 tlla 00:1c:73:bb:00:01
}

What the Compiler Calculates So You Don't Have To

  • Enforces IPv6 Hop Limit 255 (ttl 255) by default in accordance with RFC 4861 §6.1.2 / §7.1.1.
  • Encodes exact ICMPv6 message bodies for routersolicit (133), routeradvert (134, routerlifetime 1800), neighborsolicit (135), neighboradvert (136, Solicited + Override flags set), and redirect (137).
  • Appends 8-byte RFC 4861 Option TLV 1 (slla) or TLV 2 (tlla) when link-layer MACs are provided and computes the IPv6 pseudo-header checksum.
Multi-Frame Lab · Ready to Compile

IPv6 SLAAC Router Discovery Followed by Neighbor Solicitation & Advertisement

Models a dual-interface IPv6 leaf node soliciting an upstream router (routersolicit -> routeradvert) before resolving next-hop MAC reachability (neighborsolicit -> neighboradvert).

ndp_slaac_discovery.frasm12 lines
Open in Playground
host leaf_node { ip fe80::1b21:ff:feaa:10 mac 00:1b:21:aa:00:10 }
host core_rtr { ip fe80::1c73:ff:febb:01 mac 00:1c:73:bb:00:01 }
compile {
// 1. Host sends Router Solicitation with Source Link-Layer Address (SLLA)
leaf_node -> core_rtr ndp routersolicit slla 00:1b:21:aa:00:10 vlan 100 wait 2ms
// 2. Router replies with Router Advertisement (30-minute router lifetime)
core_rtr -> leaf_node ndp routeradvert routerlifetime 1800 slla 00:1c:73:bb:00:01 vlan 100 wait 5ms
// 3. Neighbor Solicitation & Solicited+Override Neighbor Advertisement
leaf_node -> core_rtr ndp neighborsolicit target fe80::1c73:ff:febb:01 slla 00:1b:21:aa:00:10 vlan 100 wait 1ms
leaf_node <- core_rtr ndp neighboradvert target fe80::1c73:ff:febb:01 tlla 00:1c:73:bb:00:01 vlan 100
}
Terminal Commands (FrameAssembly CLI v3.1.2)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show ndp_slaac_discovery.frasm

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

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

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

src_host -> dst_host ndp [routersolicit | routeradvert | neighborsolicit | neighboradvert | redirect] [target <ipv6>] [slla <mac>] [tlla <mac>] [routerlifetime <0..65535>]
Keyword / OptionAccepted ValueDefaultEffect on Packet
routersolicit | routeradvert | neighborsolicit | neighboradvert | redirectNDP message selectorneighborsolicit (Type 135)Selects ICMPv6 Type 133 (routersolicit), 134 (routeradvert), 135 (neighborsolicit), 136 (neighboradvert), or 137 (redirect).
target <ipv6>128-bit IPv6 address literalDestination host IPv6 addressPopulates the 16-byte Target Address field in Neighbor Solicitation, Neighbor Advertisement, and Redirect messages.
slla <mac> | tlla <mac>48-bit MAC addressOmitted unless setAppends 8-byte NDP Option Type 1 (Source Link-Layer Address, slla) or Option Type 2 (Target Link-Layer Address, tlla).
routerlifetime <0..65535>Whole number (0..65535) (seconds)1800Sets the 16-bit Router Lifetime in routeradvert (0 indicates the router is not a default gateway).

Cross-Layer Wrappers Valid with ndp

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).
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.
ttl <0..255> [dscp <0..63>] [ecn <0..3>]TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3ttl 255, dscp 0, ecn 0Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings.
flowlabel <0..1048575>20-bit IPv6 Flow Label (0..1048575)0Sets the 20-bit IPv6 Flow Label for ECMP routing tests (ignored when running over IPv4 hosts).

Gotchas & Quick Fixes

IPv6 Endpoints Are Mandatory on ndp

Avoid
host v4_a { ip 10.0.0.1 } v4_a -> v4_b ndp neighborsolicit
Valid v3.1.2 Syntax
host v6_a { ip 2001:db8::1 } v6_a -> v6_b ndp neighborsolicit

NDP runs over ICMPv6, so both hosts on an ndp line must have IPv6 addresses. Use arp for IPv4 MAC resolution.

Strict Alphanumeric Message Names

Avoid
v6_a -> v6_b ndp neighbor_solicit router_lifetime 900
Valid v3.1.2 Syntax
v6_a -> v6_b ndp routeradvert routerlifetime 900

Spell NDP sub-keywords without underscores: routersolicit, routeradvert, neighborsolicit, neighboradvert, routerlifetime.

Field Guide 05
VLANs, QinQ, MPLS, Tunnel Soup & Dual-Stack IPv6