Skip to content
myiphero

Guide 02 / 05 — Network

IPv4 vs IPv6

Why the internet runs two kinds of IP address, how IPv4 and IPv6 differ, how to read an IPv6 address, and what it changes for speed, privacy and security.

Reading time
5 min
Updated
Topic
Network

Every device on the internet needs an address, and there are two address systems in use at the same time: IPv4, the original from 1981, and IPv6, its replacement, standardised in the late 1990s. They do the same job. The difference is mostly about how many addresses each can provide, and a handful of design choices that followed from that.

If you just want to know whether your connection supports IPv6, the IPv6 test checks it in a second. Read on for what the result means.

Why two versions exist

IPv4 addresses are 32 bits long, which gives about 4.3 billion possible addresses. A sizeable chunk of those is reserved for private networks, multicast and other special uses. With billions of phones, laptops, servers and smart devices, the supply ran out:

  • 2011: IANA, the body at the top of the allocation chain, handed out its last free blocks to the regional registries.
  • 2011–2019: the regional registries ran dry one by one. APNIC (Asia-Pacific) in 2011, RIPE NCC (Europe) in 2012 for normal allocations and fully in 2019, ARIN (North America) in 2015.

Since then, new networks get IPv4 addresses mainly by buying or leasing them from someone else, and providers stretch what they have with NAT (many devices sharing one address). IPv6 fixes the shortage properly by making the address space so large that it will never run out in practice.

The differences at a glance

IPv4 IPv6
Address length 32 bits 128 bits
Number of addresses ~4.3 × 109 ~3.4 × 1038
Written as 203.0.113.42 2001:db8::42
Typical home setup One public address shared through NAT Every device gets its own public address
Address configuration DHCP SLAAC (self-configuration) or DHCPv6
Header 20–60 bytes, variable 40 bytes, fixed
Fragmentation Routers may split packets Only the sender splits packets
Broadcast Yes No (multicast instead)
Address lookup in DNS A record AAAA record

For you as a user, the two rows that matter most are the first and the fourth: IPv6 has enough addresses that NAT is no longer needed, so each device can be reached directly (subject to the router’s firewall).

How to read an IPv6 address

A full IPv6 address is eight groups of four hexadecimal digits:

2001:0db8:0000:0000:0000:ff00:0042:8329

Two rules make it shorter:

  1. Leading zeros in a group can be dropped: 0db8 becomes db8, 0042 becomes 42.
  2. One run of all-zero groups can be replaced with ::, but only once per address, otherwise it would be ambiguous.

So the address above is usually written as:

2001:db8::ff00:42:8329

Network part and device part

On a typical network, the first 64 bits identify the network (the prefix) and the last 64 bits identify the device (the interface ID). Your provider gives your router a prefix, often a /56 or /48, which is enough for 256 or 65,536 separate /64 networks. That sounds absurd for a home, and that is the point: nobody has to ration addresses any more.

A few prefixes are worth recognising:

Prefix Meaning
2000::/3 (starts with 2 or 3) Global addresses, reachable on the internet
fe80::/10 Link-local, only valid on the local network segment
fc00::/7 (usually fd..) Unique local addresses, the IPv6 equivalent of private ranges
::1 Loopback, the device itself
2001:db8::/32 Reserved for documentation and examples

Privacy addresses

Early IPv6 built the device part from the network card’s hardware (MAC) address, which meant a laptop carried the same identifier from network to network. Modern systems use temporary privacy addresses instead: random interface IDs that change regularly, typically daily. Windows, macOS, iOS and Android all do this by default, so your IPv6 address is no easier to track than an IPv4 one.

How both work at the same time

Most of the internet today runs dual-stack: devices have both an IPv4 and an IPv6 address, and websites publish both an A and an AAAA record in DNS.

When you open a site that supports both, your browser starts connecting over IPv6 and, if it doesn’t answer within a fraction of a second, races an IPv4 connection alongside it. Whichever connects first wins. This approach, called Happy Eyeballs, is why a broken IPv6 setup usually just feels slightly slow instead of failing outright.

There are also networks that run only IPv6 internally and translate to IPv4 at the edge (NAT64 with DNS64, or 464XLAT). Many mobile networks work this way; your phone may have no real IPv4 address at all, while IPv4-only sites still load fine.

Does IPv6 matter for you?

Speed

The protocol itself isn’t faster. What changes is the path: on a connection where IPv4 goes through carrier-grade NAT, IPv6 skips that box and can have a few milliseconds less latency. On another network the IPv6 route might be a little longer. If you want numbers for your own line, run the ping test and the speed test.

Reachability

Without NAT, you can host a game server, a home camera or a self-hosted service without port forwarding tricks, as long as you open the port in the router’s firewall. This is the biggest practical gain for people behind carrier-grade NAT, who often can’t open IPv4 ports at all.

Security

A common myth is that IPv6 exposes every device to the internet because there is no NAT. In practice, home routers run a stateful firewall on IPv6 that blocks unsolicited incoming connections by default, which is the protection NAT was incidentally giving you on IPv4. What does deserve attention:

  • VPN leaks. If your VPN only tunnels IPv4, your IPv6 traffic may bypass it. Connect to the VPN and check both addresses on the My IP page: neither should show your home provider.
  • Firewall rules. If you manage a server or office network, make sure your firewall rules cover IPv6 as well as IPv4. It is easy to lock down one and forget the other.

Compatibility

Almost everything handles IPv6 now: every major operating system, browser, phone and large website. The gaps are mostly older routers, some corporate networks and a shrinking list of sites and APIs that are IPv4-only, which dual-stack covers anyway.

How to check your connection

  1. Open the IPv6 test. It tries to reach a host that only has an IPv6 address and another that only has IPv4, and reports which ones work.
  2. If IPv6 fails, check your router’s admin page for an IPv6 setting (often labelled IPv6, DHCPv6-PD or “native”). Some routers ship with it switched off.
  3. If the router has no option, your provider may not offer IPv6 yet. Adoption varies a lot: by Google’s measurements, close to half of its users worldwide reach it over IPv6, with much higher shares in countries such as India, France and Germany and far lower ones elsewhere.

For scripts, the IP API returns the address a request came from, which is handy for dynamic DNS updates and for checking which protocol a server or container actually uses.

In short

  • IPv4 has about 4.3 billion addresses and ran out; NAT keeps it going.
  • IPv6 has effectively unlimited addresses, so each device gets its own.
  • They coexist: dual-stack devices try IPv6 first and fall back to IPv4.
  • IPv6 is not faster or less secure by itself, but it removes the limitations of shared addresses.

Last updated 1,214 wordsSpotted a mistake? Tell us

Questions

3 answers

Is IPv6 faster than IPv4?

Not inherently. Both carry the same data over the same cables. IPv6 can be slightly quicker on networks where IPv4 goes through carrier-grade NAT, and slightly slower where the IPv6 route is longer. For most people the difference is a few milliseconds either way.

Should I turn off IPv6?

Usually no. Modern operating systems prefer whichever works best, and disabling IPv6 can break some apps and services. The main exception is a VPN that only tunnels IPv4; then fix the VPN settings or choose a VPN that handles IPv6.

Do I need to do anything to get IPv6?

It depends on your provider and router. If the provider supports it, most current routers enable it automatically. Run the IPv6 test; if it fails, check the router settings for an IPv6 or DHCPv6-PD option, or ask your provider.

Learn