IPv4 vs IPv6 Addressing

IPv4 and IPv6 are the two versions of the Internet Protocol in use, and they differ mainly in address size. IPv4 uses 32-bit addresses (about 4.3 billion), which have effectively run out, while IPv6 uses 128-bit hexadecimal addresses for a practically unlimited supply; the two are not directly compatible.

3 min read

IPv4 and IPv6 are the two versions of the Internet Protocol in real-world use, and they differ primarily in address size, which directly determines how many unique devices the internet can support.

The core difference

IPv4 addresses are 32 bits long, written as four decimal numbers separated by dots (like 192.168.1.1), giving roughly 4.3 billion possible unique addresses. That sounded like an enormous number when IPv4 was designed decades ago, but with billions of phones, laptops, IoT devices, and servers all needing addresses, the supply of available IPv4 addresses has effectively run out.

IPv6 addresses are 128 bits long, written as eight groups of hexadecimal digits separated by colons (like 2001:0db8:85a3:0000:0000:8a2e:0370:7334), providing an astronomically larger address space, enough for every device on earth to have many unique addresses with room to spare for the foreseeable future.

A worked example

A typical IPv4 address: 142.250.183.14. Four numbers, each 0 to 255, separated by dots.

The equivalent-style IPv6 address might look like: 2001:4860:4860:0000:0000:0000:0000:8888, which can be shortened using a double-colon to compress consecutive zero groups: 2001:4860:4860::8888. That shorthand rule (one double-colon per address, replacing the longest run of consecutive all-zero groups) is part of the IPv6 specification specifically to keep addresses more manageable to read and write.

Why the transition has been slow

IPv4 and IPv6 are not directly compatible with each other, a device or network using only IPv4 can't natively talk to one using only IPv6 without a translation mechanism. Because so much existing infrastructure was built around IPv4, the transition has happened gradually, with techniques like NAT (letting many devices share a small number of public IPv4 addresses) extending IPv4's practical lifespan far longer than its raw address count would otherwise allow, and dual-stack systems (running both IPv4 and IPv6 simultaneously) becoming the common bridge during the long transition period.

Where this matters in real systems

Mobile carriers and large cloud providers have been especially aggressive about adopting IPv6, since they're the ones provisioning enormous numbers of new devices and don't want to be constrained by IPv4 exhaustion. Most major websites and cloud services now support both IPv4 and IPv6 simultaneously (dual-stack), and a client will typically be automatically routed over IPv6 if both the client and server support it, falling back to IPv4 otherwise. NAT, which lets an entire home network share one public IPv4 address, was originally a stopgap measure but is exactly why IPv4 has remained usable this long despite address exhaustion.

What interviewers actually ask about IPv4 vs IPv6

  • "Why was IPv6 created?" IPv4's 32-bit address space (about 4.3 billion addresses) has been exhausted by the sheer number of internet-connected devices; IPv6's 128-bit addresses provide a vastly larger supply.
  • "Are IPv4 and IPv6 directly compatible?" No, they're separate protocols and require translation mechanisms or dual-stack support to interoperate; a pure IPv4-only device can't natively communicate with a pure IPv6-only device.
  • "How has IPv4 lasted this long despite address exhaustion?" Techniques like NAT let many devices share a small number of public IPv4 addresses, extending its practical usable lifespan well beyond its raw address count.
  • "What does the double-colon mean in an IPv6 address?" Shorthand notation representing one run of consecutive all-zero groups, used to make long IPv6 addresses shorter to read and write; it can only be used once per address.

Key takeaways

  • IPv4 uses 32-bit addresses (about 4.3 billion total), which have been exhausted by real-world demand.
  • IPv6 uses 128-bit addresses, providing a practically unlimited supply for the foreseeable future.
  • IPv4 and IPv6 aren't natively compatible, requiring dual-stack support or translation during the ongoing transition.
  • NAT has been the main reason IPv4 has remained usable despite running out of unique addresses.
All 101 Computer Networks interview questions

Log in to save which topics you've read across every subject.

Frequently asked questions

Why was IPv6 created?

IPv4's 32-bit address space (about 4.3 billion addresses) has been exhausted by the sheer number of internet-connected devices; IPv6's 128-bit addresses provide a vastly larger supply.

Are IPv4 and IPv6 directly compatible?

No, they're separate protocols and require translation mechanisms or dual-stack support to interoperate; a pure IPv4-only device can't natively communicate with a pure IPv6-only device.

How has IPv4 lasted this long despite address exhaustion?

Techniques like NAT let many devices share a small number of public IPv4 addresses, extending its practical usable lifespan well beyond its raw address count.

What does the double-colon mean in an IPv6 address?

Shorthand notation representing one run of consecutive all-zero groups, used to make long IPv6 addresses shorter to read and write; it can only be used once per address.