Planning Non-Overlapping Multi-AZ Cloud Subnets With Binary CIDR Splits
Splitting a parent CIDR /P into child subnets of prefix /C borrows (C - P) host bits into the network prefix, yielding 2^(C - P) equal-sized contiguous blocks. For example, dividing a /16 VPC (10.0.0.0/16) into /20 blocks creates 16 clean 4,096-IP slices—leaving plenty of headroom for 3 public AZ subnets, 3 private app AZ subnets, 3 isolated database AZ subnets, and future expansion.
When combining unequal subnet sizes (Variable Length Subnet Masking / VLSM), always allocate the largest subnets first (e.g., /20 before /24) so every block aligns naturally on a power-of-two boundary without fragmenting address space.
- Binary Tree AlignmentGuarantees every child subnet starts on an exact 2^(32-childPrefix) boundary with zero address overlap.
- Subnets ProducedSplitting /P into /C yields 2^(C - P) contiguous child blocks (e.g., /20 → /22 produces 4 blocks of 1,024 IPs).
- Cloud Host CountsDisplays both standard usable hosts (-2) and AWS/Azure usable hosts (-5) for every generated child subnet.
How many /24 subnets fit inside a /20 or /16 CIDR block?
A /20 holds 2^(24-20) = 16 /24 subnets, and a /16 holds 2^(24-16) = 256 /24 subnets.
Can I split a /24 into 3 equal subnets?
CIDR blocks must be powers of two, so splitting a /24 into /26 yields 4 blocks—use 3 for your 3 Availability Zones and reserve the 4th block cleanly for future growth.
How does Terraform's cidrsubnet(prefix, newbits, netnum) map to this tool?
newbits equals (childPrefix - parentPrefix) and netnum is the zero-based index (0, 1, 2, ...) of each child row shown in the split table.