Skip to content

Support for ICMPv6 Neighbor Solicitation - #502

Merged
anjan-keysight merged 8 commits into
masterfrom
dev-icmpv6
Nov 17, 2026
Merged

anjan-keysight merged 8 commits into
masterfrom
dev-icmpv6

Conversation

@anjan-keysight

@anjan-keysight anjan-keysight commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Feature Overview

Related Issues: (#501, #507)

Redocly view of proposed model

Current we only support message type "Echo" in ICMPv6 traffic header. This proposal is for adding support for new message type "Neighbor Solicitation" in ICMPv6 header. Neighbor Solicitation is used to resolve IPv6 address, detect duplicate addresses or detect neighbor unreachability.

In addition, in IPv6 extension header segment routing, the segments list property is also updated to allow empty list, that may be required for negative testing. It is left to the implementation to add a default segment in the list.

Dev-Snappi branch reference

go get github.com/open-traffic-generator/snappi/gosnappi@dev-icmpv6

Case 1 - address resolution (multicast NS, Source Link-Layer Address included)

...
f := c.Flows().Add().SetName("ns-resolution")
f.TxRx().Port().SetTxName("p1").SetRxName("p2")
f.Size().SetFixed(128)
f.Rate().SetPps(100)
f.Duration().FixedPackets().SetPackets(10)

eth := f.Packet().Add().Ethernet()
eth.Src().SetValue("00:01:01:00:01:02")
eth.Dst().SetValue("33:33:ff:00:00:05")     // 33:33:ff + low 24 bits of the target (00:00:05)

ip := f.Packet().Add().Ipv6()
ip.Src().SetValue("2001:db8::1")
ip.Dst().SetValue("ff02::1:ff00:5")         // ff02::1:ff + low 24 bits of the target
ip.HopLimit().SetValue(255)                 // a conforming NS uses 255

ns := f.Packet().Add().Icmpv6().NeighborSolicitation()   // choice = neighbor_solicitation
ns.TargetAddress().SetValue("2001:db8::5")
ns.Options().Add().SourceLinkLayerAddress().LinkLayerAddress().SetValue("00:01:01:00:01:02")
...

Case 2 - neighbor reachability check (unicast NS, Source Link-Layer Address included)

...
f := c.Flows().Add().SetName("ns-reachability")
f.TxRx().Port().SetTxName("p1").SetRxName("p2")
f.Size().SetFixed(128)
f.Rate().SetPps(100)
f.Duration().FixedPackets().SetPackets(10)

eth := f.Packet().Add().Ethernet()
eth.Src().SetValue("00:01:01:00:01:02")
eth.Dst().SetValue("00:aa:bb:00:00:05")     // the target's real MAC; cannot be derived from the target address

ip := f.Packet().Add().Ipv6()
ip.Src().SetValue("2001:db8::1")
ip.Dst().SetValue("2001:db8::5")            // the target itself
ip.HopLimit().SetValue(255)

ns := f.Packet().Add().Icmpv6().NeighborSolicitation()
ns.TargetAddress().SetValue("2001:db8::5")
ns.Options().Add().SourceLinkLayerAddress().LinkLayerAddress().SetValue("00:01:01:00:01:02")
...

Case 3 - duplicate address detection (unspecified source, no options)

...
f := c.Flows().Add().SetName("ns-dad")
f.TxRx().Port().SetTxName("p1").SetRxName("p2")
f.Size().SetFixed(128)
f.Rate().SetPps(100)
f.Duration().FixedPackets().SetPackets(10)

eth := f.Packet().Add().Ethernet()
eth.Src().SetValue("00:01:01:00:01:02")
eth.Dst().SetValue("33:33:ff:00:00:05")     // same multicast formula as case 1, from the tentative address

ip := f.Packet().Add().Ipv6()
ip.Src().SetValue("::")                     // unspecified source: the node has no address yet
ip.Dst().SetValue("ff02::1:ff00:5")
ip.HopLimit().SetValue(255)

ns := f.Packet().Add().Icmpv6().NeighborSolicitation()
ns.TargetAddress().SetValue("2001:db8::5")  // the tentative address being checked
// no Options().Add(): a conforming DAD packet omits 
// the Source Link-Layer Address option (adding it is a negative test)
...

Optional case 4 - conformance / negative test (options RFC 4861 does not define for NS)

...
// ... same config, flow, ethernet and ipv6 as case 1 ...
ns := f.Packet().Add().Icmpv6().NeighborSolicitation()
ns.TargetAddress().SetValue("2001:db8::5")
ns.Options().Add().SourceLinkLayerAddress().LinkLayerAddress().SetValue("00:01:01:00:01:02")

pi := ns.Options().Add().PrefixInformation()    // Router Advertisement option
pi.PrefixLength().SetValue(64)
pi.Prefix().SetValue("2011:db8::")
pi.LFlag().SetValue(1)
pi.AFlag().SetValue(1)
pi.ValidLifetime().SetValue(100)
pi.PreferredLifetime().SetValue(50)             // must be <= valid_lifetime

ns.Options().Add().Mtu().Mtu().SetValue(1280)                // Router Advertisement option
ns.Options().Add().RedirectedHeader().SetData("0xabcdef00")  // Redirect option; 0x prefix accepted
...

@anjan-keysight anjan-keysight self-assigned this Nov 12, 2026
@anjan-keysight anjan-keysight changed the title Support for ICMPv6 Neighbor Solicitation - #501 Support for ICMPv6 Neighbor Solicitation Nov 12, 2026
@anjan-keysight

Copy link
Copy Markdown
Contributor Author

@anjan-keysight
anjan-keysight merged commit 0f6f566 into master Nov 17, 2026
1 check passed
@anjan-keysight
anjan-keysight deleted the dev-icmpv6 branch November 17, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants