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.
How Neighbor Discovery Protocol works on a link
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.
| Message | ICMPv6 type | Sent by | Purpose |
|---|---|---|---|
| Router Solicitation (RS) | 133 | Hosts | Ask routers to advertise immediately |
| Router Advertisement (RA) | 134 | Routers | Announce prefixes, gateway and link parameters |
| Neighbor Solicitation (NS) | 135 | Any node | Resolve an address or test reachability and uniqueness |
| Neighbor Advertisement (NA) | 136 | Any node | Answer an NS or announce a changed link-layer address |
| Redirect | 137 | Routers | Point a host to a better first-hop router |
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.
| Function | Messages used | Practical effect |
|---|---|---|
| Router discovery | RS, RA | Host learns default gateways and their lifetime |
| Prefix discovery | RA | Host learns which prefixes are on-link |
| Parameter discovery | RA | Host learns link MTU and hop limit |
| Address autoconfiguration | RA, NS | Supports SLAAC and signals DHCPv6 use |
| Address resolution | NS, NA | Maps an IPv6 address to a MAC address |
| Next-hop determination | Local logic | Chooses direct delivery or a router |
| Neighbor unreachability detection | NS, NA | Detects failed neighbors and gateways |
| Duplicate address detection | NS, NA | Prevents an IP address conflict |
| Redirect | Redirect | Moves traffic to a better first hop |
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.
| State | Meaning | Next transition |
|---|---|---|
| INCOMPLETE | Resolution in progress, NS sent | REACHABLE on answer, deleted after 3 failures |
| REACHABLE | Recently confirmed reachable | STALE after reachable time expires |
| STALE | Not confirmed recently, still usable | DELAY when traffic is sent |
| DELAY | Waiting about 5 s for upper-layer confirmation | PROBE if no hint arrives |
| PROBE | Unicast NS probes being sent | REACHABLE or deleted |
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.
| Aspect | NDP | ARP | DHCPv6 |
|---|---|---|---|
| IP version | IPv6 | IPv4 | IPv6 |
| Transport | ICMPv6 | Ethernet frame | UDP ports 546 and 547 |
| Delivery | Multicast and unicast | Broadcast and unicast | Multicast and unicast |
| Address resolution | Yes | Yes | No |
| Gateway announcement | Yes, via RA | No | No |
| Stateful address tracking | No | No | Yes |
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.
| Threat | Symptom | Mitigation |
|---|---|---|
| Rogue RA | Hosts use an unexpected gateway or prefix | RA Guard on access switches |
| NA spoofing | Traffic redirected through an attacker | ND inspection, SEND |
| DAD denial of service | New hosts fail to obtain addresses | Source guard, port security |
| Neighbor cache exhaustion | Router CPU spikes, dropped resolution | Smaller subnets, ND rate limiting |
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.