Back to blog

Networking ยท 2026-04-20

Subnetting Basics: What I Finally Understood

Subnetting felt confusing at first because I tried to memorize shortcuts before understanding the reason behind it. This note explains the idea in beginner-friendly terms.

Why subnetting exists

Subnetting is a way to divide one larger network into smaller logical networks. Instead of giving every device one huge shared space, we create smaller groups that are easier to manage, route, and secure.

The key idea

An IP address has a network portion and a host portion. The subnet mask, or CIDR prefix, tells us where that split happens. For example, 192.168.1.0/24 means the first 24 bits identify the network, leaving 8 bits for host addresses.

Understanding the slash number

The slash number in CIDR notation tells us how many bits are reserved for the network. IPv4 addresses are 32 bits long. If the prefix is /24, then 24 bits are for the network and 8 bits are left for hosts. If the prefix is /26, then 26 bits are for the network and 6 bits are left for hosts.

Host bits decide how many addresses are available inside the subnet. The formula I use is 2^host_bits. In most normal LAN examples, two addresses are not usable by hosts: the network address and the broadcast address. So a /24 has 256 total addresses and 254 usable host addresses.

Example calculation

If I have 192.168.1.0/26, there are 6 host bits left. That gives 2^6 = 64 total addresses per subnet. The first subnet starts at 192.168.1.0, the broadcast address is 192.168.1.63, and usable hosts are 192.168.1.1 through 192.168.1.62.

The next subnet starts after 64 addresses: 192.168.1.64/26. Then 192.168.1.128/26, and then 192.168.1.192/26. This pattern is easier to see when I write the block size down first.

What I practiced

  • Converting CIDR prefixes into subnet masks.
  • Finding network addresses and broadcast addresses.
  • Estimating usable host counts.
  • Checking my answers with a subnet calculator after solving manually.

Common beginner mistakes

  • Using the network address as a host address.
  • Forgetting the broadcast address at the end of the subnet.
  • Mixing up total addresses and usable host addresses.
  • Trying to memorize shortcuts before understanding the block size.

Lesson learned

The math matters, but the purpose matters more: subnetting is about organizing networks into useful boundaries. Once I understood that, the calculations started to feel less random.