Networking

What is Subnetting and Why Is It Used in Networking?

Subnetting splits one IP network into smaller, isolated networks. Learn the math, the /24-to-/26 breakdown, and why engineers subnet for security, performance, and address efficiency.

By Inventive HQ Team

Subnetting is the process of dividing one IP network into multiple smaller sub-networks by borrowing bits from the host portion of the address. Each subnet becomes its own broadcast domain with a dedicated range of addresses, a network address, and a broadcast address — so a single 192.168.1.0/24 network (254 usable hosts) can be split into four /26 subnets of 62 usable hosts each. Engineers subnet for three concrete reasons: to contain broadcast traffic and keep networks fast, to create boundaries a firewall can filter across for security, and to allocate address space efficiently by matching each subnet's size to the number of devices it actually holds.

That's the summary an AI Overview gives you. Here's what it can't show you: how the bits actually move when you subnet, how prefix length maps to real host counts, and how to pick the right mask for a given number of devices. The diagram, reference table, and worked example below turn the definition into something you can apply.

How subnetting actually works: borrowing host bits

An IPv4 address is 32 bits split into a network part and a host part. The subnet mask (or CIDR prefix) is the line between them. Subnetting moves that line to the right — turning host bits into network bits — which creates more networks, each with fewer hosts. The diagram below shows a single /24 being split into four /26 subnets by borrowing two bits.

Splitting a /24 network into four /26 subnets by borrowing two host bits A 192.168.1.0/24 network with 254 usable hosts divides into four /26 subnets of 62 usable hosts each. Two borrowed bits create four subnets.

Borrowing 2 host bits splits a /24 into four /26 subnets

192.168.1.0/24 256 addresses · 254 usable hosts

Move the network/host boundary right by 2 bits

Subnet 1 192.168.1.0/26 .1 – .62 usable net .0 · bcast .63 62 hosts Subnet 2 192.168.1.64/26 .65 – .126 usable net .64 · bcast .127 62 hosts Subnet 3 192.168.1.128/26 .129 – .190 usable net .128 · bcast .191 62 hosts Subnet 4 192.168.1.192/26 .193 – .254 usable net .192 · bcast .255 62 hosts

254 usable in one /24 → 4 × 62 = 248 usable across four isolated subnets (8 lost to net/bcast pairs)

The trade-off is visible in that last line: subnetting costs you addresses. Every subnet reserves its own network and broadcast address, so four /26s waste 8 addresses that the single /24 did not. That is the price of isolation, and it is almost always worth paying.

Advertisement

Prefix length, subnet mask, and usable hosts — the reference table

The single most useful thing to internalize is how CIDR prefix maps to host count. Each step of the prefix halves the network. Here is the reference for the common IPv4 sizes:

CIDR prefixSubnet maskTotal addressesUsable hostsTypical use
/24255.255.255.0256254Standard office/department LAN
/25255.255.255.128128126Split a /24 in half
/26255.255.255.1926462Small department or VLAN
/27255.255.255.2243230Small office, IoT segment
/28255.255.255.2401614Rack of servers, small DMZ
/29255.255.255.24886Tiny segment, firewall cluster
/30255.255.255.25242Point-to-point router link
/31255.255.255.25422 (RFC 3021)Point-to-point link, no broadcast
/32255.255.255.25511Single host, loopback, host route

Which should you use? Pick the smallest subnet that still fits your hosts with room to grow. A 40-device team fits a /26 (62 usable) with headroom; squeezing it into a /27 (30 usable) will fail the moment you add printers and laptops. Router-to-router links should always be /30 or /31 — assigning a /24 to a two-address link wastes 252 addresses. Matching subnet size to real host count across a network is called Variable Length Subnet Masking (VLSM), and it is the whole point of classless addressing.

Why engineers subnet: the three real motivations

1. Performance — shrinking the broadcast domain

Every device in a subnet hears every broadcast (ARP requests, DHCP discovers, service announcements) sent within it. In a flat /16 with 65,000 potential hosts, broadcast traffic becomes a constant background roar that every NIC must process. Splitting into /24s confines broadcasts to ~254 hosts each, so the noise stays local and the network stays fast.

2. Security — boundaries you can enforce

Subnetting by itself does not block anything — but it creates the lines that a router, firewall, or access-control list enforces. Put servers, employee laptops, IoT devices, and guest Wi-Fi into separate subnets and traffic between them must cross a control point you can log, filter, and block. This is the mechanical basis of network segmentation and zero-trust design: a compromised smart thermostat on the IoT subnet cannot reach the finance server subnet without passing a firewall rule that says no.

3. Efficiency and management — structure that mirrors reality

A subnet per department, floor, site, or environment makes addressing predictable and troubleshooting fast. When you see 10.20.30.x you know it is the third-floor sales VLAN; a device's address tells you where it lives. Route tables stay compact because you advertise one aggregate prefix instead of thousands of individual hosts, and address space gets handed out in right-sized blocks instead of one wasteful pool.

Worked example: subnetting for four departments

Suppose you own 192.168.10.0/24 and need to serve four teams — Engineering (50 devices), Sales (30), Operations (20), and a point-to-point link to a branch router (2). A single flat /24 would leave all four teams in the same broadcast domain with no boundary between them. Here is the VLSM plan:

  • Engineering192.168.10.0/26 — 62 usable hosts (fits 50 with growth room)
  • Sales192.168.10.64/27 — 30 usable hosts (fits 30 exactly; consider a /26 for growth)
  • Operations192.168.10.128/27 — 30 usable hosts (fits 20)
  • Branch link192.168.10.160/30 — 2 usable hosts (the router pair)

Each block starts on a valid boundary (a multiple of the block size), the ranges do not overlap, and you still have address space left over in the upper part of the /24 for future subnets. Assign a firewall or router ACL between these subnets and you have segmentation, not just organization. You can check any of these calculations — ranges, masks, broadcast addresses — with our subnet calculator.

Common subnetting mistakes to avoid

  • Off-by-two on host counts. Remember to subtract the network and broadcast addresses. A /28 gives 16 addresses but only 14 usable.
  • Misaligned subnet boundaries. A subnet must start on a multiple of its block size. 192.168.1.32/26 is invalid — a /26 block size is 64, so valid starts are .0, .64, .128, .192.
  • Sizing with no headroom. Fitting 30 devices into a /27 (30 usable) means the next device breaks. Leave growth room or step up a size.
  • Oversizing point-to-point links. A router-to-router link needs 2 addresses. Use /30 or /31, never a /24.
  • Assuming subnetting equals security. The boundary is only as strong as the firewall rule or ACL enforcing it. A subnet with a permit-any rule between it and the next is not segmented.

Key takeaways

Subnetting divides one IP network into smaller, isolated ones by moving the boundary between the network and host portions of the address. You do it to keep broadcast traffic contained (performance), to create lines a firewall can enforce (security), and to allocate addresses in right-sized blocks that mirror your real-world structure (efficiency). The math reduces to one rule — usable hosts equal 2 to the power of the host bits, minus 2 — and the practical skill is choosing the smallest prefix that fits each segment with room to grow.

Frequently Asked Questions

What is subnetting in simple terms?

Subnetting is the practice of borrowing bits from the host portion of an IP address to split one large network into several smaller ones. Each resulting subnet gets its own range of addresses, its own network and broadcast address, and can be isolated from the others by a router or firewall. A single 192.168.1.0/24 network (254 usable hosts) can, for example, be divided into four /26 subnets of 62 usable hosts each.

Why do we use subnetting instead of one big flat network?

Three reasons: security, performance, and management. Subnets create boundaries you can filter traffic across, so a compromised device in one subnet cannot freely reach another. They shrink broadcast domains, so chatty broadcast traffic does not flood every host. And they let you map network structure onto real-world structure — a subnet per department, floor, VLAN, or environment — which makes addressing and troubleshooting predictable.

How do you calculate the number of hosts in a subnet?

Take the number of host bits (32 minus the prefix length for IPv4) and compute 2 to that power, then subtract 2 for the network and broadcast addresses. A /26 has 32 − 26 = 6 host bits, so 2^6 = 64 total addresses and 64 − 2 = 62 usable hosts. The two exceptions are /31 links (RFC 3021 allows 2 usable hosts with no broadcast) and /32 host routes (a single address).

What is the difference between a subnet mask and CIDR notation?

They describe the same boundary two ways. A subnet mask like 255.255.255.0 uses dotted-decimal to mark which bits are network (the 1s) versus host (the 0s). CIDR notation writes the same thing as a slash and a count of network bits — /24. 255.255.255.0 and /24 are identical; 255.255.255.192 equals /26. CIDR (defined in RFC 4632) is just the compact form.

What are the private IP ranges I can subnet freely?

RFC 1918 reserves three private ranges that never route on the public internet: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. You can carve these into any subnets you like inside your own network without coordinating with anyone. Most home and office networks use a slice of 192.168.0.0/16 or 10.0.0.0/8.

What is a broadcast address and why does subnetting create one per subnet?

The broadcast address is the last address in a subnet — every host bit set to 1 — and traffic sent to it reaches all hosts on that subnet. The first address (all host bits 0) is the network address that names the subnet itself. Because both are reserved, every subnet loses two addresses, which is why usable hosts equal total addresses minus 2.

How small can a subnet be?

For a normal LAN, /30 (2 usable hosts) is the practical floor. Point-to- point router links commonly use /31, which RFC 3021 permits to carry 2 usable hosts with no wasted broadcast address. A /32 represents a single host and is used for loopbacks, host routes, and access-control entries rather than a shared network segment.

Does subnetting improve network security?

Indirectly but significantly. Subnetting alone does not filter anything — it creates the boundaries that a router, firewall, or access control list then enforces. Segmenting servers, user devices, IoT gear, and guest Wi-Fi into separate subnets means lateral movement between them requires crossing a control point you can log and block, which is the foundation of network segmentation and zero-trust design.

What is VLSM and how does it relate to subnetting?

Variable Length Subnet Masking (VLSM) means using different prefix lengths for different subnets inside the same network instead of one uniform size. A point-to-point link gets a /30 while a user LAN gets a /24, so you match each subnet's size to its actual host count and waste far fewer addresses. VLSM is what makes classless (CIDR) addressing efficient.

subnettingnetworkingIP addressingnetwork designCIDR