Why Subnet?
Subnetting offers several key benefits in network design:
- Reduces broadcast traffic — smaller subnets limit the reach of broadcast packets
- Improves security — network segments can be isolated with firewalls and ACLs
- Efficient address use — VLSM lets you allocate only the addresses a segment actually needs
- Simplifies routing — hierarchical addressing enables route summarisation
- Required for cloud — AWS VPCs, Azure VNets, and GCP VPCs are all built on subnets
Key Terms
| Term | Definition |
|---|---|
| Network address | First address in a subnet — identifies the subnet (not assignable to hosts) |
| Broadcast address | Last address in a subnet — sends to all hosts (not assignable) |
| Host range | All addresses between network and broadcast — assignable to devices |
| Prefix length | Number of 1-bits in the subnet mask (the /N in CIDR) |
| Block size | Number of addresses in a subnet = 2^(32 - prefix) |
| VLSM | Variable Length Subnet Masking — using different prefix lengths in the same network |
How to Subnet: Step-by-Step
Given a network block and a required number of subnets or hosts, follow these steps:
- Determine how many subnets you need. Round up to the next power of 2. For example, 5 subnets → use 8 (2³ = 8).
- Borrow bits from the host portion. Borrowing 3 bits gives 2³ = 8 subnets. Add 3 to your starting prefix. If starting with /24, the new prefix is /27.
- Calculate the block size. Block size = 2^(host bits remaining) = 2^5 = 32 addresses per /27 subnet.
- List all subnets. Start from the network address, add the block size to get the next subnet.
- Identify network, broadcast, and host range for each subnet.
Worked Example: Subnetting 192.168.10.0/24
Goal: Divide 192.168.10.0/24 into 4 equal subnets.
Step 1 — How many bits to borrow?
We need 4 subnets. 2² = 4, so borrow 2 bits.
New prefix = /24 + 2 = /26
Step 2 — Block size?
32 - 26 = 6 host bits. Block size = 2⁶ = 64 addresses.
Step 3 — List subnets:
| Subnet | Network | First Host | Last Host | Broadcast |
|---|---|---|---|---|
| 1 | 192.168.10.0/26 | 192.168.10.1 | 192.168.10.62 | 192.168.10.63 |
| 2 | 192.168.10.64/26 | 192.168.10.65 | 192.168.10.126 | 192.168.10.127 |
| 3 | 192.168.10.128/26 | 192.168.10.129 | 192.168.10.190 | 192.168.10.191 |
| 4 | 192.168.10.192/26 | 192.168.10.193 | 192.168.10.254 | 192.168.10.255 |
Use our subnet calculator to verify any of these — the Subnet Splitter section shows all sub-subnets automatically.
VLSM Subnetting
VLSM (Variable Length Subnet Masking) allows you to use different prefix lengths within the same major network block — allocating exactly the right number of addresses to each segment instead of wasting them on uniform subnets.
Example: allocating subnets for an office network with the block 10.0.0.0/24:
| Department | Hosts needed | Assigned subnet | Usable hosts |
|---|---|---|---|
| Engineering | 60 | 10.0.0.0/26 | 62 |
| Sales | 25 | 10.0.0.64/27 | 30 |
| Management | 10 | 10.0.0.96/28 | 14 |
| Printers | 5 | 10.0.0.112/29 | 6 |
| WAN link | 2 | 10.0.0.120/30 | 2 |
VLSM uses 122 of the 254 available addresses compared to 5 × /26 = 310 (which would overflow the /24). Always allocate largest subnets first when planning VLSM.
Subnetting Tips & Tricks
- The block size is always a power of 2. Subnets always start on multiples of the block size.
- The last octet of a /24's subnets always starts at 0, 64, 128, 192 (for /26) — or 0, 32, 64 … (for /27), etc.
- To quickly find a subnet mask: subtract the prefix from 32, compute 2^result, subtract 1, and subtract from 256. E.g. /26 → 2^6 = 64 → 256 - 64 = 192 → mask = 255.255.255.192.
- Always allocate subnets from largest to smallest when using VLSM.
- Use a subnet calculator to verify your work — it shows network, broadcast, host range, and all sub-subnets instantly.