2026
IPv4 vs. IPv6: Why the Internet Needed a New Address Space
IPv4 has been running out of addresses for decades. IPv6 was designed to fix that permanently, along with several other problems along the way. Here is how the two protocols compare, what changed in the header, and how the transition between them actually works.
Most people working in tech have seen an IPv4 address. The four numbers separated by dots — something like 192.168.0.1 — show up in router configuration pages, server setup guides and network diagnostics all the time. IPv6 addresses, with their colons and hexadecimal groups, tend to look alarming by comparison. That discomfort is understandable but mostly unwarranted. The two versions of IP do the same job. The differences in how they do it follow logically from a single practical problem: IPv4 is running out of space.
Understanding both versions is more relevant than it used to be. IPv6 adoption has been growing steadily for years. Cloud providers now expose IPv6 addresses by default on many resources. Mobile networks in several countries have moved most of their traffic to IPv6 already. It is no longer a topic you can safely skip until later.
Why IPv4 ran out
IPv4 uses 32-bit addresses. That gives you a theoretical maximum of 4,294,967,296 unique addresses. In 1981 when the addressing scheme was defined, that number seemed impossibly large. The internet was an academic network connecting a few hundred institutions and nobody seriously expected it to become the infrastructure that everything runs on.
The problems started showing up in the 1990s. As commercial internet access expanded, it became clear that 4 billion addresses would not last. Two stopgap measures bought time. First, large blocks of addresses that had been allocated to organisations in the early days in far greater quantities than they needed were reclaimed. Second, Network Address Translation was invented.
NAT lets an entire network share a single public IP address. Your home router has one public address assigned by your ISP. Every device on your home network gets a private address from a reserved range that is not routable on the public internet. The router keeps a translation table mapping outgoing connections to their internal source. Return traffic comes back to the public address and the router rewrites the destination to the correct internal device.
Worth noting
NAT solved the immediate exhaustion problem but introduced complications. End-to-end connectivity breaks. Protocols that embed IP addresses in their payload need special handling. Peer-to-peer connections require workarounds like STUN and TURN. IPv6 was designed to remove the need for NAT entirely, not to improve on it.
IANA, the body responsible for global IP allocation, distributed its last blocks of IPv4 address space to the regional registries in 2011. The regional registries exhausted their pools in the years that followed. New public IPv4 addresses are still obtainable through transfers from organisations that hold more than they use, but the supply is finite.
Comparing the address formats
The most visible difference between IPv4 and IPv6 is the address format. IPv4 uses 32 bits written as four decimal numbers. IPv6 uses 128 bits written as eight groups of four hexadecimal digits. The step from 32 to 128 bits is not just incremental. The total number of available addresses goes from roughly 4 billion to 340 undecillion. Written out that number has 39 digits. There are more IPv6 addresses than there are atoms in the observable universe.
Reading abbreviated IPv6 addresses
A full IPv6 address is 39 characters long. Two shortening rules exist to make addresses manageable in practice. You will see both applied together in most real addresses.
Drop leading zeros
Leading zeros within each group can be removed.
Collapse consecutive all-zero groups
A double colon replaces one or more consecutive groups of all zeros. It can only appear once in an address.
The loopback address illustrates how far this compression can go. The full form is 0000:0000:0000:0000:0000:0000:0000:0001. Drop the leading zeros and collapse the consecutive zero groups and you get ::1. The double colon represents all seven groups of zeros that were elided.
IPv6 address types
IPv4 has unicast, broadcast and multicast. IPv6 dropped broadcast entirely and introduced anycast as a first-class concept. The removal of broadcast is significant: broadcast traffic forces every device on a network segment to interrupt what it is doing to process a packet that was probably not intended for it. IPv6 replaced most broadcast uses with targeted multicast, which only reaches devices that have opted into the relevant group.
A single address assigned to a single interface. Traffic sent to a unicast address goes to exactly one destination. Global unicast addresses (starting with 2000::/3) are routable across the public internet.
An address that represents a group of interfaces. Packets sent to a multicast address are delivered to every interface in that group. IPv6 uses multicast in places where IPv4 used broadcast, including neighbour discovery.
One address assigned to multiple interfaces, usually on different nodes. Packets go to whichever node is topologically closest. Used by DNS root servers and CDN infrastructure to route requests to the nearest available instance.
The IPv6 packet header
One of the practical improvements in IPv6 is a simpler, fixed-length header. The IPv4 header has a variable length because it includes an options field. Routers have to parse that field to figure out how long the header actually is before they can find the payload. The IPv6 header is always 40 bytes. Routers can skip straight to the payload offset without inspecting anything.
Optional information that used to live in IPv4 header options is handled through extension headers in IPv6. Extension headers are chained between the fixed header and the transport layer payload. The Next Header field in the fixed header points to the first extension header. Each extension header has its own Next Header field pointing to the next one in the chain. Routers that do not need to process an extension header can skip it, which keeps the fast path fast.
Version
4 bits
Always 6 for IPv6. Tells routers which IP version this packet uses.
Traffic Class
8 bits
Equivalent to the Differentiated Services field in IPv4. Used for QoS — marking packets to influence queuing priorities at routers.
Flow Label
20 bits
A value that identifies packets belonging to the same flow so routers can handle them consistently. Useful for real-time traffic where packet reordering matters.
Payload Length
16 bits
The size in bytes of everything following the 40-byte fixed header, including any extension headers.
Next Header
8 bits
Identifies what follows the fixed header. Could be a transport protocol like TCP or UDP, an ICMPv6 header, or an IPv6 extension header.
Hop Limit
8 bits
Decremented by one at each router. Packet is discarded when it reaches zero. The IPv6 equivalent of TTL.
Source Address
128 bits
The full 128-bit IPv6 address of the sender.
Destination Address
128 bits
The full 128-bit IPv6 address of the intended recipient.
Neighbour Discovery replaces ARP
In IPv4, ARP is used to find the MAC address of another device on the same network. A device broadcasts an ARP request asking who holds a particular IP address. The owner responds with its MAC address. Every device on the segment receives the broadcast and discards it if the question was not about them.
IPv6 replaces ARP with the Neighbour Discovery Protocol, which runs over ICMPv6 and uses multicast instead of broadcast. When a device needs to resolve a link-layer address, it sends a Neighbour Solicitation message to a solicited-node multicast address derived from the target's IPv6 address. Only the target device listens to that specific multicast group. Other devices on the segment are not interrupted.
NDP also handles
Running both at once
IPv4 and IPv6 are not compatible at the network layer. An IPv6 packet cannot be forwarded by a router that only speaks IPv4. Moving the entire internet from one to the other overnight is not possible, so the transition has been managed through mechanisms that let both coexist.
Dual stack
A device runs both IPv4 and IPv6 simultaneously. It can communicate with peers over either protocol depending on what the destination supports. Most modern operating systems and cloud platforms use dual stack as the baseline during the transition period. When a hostname resolves to both an A and an AAAA record, the client picks IPv6 first if the connection succeeds.
Tunnelling
IPv6 packets are encapsulated inside IPv4 packets to travel across parts of the network that do not yet support IPv6 natively. The IPv6 payload is wrapped in an IPv4 header at the entry point of the IPv4-only segment, then unwrapped at the exit. Mechanisms like 6in4 and Teredo work this way.
NAT64
Allows IPv6-only clients to reach IPv4-only services. The NAT64 device sits at the boundary, receives traffic destined for a synthesised IPv6 address that encodes an IPv4 target, translates the packet and forwards it as IPv4. The response is translated back before reaching the IPv6-only client.
For most services today, dual stack is the practical answer. Your server gets both an IPv4 address and an IPv6 address. DNS publishes both an A record and an AAAA record for your hostname. Clients that support IPv6 connect over IPv6. Clients that only support IPv4 connect over IPv4. Both groups reach the same application without any translation layer in between.
Where it fits
IPv4 and IPv6 operate at layer 3 of the OSI model. They sit above the data link layer, which handles local delivery between directly connected devices and below the transport layer, where TCP and UDP live. IP is responsible for addressing packets and routing them across networks. Everything else in the stack — the connection tracking, the retransmission, the port numbers — belongs to the layer above it.
In practice, both versions of IP are invisible most of the time. You write code that opens a socket to a hostname. DNS resolves that hostname. The operating system picks an address family based on what is available. The packet goes out. The version in use only surfaces when something breaks — when a firewall rule is missing for IPv6, when a service is bound to 0.0.0.0 but not ::, when a NAT64 translator drops traffic that it does not know how to handle.
Cloud infrastructure has made IPv6 easier to adopt without requiring a redesign of how your network is laid out. Most managed services support dual-stack deployments. Kubernetes clusters can be configured to assign IPv6 addresses to pods alongside IPv4. The operational gap between the two protocols is narrowing. Understanding what changed between them and why it changed, is what lets you debug the edge cases that still come up.