CIDR notation, explained
CIDR (Classless Inter-Domain Routing) describes a network with an IP plus a prefix length: 192.168.1.0/24 means the first 24 bits are the network and the remaining 8 bits are host addresses — 256 total addresses, of which 254 are usable (network + broadcast are reserved).
Cloud providers reserve even more
When you create a VPC subnet in the cloud, the provider takes some addresses for its own infrastructure:
- AWS reserves 5 per subnet: network, gateway, DNS (+2 internal), broadcast.
- Azure reserves 5 per subnet: network, broadcast, DNS, default gateway, and one for future use.
- GCP reserves 4 per subnet: network, first usable, second-to-last, broadcast.
A /24 in AWS therefore has only 251 usable addresses, not 254 — planning around that number prevents the classic "my subnet looks big enough but I can't fit another instance" surprise.
Quick reference
| CIDR | Total IPs | Usable (classic) | AWS usable |
|---|---|---|---|
| /24 | 256 | 254 | 251 |
| /23 | 512 | 510 | 507 |
| /22 | 1024 | 1022 | 1019 |
| /20 | 4096 | 4094 | 4091 |
| /16 | 65536 | 65534 | 65531 |