Networking - IPv6 Neighbor Discovery Protocol (NDP) and Address Autoconfiguration
IPv6 Neighbor Discovery Protocol (NDP) is an important protocol used by IPv6 devices to discover other devices on the same network, determine their link-layer addresses, find routers, and automatically configure network settings. NDP operates at the Internet layer of the IPv6 protocol suite and uses ICMPv6 messages to perform functions that were traditionally handled by protocols such as ARP, ICMP Router Discovery, and ICMP Redirect in IPv4 networks.
1. What is IPv6 Neighbor Discovery Protocol?
In an IPv6 network, devices need to know information about their neighboring devices and available routers before they can communicate efficiently. NDP provides this information.
For example, suppose a laptop joins an IPv6-enabled Wi-Fi network. It needs to discover:
-
Which routers are available?
-
What IPv6 network prefix should it use?
-
What is the link-layer address of another IPv6 device?
-
Is a particular neighboring device still reachable?
-
Which router should be used to reach an external network?
NDP handles these requirements through a collection of ICMPv6 messages.
NDP is defined primarily in ICMPv6 and uses multicast rather than IPv4-style broadcast communication.
2. Why Was NDP Introduced?
IPv4 commonly uses ARP (Address Resolution Protocol) to determine the MAC address associated with an IPv4 address. IPv6 does not use ARP.
Instead, IPv6 incorporates address-resolution functionality into NDP.
NDP provides several additional capabilities beyond simple address resolution. It can help a host discover routers, obtain network prefixes, detect duplicate addresses, and determine whether neighboring devices are reachable.
Therefore, NDP is more than an IPv6 replacement for ARP. It is a complete neighbor and router discovery mechanism.
3. Major Functions of NDP
NDP performs several important functions:
Neighbor Discovery
A device can discover other IPv6 devices connected to the same local network.
Address Resolution
NDP can determine the link-layer address, such as a MAC address, associated with a neighboring IPv6 address.
Router Discovery
An IPv6 host can discover routers available on the local network.
Router Advertisement
Routers can advertise network prefixes, configuration information, and other parameters to IPv6 hosts.
Prefix Discovery
Hosts can learn which IPv6 prefix belongs to the local network.
Duplicate Address Detection
Before assigning an IPv6 address to itself, a device can check whether another device is already using that address.
Neighbor Unreachability Detection
NDP can determine whether a previously known neighboring device is still reachable.
Redirect
An IPv6 router can inform a host that a more appropriate next-hop router exists for a particular destination.
4. Important NDP Messages
NDP primarily uses five types of ICMPv6 messages.
4.1 Router Solicitation
A Router Solicitation (RS) message is sent by an IPv6 host when it wants to discover routers on the local network.
For example, when a computer connects to a network, it does not necessarily need to wait for a router advertisement. It can actively send a Router Solicitation message.
The host essentially asks:
"Are there any IPv6 routers available on this network?"
An IPv6 router can then respond with a Router Advertisement.
4.2 Router Advertisement
A Router Advertisement (RA) is sent by an IPv6 router.
It can contain information such as:
-
Network prefix
-
Prefix length
-
Default router information
-
Address configuration information
-
Valid and preferred lifetime information
-
Maximum transmission unit information
-
Other network configuration parameters
Router Advertisements are particularly important for IPv6 Stateless Address Autoconfiguration (SLAAC).
4.3 Neighbor Solicitation
A Neighbor Solicitation (NS) message is used to discover information about a neighboring IPv6 device.
It can be used to:
-
Resolve an IPv6 address to a link-layer address
-
Perform Duplicate Address Detection
-
Check whether a neighbor is reachable
It is broadly comparable to the role ARP plays in IPv4 address resolution, although the mechanisms are different.
4.4 Neighbor Advertisement
A Neighbor Advertisement (NA) is the response to a Neighbor Solicitation.
A device can use the Neighbor Advertisement to provide information about its link-layer address and its reachability.
For example, if Computer A wants to communicate with Computer B, it can send a Neighbor Solicitation. Computer B can respond with a Neighbor Advertisement containing the information required for local communication.
4.5 Redirect
An IPv6 router can send an ICMPv6 Redirect message to inform a host that another router or neighbor is a better next hop for a particular destination.
This can help improve routing efficiency within a local network.
5. IPv6 Stateless Address Autoconfiguration
One of the most important capabilities associated with NDP is Stateless Address Autoconfiguration, commonly called SLAAC.
SLAAC allows an IPv6 device to configure an address without requiring a DHCPv6 server for the basic address assignment process.
This is particularly useful in large networks containing many devices.
For example, when a new laptop connects to an IPv6 network, it can automatically obtain information required to construct an IPv6 address.
6. How SLAAC Works
A simplified SLAAC process can be understood in several stages.
Step 1: The Device Generates a Link-Local Address
When an IPv6 device starts using IPv6, it can generate a link-local address.
IPv6 link-local addresses normally use the FE80::/10 range.
A link-local address is used for communication within the local network segment and is important for IPv6 neighbor and router discovery.
Step 2: Duplicate Address Detection
The device performs Duplicate Address Detection (DAD).
The purpose is to determine whether another device is already using the proposed IPv6 address.
The device sends an appropriate Neighbor Solicitation message.
If another device responds indicating that the address is already in use, the host must not use that address.
Step 3: Router Discovery
The host can send a Router Solicitation message to discover an IPv6 router.
The router responds with a Router Advertisement.
The Router Advertisement provides important information about the network.
Step 4: Prefix Information Is Received
The Router Advertisement can provide an IPv6 network prefix.
For example, a router might advertise a prefix such as:
2001:db8:1234:5678::/64
The host can use this prefix as part of its IPv6 address.
Step 5: The Host Creates a Global IPv6 Address
The host combines the advertised network prefix with an interface identifier or another address-generation method.
For example:
2001:db8:1234:5678:abcd:1234:5678:90ab
The resulting address can be used for IPv6 communication according to the network's configuration.
Step 6: Duplicate Address Detection Again
The newly generated address can undergo Duplicate Address Detection before being considered usable.
This helps prevent two devices from accidentally using the same IPv6 address.
7. SLAAC and DHCPv6
SLAAC and DHCPv6 are different mechanisms.
With SLAAC, the router provides network prefix information through Router Advertisements, allowing the host to configure an IPv6 address automatically.
DHCPv6 can provide additional configuration information and, depending on the network design, can also be used for address assignment.
IPv6 networks can therefore use:
-
SLAAC alone
-
DHCPv6 alone in appropriate configurations
-
SLAAC combined with DHCPv6
The Router Advertisement contains flags that help hosts determine how address configuration should be performed.
8. NDP and IPv4 ARP
NDP and ARP have related purposes but are not identical.
| Feature | IPv4 ARP | IPv6 NDP |
|---|---|---|
| Protocol family | IPv4 | IPv6 |
| Main purpose | IPv4-to-MAC resolution | Neighbor discovery and more |
| Message mechanism | ARP messages | ICMPv6 |
| Broadcast | Commonly used | IPv6 avoids broadcast |
| Router discovery | Separate mechanisms | Built into NDP |
| Duplicate address detection | Not part of ARP | Supported |
| Prefix discovery | Not provided by ARP | Supported |
| Neighbor reachability | Limited | Supported |
NDP therefore provides a much broader collection of functions.
9. Why IPv6 Uses Multicast
IPv6 does not use traditional broadcast communication.
Instead, NDP uses carefully targeted multicast groups.
For example, when a host wants to discover information about a particular IPv6 neighbor, it can send a Neighbor Solicitation message to a solicited-node multicast address associated with that neighbor.
This approach can reduce unnecessary traffic because the message is not sent to every device on the local network.
10. Duplicate Address Detection
Duplicate Address Detection is an important IPv6 feature.
Imagine that two devices accidentally attempt to use:
2001:db8:1234:5678::10
If both devices use the same address, communication problems can occur.
DAD helps detect this situation before an IPv6 address becomes active.
The host sends a Neighbor Solicitation for the proposed address. If another device is already using that address, an appropriate response can indicate the conflict.
DAD is therefore an important protection against accidental duplicate IPv6 addresses.
11. Neighbor Unreachability Detection
Knowing a neighbor's address is not enough. A device may need to know whether that neighbor is still reachable.
For example, a computer may have previously communicated with a network gateway. Later, the gateway may become unavailable because of a failure or network change.
IPv6 NDP includes Neighbor Unreachability Detection (NUD) to help determine whether a neighbor is still reachable.
This allows IPv6 hosts to update their neighbor information and choose an appropriate next hop when necessary.
12. Example of NDP in a Real Network
Consider a laptop connecting to an IPv6-enabled office network.
The process may look like this:
-
The laptop creates a link-local IPv6 address.
-
It checks the address using Duplicate Address Detection.
-
It sends a Router Solicitation.
-
The router sends a Router Advertisement.
-
The laptop learns the network prefix.
-
The laptop creates an IPv6 address using the available configuration information.
-
The laptop performs Duplicate Address Detection for the new address.
-
The laptop discovers neighboring devices when communication is required.
-
Neighbor Solicitation and Neighbor Advertisement messages help resolve local neighbor information.
-
Neighbor Unreachability Detection can later verify whether important neighbors remain reachable.
This process allows IPv6 devices to configure themselves and communicate with relatively little manual configuration.
13. Advantages of NDP
NDP provides several important advantages.
Automatic configuration: Hosts can obtain network information without requiring manual address configuration.
Router discovery: Hosts can automatically discover available IPv6 routers.
Address resolution: IPv6 devices can determine link-layer information for local neighbors.
Duplicate detection: NDP can identify potential IPv6 address conflicts.
Neighbor monitoring: Hosts can determine whether neighboring devices remain reachable.
Reduced broadcast traffic: IPv6 multicast-based discovery avoids traditional IPv4 broadcast behavior.
Scalability: Automatic configuration and discovery mechanisms are particularly useful in large IPv6 networks.
14. Security Considerations
Although NDP provides important functionality, it can also introduce security concerns.
Because NDP relies heavily on ICMPv6 messages, attackers on a local network may attempt to send fraudulent Router Advertisements or Neighbor Advertisements.
For example, a malicious device could attempt to advertise itself as a router. A host that accepts the false information could then send traffic through the malicious device.
Network administrators can use security mechanisms such as RA Guard, appropriate IPv6 firewall rules, and SEND (Secure Neighbor Discovery) where applicable to reduce certain NDP-related threats.
Careful filtering of ICMPv6 is also important because blocking ICMPv6 indiscriminately can interfere with legitimate IPv6 functionality.
15. NDP vs SLAAC
NDP and SLAAC are closely related but should not be treated as the same concept.
NDP is the broader IPv6 discovery mechanism. It provides neighbor discovery, router discovery, address resolution, duplicate address detection, and other functions.
SLAAC is an IPv6 address-configuration mechanism that uses information provided through NDP Router Advertisements.
In simple terms:
NDP = discovering and learning about the IPv6 network
SLAAC = using network information to automatically configure an IPv6 address
16. Conclusion
IPv6 Neighbor Discovery Protocol is a fundamental component of IPv6 networking. It replaces several IPv4 mechanisms with a unified ICMPv6-based framework for discovering neighbors and routers, resolving link-layer addresses, detecting duplicate addresses, learning network prefixes, and monitoring neighbor reachability.
Its relationship with Stateless Address Autoconfiguration makes IPv6 deployment much easier because devices can automatically obtain the information required to participate in an IPv6 network. Understanding Router Solicitation, Router Advertisement, Neighbor Solicitation, Neighbor Advertisement, Duplicate Address Detection, and Neighbor Unreachability Detection is therefore essential for anyone studying IPv6 networking.