The /24 in an IP range isn't arbitrary — it's a precise statement about how many addresses you have and where they start. Once the slash number clicks, subnetting stops being scary.

You're setting up a cloud network and it asks for a CIDR block: 10.0.0.0/16. You type something that looks right, and either it works or you get a range that's mysteriously too small or overlaps something else. CIDR notation feels like arcana, but it's a compact, precise way of describing a block of IP addresses — and the moment you see what the slash number is doing in binary, subnetting turns from guesswork into arithmetic. Everything below is IPv4; every range was computed with Python's ipaddress module rather than by hand.

Where CIDR came from

CIDR exists because the old system was running out of room. Wikipedia explains the origin:

"Classless Inter-Domain Routing is a method for allocating IP addresses for IP routing. The Internet Engineering Task Force introduced CIDR in 1993 to replace the previous classful network addressing architecture on the Internet."

— Wikipedia, "Classless Inter-Domain Routing" (CC BY-SA 4.0)

The old "classful" system only offered a few fixed block sizes. CIDR let networks be carved at any prefix length, which is exactly why you now specify that size with a slash number.

What the slash number counts

An IPv4 address is 32 bits — four groups of 8 (the dotted numbers you see, each 0–255). The number after the slash says how many of those 32 bits are fixed as the network part; the rest are free for hosts. So /24 means the first 24 bits are locked and the last 8 are yours to assign. Eight free bits means 2⁸ = 256 addresses. The host bits are 32 minus the slash number, and the number of addresses is 2 to that power.

BlockMaskHost bitsAddresses
/16255.255.0.01665,536
/22255.255.252.0101,024
/24255.255.255.08256
/26255.255.255.192664
/28255.255.255.240416
/32255.255.255.25501

Smaller slash number = bigger network. That inverse relationship is the thing that trips beginners: /16 is far larger than /24, even though 24 is the bigger number. Each step of one in the prefix halves or doubles the block.

Reading the range

Because the split happens at a bit boundary, the range is predictable. 10.0.0.0/24 covers 10.0.0.0 through 10.0.0.255. 10.0.0.0/25 is the lower half, 10.0.0.0–10.0.0.127, and 10.0.0.128/25 is the upper half. In binary the boundary is obvious: .127 ends in 01111111 and .128 in 10000000. The first bit of the last octet is now part of the network, and the remaining seven count up from all zeros to all ones.

The same logic carves a /24 into four /26 blocks starting at .0, .64, .128 and .192 — each 64 addresses. Going the other way, a /22 stitches four /24s together: 10.0.0.0/22 runs from 10.0.0.0 to 10.0.3.255, which is why its mask's third octet is 252.

A bad block: host bits set

Here's a mistake that tools will catch and humans often don't. A /22 must start on a multiple of 4 in the third octet, because that's where its boundary falls. 10.0.1.0/22 isn't a valid network address: some of its host bits are set. Python's ipaddress refuses it outright ("has host bits set"); in its lenient mode it silently turns it into 10.0.0.0/22. Other software may also round it down without telling you, so the range you meant isn't the range you got.

The addresses you don't get to use

Here's the off-by-one that breaks real deployments. In a traditional subnet, two addresses are reserved: the network address (all host bits zero — 10.0.0.0 in a /24) identifies the subnet itself, and the broadcast address (all host bits one — 10.0.0.255) is for sending to everyone on it. So a /24 has 256 addresses but 254 usable for hosts.

There are documented exceptions at both ends. A /32 describes exactly one host, with nothing reserved. And RFC 3021 allows /31 prefixes on point-to-point links, so both addresses of the pair can be used.

Cloud providers reserve more. AWS's subnet sizing documentation says the first four addresses and the last address of every subnet are unavailable, and that IPv4 subnets must be between /28 and /16. The effect on usable counts:

BlockTotalClassic usable (−2)On AWS (−5)
/28161411
/26646259
/24256254251
/221,0241,0221,019

So if a team needs 250 instances in one AWS subnet, a /24 (251 usable) only just fits, and a /25 (123 usable) doesn't come close. Check your own provider's documentation; the rules differ.

Why VPC blocks overlap (and shouldn't)

The other common failure is overlap. If two networks that need to talk to each other have overlapping CIDR blocks — say both use 10.0.0.0/16 — routing between them becomes ambiguous and breaks. Overlap isn't always obvious: 10.0.128.0/20 sits entirely inside 10.0.0.0/16, while 10.1.0.0/16 doesn't touch it.

The fix is planning: allocate non-overlapping blocks from the private ranges in RFC 1918 and leave room to grow. Those ranges are very different sizes:

Home routers tend to sit in 192.168.x.x, so a VPN user whose home network uses the same range as the office can hit exactly this overlap.

Common mistakes

Let the tool do the bit math

You don't have to convert 32-bit masks in your head. A CIDR calculator takes a block like 10.0.0.0/22 and shows the network, broadcast, mask, host range and a binary view. To build intuition for why the ranges fall where they do, number bases: hex and binary walks through converting an octet between decimal and binary. And if you're validating IP or CIDR strings in code, a regex tester helps check the shape — though a real IP library is what should decide validity. Subnetting isn't hard once you stop treating the slash number as a label and start treating it as what it is: a count of fixed bits.

← All articles