IP connectivityIntermediate23 min read

What Is Neighbor Discovery Protocol in Networking?

Reviewed byJohnson Ajibi· Senior Network & Security Engineer · MSc IT Security

This page mentions older exam versions. See the Current Exam Context and Legacy Exam Context sections below for the updated mapping.

On This Page

Quick Definition

Neighbor Discovery Protocol is a tool used by devices that speak IPv6, the newer version of the Internet's addressing system. It helps devices discover other devices on the same local network, find the hardware address needed to send messages, and check if a neighbor is still reachable. Think of it as the IPv6 replacement for several older IPv4 functions like ARP, ICMP Router Discovery, and redirect messages, all rolled into one efficient set of messages.

Common Commands & Configuration

show ipv6 neighbors

ip -6 neigh show

netsh interface ipv6 show neighbors

debug ipv6 nd

Must Know for Exams

Neighbor Discovery Protocol appears in several major IT certification exams. In Cisco CCNA (200-301), IPv6 is a core topic, and NDP is specifically covered under Network Access and IP Connectivity. The exam expects you to know the five ICMPv6 message types, the Neighbor Cache states, SLAAC, and DAD. You may be asked to interpret output from commands like 'show ipv6 neighbors' or to identify which message is used for a given task (e.g., address resolution uses NS/NA).

CompTIA Network+ (N10-008) includes NDP as part of Objective 1.4 (Compare and contrast IPv4 and IPv6 addressing schemes). Questions may ask which protocol replaces ARP in IPv6, or what message type is used for router discovery. While not as deep as CCNA, understanding the basic functions and message types is necessary for a passing score.

Juniper JNCIA-Junos (JN0-105) also covers NDP, often in the context of IPv6 configuration and troubleshooting. You might be asked to analyze 'show ipv6 neighbors' output or to configure RA/RS parameters. The exam may include questions about secure NDP (SeND) in more advanced scenarios.

For Windows Server and Microsoft exams, NDP is relevant when configuring IPv6 in enterprise environments. Questions may focus on how Windows uses SLAAC and DHCPv6, or how to troubleshoot IPv6 connectivity using 'netsh interface ipv6 show neighbors'.

Exam questions typically fall into three categories: knowledge-based (e.g., "Which NDP message type is used for address resolution?"), scenario-based (e.g., "A host cannot communicate with its default gateway. Which NDP messages might be failing?"), and configuration-based (e.g., "Which router configuration command enables IPv6 router advertisements on an interface?"). Mastering NDP is essential because it underpins nearly every IPv6 function tested.

Simple Meaning

Imagine you move into a new apartment building. You need to know who your neighbors are, where the mailboxes are, and how to send packages to the right apartment. Neighbor Discovery Protocol (NDP) does exactly that, but for computers and devices on a network.

When a device, like your laptop, joins an IPv6 network, it needs to find out who else is around. This is like knocking on doors to introduce yourself. NDP sends out a friendly message called a Router Solicitation, asking any routers on the network to announce themselves. The routers reply with a Router Advertisement, which tells your laptop the network's address range, the default gateway (like the building's main entrance), and other settings.

Once your laptop knows the router, it might need to talk to another device, like a printer. Your laptop knows the printer's IPv6 address but not its hardware address (the MAC address, like a serial number on the network card). NDP uses a message called Neighbor Solicitation to ask, "Hey, who has this IP address?" The printer answers with a Neighbor Advertisement, giving its MAC address. Now your laptop can send data directly to the printer.

NDP also keeps track of which neighbors are still active. It sends periodic checks to make sure a device hasn't moved or turned off. If a device doesn't answer, NDP updates its list, just like crossing a neighbor off a list when they move out.

In everyday life, NDP is like having a friendly building manager who updates the directory of who lives where, announces new rules, and checks if everyone is still around. Without NDP, devices would have to manually enter each other's addresses, which is impractical. It makes networks self-organizing and efficient.

Full Technical Definition

Neighbor Discovery Protocol (NDP) is defined in RFC 4861 and is a core component of the Internet Protocol version 6 (IPv6) suite. It operates at the link layer and is used to discover other nodes on the same link, determine link-layer addresses, find routers, and maintain reachability information about paths to active neighbors. NDP replaces several IPv4 protocols: Address Resolution Protocol (ARP), ICMP Router Discovery, and ICMP Redirect, while also adding new functionality like Duplicate Address Detection (DAD) and Stateless Address Autoconfiguration (SLAAC).

NDP uses five key ICMPv6 message types: Router Solicitation (RS, type 133), Router Advertisement (RA, type 134), Neighbor Solicitation (NS, type 135), Neighbor Advertisement (NA, type 136), and Redirect (type 137). RS messages are sent by hosts to prompt routers to send RAs immediately, rather than waiting for the next periodic advertisement. RAs contain important network parameters, such as prefix information (the network portion of the address), hop limit, MTU size, and flags that indicate whether SLAAC or DHCPv6 should be used. RAs can be sent periodically (typically every 3-10 seconds) or in response to an RS.

NS and NA messages handle address resolution (the IPv6 equivalent of ARP), DAD, and Neighbor Unreachability Detection (NUD). For address resolution, a node sends a multicast NS to the solicited-node multicast address corresponding to the target IPv6 address. The node that owns that address responds with a unicast NA containing its link-layer (MAC) address. DAD works similarly: a node sends an NS for its own tentative address before using it; if it receives an NA, it means the address is already in use, and the node must choose a different address.

NUD is a mechanism for detecting whether a neighbor is still reachable. Each node maintains a Neighbor Cache that stores information about neighbors, including their state: INCOMPLETE (address resolution in progress), REACHABLE (confirmed reachable), STALE (reachable but not recently confirmed), DELAY (waiting for upper-layer confirmation), PROBE (actively probing with unicast NS), and FAILED (no response). This state machine ensures efficient and reliable communication.

Redirect messages are used by routers to inform hosts of a better next-hop for a particular destination. For example, if a host sends a packet to another host on the same link via the router, the router can tell the host to send future packets directly to the target host. This optimizes routing and reduces load on the router.

NDP also supports SLAAC, which allows a host to automatically configure its own IPv6 address using prefixes from RAs and its own interface identifier (often derived from its MAC address via EUI-64). When combined with DAD, SLAAC enables plug-and-play networking without a central server. In enterprise environments, NDP can be secured using IPsec or SeND (Secure Neighbor Discovery, RFC 3971) to protect against attacks like Neighbor Cache poisoning and router spoofing.

Real-Life Example

Imagine a large office building with many offices and a central mailroom. Each office has a room number (like an IPv6 address). When a new employee joins, they need to know where the mailroom is, how to send mail to other offices, and who is currently in nearby offices.

The building manager (like a router) periodically sends out a notice to all offices, saying, "Here is the building's main entrance (default gateway), the floor numbering scheme (prefix), and the hours for mail delivery (other parameters)." This is like a Router Advertisement. If a new employee is eager to start, they might knock on the manager's door and ask, "Where is the mailroom?" That is a Router Solicitation.

Now, suppose Alice in Office 201 wants to send a package to Bob in Office 305. Alice knows Bob's room number, but she does not know exactly which hallway leads there. She shouts down the hallway, "Who is in Office 305?" This shout echoes through the building's intercom system (the multicast Neighbor Solicitation). Bob hears it and replies, "I am in Office 305, and my door is around the corner to the right" (the Neighbor Advertisement with the MAC address). Now Alice can walk directly to Bob's office and hand him the package.

To ensure Bob hasn't moved or left for the day, Alice occasionally peeks into his office or sends a quick message asking if he is still there. If Bob doesn't respond after several tries, Alice marks him as unreachable and stops trying to send packages. This is Neighbor Unreachability Detection.

If Alice accidentally sends a package for Bob to the mailroom instead of directly to him, the mailroom clerk sends it back with a note saying, "Bob is in Office 305, not here. Deliver directly next time." This is a Redirect message.

Finally, if a new employee tries to set up their own office number, they first shout, "Does anyone have office number 207?" If no one answers, they claim that number. If someone does answer, they pick a different number. This is Duplicate Address Detection.

This entire system ensures that people in the building can find each other and communicate without needing a central directory that lists every person's exact location at all times. NDP makes the building smart and self-organizing.

Why This Term Matters

In modern IT networks, IPv6 is becoming increasingly important as the world runs out of IPv4 addresses. NDP is the foundation upon which all IPv6 local communication is built. Without NDP, devices would not be able to discover routers, resolve addresses, or detect duplicate addresses, making IPv6 networks unworkable.

For network administrators, understanding NDP is critical for troubleshooting connectivity issues. If a device cannot get a Router Advertisement, it won't have a default route and will be unable to communicate beyond its local link. If Neighbor Cache entries become corrupted, packets may be sent to the wrong device, causing intermittent connectivity failures. Problems like duplicate address detection failures can prevent a device from using its configured IP address, leading to network errors.

NDP also has security implications. Attackers can send fake Neighbor Advertisements to redirect traffic to themselves (a man-in-the-middle attack similar to ARP spoofing in IPv4). They can also send malicious Router Advertisements to become the default gateway and intercept all traffic. These attacks can be mitigated using RA Guard, IPsec, or SeND, but administrators must be aware of them.

From an exam perspective, NDP appears in certification exams such as CompTIA Network+, Cisco CCNA, and Juniper JNCIA. Questions often cover the five message types, the Neighbor Cache states, DAD, and the differences between NDP and IPv4's ARP. A solid grasp of NDP is not optional for IT professionals working with IPv6.

How It Appears in Exam Questions

NDP questions in certification exams often present scenarios that test your understanding of the message exchange flow or troubleshooting of network issues. A common pattern is a scenario where a host fails to obtain an IPv6 address. The question might say, "An IPv6 host boots up and sends an RS message but never receives an RA. What is the most likely cause?" The answer choices might include the router not being configured to send RAs, a firewall blocking ICMPv6 type 133, or the host being on a different VLAN. You need to know that RAs are sent either periodically or in response to RS, and that if the router is not configured with 'ipv6 unicast-routing' or the interface lacks an 'ipv6 enable' command, it will not respond.

Another typical question is about address resolution. For example: "An IPv6 host wants to send a packet to another host on the same link. It knows the destination IPv6 address but not the MAC address. Which two NDP messages are exchanged?" The correct answer is Neighbor Solicitation (NS) and Neighbor Advertisement (NA). A distractor might be ARP, which is IPv4-only.

Troubleshooting questions often involve the Neighbor Cache. For instance: "A network administrator runs 'show ipv6 neighbors' and sees several entries in STALE state. What does this indicate?" The answer is that these neighbors were once reachable but have not been verified recently. You might also see questions about DAD: "A host attempts to use an IPv6 address but receives a Neighbor Advertisement for that address. What should the host do?" The answer is that the address is already in use, so the host must configure a different address.

Configuration-based questions may ask you to select the correct command to enable router advertisements on a Cisco interface. For example: "Which command enables IPv6 router advertisements on a Cisco interface?" The correct answer is 'ipv6 nd ra-interval' and 'ipv6 nd prefix' commands, or enabling 'ipv6 unicast-routing' globally.

Finally, security-related questions might ask: "An attacker sends fake Neighbor Advertisements to redirect traffic for a specific IPv6 address. What type of attack is this?" The answer is Neighbor Cache poisoning (or a man-in-the-middle attack). You may be asked how to mitigate it, with correct options being IPsec or SeND.

Practise Neighbor Discovery Protocol Questions

Test your understanding with exam-style practice questions.

Practise

Example Scenario

Scenario: A new employee sets up their laptop on the company IPv6 network. The network uses SLAAC for automatic address configuration. The laptop boots up and needs to obtain an IPv6 address and discover the default gateway.

Step 1: The laptop sends an ICMPv6 Router Solicitation (RS) message to the all-routers multicast address (FF02::2). This is like asking, "Is anyone the network manager here?" The RS is sent immediately upon boot, or when the network interface comes up.

Step 2: The company's router, which is configured to send Router Advertisements, receives the RS. It can either send an immediate RA or wait for its next periodic RA (which typically happens every 200 seconds by default, but actual interval is random). In this case, the router responds with an RA containing the on-link prefix (e.g., 2001:db8:1::/64) and flags indicating that SLAAC is enabled. The RA also specifies the default route (the router's link-local address).

Step 3: The laptop receives the RA and uses the prefix to form an IPv6 address. It combines the prefix with a 64-bit interface identifier, which it derives from its MAC address using EUI-64 format (or a random identifier for privacy). For example, if its MAC is 00:1A:2B:3C:4D:5E, the EUI-64 identifier might be 021A:2BFF:FE3C:4D5E, and its full address would be 2001:db8:1::021A:2BFF:FE3C:4D5E.

Step 4: Before using this address, the laptop must perform Duplicate Address Detection (DAD). It sends a Neighbor Solicitation to the solicited-node multicast address corresponding to its own tentative address. This is like checking, "Does anyone already have this phone number?" If no one responds (no NA received), the laptop assumes the address is unique and begins using it.

Step 5: The laptop now wants to send a file to a printer at address 2001:db8:1::100. It sends an NS to the solicited-node multicast address of that printer (FF02::1:FF00:100). The printer sees the NS and replies with an NA containing its MAC address. The laptop now sends the file directly.

Step 6: Over time, the laptop periodically checks if the printer is still reachable using NUD. If the printer becomes unreachable, the laptop updates its Neighbor Cache entry to FAILED and stops trying to communicate.

This entire process happens automatically and transparently. In an exam, you might be asked which messages are involved at each stage or why the laptop cannot communicate if the router is not responding to RS messages.

Common Mistakes

Confusing NDP with ARP and thinking they work identically.

NDP uses ICMPv6 messages (NS/NA) and multicast addresses, while ARP uses broadcast and its own frame type. They are structurally different and not interchangeable.

Remember that ARP is for IPv4, NDP is for IPv6. NDP does not use broadcast; it uses solicited-node multicast.

Thinking NDP is only for address resolution.

NDP does much more: router discovery, prefix discovery, parameter discovery, DAD, NUD, and redirect. Reducing it to just address resolution misses the scope.

Learn all five message types and their purposes. Use the mnemonic: RS, RA, NS, NA, R (Redirect).

Assuming Router Advertisements are always sent in response to a Router Solicitation.

RAs are sent periodically regardless of whether an RS was received. The RS only triggers an immediate RA (if the router supports it), but the periodic interval still applies.

Understand that RAs are sent unsolicited every 200 seconds (default). RS makes them come faster but is not required.

Believing that NDP uses the all-nodes multicast address for Neighbor Solicitations.

NS for address resolution uses the solicited-node multicast address (FF02::1:FFXX:XXXX), not the all-nodes address (FF02::1). Only the target node responds.

Remember that solicited-node multicast is built from the last 24 bits of the target IPv6 address, making it more efficient than all-nodes multicast.

Thinking the Neighbor Cache is cleared after every RA.

The Neighbor Cache is independent of RAs. RAs affect the Prefix List and Router List, not the Neighbor Cache. The cache is updated by NS/NA exchanges and NUD.

RAs do not remove or reset Neighbor Cache entries. Only timeouts or NUD failures cause entries to be removed.

Assuming that SLAAC always uses the MAC address to form the interface ID.

Modern operating systems use privacy extensions (RFC 4941) and generate random interface IDs to prevent tracking. EUI-64 based on MAC is an older method.

Know that SLAAC can use either EUI-64 or random temporary addresses. The 'A' flag in the RA indicates whether SLAAC is available, and the 'L' flag indicates on-link prefix.

Exam Trap — Don't Get Fooled

{"trap":"In an exam, you are asked: \"Which NDP message is used by a host to discover the link-layer address of a target node?\" The options include Router Solicitation, Router Advertisement, Neighbor Solicitation, and Neighbor Advertisement. Some learners confuse Router Solicitation with Neighbor Solicitation because both contain the word 'Solicitation'."

,"why_learners_choose_it":"Learners may think that any solicitation message is for discovering something, so they choose Router Solicitation because it also asks for information. They forget that RS is for finding routers, not for address resolution.","how_to_avoid_it":"Memorize the specific roles: RS is for router discovery, NS is for neighbor (address) discovery.

A simple trick: RS has 'R' for Router, NS has 'N' for Neighbor. If the question says 'link-layer address' or 'MAC address', the answer is NS."

Commonly Confused With

Neighbor Discovery ProtocolvsAddress Resolution Protocol (ARP)

ARP is used in IPv4 to map IP addresses to MAC addresses, while NDP's NS/NA messages serve the same purpose in IPv6. However, ARP uses broadcast frames, while NDP uses multicast. NDP also performs functions beyond address resolution, such as router discovery and DAD, which ARP does not.

In IPv4, a host sends an ARP request to find the MAC of another host. In IPv6, it sends a Neighbor Solicitation to the solicited-node multicast group.

Neighbor Discovery ProtocolvsICMPv6 Router Discovery

Router Discovery is a component of NDP, but NDP is the overarching protocol. ICMPv6 Router Discovery refers specifically to the RS/RA exchange, while NDP includes address resolution, DAD, NUD, and redirect. Router Discovery is just one of NDP's five functions.

When a host asks for a router using RS, that's Router Discovery. But when it checks if an address is duplicated using NS, that's part of NDP but not Router Discovery.

Neighbor Discovery ProtocolvsStateless Address Autoconfiguration (SLAAC)

NDP's RA gives a host the network prefix; SLAAC takes that prefix and combines it with a unique identifier to form a full IP address.

Neighbor Discovery ProtocolvsDHCPv6

DHCPv6 is an alternative to SLAAC for assigning IPv6 addresses and providing additional configuration like DNS servers. NDP's RA includes flags that tell hosts whether to use SLAAC, DHCPv6, or both. NDP is the signaling protocol, while DHCPv6 is the address assignment server.

In an NDP RA, if the 'M' flag is set, hosts should use DHCPv6 for addresses. If the 'A' flag is set, they can use SLAAC. NDP carries this flag, but DHCPv6 does the actual address offering.

Neighbor Discovery ProtocolvsICMP Redirect

ICMP Redirect is a specific message in NDP (type 137) that tells a host to use a better first-hop router for a particular destination. In IPv4, ICMP Redirect also exists but is not part of a larger neighbor discovery framework. In IPv6, Redirect is just one of five message types under the NDP umbrella.

If a host sends a packet to a router that knows a shorter path, it sends an NDP Redirect message to update the host's routing table.

Step-by-Step Breakdown

1

Router Solicitation (RS) Sending

When a host first connects to an IPv6 network, it sends a Router Solicitation message to the all-routers multicast address (FF02::2). This prompts routers to respond with Router Advertisements, allowing the host to quickly learn network parameters without waiting for the next periodic RA.

2

Router Advertisement (RA) Receiving

Routers send RAs either periodically (every 200 seconds by default) or in response to an RS. The RA contains critical information: one or more on-link prefixes (used for address configuration), the default router's link-local address, hop limit, MTU, and flags indicating whether SLAAC, DHCPv6, or both should be used. The host updates its Prefix List and Router List based on this data.

3

Duplicate Address Detection (DAD)

Before using a newly formed IPv6 address (via SLAAC or manual assignment), the host sends a Neighbor Solicitation for its own address to the corresponding solicited-node multicast address. If no Neighbor Advertisement is received, the address is considered unique and safe to use. If an NA is received, the address is already in use, and the host must generate a different address.

4

Address Resolution via NS/NA

When a host wants to send a packet to another host on the same link, it needs the destination's MAC address. It sends an NS to the solicited-node multicast address derived from the destination's IPv6 address. The target host responds with a unicast NA containing its MAC address. The requesting host then adds this mapping to its Neighbor Cache.

5

Neighbor Unreachability Detection (NUD)

After address resolution, the host monitors the reachability of the neighbor. The Neighbor Cache state machine tracks this: REACHABLE means communication was recently confirmed. If no confirmation is received within the REACHABLE_TIME (default 30 seconds), the entry moves to STALE. When a new packet needs to be sent to a STALE neighbor, the host moves to DELAY, waits 5 seconds for upper-layer confirmation, then sends unicast NS probes. If no response after several probes, the entry becomes FAILED and is removed.

6

Redirect Processing

If a host sends a packet to a router that is not the optimal first-hop for that destination, the router may send an ICMPv6 Redirect message (type 137). The Redirect tells the host to send future packets for that destination directly to a different router or to the destination itself. The host updates its destination cache accordingly, optimizing path selection.

Practical Mini-Lesson

Neighbor Discovery Protocol is not just an exam topic; it is a practical protocol that network professionals encounter daily when working with IPv6. Understanding how to verify and troubleshoot NDP operations is essential.

Verification commands vary by platform. On Cisco IOS, 'show ipv6 neighbors' displays the Neighbor Cache, showing IPv6 address, link-layer address, state, and interface. This is the IPv6 equivalent of 'show arp'. The states (REACHABLE, STALE, INCOMPLETE, etc.) give clues about connectivity. For example, if you see 'INCOMPLETE' entries, it means address resolution failed, the host sent an NS but never received an NA. This could indicate a missing host, a firewall blocking ICMPv6, or a misconfigured interface.

On Linux, 'ip -6 neigh show' gives similar output. On Windows, 'netsh interface ipv6 show neighbors' is the go-to command. The Neighbor Cache is dynamic; entries timeout after a period of inactivity. Understanding the timeouts helps in diagnosing intermittent issues.

Configuration of NDP on routers is straightforward but requires careful attention. On Cisco, the global command 'ipv6 unicast-routing' must be enabled for the router to act as an IPv6 router and send RAs. On the interface, 'ipv6 enable' starts IPv6 processing. To customize RAs, use 'ipv6 nd prefix <prefix> <valid-lifetime> <preferred-lifetime>' to set which prefixes are advertised. The 'ipv6 nd ra-interval' and 'ipv6 nd ra-lifetime' control timing. Suppressing RAs is done with 'ipv6 nd suppress-ra'.

A common misconfiguration is forgetting to enable 'ipv6 unicast-routing' globally. Without it, the router will not forward IPv6 packets and will not send RAs, even if the interface has an IPv6 address. Another issue is interfaces that are in 'up/up' state but not sending RAs because the interface is in network management or passive mode.

Security considerations include RA Guard (RFC 6105) on switches to block unauthorized RAs from hosts, preventing rogue gateway attacks. Also, using SeND (RFC 3971) provides cryptographic protection for NDP messages, although it is not widely deployed due to complexity. In practice, many enterprises rely on RA Guard and careful port security.

Finally, be aware of differences between first-hop router redundancy protocols like HSRPv6 or VRRPv6 and NDP. These protocols use virtual MAC addresses that must be consistent with the NDP Neighbor Cache on hosts. If the active router changes, the virtual MAC remains the same, so hosts do not need to re-resolve the MAC address, preventing service interruption.

Troubleshooting Clues

Symptom: Host cannot ping its default gateway

Symptom: Two hosts cannot communicate even though they have IPv6 addresses

Symptom: Host receives 'Duplicate Address' error

Symptom: Intermittent connectivity, sometimes works, sometimes fails

Memory Tip

Think of the five NDP messages as 'RAN to me, NAR to you': RS (Router Solicitation), RA (Router Advertisement), NS (Neighbor Solicitation), NA (Neighbor Advertisement), and R (Redirect). The 'R' stands for both Router and Redirect depending on context.

Covered in These Exams

Current Exam Context

Current exam versions that test this topic — use these objectives when studying.

Legacy Exam Context

Older materials may mention these exam versions, but learners should use the current objectives for their target exam.

N10-008N10-009(current version)

Related Glossary Terms

Quick Knowledge Check

1.Which ICMPv6 message type is used by a host to discover the link-layer address of its default gateway?

2.What does DAD (Duplicate Address Detection) accomplish?

3.Which NDP message is used by a router to tell a host to use a different router for a specific destination?

4.What state in the Neighbor Cache indicates that address resolution is currently in progress?

5.What is the default period for unsolicited Router Advertisements on most routers?