Understanding Subnets: The Foundation of AWS Networking
Understanding subnets is essential for working with AWS VPCs and cloud networking. This article explains subnets, CIDR notation, public and private subnets, and why they matter for DevOps and cloud engineers.
Understanding Subnets: The Foundation of AWS Networking
When I started learning cloud networking, one of the concepts that confused me was the subnet. At first, CIDR notation, public and private subnets, and IP ranges seemed complicated.
After understanding the basics, the concept became much simpler.
What is a Subnet?
A subnet is a smaller network created from a larger network.
Think of a network as a large building. A subnet is like dividing that building into different sections. Each section can have its own purpose while still being part of the same overall network.
For example, a network might use:
192.168.1.0/24 This network contains a range of IP addresses that can be divided into smaller subnets.
Why Do We Need Subnets?
Subnets help us organize and control network traffic.
They can be used to:
- Separate different types of resources
- Improve network organization
- Control access between resources
- Isolate sensitive workloads
- Design scalable cloud architectures
In AWS, subnets are an important part of a VPC (Virtual Private Cloud).
Public and Private Subnets
One of the most important concepts in AWS networking is the difference between public and private subnets.
Public Subnet
A public subnet is a subnet whose route table has a route to an Internet Gateway.
Resources placed in a public subnet can potentially communicate with the internet, depending on their network configuration and security rules.
A common example is a web server or load balancer that needs to receive internet traffic.
Private Subnet
A private subnet does not have a direct route to an Internet Gateway.
Private subnets are commonly used for resources that should not be directly accessible from the public internet.
For example:
- Application servers
- Databases
- Internal services
This separation improves security and helps create a more controlled architecture.
What is CIDR?
CIDR stands for Classless Inter-Domain Routing.
CIDR notation is used to represent an IP address range.
For example:
192.168.1.0/24 The
/24 tells us how many bits are used for the network portion of the address.A smaller prefix, such as
/16 , represents a larger network, while a larger prefix, such as /28 , represents a smaller network.Understanding CIDR becomes very important when creating AWS VPCs and subnets.
A Simple AWS Example
Imagine we create a VPC with:
10.0.0.0/16 We could divide this VPC into multiple subnets:
-
10.0.1.0/24→ Public subnet
-
10.0.2.0/24→ Public subnet
-
10.0.10.0/24→ Private subnet
-
10.0.11.0/24→ Private subnet
This allows us to separate resources based on their role.
For example, web-facing resources could be placed in public subnets while application servers and databases could be placed in private subnets.
Why Subnets Matter for DevOps
For a DevOps or Platform Engineer, networking is a fundamental skill.
When working with AWS, Kubernetes, containers, or infrastructure as code, you will frequently encounter concepts such as:
- VPCs
- Subnets
- Route tables
- Internet Gateways
- NAT Gateways
- Security Groups
- Network ACLs
- CIDR blocks
Understanding how these components work together makes it much easier to troubleshoot connectivity and design cloud infrastructure.
My Key Takeaway
The easiest way I understand a subnet is:
A subnet is a smaller network inside a larger network.
In AWS, subnets help us organize resources, control network access, and build secure and scalable cloud architectures.
If you're learning AWS or DevOps, I recommend getting comfortable with CIDR notation and AWS VPC networking early. It becomes the foundation for many other cloud concepts.
Conclusion
Subnets may seem confusing at first, but the basic idea is straightforward: divide a larger network into smaller, organized networks.
Once you understand VPCs, CIDR, public and private subnets, and routing, AWS networking becomes much easier to understand.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article