9.20 Automatic IPv6 Network Configuration
DHCP works acceptably well in practice, but it relies on certain assumptions, including that there will be a DHCP server available, that the server is correctly implemented and stable, and that it can track and maintain leases. Although there’s a version of DHCP for IPv6 called DHCPv6, there’s an alternative that’s far more common.
The IETF took advantage of the large IPv6 address space to devise a new way of network configuration that does not require a central server. This is called stateless configuration, because clients don’t need to store any data such as lease assignments.
Stateless IPv6 network configuration starts with the link-local network. Recall that this network includes the addresses prefixed fe80::/64. Because there are so many available addresses on the link-local network, a host can generate an address that is unlikely to be duplicated anywhere on the network. Furthermore, the network prefix is already fixed, so the host can broadcast to the network, asking if any other host on the network is using the address.
Once the host has a link-local address, it can determine a global address. It does so by listening for a router advertisement (RA) message that routers occasionally send on the link-local network. The RA message includes the global network prefix, the router IP address, and possibly DNS information. With that information, the host can attempt to fill in the interface ID part of the global address, similar to what it did with the link-local address.
Stateless configuration relies on a global network prefix at most 64 bits long (in other words, its netmask is /64 or lower).
Routers also send RA messages in response to router solicitation messages from hosts. These, as well as a few other messages, are part of the ICMP protocol for IPv6 (ICMPv6).