IP Addressing, Subnets & CIDR
What an IP address is
An IP address is the network-layer identity of a host — the "where" that routing uses to move a packet across networks. Two versions coexist:
- IPv4 — 32 bits, written as four octets (
192.168.0.1). ~4.3 billion addresses, long since exhausted, which is why NAT and private ranges are everywhere. - IPv6 — 128 bits (
2001:db8::1). An effectively unlimited space that removes the need for NAT, though IPv4 persists for compatibility.
Public vs private addresses
Certain IPv4 ranges are reserved as private — routable only inside a local network, never on the public internet. A NAT gateway translates many private hosts behind one public address. Knowing these ranges on sight is genuinely useful when reading any cloud VPC config:
| Range | CIDR | Size | Typical use |
|---|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | ~16.7M | Large private networks / cloud VPCs |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | ~1M | Mid-size networks |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | ~65K | Home / small office |
| 127.0.0.0/8 | 127.0.0.1 | — | Loopback (localhost) |
CIDR — how address blocks are sized
CIDR (Classless Inter-Domain Routing) notation appends a prefix length:
10.0.1.0/24. The number is how many leading bits are fixed (the network part);
the remaining bits are host addresses. The rule of thumb:
Each step down in prefix length doubles the block. A/24holds 2(32−24) = 256 addresses; a/16holds 65,536.
| CIDR | Host bits | Addresses | Mnemonic |
|---|---|---|---|
/32 | 0 | 1 | A single host |
/24 | 8 | 256 | One "class C" subnet |
/16 | 16 | 65,536 | A large subnet / VPC |
/8 | 24 | 16,777,216 | A huge block |
This is the math behind sizing a cloud subnet, writing a firewall/security-group rule, or
reading a routing table. When you allocate 10.0.0.0/16 to a VPC and carve
/24s out of it for each availability zone, you are just spending host bits.
Takeaways
- IP = network-layer host identity; IPv4 (32-bit, scarce) vs IPv6 (128-bit, abundant).
- Private ranges (
10/8,172.16/12,192.168/16) stay off the public internet; NAT bridges them. - CIDR
/Nfixes N network bits; addresses = 2(32−N). Smaller N = bigger block.
Re-authored for this guide, with concepts and diagrams adapted from Karan Pratap Singh’s System Design (course, MIT licence) and the System Design Primer (CC BY 4.0). Diagrams © their respective authors.
🤖 Don't fully get this? Learn it with Claude
Stuck on IP Addressing, Subnets & CIDR? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.
Build the mental picture, not memorization.
I just read a lesson on **IP Addressing, Subnets & CIDR** (System Design) and want to truly understand it. Explain IP Addressing, Subnets & CIDR from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
Socratic — adapts to where you're stuck.
Teach me **IP Addressing, Subnets & CIDR** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
Active recall exposes what you missed.
Quiz me on **IP Addressing, Subnets & CIDR** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
Intuition + hook + flashcards for long-term memory.
Help me remember **IP Addressing, Subnets & CIDR** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.