CIDR — Prefixes and Block Sizes
Writing 255.255.255.192 every time is slow, and reading it is slower. Engineers write 192.168.10.64/26 instead. That slash number is CIDR notation, and with one small trick it lets you find any address's subnet, broadcast and host range in your head — the core skill of a subnet plan.
The rule
The slash counts the network bits; the block size is 256 minus the mask octet.
CIDR (Classless Inter-Domain Routing) writes a network as an address plus a prefix length: the number of 1s in the mask. /24 = 255.255.255.0, /26 = 255.255.255.192, /16 = 255.255.0.0. Host bits = 32 − prefix. It replaced the old fixed "class A, B, C" sizes, so a network can be any size that is a power of two.
The prefixes worth knowing by heart for the last octet:
| Prefix | Mask | Block size | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
The block size is how far apart the subnets start. Subnets always begin at multiples of it: for /26, at .0, .64, .128 and .192.
The shortcut
To place any address:
- Block = 256 − the interesting mask octet.
- Network = round the address's interesting octet down to a multiple of the block.
- Broadcast = network + block − 1.
- Hosts = everything strictly between them.
Block size
/26 is 255.255.255.192. 256 − 192 = 64.
It works in any octet. For 172.16.37.9/20, the mask is 255.255.240.0, so the block is 16 in the third octet: 37 rounds down to 32, giving network 172.16.32.0 and broadcast 172.16.47.255.
The trap is rounding to the nearest multiple instead of down. .100 is nearer to 128 than 64, but it lives in the .64 block.
Drills
Answer fast — trust the rule.
Usable hosts in a /27:
What is the network address of 192.168.10.77/27?
What is the broadcast address of 192.168.10.200/28?
Which mask matches /29?
Is 192.168.10.130 a usable host in 192.168.10.128/26?
Remember
- The slash counts the network bits; the block size is 256 minus the mask octet.
- Round the address down to a multiple of the block; broadcast = network + block − 1.
- /26 = 64, /27 = 32, /28 = 16, /29 = 8, /30 = 4.
