What Is Subnetting and Why Does It Matter?

Subnetting is the process of dividing a single IP network into smaller, more manageable sub-networks (subnets). It improves network performance by reducing broadcast domains, enhances security by isolating segments, and makes more efficient use of limited IPv4 address space.

Key Concepts Before You Start

  • Network address: The first address in a subnet — identifies the subnet itself (not assignable to a host).
  • Broadcast address: The last address in a subnet — used to reach all hosts in the subnet (not assignable to a host).
  • Usable host range: Every address between the network and broadcast addresses.
  • CIDR prefix length: Written as /n, indicating how many bits are the network portion.

The Subnetting Formula

Given a prefix length of /n:

  • Total addresses in subnet: 2(32-n)
  • Usable host addresses: 2(32-n) − 2

Worked Example: Subnetting a /24

Suppose you have the network 192.168.10.0/24 and need to create 4 equal subnets.

You need at least 2 additional bits to create 4 subnets (2² = 4), so your new prefix becomes /26.

SubnetNetwork AddressUsable RangeBroadcastHosts
1192.168.10.0/26192.168.10.1 – .62192.168.10.6362
2192.168.10.64/26192.168.10.65 – .126192.168.10.12762
3192.168.10.128/26192.168.10.129 – .190192.168.10.19162
4192.168.10.192/26192.168.10.193 – .254192.168.10.25562

Variable Length Subnet Masking (VLSM)

VLSM allows you to use different prefix lengths within the same address space, allocating only as many addresses as each subnet needs. This is essential for efficient IPv4 use.

Example: Your organization needs three subnets — one for 100 hosts, one for 50 hosts, and one for 10 hosts — from the block 10.0.0.0/24.

  1. Largest first: 100 hosts → need /25 (126 usable) → assign 10.0.0.0/25
  2. Next: 50 hosts → need /26 (62 usable) → assign 10.0.0.128/26
  3. Smallest: 10 hosts → need /28 (14 usable) → assign 10.0.0.192/28

Quick Reference: Common Subnet Sizes

CIDRSubnet MaskTotal IPsUsable Hosts
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/25255.255.255.128128126
/24255.255.255.0256254

Tips for Real-World Subnetting

  • Always allocate slightly more addresses than you think you need — networks grow.
  • Reserve at least one subnet for infrastructure links (router-to-router /30s or /31s).
  • Document every subnet assignment in an IPAM tool, even a simple spreadsheet.
  • Use summary routes where possible to keep routing tables manageable.