IPv6 Neighbor Discovery Protocol

The Neighbor Discovery Protocol (ND) is described in RFC 4861 as a protocol in the internet protocol suite operates in the link-layer of the internet module and used by IPv6 to achieve some functions. NDP actually defines a set of messages that determines the relationship between IPv6 enabled nodes.

IPv6 ND Protocol replaces Address Resolution Protocol “ARP”, Internet Control Message Protocol “ICMP” Router Discovery and Router Redirect Protocols which are used by IPv4, also ND Protocol provides additional functions that are not provided in IPv4.

The five ICMPv6 messages defined by ND Protocol:

  1. Router Solicitation (RS): Host inquires information about the local routers.
  2. Router Advertisement (RA): Advertises an active router in respond to RS messages.
  3. Neighbor Solicitation (NS): Inquires information about local neighbors – it sent by IPv6 nodes.
  4. Neighbor Advertisement (NA): Nodes advertise their presence in respond to NS messages.
  5. Redirect Message: Routers inform hosts about a better next-hop rather than themselves for a specific destination.

The mentioned five ICMPv6 messages are used to accomplish the following ND protocol functions

  • Router discovery
  • Prefix discovery
  • Parameter discovery
  • Address auto-configuration
  • Next-Hop determination
  • Neighbor unreachability detection
  • Duplicated Address detection
  • Redirect function

Now we’re going to explain three functions that I actually see them as the main functions of ND Protocol:

Router discovery:
Basically Router discovery function is for hosts to can locate Routers residing on the attached link (the same like IPv4 ARP function) but also auto configure a default router (IPv4 DHCP). Firstly when a host joins a link it Multicasts Router Solicitation (RS) to All Routers multicast group FF02::2 (as defined in RFC 4291), and each active router on that link receives the RS will immediately respond by Router Advertisement (RA) with his address to All Nodes multicast group FF02::1 (as defined in RFC 4291) showing his presence and indicating paths out of that link and other information which are used by other ND functions/processes.

– Address auto-configuration:This function/mechanism is provided to hosts to automatically configure their IPv6 enabled interfaces by doing a combination between a prefix learned from the local router and EUI-64 derived address (described in RFC 2373) of the host interface.

– Address resolution:
The process by which a node (Host/Router) resolves a neighboring node’s IPv6 address to its link-layer address the same function of ARP in IPv4. The node multicasts Neighbor Solicitation (NS) on the attached link and the mentioned router responds with Neighbor Advertisement (NA).

Example lab:
– Two routers are IPv6 connected through Fastethernet 1/0 from both sides, below we are using the debug mode “debug ipv6 nd” to show how does NDP is working:

*Sep 16 11:05:46.087: IPv6-Addrmgr-ND: DAD request for FE80::C801:2AFF:FED0:1C on FastEthernet1/0
*Sep 16 11:05:46.091: ICMPv6-ND: Sending NS for FE80::C801:2AFF:FED0:1C on FastEthernet1/0
*Sep 16 11:05:47.091: IPv6-Addrmgr-ND: DAD: FE80::C801:2AFF:FED0:1C is unique.
*Sep 16 11:05:47.091: ICMPv6-ND: Sending NA for FE80::C801:2AFF:FED0:1C on FastEthernet1/0
*Sep 16 11:05:47.095: ICMPv6-ND: L3 came up on FastEthernet1/0
*Sep 16 11:05:47.099: IPv6-Addrmgr-ND: DAD request for 2001::2 on FastEthernet1/0
*Sep 16 11:05:47.107: ICMPv6-ND: Sending NS for 2001::2 on FastEthernet1/0
*Sep 16 11:05:47.107: ICMPv6-ND: Linklocal FE80::C801:2AFF:FED0:1C on FastEthernet1/0, Up
*Sep 16 11:05:48.107: IPv6-Addrmgr-ND: DAD: 2001::2 is unique.
*Sep 16 11:05:48.111: ICMPv6-ND: Sending NA for 2001::2 on FastEthernet1/0*Sep 16 11:06:00.835: ICMPv6-ND: Received NS for 2001::2 on FastEthernet1/0 from 2001::1
*Sep 16 11:06:00.839: ICMPv6-ND: Glean 2001::1 on FastEthernet1/0
*Sep 16 11:06:00.839: ICMPv6-ND: Neighbour 2001::1 on FastEthernet1/0 : LLA ca00.2ad0.001c
*Sep 16 11:06:00.839: ICMPv6-ND: INCMP -> STALE: 2001::1
*Sep 16 11:06:00.843: ICMPv6-ND: Sending NA for 2001::2 on FastEthernet1/0
*Sep 16 11:06:00.847: ICMPv6-ND: STALE -> DELAY: 2001::1
*Sep 16 11:06:05.903: ICMPv6-ND: DELAY -> PROBE: 2001::1
*Sep 16 11:06:05.903: ICMPv6-ND: Sending NS for 2001::1 on FastEthernet1/0
*Sep 16 11:06:05.959: ICMPv6-ND: Received NA for 2001::1 on FastEthernet1/0 from 2001::1
*Sep 16 11:06:05.963: ICMPv6-ND: PROBE -> REACH: 2001::1
*Sep 16 11:06:11.039: ICMPv6-ND: Received NS for FE80::C801:2AFF:FED0:1C on FastEthernet1/0 from FE80::C800:2AFF:FED0:1C
*Sep 16 11:06:11.043: ICMPv6-ND: Glean FE80::C800:2AFF:FED0:1C on FastEthernet1/0
*Sep 16 11:06:11.043: ICMPv6-ND: Neighbour FE80::C800:2AFF:FED0:1C on FastEthernet1/0 : LLA ca00.2ad0.001c
*Sep 16 11:06:11.047: ICMPv6-ND: INCMP -> STALE: FE80::C800:2AFF:FED0:1C
*Sep 16 11:06:11.047: ICMPv6-ND: Sending NA for FE80::C801:2AFF:FED0:1C on FastEthernet1/0
*Sep 16 11:06:11.051: ICMPv6-ND: STALE -> DELAY: FE80::C800:2AFF:FED0:1C
*Sep 16 11:06:16.131: ICMPv6-ND: DELAY -> PROBE: FE80::C800:2AFF:FED0:1C
*Sep 16 11:06:16.131: ICMPv6-ND: Sending NS for FE80::C800:2AFF:FED0:1C on FastEthernet1/0
*Sep 16 11:06:16.187: ICMPv6-ND: Received NA for FE80::C800:2AFF:FED0:1C on FastEthernet1/0 from FE80::C800:2AFF:FED0:1C
*Sep 16 11:06:16.191: ICMPv6-ND: PROBE -> REACH: FE80::C800:2AFF:FED0:1C

The previous output shows two parts. The first red part the router is trying to figure out who’s FE80::C801:2AFF:FED0:1C and 2001::2 and then it discovered that those addresses are the linklocal and global for the local FastEthernet1/0 so the result came with the keyword “unique” then it started to send NA to the neighbors that these addresses belong to “ME”.
The second“blue part” shows that the neighbor is sending NS asking “who got these IPv6 addresses?” then the local router automatically figures out the neighbor’s linklocal and global addresses and install them in his IPv6 neighbors table then inform the neighbor again that the mentioned addresses belong to “ME” by sending new NA.

NetRise#show ipv6 neighbors
IPv6 Address                              Age Link-layer Addr State Interface
2001::1                                    32 ca00.2ad0.001c  STALE Fa1/0
FE80::C800:2AFF:FED0:1C                    31 ca00.2ad0.001c  STALE Fa1/0

I know that all uncovered functions seem very interesting to know about and we may explain them in another article or lab, so I hope that the above information are so useful for everyone.

recursive-lookup.com

Don’t miss our Articles & Podcasts!

We don’t spam! Read our privacy policy for more info.

Osama Aboelfath is co-founder at Recursive-lookup. Osama is a network engineer and developer with over 10 years of production network engineering, deployment & operation.

Leave a Reply