Networking
Infra Engineer
Mastering CIDR Subnetting for Modern Cloud Architectures
A deep dive into how Classless Inter-Domain Routing works and why it's essential for AWS, Azure, and GCP engineers.
Mastering CIDR Subnetting
In the world of cloud computing, understanding CIDR (Classless Inter-Domain Routing) is not just a skill—it's a requirement. Whether you're setting up a VPC on AWS or a VNet on Azure, the way you slice your IP space determines your network's scalability and security.
Why CIDR Matters
Traditional classful networking (Class A, B, C) was wasteful. CIDR allows for variable-length subnet masking (VLSM), which means we can allocate exactly the number of IPs we need.
How-To: Calculate a Subnet in 3 Steps
- Identify the Hosts: Determine how many devices need an IP.
- Find the Power of 2: Pick the smallest power of 2 that accommodates your hosts plus 2 (Network and Broadcast).
- Determine the Prefix: Subtract the exponent from 32. For example, if you need 120 hosts, 2^7 = 128 is your target. 32 - 7 = /25.
Example: A /24 provides 256 addresses, with 254 usable for hosts.