What Is a Subnet? CIDR Notation Explained
A subnet is a smaller, logically divided section of a larger IP network, used to organize devices and control traffic flow. CIDR (Classless Inter-Domain Routing) notation describes a subnet's size by writing the IP address followed by a slash and a number, such as 192.168.1.0/24, where that number tells you how many bits are fixed as the network portion.
What a subnet is
Every device on a network has an IP address, and that address is split into two conceptual parts: a network portion, shared by every device in the same subnet, and a host portion, unique to each device. Subnetting is the practice of carving a larger address block into smaller subnets, which keeps related devices together, limits broadcast traffic, and lets a network administrator or hosting provider apply separate firewall rules or routing to different segments.
On a hosting platform, subnets commonly separate public-facing servers from internal database or management traffic, or isolate one customer's private network from another's inside a VPS or cloud environment.
CIDR notation explained
CIDR notation writes a subnet as an IP address plus a slash and a prefix length, such as 10.0.0.0/16. The number after the slash is how many leading bits of the address are fixed as the network portion; the remaining bits are available for individual hosts. A smaller number after the slash means a larger subnet with more addresses; a larger number means a smaller, more specific subnet.
| CIDR | Subnet mask | Total addresses | Usable hosts (typical) |
|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 (single host) |
| /30 | 255.255.255.252 | 4 | 2 |
| /29 | 255.255.255.248 | 8 | 6 |
| /28 | 255.255.255.240 | 16 | 14 |
| /24 | 255.255.255.0 | 256 | 254 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
Two addresses in every subnet are normally reserved rather than assigned to a device: the first address identifies the network itself, and the last is the broadcast address, which is why usable hosts is typically two fewer than the total.
Subnetting in everyday hosting tasks
Most people encounter subnets without directly managing them, but a few situations come up often:
- Firewall rules. A rule that allows traffic from
203.0.113.0/24covers every address from .0 through .255 in one line, instead of 256 separate rules. - Private networking on VPS and cloud platforms. Providers often give each account a private subnet, commonly from ranges like
10.0.0.0/8or192.168.0.0/16, for internal traffic between servers that never touches the public internet. - Checking an SSH allowlist. If documentation says "allow 198.51.100.0/28", that's 16 addresses, 198.51.100.0 through 198.51.100.15, with 14 usable for devices.
Converting between a subnet mask like 255.255.255.0 and its CIDR equivalent /24 is mostly a matter of memorizing a handful of common values, since full manual binary conversion is rarely needed day to day.
Frequently asked questions
What does /24 mean in CIDR notation?
/24 means the first 24 bits of the IP address are fixed as the network portion, leaving 8 bits for host addresses. That works out to 256 total addresses, with 254 usable for devices after the network and broadcast addresses are reserved.
How many usable IP addresses are in a /29 subnet?
A /29 subnet has 8 total addresses, but 2 are reserved for the network and broadcast addresses, leaving 6 usable addresses for devices.
What is the difference between a subnet mask and CIDR notation?
They describe the same thing in different formats. A subnet mask like 255.255.255.0 and the CIDR suffix /24 both mean the first 24 bits of the address are the network portion.
Why do servers and hosting providers use subnets?
Subnets group related devices, reduce unnecessary broadcast traffic, and let administrators apply firewall rules, routing, or access controls to a whole range of addresses at once instead of one at a time.
What are the common private IP ranges?
The ranges reserved for private networks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These addresses are not routable on the public internet and are commonly used for internal server-to-server traffic.
How do I calculate a subnet’s usable host count?
Take 2 raised to the number of host bits (32 minus the CIDR prefix), then subtract 2 for the reserved network and broadcast addresses. For a /27, that's 2^5 = 32, minus 2, equaling 30 usable hosts.
Related topics
- What Is an IP Address? Networking & IP
- What Is a Hosting Provider? Hosting Basics
- What Is a Firewall? Security & SSL
- What Is a Database? Databases
- What Is a VPS (Virtual Private Server)? VPS & Cloud