How IPv6 address works.
IPv6 uses a special feature called autoconfiguration to find and assign IP address configuration to hosts on the network. IPv6 autoconfiguration can be Stateful (DHCPv6) or stateless.
IPV6 Stateless autoconfiguration.
IPv6 stateless autoconfiguration is a process that allows devices on a network to address themselves with a link-local unicast address. It’s a well known idea that every device on a Ethernet network has an interface address (Physical MAC address).
The process of auto-configuration begins with the network router obtaining the network device prefix interface address or physical mac address and goes on to add its own prefix interface address.
Have in mind that IPv6 is address is 64 bits in length, and a mac address is 48 bits, the extra 16 bits is added at the middle of the mac address with FFFE to complete the auto-configuration of the Ethernet device’ ipv6 address.
i. A MAC address is 48 bits. 0070:e876:b987
ii. 2 will be added after the first byte: 0270:e876:b987 (adding 2 makes the address globally unique since a bit of 0 is locally unique.)
iii. Insert FFFE in the middle = 0270:e8FF:FE76:b987
Stateless Auto configuration steps in summary:
i. The host sends a multicast message to each router multicast address known as Router Solicitation message (RS) for a prefix information. This message is sent inform of an ICMP type 133.
ii. The router replies with multicast packet to each multicast address with the required prefix information through the router advertisement (RA). This message is also sent inform of an ICMP type 134.
iii. The host receives the RA and added prefix, allowing it’s interface to be autoconfigured.