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”
Imagine a hospital where every room, operating theaters, waiting rooms, server closets, cafeteria, was connected to the same hallway with the same access card. A cafeteria visitor could wander into surgery. A patient could stumble into the server room.
That's what a flat network looks like. Every device can talk to every other device. No boundaries. No segmentation. A single compromised machine can scan and attack everything on the network.
Subnets solve this. They divide a large network into smaller, isolated segments. Your web servers live in one subnet. Your databases in another. Your internal tools in a third. Traffic between subnets passes through a router or firewall where you can enforce rules, who can talk to whom, on which ports, in which direction.
In cloud infrastructure, subnets are the fundamental building block. Every EC2 instance, RDS database, Lambda function, and lives inside a subnet. Public subnets face the internet. Private subnets are hidden behind NAT. Understanding how to carve a VPC into subnets is the single most practical networking skill in cloud engineering.
A subnet is a range of IP addresses within a larger network (the VPC). You create subnets by subdividing your VPC's CIDR block into smaller CIDR blocks.
Example: Your VPC has CIDR 10.0.0.0/16 (65,536 addresses). You might divide it like this:
| Subnet | CIDR | IPs | Purpose |
|---|---|---|---|
| Public A | 10.0.1.0/24 | 256 | Web servers, load balancers (AZ-a) |
| Public B | 10.0.2.0/24 | 256 | Web servers, load balancers (AZ-b) |
| Private A | 10.0.10.0/24 | 256 | App servers (AZ-a) |
| Private B | 10.0.11.0/24 | 256 | App servers (AZ-b) |
| Data A | 10.0.20.0/24 | 256 | Databases (AZ-a) |
| Data B | 10.0.21.0/24 | 256 | Databases (AZ-b) |
Public vs Private:
Why spread across Availability Zones: If AZ-a goes down (hardware failure, power outage), your application keeps running in AZ-b. This is the foundation of high availability in the cloud.