HeadlinesBriefing favicon HeadlinesBriefing.com

Closing IPv6 First-Packet Gap with GRAND

Hacker News •
×

There is a subtle asymmetry in IPv6 Neighbour Discovery: a host knows how to reach its router before the router necessarily knows how to reach the host. GRAND fixes that asymmetry by making the host proactively advertise its address, and I implemented that mechanism in FreeBSD.

A device joins an IPv6 network, receives a Router Advertisement, configures a new IPv6 address, and immediately starts communicating with the Internet. From the host's perspective, everything is ready. It knows the link-layer address of its default router, so it can immediately send packets towards the Internet. However, from the router's perspective, things may look different. The router may not yet know how to reach the host's newly configured global IPv6 address. This creates a subtle asymmetry in IPv6 Neighbour Discovery: the host can already reach the router, while the router may have to perform Neighbour Discovery before it can forward traffic back to the host.

Consider a host that has just configured a new IPv6 address. The host sends a packet towards an off-link destination. The first-hop router receives the packet and forwards it normally. When the remote destination responds, however, the return packet arrives at the router with the host as its destination. The router may not have a Neighbour Cache entry for that IPv6 address, so it has to resolve the host's link-layer address before it can forward the packet. This puts Neighbour Discovery directly in the critical path of the first return packet. For a mechanism that is normally invisible to applications, this can have a visible effect: the first packets of a connection may experience additional latency, or potentially be dropped while address resolution is in progress. The problem is particularly interesting because the host already has all the information the router needs. The host knows that it owns the IPv6 address and knows the corresponding link-layer address, but the router simply hasn't learned it yet.

GRAND changes the direction of information flow so that instead of waiting for the router to discover the host when the first packet arrives, the host proactively announces its IPv6 address and link-layer address using an unsolicited Neighbour Advertisement. The router can then learn this information before it needs to forward traffic towards the host. This is the central idea behind RFC 9131. But implementing GRAND is not simply a matter of sending an unsolicited Neighbour Advertisement whenever an address appears. GRAND interacts with several existing Neighbour Discovery rules, including the handling of multiple addresses, anycast and proxy addresses, timing, and Duplicate Address Detection. An important part of implementing GRAND is understanding that unsolicited Neighbour Advertisements already have a defined role in Neighbour Discovery. RFC 4861 rule 7.2.6 specifies behaviour for unsolicited Neighbour Advertisements, including cases such as changes to a node's link-layer address. It also limits how many advertisements a node can send for multiple addresses and recommends spacing those advertisements to avoid unnecessary congestion.