π§ What Is a Subnet?
A subnet, short for subnetwork, is a logical subdivision of an IP network. Networks are divided into smaller subnetworks to improve performance, security, and manageability.
Think of your home address:
- The city is like the network portion.
- Your house number is like the host portion. Together, they form your unique IP address within a neighborhood (network).
π¦ The 6 Key Things a Subnet Tells You
1. Network Address
This is the starting IP of your subnet. It represents the entire subnet as a whole, and no device can use it as a regular address.
Example:
For 192.168.10.0/24
, the network address is 192.168.10.0
.
Itβs used in routing tables and by network devices to identify where a packet should go.
2. Subnet Mask
The subnet mask determines which portion of the IP address is for the network and which is for hosts.
It can be written in:
-
Decimal:
255.255.255.0
-
CIDR notation:
/24
This tells routers and devices how many bits are reserved for identifying the network, and how many are for hosts.
Tip:
-
/24
means the first 24 bits are for the network. - That leaves 8 bits for host devices.
3. Range of IP Addresses
Once you know the subnet size, you can calculate the range of usable IP addresses within that subnet.
For example:
With 192.168.10.0/24
, the range is:
-
Start:
192.168.10.1
-
End:
192.168.10.254
You can't use:
-
192.168.10.0
(network address) -
192.168.10.255
(broadcast address)
So there are 254 usable addresses in this subnet.
4. Broadcast Address
The broadcast address is the last IP address in the subnet. Itβs used to communicate with all devices in the subnet simultaneously.
Example:
For 192.168.10.0/24
, the broadcast address is 192.168.10.255
.
When a device sends data to this address, everyone on the subnet receives it.
5. Number of Usable Hosts
Using the subnet mask, you can calculate how many devices (hosts) can be connected in that subnet.
Formula:
Usable Hosts = 2^(number of host bits) - 2
You subtract 2 to exclude the network and broadcast addresses.
Examples:
-
/30
β 2 usable hosts -
/24
β 254 usable hosts -
/16
β 65,534 usable hosts
Smaller subnets (like /30
) are often used for point-to-point links.
6. Efficient Network Segmentation
Subnets help you divide larger networks into smaller, manageable units. This improves:
- Security (isolating traffic between departments or services)
- Performance (limiting broadcast traffic)
- IP address conservation
For example, an organization with 10.0.0.0/8
can create thousands of /24
subnets for different offices, floors, or services.
π§ͺ Example Breakdown: 10.0.8.0/21
Letβs dissect this subnet:
Component | Value |
---|---|
CIDR | /21 |
Subnet Mask | 255.255.248.0 |
Network Address | 10.0.8.0 |
Broadcast Address | 10.0.15.255 |
Usable IPs |
10.0.8.1 to 10.0.15.254
|
Total Usable Hosts | 2,046 |
Why so many?
-
/21
gives 11 host bits β2^11 - 2 = 2046
usable hosts.
β What Subnets Don't Tell You
A common misconception is that a subnet tells you whether an IP is private or public. It doesn't.
That depends on the IP address range, not the subnet.
For example:
-
192.168.1.0/24
is private because itβs in the192.168.0.0/16
block. -
8.8.8.0/24
is public, even if it uses the same subnet size.
π Final Thoughts
Subnets are more than just technical jargonβtheyβre the foundation of how networks are built and managed. Whether you're a network engineer, a system admin, or just a curious techie, understanding what a subnet reveals helps you design faster, safer, and smarter networks.
TL;DR β A Subnet Tells You:
β
Network address
β
Subnet mask
β
Number of hosts
β
IP range
β
Broadcast address
β
How to organize and segment networks
Top comments (0)