Subnet
Definition
A Subnet is a logical subdivision of a larger IP network. It separates networks into smaller isolated groups.
What Problem It Solves
Subnets solve network congestion and security fragmentation. By dividing a broad network into smaller isolated segments, it restricts network broadcasts to local hosts and enforces strict security boundaries (e.g., isolating production databases in private subnets).
What Happens If Not Used
Without subnets, broadcast traffic would overwhelm the network, and any compromised device on the network could directly sniff and access packets from other highly sensitive servers like the database.
Easy Wording
A subnet is a small network inside a bigger network.
Layman Example
Imagine:
Big Office
Floor 1 -> HR
Floor 2 -> Finance
Floor 3 -> IT
All belong to:
ABC Company
But each floor has:
- Separate rooms
- Separate permissions
- Separate employees
Each floor is like a Subnet.
Technical Example
Suppose AWS network:
VPC
10.0.0.0/16
Inside it:
Public Subnet
10.0.1.0/24
Contains:
Load Balancer
Backend API
Private Subnet
10.0.2.0/24
Contains:
PostgreSQL
Redis
Flow:
Internet
↓
Public Subnet
↓
Backend API
↓
Private Subnet
↓
Database
Database remains hidden from internet.