Subnetting / CIDR
CIDR replaced classful addressing in 1993. The /N prefix tells you how many bits are the network portion. The animation shows the boundary line on the wire — drag the slider to see hosts-per-subnet change exponentially.
Animation
frame 0
Engineering pitfalls
Network and broadcast addresses don't count as hosts
/24 = 256 addresses but only 254 usable hosts (subtract network + broadcast). The exception is /31 for point-to-point links (RFC 3021) where both addresses are usable.
VLSM (Variable-Length Subnet Masking) requires careful planning
Allocating /27, /28, /28, /29 in the same /24 without alignment leaves unusable gaps. Always lay out subnets binary-aligned from smallest to largest.
Default-gateway in wrong subnet = silent failure
Hosts will ARP for the gateway and timeout instead of routing. Double-check the gateway IP is in the same /N as the host.
References
Primary sources
- RFC 4632 — Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan.
- RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links.
- RFC 1918 — Address Allocation for Private Internets.