{
  "id": "neighbor-discovery-protocol",
  "title": "Neighbor Discovery Protocol",
  "lang": "en",
  "source_lang": "en",
  "summary": "Neighbor Discovery Protocol is an IPv6 control protocol for discovering local-link devices and routers, resolving link-layer addresses, and tracking neighbor reachability.",
  "category": "computer-science",
  "subcategory": "networks-security",
  "type": "concept",
  "aliases": [
    "NDP",
    "ND",
    "IPv6 Neighbor Discovery"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/neighbor-discovery-protocol/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/neighbor-discovery-protocol/",
      "json": "https://aiwiki.page/zh/neighbor-discovery-protocol.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The Neighbor Discovery Protocol (NDP) is a set of mechanisms used by Internet Protocol version 6 (IPv6) nodes to discover other nodes on the same network link, learn their link-layer addresses, find routers, and determine whether neighboring devices remain reachable. It uses messages carried by Internet Control Message Protocol for IPv6 (ICMPv6). NDP also supplies information used for automatic address configuration and supports duplicate address detection. Its core specification is RFC 4861, published by the Internet Engineering Task Force (IETF) in 2007."
    },
    {
      "heading": "Purpose and scope",
      "text": "IPv6 communication requires more than a destination IP address. A node must determine whether the destination is directly reachable on an attached link or whether packets must pass through a router. On links such as Ethernet, it must also determine the link-layer destination address needed to transmit a frame.\n\nNDP coordinates these operations through several related functions:\n\n- Router discovery: finding routers that can forward packets beyond the local link.\n- Prefix discovery: learning which IPv6 address prefixes are associated with the link.\n- Parameter discovery: learning values such as the link’s maximum transmission unit and selected protocol timers.\n- Address resolution: mapping a neighboring node’s IPv6 address to its link-layer address.\n- Next-hop determination: choosing the immediate neighbor to which a packet should be sent.\n- Neighbor unreachability detection: monitoring whether a neighbor remains usable for communication.\n- Redirect processing: learning a better first hop for a particular destination.\n\nNDP replaces the Address Resolution Protocol (ARP) used with IPv4 and incorporates functions that IPv4 handles through separate router-discovery and redirect mechanisms. It is therefore broader than an IPv6 equivalent of ARP.\n\nA neighbor is a node attached to the same link. A link may be a physical local network or a logical connection over which nodes communicate without an intervening IP router. NDP discovers local connectivity; it does not calculate routes across an entire network like Open Shortest Path First (OSPF) or other routing protocols."
    },
    {
      "heading": "Message types",
      "text": "Core NDP defines five ICMPv6 message types. Their contents can include options carrying link-layer addresses, prefixes, and other configuration information.\n\nMessage | ICMPv6 type | Principal function\nRouter Solicitation (RS) | 133 | Requests routers to advertise their presence and configuration\nRouter Advertisement (RA) | 134 | Announces router information, prefixes, and link parameters\nNeighbor Solicitation (NS) | 135 | Resolves an address, probes reachability, or checks address uniqueness\nNeighbor Advertisement (NA) | 136 | Supplies neighbor information or announces changes\nRedirect | 137 | Identifies a better next hop for a destination\n\nAn NS or NA message is not tied to only one procedure. Its addresses, flags, and context determine whether it is participating in address resolution, reachability checking, or duplicate address detection.\n\nValid NDP messages must arrive with an IPv6 Hop Limit of 255. A router forwarding an IPv6 packet reduces its Hop Limit, so this check helps reject messages injected through an intervening router. It does not authenticate senders on the local link."
    },
    {
      "heading": "Router and prefix discovery",
      "text": "Routers periodically send Router Advertisements, commonly to the link-local all-nodes multicast address, ff02::1. A host can request an advertisement by sending a Router Solicitation, commonly to the all-routers multicast address, ff02::2, rather than waiting for the next periodic announcement.\n\nAn RA can convey:\n\n- A Router Lifetime, indicating how long the sender may be considered a default router.\n- Prefix Information Options, describing IPv6 prefixes and their associated lifetimes.\n- A suggested current Hop Limit.\n- Reachability and retransmission timer values.\n- The link’s maximum transmission unit (MTU).\n- Flags indicating the availability of managed address configuration or other configuration information.\n\nExtensions also allow RAs to advertise additional routes and Domain Name System (DNS) configuration.\n\nOn-link status and address configuration\n\nTwo flags in a Prefix Information Option serve distinct purposes:\n\n- The L flag indicates that the prefix can be used for on-link determination.\n- The A flag indicates that the prefix can be used for autonomous address configuration.\n\nThese flags are independent. Receiving a prefix for address formation does not, by itself, mean that every address in that prefix is directly reachable on the link.\n\nStateless Address Autoconfiguration (SLAAC) uses advertised prefixes to form addresses without obtaining an address assignment from a server. SLAAC is specified separately from core NDP, although it relies heavily on NDP messages.\n\nLikewise, DHCPv6 is a separate protocol that can provide addresses and other configuration. In the conventional IPv6 host configuration model, default-router discovery is performed through RAs rather than ordinary DHCPv6 address assignment. A router can advertise prefixes without offering itself as a default router by setting its Router Lifetime to zero."
    },
    {
      "heading": "Address resolution and packet delivery",
      "text": "For each outgoing packet, a node first determines the next hop. If the destination is on-link, the next hop is the destination itself. Otherwise, it is normally a selected router.\n\nOn a link that requires link-layer address resolution, the sender consults its Neighbor Cache. If no usable mapping exists, it creates an incomplete entry, queues packets as appropriate, and sends a Neighbor Solicitation.\n\nFor initial address resolution, the solicitation is sent to the target’s solicited-node multicast address. This address is formed from the prefix ff02::1:ff00:0/104 and the target IPv6 address’s low-order 24 bits. Nodes join the solicited-node multicast groups corresponding to their assigned addresses.\n\nThis use of multicast avoids sending every address-resolution request to all nodes, as an Ethernet broadcast ARP request does. Different IPv6 addresses can nevertheless share a solicited-node multicast group, so recipients must inspect the target address in the solicitation.\n\nThe target normally replies with a Neighbor Advertisement carrying the information needed to update the sender’s cache. On Ethernet, that information includes a MAC address. Other link technologies can use different link-layer identifiers, and some do not require conventional address resolution."
    },
    {
      "heading": "Neighbor unreachability detection",
      "text": "An address mapping can remain valid even when the corresponding node has stopped responding. Conversely, a lack of recent traffic does not necessarily mean that a neighbor has failed. Neighbor Unreachability Detection (NUD) distinguishes cached addressing information from evidence of current reachability.\n\nFor neighbors undergoing resolution and reachability tracking, the core protocol uses five cache states:\n\nState | Meaning\nINCOMPLETE | Address resolution is in progress; no link-layer address has yet been established\nREACHABLE | Recent positive confirmation indicates that the neighbor is reachable\nSTALE | The link-layer address is known, but recent reachability confirmation is absent\nDELAY | Traffic has resumed through a stale entry; active probing is temporarily deferred\nPROBE | Unicast Neighbor Solicitations are being sent to verify reachability\n\nPositive confirmation can come from a solicited Neighbor Advertisement or from an upper-layer indication that traffic is making forward progress. For example, suitable feedback from TCP can provide such evidence.\n\nExpiration of the reachable timer normally makes an entry stale; it does not immediately delete it or prevent further transmission. When the entry is used again, NUD allows time for confirmation before initiating active probes. If probes repeatedly fail, the node can discard the entry and reconsider its next hop or default-router selection.\n\nNUD verifies reachability to a neighboring next hop, not end-to-end connectivity to a remote destination."
    },
    {
      "heading": "Duplicate address detection",
      "text": "Duplicate Address Detection (DAD) checks whether a candidate unicast IPv6 address is already in use on the link. It is defined as part of IPv6 address autoconfiguration and uses NDP Neighbor Solicitation and Neighbor Advertisement messages.\n\nBefore ordinarily using a tentative address, a node sends a solicitation targeting that address. The source is the unspecified IPv6 address, ::, because the tentative address is not yet available for normal use. The message does not include a Source Link-Layer Address option.\n\nA response from an existing owner, or evidence of another node simultaneously checking the same address, can indicate a duplicate. DAD is a local-link check, not proof of global uniqueness, and it does not establish ownership through authentication."
    },
    {
      "heading": "Redirects and maintained information",
      "text": "A router can send a Redirect when a host has used it to reach a destination for which a better first hop exists on the same link. The better next hop may be another router or the destination itself.\n\nRedirects update destination-specific forwarding information rather than acting as a general routing protocol. Validation rules restrict their acceptance; in particular, a redirect must come from the first-hop router currently used for the relevant destination.\n\nThe NDP model separates several kinds of information:\n\n- A Neighbor Cache records neighboring nodes, link-layer mappings, and reachability state.\n- A Destination Cache records recently used destinations and their next hops.\n- A Prefix List records prefixes used for on-link determination.\n- A Default Router List records routers available for destinations without a more specific next-hop determination.\n\nImplementations may organize these structures differently internally, but the distinction separates address resolution, reachability, and forwarding decisions."
    },
    {
      "heading": "Security and operational limitations",
      "text": "Basic NDP does not cryptographically authenticate its messages. A malicious node able to transmit on the local link may send forged advertisements or solicitations. Possible effects include:\n\n- Installing an unauthorized default router through rogue RAs.\n- Corrupting neighbor mappings to intercept or misdirect traffic.\n- Disrupting address configuration by interfering with DAD.\n- Exhausting neighbor-cache resources through large numbers of unresolved addresses.\n- Causing a denial-of-service attack by advertising misleading configuration or reachability information.\n\nThe Hop Limit check limits ordinary off-link injection but does not stop a hostile local participant.\n\nSecure Neighbor Discovery (SEND), specified in RFC 3971, adds protection using mechanisms including cryptographically generated addresses and digital signatures. Its deployment requires additional cryptographic processing and supporting infrastructure.\n\nAnother mechanism, Router Advertisement Guard, filters RAs at network attachment points according to policy. It addresses unauthorized router advertisements rather than authenticating all NDP exchanges. Protocol-aware handling is important because IPv6 extension headers and fragmentation have historically complicated simplistic filtering.\n\nNDP also creates scaling considerations on large links: multicast delivery, address resolution, and neighbor-cache maintenance consume processing and state. Extensions for constrained networks adapt discovery and address registration to environments where conventional multicast-heavy behavior is costly. These extensions preserve NDP’s basic role while changing particular discovery and registration procedures."
    },
    {
      "heading": "Standardization history",
      "text": "IPv6 Neighbor Discovery was initially specified in RFC 1970 in 1996, revised in RFC 2461 in 1998, and revised again in RFC 4861 in 2007. RFC 4861 remains the core reference, with subsequent documents updating or extending particular behaviors.\n\nRelated specifications are deliberately separate. RFC 4862 defines IPv6 stateless address autoconfiguration, including DAD; RFC 3971 defines SEND. Other extensions cover functions such as router preferences, additional route information, DNS configuration, and adaptations for low-power networks."
    }
  ],
  "links": [
    "router",
    "internet-engineering-task-force",
    "ospf",
    "domain-name-system",
    "authentication",
    "denial-of-service-attack",
    "digital-signature"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}