Skip to main content

IP Addresses

An IP address is a numeric label assigned to a device on a network, used to identify it and route traffic to it — the Layer 3 concern in the OSI Model. Every design that involves more than one machine eventually depends on IP addressing working correctly: it's how a load balancer knows which backend to forward to, how a client's DNS lookup turns into something a TCP connection can actually be opened against, and how two services inside the same private network find each other at all.

IPv4 vs. IPv6

IPv4IPv6
Address size32 bits128 bits
Total address space~4.3 billion~340 undecillion
FormatDotted decimal (192.168.1.1)Colon-separated hex (2001:0db8::1)
AdoptionStill dominant, especially internallyGrowing, but far from universal

IPv4's ~4.3 billion addresses sounded inexhaustible in the 1980s and ran out faster than anyone expected once mobile devices and IoT joined the internet. IPv6 exists specifically to solve that exhaustion problem with an address space large enough that it's not expected to run out. The practical reason IPv6 adoption has been slow anyway is that IPv4 and IPv6 aren't wire-compatible — a pure-IPv6 host can't directly talk to a pure-IPv4 host — so the transition requires dual-stack support or translation layers, and most existing infrastructure already works fine on IPv4 plus the workaround described next.

Public vs. private addresses, and NAT

Not every device needs a globally unique address. Ranges like 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are reserved as private — they're reused inside millions of separate home networks, offices, and cloud VPCs, and packets addressed to them are never routed on the public internet. This is exactly why your laptop's IP is almost never the address a remote server actually sees.

NAT (Network Address Translation), typically run on a router or a cloud NAT gateway, rewrites the source address of outbound packets from a private IP to a single shared public IP (and rewrites it back on the way in). This is also why NAT quietly extended IPv4's usable lifespan for years: thousands of private devices can share one public address.

System Design Lab

This is also the standard shape of a cloud VPC: application servers and databases sit on private IPs, unreachable directly from the internet, while only a small number of components — a load balancer, a NAT gateway, a bastion host — hold public IPs. It's a security boundary as much as an addressing scheme: nothing can even attempt to reach a private-IP-only server without first going through whatever public-facing component fronts it.

Static vs. dynamic addresses

Most devices get an IP address automatically via DHCP (Dynamic Host Configuration Protocol), leased for a limited time and potentially reassigned later. Servers that other things need to find reliably — a database, a load balancer, a DNS record's target — are usually given a static address instead, since a dynamically changing address would break anything that had it cached or hardcoded. This is one of the reasons DNS exists as its own layer: it lets everything else refer to a stable name while the underlying IP is free to change.

Why this matters in an interview

When you sketch a network diagram, it's worth being explicit about which components get public IPs and which stay private — it signals you're thinking about the security boundary, not just connectivity. It also connects directly to two later lessons: DNS is the system that maps names to these addresses, and Load Balancing is often the single public IP that everything else in your private network hides behind.

IPv6 adoption: pros and cons

Pros

  • Address space large enough that exhaustion isn't a practical concern
  • Simplifies routing tables and removes the need for most NAT
  • Built-in support for better auto-configuration and (optionally) IPsec

Cons

  • Not wire-compatible with IPv4 — requires dual-stack or translation during migration
  • Much existing infrastructure, tooling, and operational knowledge is IPv4-centric
  • NAT already solved exhaustion "well enough" for most networks, reducing urgency to migrate

Further Reading

Saved locally in your browser — visible in the sidebar as you go.