AWS Builder Center

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.30
They 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 Subnet
In 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 C
Subnets 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 length
For example:
1
10.0.0.0/16
Here:
1
2
10.0.0.0 → Network address
/16 → Prefix length
The /16 tells us how many bits belong to the network portion of the address.

4. Understanding /24

Consider:
1
192.168.1.0/24
A /24 IPv4 network contains 256 total addresses.
The range is:
1
2
3
192.168.1.0
↓
192.168.1.255
So:
1
192.168.1.0/24
represents a network containing 256 IPv4 addresses.

5. /16 vs /24

Compare:
1
10.0.0.0/16
and:
1
10.0.0.0/24
The /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 still

6. 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/16
You 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/24
This 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
↓
Database
We 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
↓
Resources
For example:
1
2
3
4
5
6
10.0.0.0/16
↓
┌────┴────┐
▼ ▼
Public Private
Subnet Subnet
The subnet determines the network range in which resources receive their private IP addresses.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article