
CIDR notation is one of those topics that looks intimidating until you do the math once and realize it's just arithmetic. If you're studying for the Professional Cloud Architect exam, you need to be able to read a CIDR block and know how many IP addresses it covers, because subnet sizing questions show up in the networking sections.
CIDR notation describes an IPv4 range using the form X.X.X.X/Y. The four numbers before the slash are an IP address. The number after the slash is the prefix length, which tells you how many bits at the front of the address are fixed for the network portion. The remaining bits are available for host addresses inside that network.
An IPv4 address has 32 bits in total. The prefix length tells you how many of those bits are locked in. Anything left over is what you have to assign to actual machines, services, and reserved addresses inside the subnet.
To work out how many IP addresses live inside a CIDR block, the procedure is:
That final value is the total number of possible IP addresses in the range. Take 192.168.0.0/12 as an example. The prefix length is 12. Subtracting from 32 gives 20. Two to the twentieth power is 1,048,576. So a /12 block holds just over a million addresses.
The pattern is consistent. A smaller number after the slash means a larger network. A /8 covers about 16.7 million addresses. A /24 covers 256. A /29 covers 8. The slash number going up by one cuts the address count in half, every time.
On the Professional Cloud Architect exam, you may be given a scenario where a team has a VPC subnet that's running out of room, or a design where two subnets need to fit inside a parent range without overlapping. You won't pass these questions if you can't translate /20 or /16 into an address count in your head.
It also matters for VPC peering and Shared VPC design. Two subnets that overlap in their CIDR ranges cannot be connected, so when you're picking ranges for a multi-project network you need to know what each block covers. Picking a /16 when you needed a /24 wastes address space you might want for a future subnet.
You don't need to memorize every prefix length, but a few are worth keeping ready:
If you can hold those five anchor points in your head, you can interpolate everything else by halving or doubling. That's usually enough to answer any subnet sizing question on the Professional Cloud Architect exam without writing anything down.
My Professional Cloud Architect course covers CIDR notation alongside the rest of the networking material.