IPv4 Addressing — What I Wish Someone Told Me First
Before subnetting makes any sense, you need to actually understand what an IP address is. Here's the foundation — binary, octets, private ranges, and subnet masks — explained the way I finally got it.
I’m making a career shift from software engineering into cybersecurity. Along the way I’m writing up the things that actually clicked for me — not textbook summaries, just honest notes from someone working through it.
This one’s about IPv4 addressing. It’s the foundation that everything else in networking sits on top of. I kept skipping past it to get to the “interesting” stuff and kept getting lost. Turns out you can’t skip this.
An IP Address Is Just a Postal Address
Every device on a network needs a unique address so data knows where to go. That’s all an IP address really is — a logical location identifier.
Two things worth separating early:
- IP address — assigned by software, can change, identifies where a device is in the network. Layer 3.
- MAC address — tied to the network interface, used for communication within a local network. Layer 2.
The analogy that made it land for me: your IP is your home address (changes when you move), your MAC is your passport number (tied to you forever). IP gets the packet to the right neighbourhood. MAC gets it to the right door within that local network.
IPv4 addresses are 32 bits, written as four decimal numbers separated by dots — 192.168.1.1. Each group is called an octet (8 bits). Each octet ranges from 0 to 255, which gives roughly 4.3 billion unique addresses.
An IP address actually encodes two things at once: the network (which network you’re on) and the host (which device you are within that network). Subnetting is just learning how to separate those two parts — but we’ll get to that in the next post.
Binary — The Part That Actually Matters
We write IP addresses in decimal for human readability, but all the real work — routing decisions, subnet calculations, address comparisons — happens in binary. As developers we already know data is binary at the wire level; this is just that same principle one layer up.
Binary is base-2, which means each digit position represents a power of 2. We’re so used to base-10 that we rarely think about why the digit positions in decimal are 1, 10, 100, 1000 — it’s because each is 10 raised to the next power (10⁰, 10¹, 10², 10³). Binary works identically, just with base 2 instead of 10.
So an 8-bit octet has eight positions, each worth 2 raised to an increasing power, reading right to left:
1
2
3
Position: 7 6 5 4 3 2 1 0
Power: 2⁷ 2⁶ 2⁵ 2⁴ 2³ 2² 2¹ 2⁰
Value: 128 64 32 16 8 4 2 1
To read a binary number: a 1 in a position means “include this value,” a 0 means “skip it.” Add up the included values.
So 11000000 = 2⁷ + 2⁶ = 128 + 64 = 192. That’s the first octet of every 192.168.x.x address you’ve ever seen on a home network.
Try it — flip any bit below and watch the decimal update:
Quick sanity check: flip on just the leftmost bit (128). Result: 128. Add the next one (64). Result: 192. You just read a real IP octet in binary.
8 bits → values 0–255. Four octets → 32 bits total → ~4.3 billion addresses.
Private vs Public — Why Your Home IP Is 192.168.x.x
Three address ranges are permanently reserved for private networks. They never get routed on the public internet:
| Range | Common Use |
|---|---|
10.0.0.0/8 | Large enterprises |
172.16.0.0/12 | Medium organisations |
192.168.0.0/16 | Home networks — yours, right now |
Your home router uses NAT (Network Address Translation) to represent every device in your house behind a single public IP. Like an apartment building — dozens of flats, one street address.
This is why 192.168.1.x devices can’t be directly reached from the internet. By design.
Subnet Masks — Where One Network Ends and Another Begins
An IP address carries two pieces of information: which network the device is on, and which host it is within that network. A subnet mask is how you split them apart.
It’s always a solid block of 1s followed by 0s. The 1s mark the network portion, the 0s mark the host portion:
1
2
255.255.255.0 = 11111111.11111111.11111111.00000000
|_______ network _________|_ host _|
So for 192.168.1.100 with mask 255.255.255.0:
- Network:
192.168.1— this is fixed - Host:
100— this identifies the specific device
More 1s = more bits locked to the network = fewer addresses left for hosts = smaller subnet.
Fewer 1s = more host bits free = larger subnet.
That’s it. The mask just draws a line through the 32 bits. It doesn’t change the IP address — it tells you how to interpret it.
A Word on IPv6 — This Isn’t the Whole Internet
One thing worth flagging: IPv4 is not the only addressing system. We’ve been running low on the ~4.3 billion IPv4 addresses for years now — every device needing a public IP made that math brutal fast.
IPv6 was designed to solve this. Instead of 32 bits, it uses 128 bits, written in eight groups of hex — like 2001:0db8:85a3::8a2e:0370:7334. That’s 2¹²⁸ possible addresses, or roughly 340 undecillion. Enough to give every atom on Earth its own IP and still have room.
IPv6 was designed to remove the need for NAT by giving every device a globally unique address — though in practice, some networks still use translation mechanisms. It also has better built-in security and handles routing more efficiently. Most modern systems support it — you’ve probably already been using it without noticing.
I’m not covering IPv6 deeply here because the fundamentals of addressing and binary are the same. But it’s worth knowing it exists and that the internet isn’t purely IPv4 anymore. I’ll write a dedicated post on it once I’ve worked through it properly.
What’s Next
This is the ground floor. Once this clicks, everything else in networking becomes predictable instead of confusing.
Next post: CIDR notation (/24, /26, etc.), how routers use the AND operation to make forwarding decisions, and subnetting any network from scratch in four steps.
If something didn’t click, let me know in the comments — those are exactly the parts worth expanding.
Tsotne · tsotne.blog · Networking series, post #1 of 2