CIDR notation tells you exactly where the network portion stops and the host portion begins
Classless Inter-Domain Routing notation writes an IPv4 address followed by a slash and a prefix length, such as 192.168.1.25/24. The slash number counts the number of leading network bits. The remaining bits identify positions inside that network. That one number drives subnet size, address boundaries, host capacity, local-vs-remote decisions, and route specificity.
/24 means 24 network bits—not 24 hosts
IPv4 addresses contain 32 bits. A /24 reserves the first 24 bits for the network prefix and leaves 8 host bits. A /26 reserves 26 network bits and leaves 6 host bits. As the slash number gets larger, fewer host bits remain, so the subnet becomes smaller.
This is the first distinction to master because nearly every other CIDR calculation follows from it.
Every additional prefix bit halves the address block
A /24 leaves 8 host bits, so it contains 2^8 = 256 total addresses. A /25 leaves 7 host bits and contains 128. /26 contains 64. /27 contains 32. The pattern continues by halving each time the prefix increases by one.
| Prefix | Host bits | Total addresses | Traditional usable hosts |
|---|---|---|---|
| /24 | 8 | 256 | 254 |
| /25 | 7 | 128 | 126 |
| /26 | 6 | 64 | 62 |
| /27 | 5 | 32 | 30 |
| /28 | 4 | 16 | 14 |
| /29 | 3 | 8 | 6 |
| /30 | 2 | 4 | 2 |
Swipe horizontally to see the CIDR capacity table.
Write leading 1s to convert a prefix into dotted decimal
A subnet mask contains 1s for network bits and 0s for host bits. Every full octet of eight 1s becomes 255. A partial octet uses one of a small set of values.
| Leading 1s in partial octet | Binary | Decimal |
|---|---|---|
| 1 | 10000000 | 128 |
| 2 | 11000000 | 192 |
| 3 | 11100000 | 224 |
| 4 | 11110000 | 240 |
| 5 | 11111000 | 248 |
| 6 | 11111100 | 252 |
| 7 | 11111110 | 254 |
Swipe horizontally to see the partial-octet table.
Know the /24 through /30 sequence
/24
255.255.255.0
/25
255.255.255.128
/26
255.255.255.192
/27
255.255.255.224
/28
255.255.255.240
/29
255.255.255.248
/30
255.255.255.252
The mask reveals how far subnet boundaries advance
For a /26, the last-octet mask is 192. The block size is 256 − 192 = 64. That produces boundaries at .0, .64, .128, and .192. For /27, 256 − 224 = 32, so blocks begin at .0, .32, .64, .96, and so on.
172.16.8.70/27 belongs to 172.16.8.64/27
A /27 has a block size of 32. The final-octet blocks are 0–31, 32–63, 64–95, 96–127, and so on. Since 70 falls between 64 and 95, the network is .64.
This same calculation tells the host which destinations are local.
The prefix determines whether a host uses ARP locally or sends traffic to the gateway
Suppose 172.16.8.70/27 wants to reach 172.16.8.90. Both addresses fall inside 172.16.8.64/27, so the destination is local. The sender can resolve the destination's Layer 2 address directly.
Now try 172.16.8.100. That address belongs to the next /27 block, so the sender treats it as remote and forwards the packet toward its default gateway.
Routers use CIDR notation to describe destination ranges
A route such as 10.20.0.0/16 covers a broad range. A route for 10.20.30.0/24 covers a smaller, more specific range inside it. If a destination matches both, routers generally choose the route with the longest matching prefix.
Specificity is checked before route metric among overlapping prefixes
A common mistake is to compare route metrics before checking which prefixes actually match most specifically. A /24 route is more specific than a /16. A /32 host route is more specific than either. The default route /0 is the least specific possible IPv4 route.
| Prefix | Specificity | Typical meaning |
|---|---|---|
| /32 | Most specific in this list | Single host |
| /24 | More specific | 256-address block |
| /16 | Broader | 65,536-address block |
| /0 | Least specific | Default route |
Swipe horizontally to see the specificity table.
0.0.0.0/0 matches every IPv4 destination, but only when no more-specific route wins
The /0 prefix contains zero fixed network bits. That means every IPv4 address matches it. It is useful as a catch-all route toward an upstream gateway or Internet edge.
The default route does not override specific routes. It is selected when the route table has no more-specific match for the destination.
A broader prefix can summarize multiple contiguous aligned networks
CIDR made route aggregation practical. Instead of advertising many smaller routes separately, a router can sometimes advertise one broader prefix when the included networks share the required leading bits.
The summary must begin on the correct binary boundary. Similar-looking decimal addresses are not automatically aggregatable.
A summary route should cover all intended networks—and no unintended range unless that is deliberate
If you summarize too broadly, the router may attract traffic for networks that do not actually exist behind it. That can produce black holes or confusing forwarding behavior.
A /26 address is misclassified because someone assumes every subnet starts at .0
Address 192.168.10.150/26 does not belong to 192.168.10.0/26. /26 blocks advance by 64: .0, .64, .128, .192.
The slash length defines the block. The written address does not tell you the boundary by itself.
A host treats .90 as local but .100 as remote under /27
Host 172.16.8.70/27 belongs to .64-.95. Address .90 is inside that range, so it is local. Address .100 is outside, so the packet goes to the default gateway.
This connects CIDR directly to ARP and routing behavior.
A router chooses /24 over /16 even when the /16 route has a lower metric
Destination 10.20.30.55 matches both 10.20.0.0/16 and 10.20.30.0/24. The /24 is more specific, so it is considered before comparing metrics with routes to different prefix lengths.
This is why longest-prefix matching must come before general route-cost intuition.
A /23 summary can represent two aligned /24 networks
192.168.0.0/24 and 192.168.1.0/24 are contiguous and aligned on the /23 boundary. Their shared leading bits allow the summary 192.168.0.0/23.
But 192.168.1.0/24 and 192.168.2.0/24 do not form a single aligned /23 summary beginning at .1.
A larger slash number creates a smaller subnet
A student says /28 is larger than /24 because 28 is numerically larger. In reality, /28 leaves only 4 host bits, while /24 leaves 8. /28 has 16 total addresses; /24 has 256.
The slash number counts fixed network bits, not subnet size.
Both formats describe the same bit boundary
| CIDR | Dotted mask | Host bits | Total addresses |
|---|---|---|---|
| /24 | 255.255.255.0 | 8 | 256 |
| /26 | 255.255.255.192 | 6 | 64 |
| /27 | 255.255.255.224 | 5 | 32 |
| /30 | 255.255.255.252 | 2 | 4 |
Swipe horizontally to see the comparison.
Use binary when the decimal boundary feels ambiguous
For 192.168.10.150/26, the final octet 150 is binary 10010110. A /26 fixes the first two bits of that final octet because the first 24 bits already occupy the first three octets.
Binary reveals why the network block is .128-.191.
Host capacity is a direct consequence of how many bits CIDR leaves unfixed
If a /27 leaves 5 host bits, those bits create 32 combinations. In the traditional LAN model, network and broadcast consume two combinations, leaving 30 usable host addresses.
For full capacity calculations, continue to How Many Hosts Per Subnet?.
/31 and /32 show why CIDR should be understood as bit boundaries, not memorized host formulas
A /31 leaves one host bit and can be used on point-to-point links under modern standards. A /32 fixes all 32 bits and identifies one exact host route/address.
The traditional “subtract two” host formula belongs to ordinary multi-host subnet calculations, not every possible prefix context.
Most errors come from confusing prefix length with block size or route meaning
| Mistake | Why it fails | Better rule |
|---|---|---|
| /24 means 24 hosts | Slash counts network bits | Host bits = 32 − prefix |
| /28 is larger than /24 | More network bits leave fewer host bits | Larger prefix = smaller subnet |
| Every /26 begins at .0 | There are four /26 blocks inside a /24 | Use block-size boundaries |
| Lowest metric always wins | Longest prefix is considered first | Find most-specific match first |
Swipe horizontally to see the mistake table.
A wrong prefix can make a host send traffic to the wrong place
Suppose Host A is 192.168.10.70/27 and the intended gateway is 192.168.10.65. Host B is 192.168.10.100. With /27, Host A correctly treats Host B as remote and sends the packet to the gateway.
If Host A is accidentally configured /24, it now believes .100 is local and tries to resolve it directly with ARP. If no Layer 2 path exists between the actual subnets, communication fails even though the gateway is healthy.
Choose the route by longest matching prefix
This drill makes CIDR useful beyond subnetting arithmetic.
Use the shortest reliable sequence under time pressure
1. Prefix: identify slash length.
2. Host bits: 32 − prefix.
3. Mask/block: convert partial octet or use known block size.
4. Boundary: locate the address inside the correct subnet block.
5. Behavior: decide local vs. remote or route specificity.
6. Verify: cross-check capacity or binary boundary if needed.
The same prefix creates repeating boundaries across the octet
Once you know the block size, you can write the valid network starts without converting every address to binary. A /27 has a block size of 32, so the boundaries in the final octet are 0, 32, 64, 96, 128, 160, 192, and 224. A /28 has a block size of 16, so its boundaries occur twice as often.
This gives you a fast test: the network address must be one of the valid block starts for that prefix. If someone claims 192.168.10.70/27 belongs to 192.168.10.70/27 as the network, that is immediately wrong because 70 is not a /27 boundary.
Two hosts can use the same IP range differently when their prefixes differ
Consider Host A at 192.168.10.70/27 and Host B at 192.168.10.100/24. Host A sees .100 as remote because .70/27 belongs to the .64-.95 subnet. Host B sees .70 as local because /24 covers .0-.255.
This asymmetry can produce confusing failures when one endpoint has the wrong mask. One host sends toward the gateway while the other expects direct Layer 2 delivery. CIDR therefore affects forwarding behavior on each endpoint independently.
Overlapping prefixes are normal when they express increasing specificity
A route table can contain a default route, a broad organizational route, a subnet route, and a host route at the same time. These entries do not conflict merely because they overlap. Longest-prefix matching provides a deterministic selection rule.
Traffic to 10.20.30.55 selects the /32. Traffic to 10.20.30.80 selects the /24. Traffic to 10.20.40.10 selects the /16. This is a useful way to connect subnetting knowledge directly to routing-table analysis.
Cross-check the answer using mask, block size, and binary when needed
When the problem matters enough to verify, use more than one method. Convert the prefix to a mask, calculate the block size from the partial octet, and confirm the binary boundary. These methods should converge on the same answer.
If one method gives .128 and another gives .64, stop and fix the arithmetic before using the result in a routing or host-capacity decision.
24 CIDR Notation digital flashcards
Practice prefix lengths, host bits, subnet masks, block sizes, address boundaries, longest-prefix matching, default routes, aggregation, local-vs-remote behavior, and common exam traps.