IP Address
Updated June 6, 2026What Is an IP Address?
Every device that communicates on a network needs an address, a way to be found. That's exactly what an IP (Internet Protocol) address is. Think of it like a postal address for your device. Without it, the internet has no idea where to deliver data.
But IP addresses are more than just identifiers. They encode location information, define network boundaries, and sit at the heart of how routing works. Let's break it down.
IPv4: The Classic Format
IPv4 addresses look like this: 192.168.1.1
They're 32-bit numbers, written as four groups of decimal values (0-255) separated by dots. Each group is called an octet. That gives us 2³² possible addresses, which is about 4.3 billion unique addresses.
Sounds like a lot until you realize there are over 8 billion people on earth, each with multiple devices. IPv4 ran out.
How many unique addresses does IPv4 support, and why is that insufficient today?
The Structure of an IPv4 Address
An IPv4 address has two parts:
- Network portion identifies the network the device is on
- Host portion identifies the specific device within that network
The split between these two parts is determined by the subnet mask (more on that below).
IPv6: The Fix for Running Out
IPv6 addresses look like this: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
They're 128-bit numbers, written as eight groups of four hexadecimal digits separated by colons. That gives us 2¹² possible addresses, a number so large it's often described as "one for every grain of sand on earth, many times over."
IPv6 also brings some improvements beyond just more addresses:
- No need for NAT (every device can have a real public IP)
- Better built-in security (IPSec is part of the spec)
- More efficient routing
IPv6 adoption has been slow but steady. Most modern systems support both, a setup called dual-stack.
| Feature | IPv4 | IPv6 |
|---|---|---|
| Bit length | 32-bit | 128-bit |
| Address count | ~4.3 billion | ~340 undecillion |
| Format | Dotted decimal | Colon-separated hex |
| NAT required? | Usually yes | No |
| Example | 93.184.216.34 | 2606:2800:220:1:248:1893:25c8:1946 |
Public vs Private IPs
Private vs public IP address space design
Not every IP address is visible on the internet. The internet authority (IANA) has reserved certain IP ranges for private networks; these are used inside homes, offices, and data centers, but they're never routed on the public internet.
Private IP ranges:
10.0.0.0-10.255.255.255(10.x.x.x)172.16.0.0-172.31.255.255192.168.0.0-192.168.255.255
If you've ever seen your home router give you a 192.168.1.x address, that's a private IP. Your router itself has a public IP that the internet sees.
Public IPs are globally unique and routable across the internet. Your cloud servers, websites, and APIs all need public IPs to be reachable.
Which of the following is a private IP address range that is never routed on the public internet?
Subnets and CIDR Notation
VPC subnet design with public and private boundaries
A subnet is a subdivision of a network. Instead of one massive network with millions of devices, you break it into smaller, more manageable segments. Subnets help with:
- Security: isolate sensitive systems (like databases) from public-facing servers
- Performance: less broadcast traffic
- Organization: logical grouping of devices
CIDR (Classless Inter-Domain Routing) notation is the standard way to express a subnet. It looks like:
192.168.1.0/24The /24 is the prefix length, which tells you how many bits of the address are the network portion. The remaining bits are for hosts.
/24has 24 bits for network, 8 bits for hosts, giving 254 usable hosts/16has 16 bits for network, 16 bits for hosts, giving 65,534 usable hosts/32has 32 bits for network, 0 bits for hosts, indicating a single host (used for a specific IP)
In AWS, when you create a VPC and choose
10.0.0.0/16, you're saying "I want a private network with the first 16 bits fixed, and the remaining 16 bits available for subnets and hosts."
A CIDR block of /24 leaves how many bits for host addresses, and how many usable hosts does that yield?
NAT: Why Private IPs Can Talk to the Internet
Network Address Translation (NAT) flow mapping private to public IPs
Here's a problem: your laptop has a private IP (192.168.1.10). You want to visit google.com. Google needs to know where to send the response, but your private IP isn't reachable from the internet.
Enter NAT (Network Address Translation).
Your router (or a cloud NAT gateway) translates your private IP to its public IP before sending traffic to the internet. When the response comes back, it translates it back to your private IP and delivers it to you.
How it works:
- Your laptop sends a request from
192.168.1.10:54231 - Your router rewrites the source to
203.0.113.5:54231(its public IP) - Google responds to
203.0.113.5:54231 - Your router knows that port
54231belongs to your laptop and forwards the response
NAT is why billions of devices can share a relatively small pool of IPv4 addresses. It's a clever hack, but it's also why IPv6 was designed to eliminate the need for it entirely.
NAT allows billions of devices with private IPs to access the internet by rewriting the source IP and port to the router's public IP before forwarding traffic.
Loopback and Special Addresses
A few IPs you'll see often:
127.0.0.1(orlocalhost) is the loopback address. Traffic sent here never leaves your machine. Useful for testing local servers.0.0.0.0means "all interfaces on this machine." When a server binds to0.0.0.0:8080, it listens on every network interface.255.255.255.255is the broadcast address. Traffic sent here goes to every device on the local network.
What does binding a server to `0.0.0.0:8080` mean in practice?
IP Addresses in System Design
Understanding IP addressing helps you make better architectural decisions:
- VPC design: in AWS/GCP/Azure, you carve up IP space using CIDRs when building VPCs. Get this wrong early and it's painful to fix.
- Security groups and firewall rules: most firewall rules are IP-based. Knowing subnets helps you write precise rules (allow
10.0.1.0/24instead of0.0.0.0/0). - Service discovery: microservices need to find each other. Whether through DNS or direct IP, understanding addressing helps you design resilient discovery mechanisms.
- DDoS mitigation: attackers come from IPs. Knowing how to block IP ranges (CIDR blocks) is a basic defense.
IPv6 was designed to require NAT, since its 128-bit address space alone is not enough to assign unique public IPs to every device.
Summary
IP addresses are the fundamental addressing mechanism of the internet. IPv4 (32-bit, ~4.3B addresses) is the classic format, but it ran out; IPv6 (128-bit) is the long-term fix. Private IPs are used inside networks, public IPs are internet-routable, and NAT bridges the gap between them. CIDR notation lets you precisely define network ranges and subnets. As a system designer, you'll constantly work with IP addressing when building VPCs, configuring firewalls, and designing network topology; it's foundational knowledge that pays off everywhere.
Saved on this device only
Sign in to sync progress across devices