The Slash Number: What It Means
CIDR stands for Classless Inter-Domain Routing. It was introduced in 1993 (RFC 1519) to replace the rigid class-based IPv4 address allocation system and allow more efficient use of the address space. The CIDR notation you see everywhere — 192.168.1.0/24, 10.0.0.0/8, 172.16.0.0/12 — encodes a network address and its size in a single compact expression.
The number after the slash (the "prefix length") tells you how many of the 32 bits in the IPv4 address are fixed as the network identifier. The remaining bits are free to vary and identify individual hosts within the network. A /24 has 24 fixed network bits and 8 host bits, giving 28 = 256 total addresses. A /16 has 16 fixed bits and 16 host bits, giving 216 = 65,536 addresses.
The network address in a CIDR block is the lowest address in the range (all host bits set to 0). The broadcast address is the highest (all host bits set to 1). Both are reserved — they cannot be assigned to individual hosts. Every other address in the block is a usable host address.
Common CIDR Blocks and Their Sizes
| CIDR | Subnet Mask | Total Addresses | Usable Hosts |
|---|---|---|---|
/32 | 255.255.255.255 | 1 | 1 (host route) |
/30 | 255.255.255.252 | 4 | 2 (point-to-point links) |
/29 | 255.255.255.248 | 8 | 6 |
/28 | 255.255.255.240 | 16 | 14 |
/24 | 255.255.255.0 | 256 | 254 (typical home/small office LAN) |
/22 | 255.255.252.0 | 1,024 | 1,022 |
/20 | 255.255.240.0 | 4,096 | 4,094 |
/16 | 255.255.0.0 | 65,536 | 65,534 (old Class B) |
/8 | 255.0.0.0 | 16,777,216 | 16,777,214 (old Class A) |
/0 | 0.0.0.0 | 4,294,967,296 | Entire IPv4 address space (default route) |
Subnet Masks: The Older Notation
Before CIDR, subnet masks were the standard way to express network boundaries. A subnet mask is a 32-bit number written in dotted-decimal, just like an IP address. Network bits are represented by 1s and host bits by 0s. The mask 255.255.255.0 in binary is 24 ones followed by 8 zeros — equivalent to /24 in CIDR notation.
Subnet masks and CIDR prefixes express identical information. You will still see subnet masks in older router interfaces, Windows network configuration dialogs, and legacy documentation. Converting between the two is straightforward: count the number of consecutive 1-bits in the mask, and that is the CIDR prefix length. A mask of 255.255.240.0 has 20 leading 1-bits, so it is /20.
One important rule: subnet masks must always be a contiguous sequence of 1s followed by a contiguous sequence of 0s. A "mask" like 255.0.255.0 (alternating octets) is not a valid subnet mask — CIDR only supports contiguous prefix lengths from /0 to /32.
How to Read a CIDR Block
Given a CIDR block like 192.168.10.0/24, you can derive all the key facts. The prefix length is 24, so there are 32 − 24 = 8 host bits. Total addresses: 28 = 256. Usable hosts: 254. Network address: 192.168.10.0 (the given address with all host bits zero). Broadcast address: 192.168.10.255 (all host bits one). Usable host range: 192.168.10.1 through 192.168.10.254.
For a block like 10.0.0.0/8: 32 − 8 = 24 host bits, 224 = 16,777,216 total addresses, network address 10.0.0.0, broadcast 10.255.255.255, host range 10.0.0.1 through 10.255.255.254. This is the largest RFC 1918 private range.
Cloud providers use CIDR notation extensively. When you create a VPC (Virtual Private Cloud) in AWS, Azure, or GCP, you specify a CIDR block for the entire VPC (e.g., 10.0.0.0/16) and then divide it into subnets (e.g., 10.0.1.0/24, 10.0.2.0/24). Understanding CIDR is essential for any cloud networking configuration.
Supernetting: Combining Small Blocks
CIDR also enables supernetting — the aggregation of multiple smaller blocks into a single larger announcement. If you own four consecutive /24 networks — 192.0.2.0/24, 192.0.3.0/24, 192.0.4.0/24, 192.0.5.0/24 — a router can advertise them as a single /22 block (192.0.2.0/22), reducing routing table size. This is route aggregation or route summarization, and it is fundamental to keeping internet routing tables manageable as the internet grows.
Frequently Asked Questions
What does /24 mean in an IP address?
The /24 means the first 24 bits identify the network, and the remaining 8 bits identify hosts. A /24 block contains 256 total addresses (254 usable for hosts), equivalent to the old Class C network size.
How many addresses are in a /24?
A /24 block contains 256 total IP addresses. Of these, 254 are usable for hosts — one is the network address and one is the broadcast address.
What is the difference between CIDR and subnet mask?
CIDR notation and subnet masks express the same information in different formats. A /24 CIDR prefix is equivalent to a subnet mask of 255.255.255.0. CIDR simply counts how many leading 1-bits the mask contains.
What does /32 mean?
A /32 means all 32 bits identify the network — there are no host bits. It refers to exactly one specific IP address. /32 routes appear in routing tables for host routes, firewall rules targeting a single IP, and loopback or VPN tunnel configurations.
What is a subnet?
A subnet (subnetwork) is a logical subdivision of an IP network. Subnetting divides a larger network into smaller segments, each with its own address range. Devices within a subnet communicate directly without going through a router.
How do I calculate hosts in a subnet?
Subtract the prefix length from 32 to get the host bit count, raise 2 to that power, then subtract 2. For a /24: 32 − 24 = 8 bits, 28 = 256, minus 2 = 254 usable hosts. For a /28: 32 − 28 = 4 bits, 24 = 16, minus 2 = 14 usable hosts.