Gate46
  1. Learn
  2. IPv4 vs IPv6

IPv4 vs IPv6

Why the internet is moving from 32-bit to 128-bit addresses, how to read the new ones, and what the change means for a home connection.

Why IPv4 ran out

An IPv4 address is 32 bits long, which allows 232, or 4,294,967,296, addresses. That looked generous when the protocol was specified in 1981. It is fewer than one per person alive today.

Not all of that space is usable. Large parts are reserved for private networks, loopback, multicast and future use. Early allocations were also generous: some organisations received a /8, a block of 16,777,216 addresses.

IANA, which holds the global pool, handed its last five /8 blocks to the regional registries on 3 February 2011. The registries then ran short one after another: APNIC in April 2011, RIPE NCC in September 2012, LACNIC in June 2014 and ARIN in September 2015. A network that needs IPv4 space today joins a waiting list or buys a block from another organisation.

The internet kept growing by sharing. Home routers put every device behind one public address with NAT, and many providers now add a second layer, carrier-grade NAT, that puts many customers behind one address. It works, but it has costs. Inbound connections need port forwarding or fail outright, and one customer's abuse can land a shared address on a blocklist for everyone using it.

What IPv6 changes

An IPv6 address is 128 bits long. That allows 2128 addresses, about 3.4 × 1038. A single standard subnet, a /64, holds 264 addresses, roughly four billion times the entire IPv4 internet.

  • No NAT needed. Every device can have its own globally unique address, so nothing has to be shared or translated. The router's firewall, not NAT, is what keeps unsolicited traffic out.
  • Devices configure themselves. With stateless address autoconfiguration, or SLAAC, the router announces the network prefix and each device builds the rest of its own address, then checks that no neighbour is already using it. No DHCP server is required, although DHCPv6 exists for networks that want one.
  • Privacy extensions. Early implementations built the device half of the address from the network card's hardware address, which made a device recognisable on every network it joined. Current versions of Windows, macOS, iOS and Android generate random identifiers instead, and use temporary addresses for outgoing connections that they replace regularly, often daily.
  • Simpler plumbing. The header is a fixed 40 bytes with no checksum, routers never fragment packets, multicast replaces broadcast, and Neighbor Discovery replaces ARP.

How to read an IPv6 address

The full form is eight groups of four hexadecimal digits separated by colons. Two rules shorten it:

  1. Drop the leading zeros in any group, so 0db8 becomes db8 and 0000 becomes 0.
  2. Replace one run of consecutive all-zero groups with ::. This is allowed only once per address, because with two gaps nobody could tell how many groups each one stands for.
Full formShortened
2001:0db8:0000:0000:0000:ff00:0042:83292001:db8::ff00:42:8329
2001:0db8:0000:0001:0000:0000:0000:00012001:db8:0:1::1
2001:0db8:0000:0000:0001:0000:0000:00012001:db8::1:0:0:1
2001:0db8:0000:0000:0000:0000:0000:00002001:db8::
0000:0000:0000:0000:0000:0000:0000:0001::1

By convention the result is written in lower case and the :: goes on the longest run of zero groups, never on a single group. That is why the second example keeps its lone 0 and compresses the run of three. When two runs tie, as in the third example, the first one is compressed.

A slash and a number give the prefix length, the count of leading bits that identify the network. 2001:db8::/32 is the block reserved for documentation, which is why the examples in this guide use it. The subnet calculator shows the range behind any prefix.

Side by side

PropertyIPv4IPv6
Address length32 bits128 bits
Total addressesAbout 4.3 billionAbout 3.4 × 1038
Written asFour decimal numbers with dotsEight hexadecimal groups with colons
Example203.0.113.422001:db8::ff00:42:8329
Typical home setupOne public address shared through NATA whole prefix, with a global address for each device
Getting an addressDHCP or manualSLAAC, DHCPv6 or manual
Finding neighboursARP, using broadcastNeighbor Discovery, using multicast
Private range10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16fc00::/7
Loopback127.0.0.1::1
Packet header20 to 60 bytes, with a checksumFixed 40 bytes, no checksum
FragmentationBy the sender or by routersBy the sender only
DNS recordAAAAA
Reverse DNS zonein-addr.arpaip6.arpa

Dual-stack and the transition

The two protocols cannot talk to each other directly. An IPv4-only device cannot exchange packets with an IPv6-only one unless something translates in between. So the move is a long overlap, not a switch-over day.

  • Dual-stack. The connection carries both protocols. Your device tries both, prefers IPv6 when it works, and falls back to IPv4 within a fraction of a second when it does not. Where a home broadband provider offers IPv6, this is the usual arrangement.
  • NAT64 and DNS64. The network runs IPv6 only. When a site has only an IPv4 address, the DNS64 resolver builds an IPv6 address that embeds the IPv4 one, commonly under 64:ff9b::/96, and a NAT64 gateway translates the traffic.
  • 464XLAT. This adds a small translator on the device itself, so apps that insist on IPv4 still work across an IPv6-only network. Many mobile networks run this way, which is why a phone on mobile data may have no IPv4 address from the carrier yet still reaches IPv4 sites.
  • Tunnels. IPv6 packets travel inside IPv4 ones, as with 6in4 tunnels from a tunnel broker or 6rd run by some providers. DS-Lite does the reverse and carries IPv4 inside IPv6 to a carrier-grade NAT. The older automatic tunnels, 6to4 and Teredo, have largely been retired.

What it means at home

  • Usually there is nothing to do. If your provider and router support IPv6, your devices pick it up on their own.
  • No IPv6 is not a fault. Everything remains reachable over IPv4. If you want IPv6, check that it is switched on in the router's settings, then ask the provider whether they offer it.
  • Hosting works differently. Port forwarding is not needed over IPv6. You allow inbound traffic to the device's own address in the router's firewall instead, then test it with the port checker.
  • Check your VPN. A VPN that only tunnels IPv4 leaves IPv6 traffic going out directly. With the VPN on, My IP should not show an IPv6 address from your usual provider.
  • Do not expect a speed change. Neither protocol is faster by design.

How to check your connection

The IPv6 test shows whether your connection can reach an IPv6-only server and which protocol your browser prefers when both work. My IP shows both of your addresses side by side. To see whether a website is reachable over IPv6, run a DNS lookup and look for an AAAA record.

Common questions

What happened to IPv5?

Version number 5 was given to an experimental protocol for streaming voice and video, the Internet Stream Protocol. It was never meant as a replacement for IPv4, but the number was taken, so the successor became version 6.

Is IPv6 faster than IPv4?

Not by design. Speed depends on the route your provider has to each destination. IPv6 can be slightly quicker where it avoids a carrier-grade NAT, and slightly slower where the provider's IPv6 routes are less direct. Most people see no difference.

Should I turn IPv6 off?

Usually not. Turning it off rarely solves a problem, and some operating system features expect it to be there. If you suspect it is causing a specific problem, switch it off on the router as a test, note the result, and switch it back on afterwards.

Will IPv4 be switched off?

No date has been set, and none is likely soon. Too many sites and devices still speak only IPv4. The two will run side by side for years, with translation such as NAT64 covering the gaps as more networks go IPv6 only.