IP Addresses, Subnets & CIDR Explained
Learn how IP addresses are organized into networks and subnets, understand CIDR notation, and see why concepts like 10.0.0.0/16 are important when designing an AWS VPC.
Now let's answer an important question:
How are IP addresses organized into networks?
This is where subnets and CIDR become important.
1. What Is a Network?
Consider these IP addresses:
1
2
3
192.168.1.10
192.168.1.20
192.168.1.30They may belong to the same local network.
A network allows devices to communicate with each other according to the network's addressing and routing configuration.
2. What Is a Subnet?
A subnet is a smaller logical network created from a larger IP network.
Think of it like this:
1
2
3
4
5
Large Network
│
┌────┼────┐
▼ ▼ ▼
Subnet Subnet SubnetIn AWS, we create subnets inside a VPC.
For example:
1
2
3
4
5
VPC
└── 10.0.0.0/16
├── Subnet A
├── Subnet B
└── Subnet CSubnets help us organize resources and control network traffic.
3. What Is CIDR?
CIDR stands for Classless Inter-Domain Routing.
It represents an IP network using:
1
IP address / Prefix lengthFor example:
1
10.0.0.0/16Here:
1
2
10.0.0.0 → Network address
/16 → Prefix lengthThe
/16 tells us how many bits belong to the network portion of the address.4. Understanding /24
Consider:
1
192.168.1.0/24A
/24 IPv4 network contains 256 total addresses.The range is:
1
2
3
192.168.1.0
↓
192.168.1.255So:
1
192.168.1.0/24represents a network containing 256 IPv4 addresses.
5. /16 vs /24
Compare:
1
10.0.0.0/16and:
1
10.0.0.0/24The
/16 network is larger.The
/24 network is smaller.A useful rule is:
Larger prefix number → smaller network
For example:
1
2
3
/16 → larger network
/20 → smaller
/24 → smaller still6. Why Does This Matter in AWS?
When creating an Amazon VPC, you choose an IP address range.
For example:
1
2
VPC
10.0.0.0/16You can then divide it into smaller subnets:
1
2
3
4
5
6
VPC: 10.0.0.0/16
├── 10.0.1.0/24
├── 10.0.2.0/24
├── 10.0.3.0/24
└── 10.0.4.0/24This gives us a structured way to organize AWS resources.
For example:
1
2
3
4
5
6
7
8
9
10
11
Public Subnet
↓
Load Balancer
Private Subnet
↓
Application Server
Private Subnet
↓
DatabaseWe will learn what public and private subnets actually mean in a later article.
7. A Simple Mental Model
Think of:
1
2
3
4
5
6
7
VPC
↓
Network
↓
Subnets
↓
ResourcesFor example:
1
2
3
4
5
6
10.0.0.0/16
↓
┌────┴────┐
▼ ▼
Public Private
Subnet SubnetThe subnet determines the network range in which resources receive their private IP addresses.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article