Internet 101 · Part 3 of 15

IP addresses, the postal-mail analogy that finally makes sense

Oct 30, 20247 min read#networking#beginner#internet-101

IP addresses, the postal-mail analogy that finally makes sense

Field note. When a player can't connect, the diagnostic almost always starts with 'is the address right?' Knowing how IPs route helps you tell the difference between 'wrong address' and 'right address, wrong host.'

Every computer on the internet has an address. When you load a webpage, your computer sends a message addressed to the webpage's server. The message travels across the internet and arrives there. Eventually a response comes back, addressed to your computer.

This article explains what those addresses look like, why they look weird, and how the system actually works.

The postal-mail analogy, done properly

Postal mail works because every house has an address structured so the postal service can find it. The address has a hierarchy:

123 Main Street
Springfield, IL 62701
United States

A letter sent to this address from Tokyo goes through several stages:

  1. Tokyo's mail system sorts by country. Sends to a U.S. processing facility.
  2. The U.S. facility sorts by state. Sends to Illinois.
  3. Illinois sorts by city. Sends to Springfield.
  4. Springfield sorts by street, then house number, then delivers.

At each stage, the system only needs to look at the part of the address relevant to it. Tokyo doesn't need to know what street the recipient is on. Springfield doesn't need to know the country.

Internet addresses work the same way. An IP address has parts that mean "which network" and parts that mean "which computer in that network." Routers at different layers of the internet only care about the parts relevant to them.

What an IP address looks like

An IPv4 address (the old, common kind) looks like:

192.168.1.42

Four numbers, each from 0 to 255, separated by dots. Under the hood, this is just a 32-bit number, written in a human-friendly format. Each number ("octet") represents 8 bits, hence 0 to 255.

192.168.1.42 as bits:

11000000.10101000.00000001.00101010

Computers think of IP addresses as the 32-bit number. Humans think of them as four dotted decimal parts. Both refer to the same thing.

An IPv6 address (the new kind, slowly replacing IPv4) looks like:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Eight groups of four hexadecimal digits separated by colons. Same idea, just 128 bits instead of 32. We'll spend more time on IPv6 later.

What the parts mean

Take this IPv4 address: 203.0.113.42.

The address contains two pieces of information:

  • The network: which network this computer is on.
  • The host: which specific computer within that network.

But here's the catch: which part of the 32 bits is the network and which part is the host can vary. It's specified by an additional number called the subnet mask or prefix length.

Written together with a slash:

203.0.113.42/24

The /24 means "the first 24 bits identify the network, the remaining 8 bits identify the host within that network." So:

  • Network: 203.0.113.0 (the first three octets)
  • Host: .42 (the last octet)

Networks can be different sizes. /24 is small (256 addresses). /16 is bigger (65,536 addresses). /8 is huge (16,777,216 addresses). The system is called CIDR (Classless Inter-Domain Routing) and we'll cover it in a separate article.

For now: an IP address belongs to a network, and routers everywhere have routing tables that say "to reach network X, send to neighbor Y."

How routing actually works

When your computer wants to send a packet to 203.0.113.42, here's what happens:

  1. Your computer compares 203.0.113.42 to its own IP and subnet. They're not on the same local network.
  2. So your computer sends the packet to its default gateway, which is your home router.
  3. Your home router compares the destination to its own routing table. It doesn't know 203.0.113.0/24 directly, so it sends the packet to its default route, your ISP.
  4. Your ISP has a more comprehensive routing table. It looks up 203.0.113.0/24 and finds it's on the network served by AS-XYZ. It forwards the packet there.
  5. Eventually the packet reaches the network that owns 203.0.113.0/24. That network's routers know which physical port .42 is connected to. They deliver the packet.

This whole journey happens in milliseconds. Each router does a quick table lookup and forwards. Nobody needs a global picture of where every IP address is; they just need to know which neighbor to forward to.

The routing tables themselves are built and maintained by a protocol called BGP (Border Gateway Protocol). We'll cover that in detail later. For now: BGP is how routers automatically learn which networks are reachable through which paths.

Private vs public IPs

You may have noticed that your home computer has an IP like 192.168.1.42. Your friend's home computer might have the same address. How is that not a conflict?

Because 192.168.x.x is a private address range. It's specifically set aside (by RFC 1918) for use inside private networks. The internet routing system refuses to route to private addresses. They only work inside a single network.

The private ranges:

  • 10.0.0.0/8 (16.7M addresses)
  • 172.16.0.0/12 (1M addresses)
  • 192.168.0.0/16 (65K addresses)

If you look at your computer's IP and it's in one of these, you're behind a NAT (Network Address Translation). Your home router has a public IP that the rest of the internet sees, and translates between the public IP and the private IPs inside your home. We have a dedicated NAT article later.

This matters because:

  • Your "real" IP from the perspective of the wider internet is your router's public IP, not your computer's private IP.
  • Private addresses can't be reached from outside without specific configuration.
  • This is why hosting a game server from home requires "port forwarding."

A few special addresses

Some IP addresses have specific meanings:

  • 127.0.0.1: localhost. Means "this computer, talking to itself." Useful for testing.
  • 0.0.0.0: usually means "any address" in configuration. As a destination, it means nowhere.
  • 255.255.255.255: broadcast. "Everyone on this local network."
  • 169.254.x.x: link-local. Auto-assigned when DHCP fails. Means "I couldn't get a real address."

These come up in configuration files often enough that knowing what they mean is useful.

How an IP is assigned

Where do IP addresses come from?

The hierarchy:

  1. IANA (the Internet Assigned Numbers Authority) holds the global pool.
  2. RIRs (regional internet registries: ARIN, RIPE, APNIC, LACNIC, AFRINIC) get large blocks from IANA.
  3. ISPs and large organizations request blocks from their region's RIR.
  4. Individual computers get addresses from their ISP or from their own private pool via DHCP.

When you connect a new device to your home Wi-Fi, your router uses DHCP (Dynamic Host Configuration Protocol) to give it a private IP. When your ISP first turns on your home service, they assign your router a public IP via similar dynamic mechanisms.

Most home connections have a "dynamic" public IP that can change over time (sometimes hours, sometimes years). Static IPs are available for an extra fee, usually for hosting purposes.

IPv4 exhaustion: the looming problem

IPv4 has 32 bits, which means 2^32 = ~4.3 billion possible addresses. That sounded like more than enough in 1981 when IPv4 was standardized. The world had a few thousand computers.

Today there are tens of billions of devices on the internet. We ran out of IPv4 addresses years ago. IANA exhausted its pool in February 2011. The regional registries exhausted theirs over the following decade.

Workarounds:

  • NAT (private addresses behind a single public one).
  • CGNAT (multiple customers behind a single public IP, run by the ISP).
  • IPv6 (the long-term fix).

We have dedicated articles on each. The short version: IPv4 scarcity is real, prices for IPv4 blocks are high (currently around $50 per address on resale markets), and the industry has been transitioning to IPv6 for two decades.

Why this matters

For most users, IP addresses are invisible. Things work. But understanding them helps you:

  • Diagnose home network issues ("why are two devices on my network getting the same IP?").
  • Configure game servers ("the host wants the server-port and bind-address.").
  • Understand DNS ("the DNS lookup returned a different IP than yesterday").
  • Recognize regional content limitations ("the service blocked me because my IP is in a region they don't support").

It also primes you for the next several articles, where we'll cover ports, TCP/UDP, DNS, and routing in detail. All of those are built on the foundation of "every computer has an address."

Coming up

Next: ports. How one server with one IP address can simultaneously host a website, a game, an email service, and a database, by giving each one a different "port" within the same address. The postal-mail analogy continues: the IP is the building's street address; the port is the apartment number.


Hosting your game server with AndroHost means we handle most of what's in this post for you automatically: tier sizing, SRV records, off-site backups, DDoS protection.

Browse plans·More posts·Discord