Neighbor Discovery Protocol

Also known as: NDP

On this page 8

Neighbor Discovery Protocol (NDP) is the IPv6 mechanism that lets nodes on the same link discover each other, find routers, resolve link-layer addresses and verify that their addresses are unique. In networking, and especially in IPv6 address configuration, NDP is the foundation on which SLAAC, duplicate address detection and default gateway selection are built.

NDP is specified in RFC 4861 and carried entirely inside ICMPv6, so it needs no separate transport. It replaces several IPv4 functions at once: ARP for address resolution, ICMP Router Discovery and ICMP Redirect, while adding capabilities that IPv4 never had, such as neighbor unreachability detection.

NDP works by exchanging five ICMPv6 message types between nodes that share a single link, such as an Ethernet segment or a Wi-Fi network. Every NDP packet is sent with a hop limit of 255, and receivers discard any NDP message that arrives with a lower value, which guarantees that the message originated on the local link and was not forwarded by a router.

Instead of broadcast, NDP relies on multicast addressing. Address resolution targets the solicited-node multicast address, built from the prefix ff02::1:ff00:0/104 plus the last 24 bits of the target address. Only the few hosts whose addresses share those bits process the query, which reduces interrupt load compared with the ARP broadcast that wakes every IPv4 host on a segment.

The table below lists the five message types, their ICMPv6 numbers and their primary purpose on the link.

MessageICMPv6 typeSent byPurpose
Router Solicitation (RS)133HostsAsk routers to advertise immediately
Router Advertisement (RA)134RoutersAnnounce prefixes, gateway and link parameters
Neighbor Solicitation (NS)135Any nodeResolve an address or test reachability and uniqueness
Neighbor Advertisement (NA)136Any nodeAnswer an NS or announce a changed link-layer address
Redirect137RoutersPoint a host to a better first-hop router
NDP message types defined in RFC 4861

Core functions of NDP in address configuration

NDP combines nine related functions in one protocol, and several of them directly drive how an IPv6 interface obtains and validates its addresses. Router Advertisements carry Prefix Information options with the on-link and autonomous flags, which tell hosts whether they may build addresses through SLAAC, and the M and O flags, which point hosts to DHCPv6 for addresses or for other settings such as DNS servers.

Before any unicast address is used, a node runs duplicate address detection (DAD): it sends a Neighbor Solicitation for its tentative address from the unspecified address :: and waits, typically about one second. If a Neighbor Advertisement answers, the address is a duplicate and must not be assigned. This applies to the link-local address as well, which every IPv6 interface creates in fe80::/10 before it talks to anything else.

The following table maps each major function to the messages that implement it and its practical effect.

FunctionMessages usedPractical effect
Router discoveryRS, RAHost learns default gateways and their lifetime
Prefix discoveryRAHost learns which prefixes are on-link
Parameter discoveryRAHost learns link MTU and hop limit
Address autoconfigurationRA, NSSupports SLAAC and signals DHCPv6 use
Address resolutionNS, NAMaps an IPv6 address to a MAC address
Next-hop determinationLocal logicChooses direct delivery or a router
Neighbor unreachability detectionNS, NADetects failed neighbors and gateways
Duplicate address detectionNS, NAPrevents an IP address conflict
RedirectRedirectMoves traffic to a better first hop
Functions performed by Neighbor Discovery Protocol

The neighbor cache and reachability states

Every IPv6 node keeps a neighbor cache, the counterpart of the IPv4 ARP table, but with an explicit state machine for each entry. Instead of simply aging entries out, NDP tracks whether a neighbor is confirmed reachable, and it uses upper-layer hints, such as TCP acknowledgments, to avoid unnecessary probes.

The default REACHABLE_TIME of 30 seconds is randomized between half and one and a half times its base value to prevent synchronized probing. The states below appear in the output of commands such as ip -6 neigh on Linux or netsh interface ipv6 show neighbors on Windows.

StateMeaningNext transition
INCOMPLETEResolution in progress, NS sentREACHABLE on answer, deleted after 3 failures
REACHABLERecently confirmed reachableSTALE after reachable time expires
STALENot confirmed recently, still usableDELAY when traffic is sent
DELAYWaiting about 5 s for upper-layer confirmationPROBE if no hint arrives
PROBEUnicast NS probes being sentREACHABLE or deleted
Neighbor cache entry states

NDP compared with ARP and DHCPv6

NDP is broader than ARP and complementary to DHCPv6. ARP only resolves IPv4 addresses to MAC addresses and runs directly over Ethernet, while NDP runs over IPv6 itself, which means it can be protected with IPsec or SEND and can carry configuration data that ARP cannot.

AspectNDPARPDHCPv6
IP versionIPv6IPv4IPv6
TransportICMPv6Ethernet frameUDP ports 546 and 547
DeliveryMulticast and unicastBroadcast and unicastMulticast and unicast
Address resolutionYesYesNo
Gateway announcementYes, via RANoNo
Stateful address trackingNoNoYes
How NDP relates to neighboring protocols

A frequent misunderstanding is that DHCPv6 replaces NDP. In practice, hosts always learn their default gateway from Router Advertisements, because DHCPv6 has no default router option, so RA must work even in fully managed networks.

Security risks and protective measures

NDP trusts every node on the link by default, which makes it vulnerable to spoofing attacks that mirror ARP poisoning. A malicious host can send rogue Router Advertisements to become the default gateway, forge Neighbor Advertisements to intercept traffic, or answer every DAD probe to deny addresses to new hosts.

ThreatSymptomMitigation
Rogue RAHosts use an unexpected gateway or prefixRA Guard on access switches
NA spoofingTraffic redirected through an attackerND inspection, SEND
DAD denial of serviceNew hosts fail to obtain addressesSource guard, port security
Neighbor cache exhaustionRouter CPU spikes, dropped resolutionSmaller subnets, ND rate limiting
Common NDP threats and mitigations

Secure Neighbor Discovery (SEND), defined in RFC 3971, adds cryptographically generated addresses and signatures, but it is rarely deployed because major desktop operating systems lack native support. In enterprise networks the practical defense is first-hop security on switches, combining RA Guard, DHCPv6 Guard and ND inspection.

Troubleshooting Neighbor Discovery Protocol

Most NDP failures come from filtered ICMPv6. Administrators who copy IPv4 habits and block all ICMP break address resolution, router discovery and DAD at once, so ICMPv6 types 133 to 137 must be permitted on every link where IPv6 runs.

  • No global address: check whether RAs arrive and whether the autonomous flag is set in the prefix option.
  • Duplicate address warnings: look for looped switch ports that reflect the host’s own DAD probe.
  • Intermittent loss to the gateway: compare neighbor cache states and verify that multicast snooping does not drop solicited-node groups.
  • Wrong gateway: capture RAs with a packet analyzer and identify every router sending them.

In plain words

Neighbor Discovery Protocol is how IPv6 devices on the same network introduce themselves to each other. When a laptop joins a network, it asks out loud who the router is, the router answers with the local address range, and the laptop builds its own address from that answer.

Before using the new address, the laptop checks that nobody else already owns it. Later, when it wants to talk to a printer, it asks which hardware address belongs to the printer’s IP address. It is like moving into a new building, reading the directory in the lobby and knocking on doors politely before assuming anyone lives there.

A real-world example

A university network team enables IPv6 on a student dormitory VLAN with the prefix 2001:db8:40:12::/64. The router sends Router Advertisements every 200 seconds with the autonomous flag set and the O flag set, so laptops build addresses through SLAAC and fetch DNS servers from a stateless DHCPv6 server.

Within a week, the help desk receives reports that some students cannot reach the internet. A packet capture shows a second set of Router Advertisements coming from a student’s travel router plugged in backward, which advertises its own prefix and gateway. Hosts pick it as a default router and their traffic disappears.

The team enables RA Guard on every access port, allowing advertisements only from the uplink toward the real router. The rogue advertisements are dropped at the switch, affected laptops age out the bad gateway, and complaints stop within the hour. The incident also leads the team to add ND inspection to the campus switch template.