Computer Networking › Section D · The network layer: data plane › Topic D.5
IPv6
IPv4's 4.3 billion addresses were never going to be enough for a world of phones, sensors and cloud servers. IPv6 fixes the shortage with 128-bit addresses and uses the redesign to simplify the header that every router must read.
Why a new version
By the early 1990s it was clear that 32-bit IPv4 addresses would run out, and the IETF began designing a successor. The result was IPv6, first standardised in the mid-1990s and now defined by RFC 8200 (2017). Its addresses are 128 bits long, giving \(2^{128} \approx 3.4 \times 10^{38}\) addresses, which is \(2^{96}\) times as many as IPv4, not four times. The designers also used the chance to streamline processing: a fixed-length header, no per-router fragmentation and no header checksum. NAT and the private blocks described in DHCP and network address translation stretched IPv4's life, but they were a stopgap rather than a cure.
Writing IPv6 addresses
An IPv6 address is written as eight groups of four hexadecimal digits separated by colons, each group being 16 bits. Two rules shorten it. First, leading zeros in a group may be dropped, so 0db8 becomes db8 and 0000 becomes 0. Second, one run of consecutive all-zero groups may be replaced by a double colon, ::. The double colon may appear only once, or the reader could not tell how many zeros each one hides. The recommended form, in RFC 5952, uses lower-case letters, applies :: to the longest run of zero groups (the first one if two runs tie) and never uses it for a single zero group.
Worked example: shortening an address
Shorten 2001:0db8:00a0:0000:0000:0000:0000:0e15. 1. Drop leading zeros in each group: 2001:db8:a0:0:0:0:0:e15. 2. Find runs of zero groups: there is one run of four, groups 4 to 7. 3. Replace it with ::, giving 2001:db8:a0::e15. 4. Now a harder one: 2001:0db8:0000:0000:0001:0000:0000:0001 has two runs of two zero groups. They tie, so compress the first: 2001:db8::1:0:0:1. Check: to expand, count the groups present (2001, db8, 1, 0, 0, 1 is six) and let :: stand for the missing two zero groups, which recovers all eight.
The IPv6 header
The IPv6 header is a fixed 40 bytes, though 32 of those bytes are the two 16-byte addresses. Its fields are: version (6); traffic class, 8 bits playing the role of IPv4's service bits; flow label, 20 bits that let a source tag datagrams belonging to one flow; payload length; next header, which names the TCP, UDP or ICMPv6 payload or an extension header; hop limit, the renamed TTL; and the source and destination addresses. Because the length never varies, routers can parse it quickly in hardware. Options are no longer in the main header: they move into optional extension headers chained by the next-header field.
What IPv6 removed
Three IPv4 features are gone from the fixed header. Fragmentation by routers: an IPv6 router facing a datagram larger than the next link's MTU drops it and returns an ICMPv6 Packet Too Big message, and only the source may fragment, using a fragment extension header. Every IPv6 link must carry at least 1,280 bytes. The header checksum: link layers and TCP and UDP already check for errors, and removing it saves routers from recomputing it at every hop as the hop limit falls. The variable-length options field: options became extension headers, so the common case stays fixed and fast.
Kinds of address
IPv6 has no broadcast. A unicast address names one interface; global unicast addresses currently come from 2000::/3. Every interface also has a link-local address in fe80::/10, valid only on its own link, which neighbours use to find each other. Unique local addresses, fc00::/7, are a rough counterpart to IPv4's private blocks. Multicast addresses, in ff00::/8, reach a group of interfaces, and anycast lets one address be shared so that a datagram reaches the nearest member. Subnets are almost always /64: the first 64 bits identify the network and the last 64 the interface.
Worked example: a home's allocation
An ISP delegates the prefix 2001:db8:4c00::/56 to a home. 1. Subnets are /64, so the home has \(64 - 56 = 8\) bits to number them: \(2^8 = 256\) subnets. 2. They run from 2001:db8:4c00::/64 to 2001:db8:4c00:ff::/64; the subnet number is the last two hex digits of the fourth group. 3. Each subnet has \(2^{64} \approx 1.8 \times 10^{19}\) interface identifiers. 4. The family could give the main network, guests and smart devices separate subnets, with no NAT and globally reachable addresses, filtered by the router's firewall. Check: one home's single /56 holds \(2^{72}\) addresses, far more than the entire IPv4 internet.
Configuring hosts: SLAAC
IPv6 hosts can configure themselves without a server, using stateless address autoconfiguration (SLAAC). A host forms its link-local address, then listens for, or asks for, a Router Advertisement, an ICMPv6 message in which the local router announces the subnet's /64 prefix. The host appends a 64-bit interface identifier, today usually random and changed over time for privacy, and checks that no neighbour already uses the result. DHCPv6 remains available for networks that want central control. The discovery messages belong to ICMPv6's Neighbor Discovery, the subject of the topic ICMP.
Transition: dual stack, tunnels and translation
IPv6 is not backward compatible: an IPv4-only router cannot forward an IPv6 datagram. A flag day switching everything at once was impossible, so three techniques coexist. Dual stack: hosts and routers run both protocols and use IPv6 when both ends support it. Tunnelling: to cross an IPv4-only region, a router wraps the entire IPv6 datagram as the payload of an IPv4 datagram with protocol number 41, and the router at the far end unwraps it. Translation: NAT64, with DNS64, lets IPv6-only clients reach IPv4-only servers. Adoption is uneven: Google's measurements showed IPv6 use passing 50% of its users for the first time in March 2026, varying day to day and widely between countries.
Common mistakes to avoid
First, saying IPv6 has four times as many addresses because it has four times as many bits; it has \(2^{96}\) times as many. Second, using :: twice in one address. Third, dropping trailing zeros from a group: 00a0 shortens to a0, never to a. Fourth, thinking IPv6 routers fragment oversized datagrams; they drop them and send Packet Too Big. Fifth, looking for an IPv6 broadcast address; multicast does that job. Sixth, assuming an IPv6 header is always 40 bytes plus data; extension headers can sit in between.
Key takeaways
IPv6 (RFC 8200) uses 128-bit addresses in eight hexadecimal groups, shortened by dropping leading zeros and replacing one longest run of zero groups with ::. Its fixed 40-byte header holds version, traffic class, flow label, payload length, next header, hop limit and two addresses. Routers do not fragment, there is no header checksum, and options move to extension headers. There is no broadcast; subnets are /64, link-local addresses use fe80::/10, and SLAAC lets hosts configure themselves. The transition relies on dual stack, tunnelling and NAT64, and about half of Google's users reached it over IPv6 in 2026.
Flashcards
Flashcard
128 bits, written as eight groups of four hex digits
Test your understanding
Question 1 of 5
What is the recommended short form of 2001:0db8:0000:0001:0000:0000:0000:0000?
Question 2 of 5
An IPv6 router receives a 1,500-byte datagram whose next link has a 1,280-byte MTU. What does it do?
Question 3 of 5
A home receives the prefix 2001:db8:4c00::/56 and uses /64 subnets. How many subnets can it create?
Question 4 of 5
Why does the IPv6 header have no header checksum?
Question 5 of 5
Two dual-stack routers are joined only through an IPv4-only network. How can IPv6 traffic cross between them?
