We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Cloud Infrastructure
Free preview: the first 2 parts of this 7-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Cloud Infrastructure
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
In the early days of the internet, IP addresses were handed out in fixed-size blocks called "classes." Class A gave you 16.7 million addresses. Class B gave you 65,536. Class C gave you 256.
If your company needed 500 addresses, you'd be assigned a Class B block. 65,536 addresses. You'd use 500 and waste 65,036. Multiply that across thousands of organizations, and you can see the problem. The internet was running out of IPv4 addresses not because they were all in use, but because they were being wasted by rigid allocation rules.
CIDR. Classless Inter-Domain Routing, threw away the class system entirely. Instead of fixed blocks, you could request exactly the size you needed. Need 512 addresses? Here's a /23 block. Need 2,048? Here's a /21. No waste.
This single change extended the life of IPv4 by decades and became the foundation of how every cloud provider allocates network space today. When you create a VPC in AWS, Azure, or GCP, you define it with a CIDR block. Understanding this notation is non-negotiable for cloud infrastructure work.
A CIDR block looks like this: 10.0.0.0/16
The number after the slash tells you how many bits of the 32-bit IPv4 address are fixed (the "network" portion). The remaining bits are yours to assign to individual hosts.
| CIDR | Fixed Bits | Host Bits | Total Addresses | Usable Hosts |
|---|---|---|---|---|
| /8 | 8 | 24 | 16,777,216 | 16,777,214 |
| /16 | 16 | 16 | 65,536 | 65,534 |
| /20 | 20 | 12 | 4,096 | 4,094 |
| /24 | 24 | 8 | 256 | 254 |
| /28 | 28 | 4 | 16 | 14 |
| /32 | 32 | 0 | 1 | 1 (single host) |
Why "usable hosts" is always two less than "total addresses", the first address is the network address (identifies the block itself), and the last address is the broadcast address. In cloud environments like AWS, a few more are reserved, typically 5 per subnet.
The math: Total addresses = 2^(32 - prefix length). A /24 gives you 2^8 = 256. A /20 gives you 2^12 = 4,096.