The IPv4 address space has a theoretical limit of 4.3 billion addresses (2^32) as it is 32bits log. We are running out of IPv4 Addresses. If we want to provide Internet access to only 20 percent of the world’s population, we will need the IPv6 address space. Almost of the consumer electronics devices which are manufactured today has some kinda of network connectivity and all of them are IP-based. To solve this issue switching to IPv6 is the goto solution because of its large address space.
Neighbour Discovery (ND) is specified in RFC 4861. With the Neighbor Discovery protocol we can detect for Duplicate IP addresses (DAD). This is built into the protocol itself. And also it provides Neighbour Unreachability Detection (NUD) mechanism also. With IPv4,there are no means to detect whether a neighbour is reachable or not.Neighbour Discovery combines both Address Resolution Protocol (ARP) and ICMP Router Discovery and Redirect.
Neighbour discovery in IPv6 is used for the following purposes:
- Stateless Autoconfiguration of IPv6 addresses (SLAAC).
- Get details about network prefixes, routes, DNS and other configuration information
in other words DHCPv6.
- Duplicate IP Address Detection (DAD) and tracking of neighbours who are reachable (NUD).
- Determine Layer 2 addresses of nodes on the same link. This replaces ARP in IPv6. Yes in IPv6 there is no ARP protocol.
The workhorse behind Neighbour discovery in IPv6 is ICMPv6 which is used in the all the above said use cases. This protocol has many functionalities and pls refer to RFC 4443 for more detailed information (Will share more detailed info in a separate blog).
As an example on how the few things are made simple in IPv6 when a new node wants to know about the available routers in the link it sends a Router solicitation packet and the routers responds with a Router Advertisement packet which already contains link-layer addresses for the router. There is no need for the node receiving a Router Advertisement to send out an additional ARP request as an IPv4 node would have to do to get the link-layer address for the router interface.
This is one of the most important capabilities provided by IPv6 protocol. Nodes in the network now have the capability to automatically configure themselves with valid IPv6 addresses. This keeps manual entering of IP addresses at bay (with 128bits and addresses in HEX it is much easier for us to let the machine do the work for us). For example, Nodes in the same LAN can talk to each other without any manual configuration or through DHCP using the automatically configured link local addresses. These addresses have the network prefix of FE80::/10. Any interface which supports IPv6 should have at least one link local address.
The above screenshot is taken from Pandaboard ES running ARCH Linux. The IPv6 address on the interface is marked as ” inet6 fe80::a42b:6dff:febb:8c54 “. Next to it is prefix length “prefixlen 64” and then scope of the address which is shown as link local “scopeid 0x20<link>“. This address can be derived either using the MAC address of the interface along EUI64 calculation or they can be randomly chosen for security purposes.
Another screenshot of the interfaces having IPv6 addresses. This is taken from a machine running Mate on X86_64.
SLAAC – Stateless Address Auto-configuration
IPv6 hosts can auto-configure their IPv6 addresses without any manual configuration. As said above, IPv6 addresses can be generated by hosts using either interface MAC address (which is unique for each interface) or a randomly chosen interface ID value.
DHCP – Stateful Address configuration
IPv6 nodes gets all the needed configuration from the DHCP servers. This is exactly similar to what happens in the case of IPv4 networks.
This is manual configuration of IPv6 address on the node. As we can understand, mostly this is done for servers providing functionalities like HTTP, DNS , DHCP etc whose IP address can’t change for obvious reasons.
Stateless and Stateful Address Auto-configuration can also be combined. For instance, a
host can use Stateless Address Auto-configuration to generate an IPv6 address but then
use DHCPv6 for additional parameters like DNS server, MTU etc.