Neighbor Discovery Protocol in IPv6 is similar to Address Resolution Protocol (ARP) in IPv4. The main purpose of both the protocols is to enable a host (node) to determine the link layer address (MAC address) of the node it wants to communicate with, in the local network and to find out the link layer address of the router though which it can access a node in an external network, so that the actual exchange of messages can take place between the two nodes.
IP addresses are used to identify devices in Layer-3. But within a particular network, only Layer-2 MAC addresses are used to find out and enable communication between two nodes. So, all the hosts/ nodes within a network maintain a table/ database containing the MAC address corresponding to the IP address of the nodes with which it needs to communicate/ exchange data packets.
What if, node 1 needs to communicate with node 2 within the same network but it does not have its link layer address? What if node 1 wants to communicate with node 3 outside the network but does not know which router to send the packets to? These questions are addressed by the Neighbor Discovery Protocol.
Functions of NDP – Neighbor Discovery Protocol:
- NDP enables nodes/ devices within a given network to determine the MAC/ link-layer address, when the IPv6 address of the destination node that it wants to communicate with, is available. This is called Address resolution and it is required in order to exchange data packets between them.
- NDP enables nodes/ devices to locate the optimum path to reach another node which is present in an external network (whose IPv6 address doesn’t belong to its network). This is done by helping the system locate the best router that is in position to deliver its packets to the destination node using the shortest path.
- NDP also enables auto-configuration of IPv6 addresses on IPv6 compliant nodes & tracks reachability state of neighboring nodes continuously in order to avoid flooding of packets to a node that is down, among other functions.
Some salient points you should know about NDP – Neighbor Discovery Protocol:
- NDP can be implemented when IPv6 IP address system is used in a network. Its function is similar to ARP (in IPv4) but it comes with certain advancements over ARP. Click here to read an introduction to IPv6 addressing system.
- Each node/ system using NDP maintains a database of all possible information about other nodes / routers in its network (like the local link and aggregated global unicast IPv6 addresses, list of available routers in the local network / their link layer addresses, list of on-link prefixes, default router, etc) using Neighbor cache (for storing info on other nodes), destination cache (for storing info on routers), etc.
- Systems using Neighbor Discovery Protocol use IPv6 prefixes to find out which destination nodes are reachable through the local link (local network) and which ones can be reached only through a router (external network).
- NDP facilitates a process called Host Auto-configuration where the host system (node) automatically gets all the information required to communicate with other nodes/ systems/ routers present in the local network.
- Since IPv6 addresses can be configured manually, there is a scope for error if the same IP address is assigned to two or more nodes. NDP pro-actively detects such duplicate addresses (even before hosts start sending information between them) in order to avoid IP address conflicts.
- When a system/ node is not sure about the Link layer address of a local node that it wants to communicate with, it uses the Address Resolution feature of NDP to find out the same. This is done by advertising Neighbor solicitation messages to all nodes in the network via multi-cast messaging. The system whose IP address was advertised, replies back to the requesting node with its link layer address via unicast messaging.
- Router discovery (for the routers present in the local network) is done as a part of the host auto-configuration process where router advertisement messages are sent to all hosts by the router informing its link layer address. Also, router solicitation messages are sent by a new host joining the network, requesting the address and credentials of the routers present in its local link.
- Generally, if a host wants to communicate with a node that is outside the network, it sends the message to a default router (in its database). The default router might accept it or respond back with a redirection message indicating that the message could be sent in a more optimal route, using another router present in a same network. This process is called redirection.
- When compared to ARP/IPv4, NDP/IPv6 is better because NDP address resolution uses multi-cast messages (compared to the broadcast messages in ARP that can flood the network). NDP also provides host auto-configuration and discovers the link layer addresses of the routers pro-actively using the initial router advertisement messages.
You could stay up to date on the various computer networking / enterprise IT technologies by subscribing to this blog with your email address in the sidebar box that says, ‘Get email updates when new articles are published’