The IPv6 address space
One IPv6 subnet holds four billion IPv4 internets
IPv6 addresses are 128 bits. A single /64 subnet has 2^64 addresses, 2^32 times all of IPv4.
IPv4 has a little over four billion addresses, and they are gone. Here is the whole IPv4 internet, two to the thirty-two. One ordinary IPv6 subnet, a slash sixty-four, has two to the sixty-four addresses. That is the entire IPv4 internet, four billion times over, for one office network. A site is usually given a slash forty-eight: sixty-five thousand such subnets. And the whole space is two to the hundred and twenty-eight. The design goal was never to run out again.
Writing IPv6 addresses
Drop leading zeros, then fold one run of zero groups into ::
2001:0db8:0000:0000:0000:ff00:0042:8329 shortens to 2001:db8::ff00:42:8329. The double colon may appear only once.
An IPv6 address is written as eight groups of four hexadecimal digits. That is long. Two rules shorten it. First, drop the leading zeros in every group: zero d b eight becomes d b eight, and four zeros become a single zero. Second, replace one run of zero groups with a double colon. Only once, so the reader can count how many groups it stands for.
Prefix and interface ID
The first 64 bits choose the subnet; the last 64 choose the interface
A global address is a global routing prefix (often /48), a 16-bit subnet ID and a 64-bit interface ID.
An IPv6 address has a fixed shape. The provider gives your site a prefix, usually forty-eight bits. The next sixteen bits are yours to number your subnets, sixty-five thousand of them. And the last sixty-four bits identify one interface on the subnet. Every LAN is a slash sixty-four; there is no host counting to do.
Prefix and interface ID · Going deeper
Address types: global, unique local, link-local, multicast
Global unicast is 2000::/3, unique local fc00::/7, link-local fe80::/10 and multicast ff00::/8. IPv6 has no broadcast.
SLAAC
A host builds its own address from the router’s advertised prefix
SLAAC: the router advertisement gives the prefix and gateway; the host adds its interface ID and checks for duplicates.
IPv6 hosts can configure themselves. A new host asks: are there any routers here? The router answers with an advertisement: the prefix for this link is two zero zero one, d b eight, a c a d, one, slash sixty-four, and I am your gateway. The host joins its own interface ID to the prefix. Then it asks whether anyone is already using that address. Silence means no, and the address is ready. No DHCP server was involved.
SLAAC · Going deeper · 1 of 2
SLAAC or DHCPv6, and the NDP messages
The RA’s M and O flags choose SLAAC, stateless or stateful DHCPv6. Neighbour discovery (ICMPv6 133 to 137) replaces ARP.
SLAAC · Going deeper · 2 of 2
Insert FFFE in the MAC and flip the seventh bit
EUI-64 turns MAC 00:1a:2b:3c:4d:5e into interface ID 21a:2bff:fe3c:4d5e.
A device can build its sixty-four-bit interface ID from its forty-eight-bit MAC. Start with the MAC. Split it down the middle and insert F F F E. Then flip the seventh bit of the first byte. Here zero zero becomes zero two. The result is the interface ID, and with the subnet prefix in front, a complete address. Routers use this; phones and laptops use random IDs, so they cannot be tracked by their MAC.
IPv4 to IPv6 transition
Most networks run both for years and translate at the edges
Dual stack runs IPv4 and IPv6 together; tunnelling carries IPv6 across IPv4; NAT64 lets IPv6-only hosts reach IPv4 servers.
Nobody can switch the internet over in a day, so the two protocols live side by side. Dual stack is the usual answer: every device and link gets both, and software prefers IPv6. Where a stretch of network only speaks IPv4, IPv6 packets are wrapped in an IPv4 header and tunnelled across. And mobile carriers often give phones only IPv6, translating to IPv4 at the edge with NAT64 when a site has no IPv6 yet.