Skip to content

Try “polymorphism”, “TCP handshake” or “git rebase”.

    Computer Basics / Networking 1: Addresses and Routing

    Special Address Ranges

    Some phone numbers are special: 100 goes to the police, internal office extensions like 2045 only

    Chapter 6 of 114 min read

    The Plain Picture#

    Some phone numbers are special: 100 goes to the police, internal office extensions like 2045 only work inside the office, and dialling your own number gives a busy tone. IP addresses have special ranges too.

    The Real Names and the Ranges to Memorise#

    RangeNameMeaning
    10.0.0.0/8privateusable by anyone inside their own network; never routed on the public internet
    172.16.0.0/12privatesame (covers 172.16.0.0 – 172.31.255.255)
    192.168.0.0/16privatesame; typical for home routers
    127.0.0.0/8loopback"this same computer". 127.0.0.1 is called localhost
    169.254.0.0/16link-localself-assigned when no address could be obtained (Ch 9). Also where clouds put their "metadata service": 169.254.169.254
    100.64.0.0/10carrier-grade NATused inside internet providers' networks (next file)
    0.0.0.0"unspecified""no address yet", or "every address on this machine" — its server meaning is in the next file
    255.255.255.255limited broadcast"everyone on this LAN" (Ch 9)

    Under the Hood#

    Private addresses (RFC 1918). A standards document numbered RFC 1918 set aside the three private ranges. Millions of homes all use 192.168.1.x at the same time without conflict, because those addresses never appear on the public internet — routers on the internet drop them. A device with a private address reaches the internet only through NAT, which rewrites addresses at the edge of the network (next file, after ports are explained).

    In the cloud, every server in your network normally gets a private address from your VPC range (10.0.0.0/16 in Chapter 5), and only a few entry points get public addresses. That's a security feature: a database with only a private address simply cannot be reached from the internet.

    Loopback. Traffic to 127.0.0.1 never leaves your machine — the kernel hands it straight back. When you run StudyBuddy's backend on your laptop and open http://localhost:8000, you're using loopback.

    Link-local 169.254.x.x. If your laptop shows an address starting with 169.254, it failed to get an address from the network (Chapter 9) and made one up. It can't reach the internet. It's a common "Wi-Fi connected but no internet" symptom.

    Gotchas

    • localhost inside a Docker container means the container itself, not your laptop. "My app can't reach the database on localhost from inside Docker" is a classic confusion (Docker (coming soon)).

    • The cloud metadata address 169.254.169.254 can hand out a server's cloud credentials to anything running on it. Attackers who trick a server into fetching URLs for them (an attack called SSRF, Security Fundamentals) aim straight for it.

    Check yourself

    4 questions
    1

    Name the three private IPv4 ranges.

    Show answer

    10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.

    2

    Why can millions of homes all use 192.168.1.10?

    Show answer

    Private addresses only need to be unique inside each network; they're never used on the public internet, and NAT translates them at the edge.

    3

    What is 127.0.0.1?

    Show answer

    Loopback / localhost — "this same machine"; traffic never leaves it.

    4

    Your laptop's address is 169.254.12.7. What does that tell you?

    Show answer

    It failed to get an address automatically (DHCP, Ch 9) and self-assigned a link-local address; it has no working internet.