What Is Subnetting? Subnetting Explained
Subnetting is the practice of splitting one large IP network into several smaller, self-contained networks called subnets. You do it by moving the dividing line between the "network" part and the "host" part of an IP address, which lets you right-size each network, waste fewer addresses, and keep traffic contained.
Part of the Subnetting & IP Addressing learning hub
Everything below is the concept, not the keystrokes. When you're ready to configure it on a router or work the binary math, follow our step-by-step subnetting how-to guide and free subnetting practice tool — this article is about understanding what's happening and why.
What Subnetting Actually Is
Every IPv4 address is 32 bits long, and those bits are split into two parts: a network portion (which network you're on) and a host portion (which specific device you are). Subnetting is simply deciding where that dividing line sits. Slide the line to the right and you get more host addresses per network; slide it left and you get more networks, each with fewer hosts.
A useful analogy is a street address. The street name tells you the general area — that's the network part. The house number tells you the exact home — that's the host part. Subnetting is like taking one very long street and breaking it into several shorter, separately named blocks so mail (and traffic) stays organized.
Why Subnetting Exists — The Problem It Solves
Subnetting solves three real problems. First, it conserves addresses. IPv4 has only about 4.3 billion addresses total, so handing an organization one giant block and letting most of it sit unused is wasteful. Subnetting lets you carve out a network that fits each group's actual size.
Second, it limits broadcast domains. Every device in a subnet hears the broadcasts of every other device in that subnet (things like ARP requests). One flat network with thousands of hosts drowns in broadcast noise. Splitting it into subnets keeps each broadcast domain small — and because a router does not forward broadcasts, the subnet boundary naturally contains them.
Third, it aids organization and security. Separating departments or device types into their own subnets gives you clean boundaries where you can apply routing policy and access control lists (ACLs).
Network Bits vs. Host Bits
Within those 32 bits, the leading bits identify the network and the trailing bits identify the host. The count of host bits determines how many devices fit. The formula is usable hosts = 2^(host bits) − 2.
Why minus two? In each subnet, the all-zeros host value is reserved as the network (or subnet) ID, and the all-ones host value is reserved as the broadcast address — neither can be assigned to a device. The exceptions are a /31, which is designed for point-to-point links and provides exactly 2 usable addresses, and a /32, which represents a single host such as a router loopback.
The trade-off is fixed: borrow one bit from the host portion and you double the number of subnets while halving the hosts each one can hold.
How a Mask Defines a Subnet
The subnet mask is a companion 32-bit value that marks which bits are network and which are host: 1s cover the network bits and 0s cover the host bits (for example, 255.255.255.0). A device performs a bitwise AND of its own IP address with the mask to calculate its network ID.
That calculation is how a device decides where to send traffic. If the destination falls in the same subnet, it delivers the packet directly on the local segment. If the destination is on a different subnet, it hands the packet to its default gateway — the next hop for any off-subnet, catch-all (0.0.0.0/0) traffic — to be routed.
You'll also encounter the wildcard mask, which is the exact inverse of the subnet mask (where the mask has 1s, the wildcard has 0s). It shows up in tools like ACLs and OSPF configuration.
CIDR and Prefix Notation
Writing out 255.255.255.0 gets tedious, so CIDR (Classless Inter-Domain Routing) notation just counts the network bits and appends them after a slash. So 192.168.1.0/24 means 24 network bits and 8 host bits — the same thing as a 255.255.255.0 mask, written more compactly.
CIDR matters for more than shorthand. It replaced the old, rigid "classful" system (Class A, B, C) where the network/host boundary could only fall on 8-bit octet lines. CIDR lets the boundary sit at any bit position, which is exactly what makes flexible, right-sized subnetting possible.
A few common prefixes to internalize: a /24 gives 254 usable hosts, a /25 gives 126, a /26 gives 62, and a /30 gives 2. Each step up in prefix length roughly halves the hosts.
VLSM and Common Beginner Gotchas
VLSM (Variable Length Subnet Masking) means using different mask lengths for different subnets carved out of the same larger block, sizing each one to its real need. A point-to-point link between two routers needs only two addresses (a /30 or /31), while a user LAN might need 200 (a /24). VLSM lets both live in the same address space without wasting a full /24 on a two-host link.
A few gotchas trip up beginners. The mask is not part of the IP address itself, but it must travel alongside it — the same address bytes mean different things under different masks. You can't reclaim the reserved network and broadcast addresses. Overlapping subnets quietly break routing, so plan blocks that don't collide.
Finally, don't confuse subnetting with VLANs. Subnetting is a Layer 3 (IP) concept about address boundaries, while a VLAN segments a switch into separate broadcast domains at Layer 2. In practice they're usually paired one-to-one (one VLAN per subnet), but they are two different mechanisms doing two different jobs.
Frequently asked questions
What does the "/24" after an IP address mean?
That's CIDR prefix notation, and it's just a count of network bits. A /24 means the first 24 of the address's 32 bits identify the network, leaving 8 bits for hosts — the same information as a 255.255.255.0 subnet mask, written more compactly. A larger number (like /26) means more network bits and therefore fewer host addresses per subnet.
Why do you subtract 2 when counting how many hosts a subnet can hold?
Because two addresses in every subnet are reserved and can't be assigned to devices: the all-zeros host value is the network/subnet ID, and the all-ones host value is the broadcast address. So usable hosts = 2^(host bits) − 2. The exceptions are a /31, which is meant for point-to-point links and gives you 2 usable addresses, and a /32, which is a single host such as a router loopback.
Does subnetting change the IP address itself?
No. Subnetting doesn't rewrite the address — it changes where the boundary between network bits and host bits falls, which is defined by the subnet mask that accompanies the address. That's why the same address bytes can belong to differently sized networks depending on the mask, and why an address is only fully meaningful when you know its mask or prefix.
Now build it on real Cisco IOS
Concepts stick when you configure them. Try a free graded lab, then grade your own config against the answer key.