What is Subnetting?

Subnetting is the practice of dividing a single IP network into two or more smaller networks called subnets. It’s one of the most fundamental skills in networking, whether you’re studying for the CCNA, planning an AWS VPC, or setting up a home lab.

Why Subnet?

Every device on a network needs a unique IP address. Without subnetting, all devices share a single broadcast domain. That creates three problems:

  1. Broadcast storms. Every device hears every broadcast, wasting bandwidth.
  2. No security isolation. There’s no separation between departments, servers, and users.
  3. Address waste. A /16 gives you 65,534 hosts. Most networks don’t need that many.

Subnetting solves all three by splitting one large network into smaller, isolated segments.

How It Works

An IPv4 address is 32 bits long, written as four octets: 192.168.1.0. A subnet mask (or CIDR prefix) tells you which bits are the network part and which are the host part.

For example, 192.168.1.0/24 means:

  • The first 24 bits (192.168.1) identify the network.
  • The remaining 8 bits (.0 through .255) identify hosts.
  • That gives you 2⁸ = 256 addresses, of which 254 are usable (the first is the network address, the last is broadcast).

To subnet, you borrow bits from the host portion and assign them to the network portion. This creates more networks with fewer hosts each.

Worked Example

Goal: Split 192.168.1.0/24 into 4 equal subnets.

Step 1: We need 4 subnets. 4 = 2², so we borrow 2 bits. The new mask is /24 + 2 = /26.

Step 2: Each /26 has 2⁶ = 64 addresses (62 usable).

Step 3: The four subnets are:

SubnetNetwork AddressBroadcastUsable RangeHosts
1192.168.1.0/26192.168.1.63.1 to .6262
2192.168.1.64/26192.168.1.127.65 to .12662
3192.168.1.128/26192.168.1.191.129 to .19062
4192.168.1.192/26192.168.1.255.193 to .25462

Verify: 4 subnets × 64 addresses = 256 total = one /24. ✓

Try this yourself with our subnet calculator. Enter 192.168.1.0/24, click Split to get two /25s, then split each /25 (three clicks total).

Key Terms

  • Network address: the first address in a subnet (all host bits are 0). Not assignable to hosts.
  • Broadcast address: the last address (all host bits are 1). Used to reach all hosts on the subnet.
  • CIDR notation: the /24 shorthand for the subnet mask. See our CIDR guide.
  • VLSM: Variable Length Subnet Masking, where subnets can be different sizes. See our VLSM guide.

Common Mistakes

  1. Forgetting reserved addresses. A /24 has 256 addresses but only 254 usable hosts. Cloud providers reserve even more. For example, AWS reserves 5.
  2. Miscounting powers of 2. The number of hosts is 2^(32-prefix) - 2, not 2^prefix.
  3. Ignoring alignment. A /25 block (128 addresses) must start at a multiple of 128. You can’t start a /25 at .50.

Next Steps

References