An IPv4 address is 32 bits. A CIDR prefix such as /24 says that the first 24 bits identify the network prefix while the remaining 8 bits are available for host addressing within that subnet. Subnetting is the art of allocating those bits deliberately rather than treating addresses as four unrelated decimal octets.
Remember the shape, not the sentence
“Think of a postal code plus house number. The postal code gets you to the neighborhood; the house number gets you to the exact building. CIDR tells you how many bits belong to the neighborhood.”
Binary is the truth
The decimal form is a human-friendly encoding of 32 binary bits. Subnet masks simply mark which positions belong to the network prefix.
CIDR is variable length
Old classful thinking used fixed A/B/C boundaries. CIDR lets operators choose prefixes such as /20, /27 or /31 to fit actual capacity.
Network, broadcast and usable hosts
For a conventional IPv4 subnet, the all-zero host address is the network address and the all-one host address is the broadcast address, leaving 2^h − 2 conventional host addresses when h ≥ 2. Point-to-point and special-purpose prefixes have exceptions.
See the mechanism before you memorize it
One diagram, one causal story, one reconstruction task.
IPv4 anatomy: network vs host bits, CIDR — causal map
1
Write the address in 32-bit binary.
2
Mark the first N bits as the network prefix for /N.
3
The remaining bits identify hosts inside that prefix.
4
Compute the network boundary and next subnet boundary.
Draw the idea yourself
Rebuild the core flow on a real canvas before moving to the worked walkthrough.
Walk the system
1
Write the address in 32-bit binary.
2
Mark the first N bits as the network prefix for /N.
3
The remaining bits identify hosts inside that prefix.
4
Compute the network boundary and next subnet boundary.
5
Check whether the requested host lies inside the subnet.
Example
A /27 leaves 5 host bits, giving 32 addresses per block. For conventional host addressing, .32 is the network and .63 is the broadcast address.
192.168.10.37/27
mask = 255.255.255.224
block size = 32
subnet = 192.168.10.32/27
range = .32–.63What usually goes wrong
Close the tab. Rebuild it from memory.
Read the question, answer aloud, then reveal.
How many host bits does /27 leave?Reveal answer
5 host bits because 32 − 27 = 5.
What determines the subnet size?Reveal answer
The prefix length. Fewer network bits means more addresses per subnet; more network bits means smaller subnets.
Why learn binary subnetting?Reveal answer
It reveals the actual bit boundary and prevents memorized decimal tricks from failing on unusual prefixes.
Make this idea travel.
Connect it next to: subnetting • routing • subnet-design-lab.