What Is Subnetting?
Subnetting divides an IPv4 address space into smaller networks. Instead of treating an entire address block as one broadcast domain, you borrow bits from the host portion of the address to create additional network prefixes.
The result is a longer prefix and therefore smaller individual networks. For example, splitting 192.168.10.0/24 into four equal networks gives four /26 subnets:
192.168.10.0/26192.168.10.64/26192.168.10.128/26192.168.10.192/26
IPv4 Address Structure
An IPv4 address contains 32 bits. The prefix length tells you how many of those bits identify the network, while the remaining bits are available for host addressing.
| Prefix | Mask | Total addresses | Typical usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 point-to-point addresses* |
| /32 | 255.255.255.255 | 1 | 1 host route |
* /31 point-to-point addressing is defined by RFC 3021 and does not use the traditional network/broadcast interpretation.
How to Find the Network Address
The network address is the first address in the subnet. Conceptually, you keep the prefix bits and set all host bits to zero.
192.168.10.77/26
The /26 mask is 255.255.255.192. The block size in the last octet is 256 - 192 = 64. The subnet boundaries are therefore 0, 64, 128 and 192.
77 falls between 64 and 127, so the network is 192.168.10.64/26.
Broadcast and Usable Host Range
For traditional IPv4 subnets, the broadcast address is the last address in the subnet. The usable host range sits between the network and broadcast addresses.
For 192.168.10.64/26:
- Network:
192.168.10.64 - First host:
192.168.10.65 - Last host:
192.168.10.126 - Broadcast:
192.168.10.127 - Total addresses:
64 - Traditional usable hosts:
62
Calculating Host Capacity
If the prefix length is /n, the number of host bits is 32 - n. The total number of addresses is:
2^(32 - prefix length)
For a /27, there are five host bits:
2^5 = 32 total addresses
Under the traditional network/broadcast model, that means 30 usable host addresses.
Subnetting a /24
A common operational example is dividing a /24 into smaller equal-sized networks.
| New prefix | Subnets from /24 | Addresses/subnet | Traditional usable hosts |
|---|---|---|---|
| /25 | 2 | 128 | 126 |
| /26 | 4 | 64 | 62 |
| /27 | 8 | 32 | 30 |
| /28 | 16 | 16 | 14 |
| /29 | 32 | 8 | 6 |
| /30 | 64 | 4 | 2 |
VLSM: Different Subnet Sizes
Variable Length Subnet Masking (VLSM) lets you allocate different prefix lengths from the same address block. This avoids wasting large subnets on small point-to-point links or infrastructure segments.
A practical allocation might use a /24 like this:
/25for a larger user VLAN/27for infrastructure/28for a small service segment/30for a traditional point-to-point link
When planning VLSM, allocate the largest required subnet first and continue with progressively smaller blocks. Each subnet must start on a valid boundary for its prefix.
Subnet Boundaries Matter
A subnet is not defined by an arbitrary first address. The network address must align with the prefix. For example, 192.168.10.70/26 is a valid host address, but it is not a valid /26 network address. The corresponding network is 192.168.10.64/26.
This becomes especially important when summarizing routes, assigning VLANs and troubleshooting overlapping address ranges.
Practical Subnetting Workflow
- Identify the required number of hosts or subnets.
- Choose the smallest prefix that provides enough addresses.
- Determine the subnet block size.
- Find the valid network boundary.
- Calculate broadcast and usable host range.
- Check for overlap with existing allocations.
Use the NetOpsBench Subnet Calculator
Calculate the network, mask, host range, broadcast address and subnet breakdown without doing the boundary math manually.
Open NetOpsBench →FAQ
Why does a /26 have 64 addresses?
A /26 leaves six host bits. 2^6 = 64 total addresses.
Is every subnet limited to two fewer usable addresses?
No. The traditional IPv4 model reserves the network and broadcast addresses, but special cases such as /31 point-to-point links and /32 host routes have different semantics.
What is the fastest way to find a subnet boundary?
For the octet containing the prefix boundary, calculate 256 - mask value. The resulting block size gives the valid boundaries.
Reference: RFC 4632 (Classless Inter-domain Routing), RFC 1812 (IPv4 routing requirements), RFC 3021 (/31 point-to-point addressing).