IPv4 Subnetting & CIDR Notation Fundamentals (RFC 4632)
In modern computer networking, IPv4 addressing utilizes 32-bit binary integers grouped into four 8-bit octets separated by dots (from 0.0.0.0 to 255.255.255.255). Subnetting and CIDR (Classless Inter-Domain Routing - RFC 4632) revolutionized address allocation by eliminating legacy Class A, B, and C rigid boundaries in favor of variable-length prefix masks.
1. Anatomy of a Subnet Mask: Network vs Host Bits
Every IPv4 subnet mask divides the 32 bits into two segments:
- Network Prefix (CIDR Bits): The leading contiguous sequence of binary 1s that specifies the network routing prefix. For example,
/24means 24 ones followed by 8 zeros, representing dotted decimal255.255.255.0. - Host Identifier: The trailing sequence of binary 0s that uniquely identifies interfaces within that particular sub-network.
2. Frequently Used CIDR Subnet Masks Reference
| CIDR | Dotted Mask | Total IPs | Usable Hosts | Common Use Case |
|---|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point router links |
| /28 | 255.255.255.240 | 16 | 14 | Small DMZ or isolated microservice clusters |
| /24 | 255.255.255.0 | 256 | 254 | Standard office LANs and Kubernetes pod subnets |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Cloud VPCs (AWS VPC, GCP Virtual Networks) |
The Two Reserved Addresses Rule: In standard IPv4 subnets, exactly two addresses cannot be allocated to endpoints: the first IP serves as the Network Wire Address, and the final IP is reserved as the Directed Broadcast Address.