IPv6 - Communication
In IPv4, a host which wants to communicate with some other host on the network, needs first to have an IP address acquired either by means of DHCP or by manual configuration. As soon as a host is equipped with some valid IP address, it is now able to speak to any host on the subnet. To communicate on layer-3, a host also must know the IP address of the other host. Communication on a link, is established by means of hardware embedded MAC Addresses. To know the MAC address of host whose IP address is known, a host sends ARP broadcast and in revert the intended host sends back its MAC address.
In IPv6, there’s no broadcast mechanism. It is not a must for an IPv6 enabled host to obtain IP address from DHCP or manually configured, but it can auto-configure its own IP. Then, how would a host communicates with others on IPv6 enabled network?
ARP has been replaced by ICMPv6 Neighbor Discovery Protocol.
Neighbor Discovery Protocol
A host in IPv6 network is capable of auto-configuring itself with a unique link-local address. As soon as it is equipped with an IPv6 address, it joins a number of multicast groups. All communications related to that segment happens on those multicast addresses only. A host goes through a series of states in IPv6:
Neighbor Solicitation: After configuring all IPv6’s either manually, or by DHCP Server or by auto-configuration, the host sends a Neighbor Solicitation message out to FF02::1/16 multicast address for all its IPv6 addresses in order to know that no one else occupies same addresses.
DAD (Duplicate Address Detection): When the host does not listen from anything from the segment regarding its Neighbor Solicitation message, it assumes that no duplicate address exists on the segment.
Neighbor Advertisement: After assigning the addresses to its interfaces and making them up and running, the host once again sends out a Neighbor Advertisement message telling all other hosts on the segment, that it has assigned those IPv6 addresses to its interfaces.
Once a host is done with the configuration of its IPv6 addresses, it does the following things:
Router Solicitation: A host sends a Router Solicitation multicast packet (FF02::2/16) out on its segment to know the presence of any router on this segment. This helps the host to configure the router as its default gateway. If its default gateway router goes down, the host can shift to a new router and makes it the default gateway.
Router Advertisement: When a router receives a Router Solicitation message, it responses back to the host advertising its presence on that link.
Redirect: This may be the situation where a Router receives a Router Solicitation request but it knows that it is not the best gateway for the host. In this situation, the router sends back a Redirect message telling the host that there is a better ‘next-hop’ router available. Next-hop is where the host will send its data destined to a host which does not belong to the same segment.