===============
let’s expand on that precisely.
1. IPv4 address space size
Each IPv4 address is 32 bits long.
Therefore, the total number of possible combinations is:
[
2^{32} = 4,294,967,296
]
That’s roughly 4.29 billion unique addresses.
2. Why we don’t actually have 4.29 billion usable public addresses
A large portion of that space is reserved for special uses.
Examples:
| Range | Purpose | Notes |
|---|---|---|
| 0.0.0.0/8 | “This network” | Used in routing contexts. |
| 10.0.0.0/8 | Private networks (RFC 1918) | Not publicly routable. |
| 127.0.0.0/8 | Loopback | 127.0.0.1 = localhost. |
| 169.254.0.0/16 | Link-local (APIPA) | Used when no DHCP server. |
| 172.16.0.0/12 | Private networks | Not routable. |
| 192.168.0.0/16 | Private networks | Not routable. |
| 224.0.0.0/4 | Multicast | Not unicast. |
| 240.0.0.0/4 | Reserved for future use | Historically unused. |
| 255.255.255.255 | Broadcast | Special all-hosts address. |
After subtracting all of those, the number of publicly routable IPv4 addresses is closer to ~3.7 billion.
3. The consequence: IPv4 exhaustion
Because of this limited pool, IPv4 addresses began running out.
Regional Internet Registries (RIRs) officially exhausted their free pools between 2011 and 2019.
The world has since relied on:
-
NAT (Network Address Translation) — allowing thousands of devices to share a single public address.
-
CIDR (Classless Inter-Domain Routing) — to allocate space more efficiently.
-
IPv6 — the successor protocol, with 2¹²⁸ addresses, effectively inexhaustible for the foreseeable future.
4. Quick comparison
| Protocol | Address bits | Total addresses | Example |
|---|---|---|---|
| IPv4 | 32 | 4,294,967,296 | 192.168.1.100 |
| IPv6 | 128 | 340,282,366,920,938,463,463,374,607,431,768,211,456 | 2001:0db8::1 |
IPv6 has about 7.9×10²⁸ times as many addresses as IPv4.
So yes — (2^{32}) defines the theoretical IPv4 address space, but in practice, only a fraction of that is globally usable.
==================================
let’s write out 2001:0db8::1 in binary form step by step.
1. IPv6 address structure
An IPv6 address has 128 bits, written as 8 groups of 16-bit hexadecimal blocks, separated by colons:
2001:0db8::1
The :: means a run of zero blocks has been compressed.
Let’s first expand it fully.
2. Expand the compressed form
2001:0db8::1 expands to:
2001:0db8:0000:0000:0000:0000:0000:0001
Now we have 8 groups (each 16 bits = 4 hex digits).
3. Convert each group to binary
Each hexadecimal digit → 4 binary bits.
| Group | Hex | Binary |
|---|---|---|
| 1 | 2001 | 0010 0000 0000 0001 |
| 2 | 0db8 | 0000 1101 1011 1000 |
| 3 | 0000 | 0000 0000 0000 0000 |
| 4 | 0000 | 0000 0000 0000 0000 |
| 5 | 0000 | 0000 0000 0000 0000 |
| 6 | 0000 | 0000 0000 0000 0000 |
| 7 | 0000 | 0000 0000 0000 0000 |
| 8 | 0001 | 0000 0000 0000 0001 |
4. Concatenate them all
The full 128-bit binary form is:
0010000000000001 0000110110111000 0000000000000000 0000000000000000
0000000000000000 0000000000000000 0000000000000000 0000000000000001
Or, without spaces:
00100000000000010000110110111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
5. Verification
-
8 × 16 bits = 128 bits ✅
-
Each group corresponds exactly to its hex block ✅
So in binary,
2001:0db8::1 = 0010 0000 0000 0001 0000 1101 1011 1000 … (rest all zero) … 0000 0000 0000 0001.