An IP address is less like a street address and more like a phone number that changes depending on which network you’re on.
Let’s see this in action. Imagine you have two machines, client.local and server.local, on the same local network.
# On client.local
ping server.local
You’ll see ping resolving server.local to an IP address like 192.168.1.100. Now, if server.local also has a public IP address, say 203.0.113.5, and you try to ping it from outside your local network, you’ll use that public IP. The 192.168.1.100 is only meaningful within your local network.
This dynamic nature is key. Your laptop gets a new IP address from your home router every time it connects, and your router gets a new public IP from your ISP. It’s a system designed for flexibility and efficient use of a finite resource.
The problem IP addresses solve is simple: how do devices on a global, interconnected network find and talk to each other? Before IP, networks were mostly isolated. IP provides a common addressing scheme, a universal language for routing data packets.
Internally, it works like this: when you send data to example.com, your computer first asks a DNS server for the IP address of example.com. Then, your computer, along with a series of routers, uses that IP address to guide the data packet across the internet, hopping from router to router, until it reaches the destination server. Each router on the path looks at the destination IP address and consults its routing table to decide the best next hop.
The two main versions, IPv4 and IPv6, are fundamentally the same in purpose but differ in scale and structure.
IPv4 is the older system, using 32-bit addresses. This gives us roughly 4.3 billion unique addresses. We represent them as four numbers separated by dots, like 192.168.1.1. Each number can range from 0 to 255. This was plenty when the internet was young, but we’ve run out.
IPv6 was developed to solve the IPv4 exhaustion problem. It uses 128-bit addresses, offering an astronomical number of unique addresses (2^128, which is about 340 undecillion). These are written as eight groups of four hexadecimal digits, separated by colons, like 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
The allocation of these addresses is managed by organizations like ICANN (Internet Corporation for Assigned Names and Numbers) and its regional internet registries (RIRs). They receive large blocks of IP addresses from IANA (Internet Assigned Numbers Authority) and then allocate smaller blocks to ISPs, large organizations, and enterprises. ISPs, in turn, assign addresses to their customers. This hierarchical allocation ensures that IP addresses are distributed in a structured way, allowing for efficient routing.
A common misconception is that IPv6 is just "more IPs." It’s also designed to simplify network configuration, improve security, and streamline routing efficiency through features like stateless autoconfiguration and mandatory IPsec support. You can also represent IPv6 addresses more compactly by omitting leading zeros and collapsing consecutive blocks of zeros with a double colon (::). So, 2001:0db8:0000:0000:0000:8a2e:0370:7334 can become 2001:db8::8a2e:370:7334.
The next major challenge is the transition to IPv6, which involves co-existence strategies like dual-stacking and tunneling.