2.7.2. Subnetting with VLSM and CIDR
CIDR (Classless Inter-Domain Routing): Allows subnet masks independent of address class. A /26 provides 64 addresses whether it's from Class A, B, or C space.
VLSM (Variable Length Subnet Mask): Using different subnet sizes within the same network. Allocate /24 where you need 200 hosts, /30 for point-to-point links, /27 for small segments.
Common Subnet Sizes:
| CIDR | Subnet Mask | Total IPs | Usable Hosts | Use Case |
|---|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point links |
| /29 | 255.255.255.248 | 8 | 6 | Small segments |
| /28 | 255.255.255.240 | 16 | 14 | Small department |
| /27 | 255.255.255.224 | 32 | 30 | Medium segment |
| /26 | 255.255.255.192 | 64 | 62 | Larger segment |
| /25 | 255.255.255.128 | 128 | 126 | Half Class C |
| /24 | 255.255.255.0 | 256 | 254 | Standard segment |
Subnetting Skill: Given an IP and mask, identify network address, broadcast address, and usable host range. Practice until automatic—this is tested both in multiple-choice and performance-based questions.
The two rules behind every subnet question:
- Usable hosts = 2^(host bits) − 2, because the first address (network) and the last (broadcast) are reserved. A /16 has 16 host bits: 2^16 − 2 = 65,534 usable hosts.
- The network and broadcast addresses bracket the block. 172.16.5.64/26 is a 64-address block running .64 through .127: .64 is the network address, .127 is the broadcast, and .65–.126 are usable hosts.
Route summarization (supernetting): CIDR also lets a router advertise several contiguous networks as one shorter prefix. The best summary is the most specific prefix that still contains every route: 10.1.4.0/24 and 10.1.6.0/24 both fall inside 10.1.4.0/22 (10.1.4.0–10.1.7.255). 10.1.4.0/23 is too small (it stops at 10.1.5.255), and 10.0.0.0/8 would contain both but also advertises many networks the router doesn't have.