How subnetting works
The prefix length says how many leading bits identify the network. AND-ing the address with the mask gives the network address; setting all host bits to 1 gives the broadcast address. Usable hosts = 232 − prefix − 2, except /31 (point-to-point links, RFC 3021) and /32 (a single host).
Worked example: 192.168.1.10/24
Mask 255.255.255.0 → network 192.168.1.0, broadcast 192.168.1.255, hosts .1 to .254 = 254 usable.
Private address ranges (RFC 1918)
| Range | CIDR | Addresses |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 |
See every prefix in the CIDR table.