IPv4 and IPv6 are the two versions of the Internet Protocol running the internet today. IPv4 uses 32-bit addresses, and it's flat-out run out of new ones to hand out. IPv6 uses 128-bit addresses instead, which gives you an effectively unlimited supply, and it cleans up several parts of how networks operate along the way.
IPv4 vs IPv6 at a glance
| IPv4 | IPv6 | |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Number of addresses | 232 ≈ 4.3 billion | 2128 ≈ 3.4 × 1038 |
| Notation | Dotted decimal: 192.0.2.10 | Hexadecimal with colons: 2001:db8::10 |
| Header | Variable, 20–60 bytes, with checksum | Fixed 40 bytes, no checksum, optional extension headers |
| Address configuration | Manual or DHCP | SLAAC, DHCPv6 or manual |
| Local address resolution | ARP (uses broadcast) | Neighbor Discovery (uses multicast) |
| Broadcast | Yes | No (replaced by multicast) |
| Fragmentation | By sender or routers | By sender only |
| NAT | Almost universal on home networks | Not needed for address sharing |
| Defined in | RFC 791 (1981) | RFC 2460 (1998), now RFC 8200 |
How the address formats differ
IPv4 notation
An IPv4 address is just four 8-bit numbers (octets), written in decimal and separated by dots. Each octet has to fall between 0 and 255 — so 192.0.2.10 works fine, but 192.0.2.300 doesn't. Strip away the formatting and it's really one 32-bit integer underneath, which is exactly why the same address can also be written as 3221225994. Try the conversion yourself with the IP address converter.
IPv6 notation
An IPv6 address breaks into eight groups of 16 bits, each one written as up to four hexadecimal digits and separated by colons. Two rules keep these from becoming unreadable:
- Drop leading zeros wherever they appear:
0db8just becomesdb8. - Collapse one run of all-zero groups down to a double colon
::. You only get to do this once per address — do it twice and the length becomes ambiguous.
Full: 2001:0db8:0000:0000:0000:0000:0000:0001
Compressed: 2001:db8::1
RFC 5952 recommends writing IPv6 addresses in lowercase, in their shortest possible form — and that's what most tools show you by default. One catch: put an IPv6 address in a URL and you have to wrap it in square brackets, or the colons get mistaken for a port separator. So it's http://[2001:db8::1]:8080/, brackets and all.
Prefixes instead of subnet masks
Both versions describe networks using CIDR prefixes, but IPv6 networks run far bigger. A standard IPv6 subnet — a single LAN — is a /64, and that alone holds 264 addresses. ISPs commonly hand customers a /56 or /48, which works out to hundreds or even tens of thousands of /64 subnets for a single home or business. The subnet calculator handles both IPv4 and IPv6 prefixes if you need to work through the math.
Why IPv4 ran out
Back when IPv4 was standardised, 4.3 billion addresses looked like plenty. In practice, though, a good chunk was never usable at all — large ranges got reserved for private networks, multicast, loopback, documentation, future use, you name it — and early allocations handed enormous blocks to a small handful of organisations. Then home broadband, smartphones and cloud computing came along and ate through what was left.
IANA handed out its last free blocks to the five Regional Internet Registries back in February 2011. From there, each registry ran dry on its own schedule: APNIC in 2011, RIPE NCC in 2012 for normal allocations, ARIN in 2015, with the rest following along after. These days, an organisation that needs more IPv4 space mostly buys or leases it on a secondary market, or waits in line for returned addresses.
How NAT kept IPv4 alive
If IPv4 still works at all today, it's largely thanks to Network Address Translation. Your router quietly gives every device at home its own private address, then rewrites outgoing traffic so it all looks like it's coming from one public address. Mobile carriers, and a fair few broadband providers, push this further with carrier-grade NAT (CGNAT), sharing a single public address among many customers at once. It conserves addresses, sure, but it breaks end-to-end connectivity in the process — inbound connections need port forwarding, and behind CGNAT they're often just impossible. See Public vs Private IP Addresses Explained for how it actually works.
What IPv6 improves
Enough addresses for everything
With IPv6, every single device gets to have its own globally unique address. That brings back end-to-end connectivity (your firewall notwithstanding) and does away with address-sharing tricks altogether. It also makes peer-to-peer apps, gaming, video calls and self-hosting a whole lot simpler.
Simpler, faster headers
The IPv6 header is fixed-size and carries fewer fields than its predecessor. It ditches the header checksum entirely — link layers and transport protocols already catch errors — and routers no longer fragment packets themselves; the sender instead uses Path MTU Discovery to pick a packet size that'll actually fit. Optional features live in extension headers most routers can just skip right past. Put together, forwarding becomes a lot more predictable for the hardware doing it.
Automatic configuration
IPv6 hosts can set themselves up using Stateless Address Autoconfiguration (SLAAC): the router advertises a network prefix, and each device builds its own address from there. DHCPv6 is still around for administrators who want central control instead. And every IPv6 interface gets a link-local address starting with fe80:: that works even with no router present at all.
Privacy addresses
Early SLAAC derived part of the address straight from the device's MAC address — which, as it turns out, made tracking a device across networks fairly trivial. Modern operating systems have moved on: they use temporary (privacy) addresses for outgoing connections and rotate them regularly, so a website sees a changing address instead of one tied permanently to your hardware.
How IPv4 and IPv6 coexist
Here's the awkward part: IPv4 and IPv6 aren't directly compatible with each other. An IPv4-only device simply can't talk to an IPv6-only one without something translating in between. So the transition leans on a handful of techniques instead:
- Dual stack: devices and networks just run both protocols side by side. This is, by far, the most common setup for home broadband today.
- Happy Eyeballs: browsers and operating systems try IPv6 and IPv4 at the same time and go with whichever connects first — so a broken IPv6 path never stalls your page load.
- NAT64 and DNS64: IPv6-only networks, which mobile carriers love, translate to IPv4 whenever a site has no IPv6 address of its own. 464XLAT tacks on a small client-side translator so IPv4-only apps keep working regardless.
- Tunnels: IPv6 packets can ride inside IPv4 (or the reverse) wherever native support just isn't there.
Adoption, though, is far from even. Google's own IPv6 statistics — which track the share of users reaching Google over IPv6 — show the number climbing steadily, sitting around half of users at the time of writing. But that varies wildly by country and by network: plenty of mobile networks lean heavily IPv6, while no small number of fixed-line ISPs and corporate networks still run IPv4 only.
How to tell which one your connection uses
Quickest way to check is the IPv6 test — it shows your IPv4 and IPv6 addresses side by side and tells you flat out whether IPv6 is actually working. Or check locally yourself:
# Windows
ipconfig
# macOS / Linux
ifconfig # or: ip -6 addr
Look for anything starting with 2 or 3 — that's global unicast IPv6. An address starting with fe80, though, is link-local only, and that doesn't mean you have real IPv6 internet access.
Frequently asked questions
Is IPv6 faster than IPv4?
Not inherently, no. Speed comes down mostly to the route and congestion between you and the server, whatever protocol you're on. IPv6 can run a touch faster on networks where it sidesteps carrier-grade NAT, and a touch slower where its route happens to be less direct. Day-to-day browsing, though? Most people won't notice either way.
Should I disable IPv6?
Generally, no. Modern operating systems expect IPv6 to be on, and switching it off can break features or just dump more traffic onto an already-overloaded IPv4 NAT. Suspect an IPv6 problem? You're better off fixing the router or ISP configuration than disabling it outright.
Will IPv4 be switched off?
Not anytime soon, no. Way too much equipment and software still depends on it, so expect the two protocols to keep coexisting for years yet. Some networks do already run IPv6-only internally, translating to IPv4 only at the edge.
Can an IPv4 address be written as IPv6?
Yes — an IPv4-mapped IPv6 address just embeds the IPv4 address after ::ffff:, like ::ffff:192.0.2.10. That's used inside dual-stack software to represent IPv4 connections internally, not for actually routing anything on the internet.
التعليقات
شارك نصيحة أو اطرح سؤالًا أو أخبر الآخرين كيف عملت الأداة معك.