IP Addresses Explained: Everything About IPv4, IPv6, and Why We're Running Out
Every device on the internet needs an address. Without one, there's no way to send data to it or receive data from it. It's that fundamental. In the internet world, those addresses are called IP addresses, and they are the cornerstone of how everything connects.
But the story of IP addresses is also a story of a design decision made in the 1970s that worked beautifully for decades and then started to crack under the weight of billions of smartphones, laptops, servers, smart appliances, and connected gadgets that nobody in 1973 could have possibly anticipated.
This is the full story of IP addresses: what they are, how they work, why we nearly ran out, and what we're doing about it.
What Is an IP Address?
An IP address is a numerical label assigned to each device connected to a network. It serves two purposes:
1. Identification: It identifies which device is which.
2. Location: It indicates where that device is located within the network, so data knows how to get to it.
The analogy to a postal address is quite good. Your home's street address identifies your specific building and its location relative to the postal grid — the street, the city, the country. An IP address does the same thing for a device on the internet. When your computer sends a packet of data, that packet contains your IP address as the "return address" and the destination's IP address as the "destination address." Routers along the way read the destination address and figure out the best route to get the packet there.
IPv4: The Original Format
The IPv4 format — version 4 of the Internet Protocol — was defined in 1981 and is still the most widely recognized. An IPv4 address looks like this: `192.168.1.1`.
An IPv4 address is a 32-bit number, which means it's made up of 32 binary digits (1s and 0s). For human readability, it's split into four groups of 8 bits each (called octets), and each octet is converted from binary to a decimal number between 0 and 255. The four decimal numbers are separated by dots.
So the address `192.168.1.1` in binary is:
`11000000.10101000.00000001.00000001`
Because each address is 32 bits, the total number of possible IPv4 addresses is 2^32, which equals approximately 4.3 billion addresses. That sounds enormous. In 1981, it was so enormous that designers believed it would never be exhausted. The world had only a few thousand networked computers.
They were wrong.
The Exhaustion Problem
The internet grew. Explosively. By the 1990s, ISPs were handing out IP addresses to consumers. Then businesses wanted multiple addresses. Then mobile phones arrived. Then the Internet of Things — smart TVs, security cameras, thermostats, light bulbs, cars. Each one needs an address.
4.3 billion simply wasn't enough.
The moment this became clear, the engineering community threw everything they had at slowing the depletion:
Network Address Translation (NAT): This is the big one. Your home router probably has a single public IP address assigned to it by your ISP. But all the devices in your home — your laptop, your phone, your tablet, your smart TV — also have IP addresses. How? They use private IP addresses from reserved ranges (like `192.168.x.x` or `10.x.x.x`) that are not routable on the public internet.
Your router acts as a translator. When a device on your home network sends a packet to the internet, the router replaces the device's private source address with its own public address, and keeps track of the mapping. When the response comes back, the router translates it back and forwards it to the correct device.
NAT is why your home has one public IP address but dozens of devices connected. It effectively multiplied the capacity of the IPv4 address space by allowing many private addresses to share one public address.
CIDR (Classless Inter-Domain Routing): The original IPv4 design divided the address space into large "classes" that wasted huge blocks of addresses. CIDR replaced this with a more flexible system that allows addresses to be allocated in precisely the right sizes.
Despite these mitigations, the inevitable happened. The Internet Assigned Numbers Authority (IANA) — the organization responsible for allocating IP address blocks to regional registries — issued its final blocks of IPv4 addresses in February 2011. The regional registries continued distributing addresses from their existing pools for a few more years, but most ran out of fresh IPv4 addresses between 2011 and 2019.
Today, getting a new block of IPv4 addresses essentially requires buying them from organizations that have unused allocations. Prices have risen significantly — a single IPv4 address can cost $30–50 or more on the secondary market. IPv4 scarcity is a real economic phenomenon.
IPv6: The Solution
The obvious solution was to create a new version of IP with a larger address space. That solution is IPv6 (version 6 — version 5 was an experimental protocol that never reached widespread deployment).
An IPv6 address looks very different from IPv4. Here's an example:
`2001:0db8:85a3:0000:0000:8a2e:0370:7334`
IPv6 addresses are 128-bit numbers. Instead of four groups of decimals, they're written as eight groups of four hexadecimal digits (base 16, using digits 0–9 and letters A–F), separated by colons.
The total number of possible IPv6 addresses is 2^128 — approximately 340 undecillion. Written out, that's:
340,282,366,920,938,463,463,374,607,431,768,211,456
To put that in perspective, that's enough addresses to give every atom on the surface of the earth its own IP address. Multiple times over. We will genuinely never run out of IPv6 addresses. The problem is solved for all practical eternity.
IPv6 Address Shorthand
Those long IPv6 addresses can be shortened in a couple of ways:
1. Leading zeros in a group can be omitted. `0000` can be written as `0`, and `0db8` can be written as `db8`.
2. One continuous group of all-zero sections can be replaced with `::` — the double colon. For example, `2001:db8:0:0:0:0:0:1` can be written as `2001:db8::1`. The `::` can only appear once in an address.
So the address `2001:0db8:85a3:0000:0000:8a2e:0370:7334` can be shortened to `2001:db8:85a3::8a2e:370:7334`.
What's Different About IPv6 Beyond the Size?
IPv6 wasn't just a bigger IPv4 — it was a redesign that incorporated decades of lessons learned from running the internet. Some important differences:
No more NAT (in theory): Because IPv6 has enough addresses for every device in the world to have a unique public address, NAT is no longer necessary. Every device gets a globally routable address directly. This simplifies networking and enables features like peer-to-peer connectivity that NAT makes difficult.
Built-in IPSec: IPv6 was designed with security (IPSec) as a required component, though in practice this requirement has been relaxed and IPSec is optional in the current standard.
Simplified header: The IPv6 packet header is simpler and more efficient than IPv4's, making routing faster.
Stateless Address Autoconfiguration (SLAAC): IPv6 devices can automatically configure their own addresses based on the network they're on, without needing a DHCP server. Though DHCPv6 also exists for cases where more administrative control is needed.
Multicast instead of broadcast: IPv4 used broadcast extensively (sending a packet to every device on a network). IPv6 replaces broadcast with multicast (sending to specific groups of devices), which is more efficient.
How Do Private vs. Public Addresses Work?
IPv4 has reserved ranges for private (non-routable) use:
These ranges can be used freely within private networks, but packets with these addresses are dropped by internet routers — they're not meant for the public internet.
IPv6 has its own equivalent: Unique Local Addresses (ULAs) in the range `fc00::/7`, and Link-Local Addresses in the range `fe80::/10` (used for communication on the local network segment, automatically configured by devices without any configuration).
The Dual-Stack Transition
The internet hasn't switched to IPv6. It's running both simultaneously. This is called a dual-stack configuration — devices and networks that support both IPv4 and IPv6 at the same time.
When you visit a website that supports IPv6, your device and the server will prefer IPv6 if both support it. If either doesn't support IPv6, they fall back to IPv4. This fallback mechanism allows the transition to happen gradually without breaking anything.
The transition is painfully slow. As of 2024, global IPv6 adoption (measured by the percentage of traffic that uses IPv6) is somewhere around 40–45% globally, but varies enormously by country and ISP. The US is well above 50%. India is very high (driven by major carriers). Many developing regions are much lower.
The practical reality is that IPv4 will continue to exist for many more years, even decades, because of all the legacy devices and systems that don't support IPv6. NAT will remain a fixture of home and corporate networking for the foreseeable future.
Reading Your Own IP Address
You can find your own public IP address easily — just search "what is my IP" in any search engine. You'll see the IP address your ISP assigned to your connection.
To see the private IP address of your device on your local network:
You'll almost certainly see a private IPv4 address in the `192.168.x.x` or `10.x.x.x` range, plus possibly an IPv6 address starting with `fe80::` (link-local).
Why Should You Care?
Understanding IP addressing gives you power over your own technology. You can:
The IP address is the bedrock of internet communication. Everything else — DNS, TCP, HTTP, all of it — builds on top of the fundamental layer of addressing. Understanding it is the first step to truly understanding how the internet works.