IPv4, the original internet addressing scheme, uses 32-bit addresses and can identify approximately 4.3 billion devices — a number that proved far too small as the internet grew. IPv6 replaces it with 128-bit addresses, giving enough unique addresses for every atom on the surface of the Earth to have its own, many times over.

What is IPv4?

Internet Protocol version 4 (IPv4) was formalised in 1981 and remained the dominant addressing scheme for more than three decades. An IPv4 address is 32 bits long, divided into four groups of 8 bits (octets), written in dotted decimal notation:

192.168.0.1

Each octet can hold a value from 0 to 255 (because 2⁸ = 256 possible values). The total number of unique IPv4 addresses is 2³² = 4,294,967,296 — approximately 4.3 billion.

In practice, fewer are usable because certain ranges are reserved:

Reserved range Purpose
10.0.0.0 – 10.255.255.255 Private networks (home/office)
172.16.0.0 – 172.31.255.255 Private networks
192.168.0.0 – 192.168.255.255 Private networks (most home routers)
127.0.0.0 – 127.255.255.255 Loopback (localhost — your own device)

Private addresses cannot be routed on the public internet; Network Address Translation (NAT) allows many devices on a private network to share a single public IPv4 address, which delayed exhaustion significantly.

What is IPv4 address exhaustion?

The Internet Assigned Numbers Authority (IANA) allocated the last block of unassigned IPv4 addresses to regional registries in February 2011. Regional registries — such as RIPE NCC in Europe — exhausted their pools between 2012 and 2019. New internet-connected devices can still receive IPv4 addresses through reallocation and NAT, but the pool of freely available addresses is effectively zero.

The rise of smartphones, IoT devices, smart meters, and connected appliances made exhaustion inevitable: in 1981, billions of connected devices were unimaginable; today a single household may have 30 or more.

What is IPv6?

Internet Protocol version 6 (IPv6) was designed to succeed IPv4 and published as a standard in 1998. An IPv6 address is 128 bits long, divided into eight groups of 16 bits, written in hexadecimal with groups separated by colons:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Shortening rules:

  • Leading zeros within a group may be omitted: 0db8db8
  • One consecutive run of all-zero groups may be replaced with :::
2001:db8:85a3::8a2e:370:7334

The total number of unique IPv6 addresses is 2¹²⁸ = approximately 3.4 × 10³⁸ — 340 undecillion. This is enough to assign billions of addresses to every square metre of Earth's surface.

How do IPv4 and IPv6 compare?

Feature IPv4 IPv6
Address length 32 bits 128 bits
Address count ~4.3 billion (2³²) ~3.4 × 10³⁸ (2¹²⁸)
Notation Dotted decimal (e.g. 192.168.1.1) Hexadecimal groups (e.g. 2001:db8::1)
Header size 20–60 bytes (variable) 40 bytes (fixed)
NAT required? Usually yes (to cope with shortage) No — every device gets a global address
Built-in security Optional (IPSec) IPSec support is mandatory
Auto-configuration DHCP required Stateless Address Auto-Configuration (SLAAC) built in
Adoption rate (2024) Still dominant but declining Rapidly growing — Google reports ~45–50% of its traffic over IPv6

How is the transition from IPv4 to IPv6 managed?

The internet cannot switch off IPv4 overnight — billions of devices, routers, and applications depend on it. Three transition mechanisms are in common use:

  1. Dual stack: A device runs both IPv4 and IPv6 simultaneously, using IPv6 when both ends support it and falling back to IPv4 otherwise. This is the most common approach today.

  2. Tunnelling: IPv6 packets are wrapped inside IPv4 packets to cross parts of the internet that are not yet IPv6-capable. The outer IPv4 header is removed when the packet exits the tunnel.

  3. Translation: Network devices translate between IPv4 and IPv6 packets, allowing IPv4-only and IPv6-only hosts to communicate. This is a last resort, as it has limitations.

Frequently asked questions

Why is IPv6 written in hexadecimal rather than decimal?

IPv6 addresses are 128 bits long. Written in dotted decimal (like IPv4), that would require 16 groups of numbers — far too unwieldy to read or type. Hexadecimal is more compact: each hexadecimal digit represents 4 bits, so 128 bits fit neatly into 32 hex digits, grouped into eight sets of four. This is still long, which is why the zero-omission shorthand rules exist.

Does every home device have an IPv6 address?

Many do. UK ISPs including BT, Virgin Media, and Sky have deployed IPv6, and modern devices support dual stack automatically. However, some older routers and ISP infrastructure still use IPv4 only. In an exam context, the important point is that IPv6 is designed to give every device a globally unique address, eliminating the need for NAT.

Will IPv6 addresses ever run out?

At current growth rates, no — not in any meaningful human timeframe. 2¹²⁸ is so astronomically large that even if every star in the observable universe had as many planets as Earth, and every square centimetre of every planet had a device, there would still be addresses to spare. IPv6 was explicitly designed to be large enough that exhaustion is a non-problem.

What does the loopback address do?

The loopback address allows a device to send a network packet to itself for testing. In IPv4, 127.0.0.1 is the loopback address (also known as localhost). In IPv6, ::1 is the loopback address. When a program connects to localhost on your own machine, no data leaves the device — it loops straight back to the network stack.


If networking topics are tripping you up, Professor Turing at aitutors.me offers patient, Socratic walkthroughs — bring any question, however small.