What is CIDR block allocation?
In networking, CIDR (Classless Inter-Domain Routing) is the system we use to allocate IP addresses and group them into manageable "blocks."
Before CIDR, IP addresses were handed out in rigid, wasteful "Classes" (A, B, or C).
Think of an IP address like a house address.
The Starting Number: This is the street.
The Slash Number (/): This is the size of the neighborhood.
In CIDR notation (e.g., 10.0.0.0/24), the number after the slash tells the computer: "Lock the first 24 bits as the 'Neighborhood ID' and leave the rest for 'House Numbers'."
An IPv4 address is made of 32 bits.
| CIDR Block | Total IP Addresses | Best Use Case |
| /32 | 1 | A single specific server or "Loopback." |
| /28 | 16 | A tiny subnet for a small internal tool. |
| /24 | 256 | The "Standard" size for most subnets. |
| /20 | 4,096 | A medium-sized production environment. |
| /16 | 65,536 | The standard starting size for a whole VPC. |
| /8 | 16.7 Million | Massive enterprise or ISP-level backbone. |
Pro Tip: As the number after the slash gets smaller, the number of available IP addresses gets larger.
In a cloud environment, you don't just pick numbers at random. You have to "allocate" with a plan.
The most common mistake in cloud networking is giving two VPCs the same CIDR block (e.g., both are 10.0.0.0/16). If you ever try to connect them later (VPC Peering), the traffic will get "confused" and crash.
The Rule: Always ensure your Cloud VPCs don't overlap with each other OR your physical office network.
In the cloud (specifically AWS and Azure), you don't get every IP in your block.
.0: Network Address.
.1: VPC Router.
.2: DNS Server.
.3: Future Use/Reserved.
.255: Broadcast Address.
Result: In a /24 (256 IPs), you only have 251 usable spots for your servers.
Modern architects use "T-Shirt Sizing" to keep things clean:
Small (/24): Development and testing subnets.
Medium (/22): Standard production application tiers.
Large (/20):
Define the VPC Root: Start with a large block like 10.1.0.0/16.
Carve Subnets: Use a function (like Terraform's cidrsubnet) to automatically chop that /16 into smaller /24 chunks.
Leave "Gaps": Don't use every number immediately. Leave empty CIDR "space" between your subnets so you can expand them later if you run out of room.
CIDR block allocation is the blueprint of your house. If you build the rooms too small or put the doors in the wrong place (overlapping addresses), it is very difficult to fix later without tearing the whole thing down.