1. How Routers Read an IP: Binary ANDing
An IPv4 address is just a 32-bit binary number split into four 8-bit octets so humans can read it. When a router receives a packet addressed to 192.168.10.105/26, it does not look at decimal numbers—it converts both the IP and the subnet mask to binary and performs a bitwise AND (1 AND 1 = 1; everything else is 0).
| Row | Binary (32 bits) | Decimal |
|---|---|---|
| Host IP | 11000000.10101000.00001010.01101001 | 192.168.10.105 |
| Mask (/26) | 11111111.11111111.11111111.11000000 | 255.255.255.192 |
| Network (AND) | 11000000.10101000.00001010.01000000 | 192.168.10.64 |
| Broadcast | 11000000.10101000.00001010.01111111 | 192.168.10.127 |
Notice what happened in the fourth octet: the first two bits (01) stayed locked as the network ID (64), while setting the remaining six host bits to all ones (01111111) gave the broadcast address (127). Every IP from .65 to .126 can be assigned to a PC, printer, or switch interface.
2. The Fast Block-Size ("Magic Number") Shortcut
On a timed Cisco Packet Tracer lab or written quiz, writing out 32 bits for every question is slow. Use the block-size shortcut instead:
- Find the interesting octet — the first octet in the subnet mask that is not
255. For255.255.255.224(/27), it is the 4th octet (224). - Compute the block size:
256 − 224 = 32. Subnets jump by multiples of 32:0, 32, 64, 96, 128, 160, 192, 224. - Bracket your host IP: If your host is
172.16.5.140/27, 140 sits between 128 and 160. - Read all four answers immediately: Network =
.128, Broadcast =160 − 1 = .159, First Host =.129, Last Host =.158.
Verify your hand math live with the IPv4 Subnet, CIDR & VLSM Calculator, which prints both the binary AND table and the wildcard mask side by side.
3. Essential /24 to /32 Reference Chart
| CIDR | Subnet Mask | Wildcard | Block Size | Usable Hosts | Typical Use |
|---|---|---|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Standard floor LAN |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | Large department VLAN |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | Computer lab (40–60 PCs) |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | Faculty room / small lab |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | Server rack / printers |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | Small management VLAN |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Router-to-router WAN link |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2* | RFC 3021 point-to-point |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Single host / loopback route |
4. Complete Worked VLSM Campus Allocation Lab
Suppose your instructor assigns the base network 192.168.0.0/24 (256 total addresses) and asks you to design five subnets: Faculty LAN (60 hosts), Student Lab (28 hosts), Library (12 hosts), Server Room (5 hosts), and a Router WAN Link (2 hosts).
With equal-size subnetting, you would need five /26 blocks (320 addresses)—which does not even fit inside a /24! With VLSM, sort from largest host requirement to smallest, add 2 for network + broadcast, and pick the smallest power-of-two block that fits each subnet:
| Subnet | Needed | Network / CIDR | Usable Host Range | Broadcast | Spare IPs |
|---|---|---|---|---|---|
| 1. Faculty LAN | 60 | 192.168.0.0/26 | .1 – .62 | .63 | 2 |
| 2. Student Lab | 28 | 192.168.0.64/27 | .65 – .94 | .95 | 2 |
| 3. Library | 12 | 192.168.0.96/28 | .97 – .110 | .111 | 2 |
| 4. Server Room | 5 | 192.168.0.112/29 | .113 – .118 | .119 | 1 |
| 5. Router WAN | 2 | 192.168.0.120/30 | .121 – .122 | .123 | 0 |
Total addresses consumed: 64 + 32 + 16 + 8 + 4 = 124 out of 256—leaving the entire upper half of the network (192.168.0.128/25) untouched for future campus expansion.
5. RFC 1918 Private Blocks & Special Addresses
- 10.0.0.0/8 (
10.0.0.0 – 10.255.255.255): 16.7 million addresses; standard for large campuses and cloud VPCs. - 172.16.0.0/12 (
172.16.0.0 – 172.31.255.255): Watch the upper bound—172.32.0.1is a public IP, not private! - 192.168.0.0/16 (
192.168.0.0 – 192.168.255.255): Home routers, small offices, and classroom Packet Tracer labs. - 127.0.0.0/8 (Loopback) and 169.254.0.0/16 (APIPA link-local assigned when DHCP fails).
6. Four Subnetting Mistakes Students Make on Exams
- Forgetting to add +2 before choosing a VLSM block: If a lab needs 30 usable hosts, a
/27has 32 total addresses and 30 usable—it fits. If a lab needs 31 hosts,/27is 1 host short; you must step up to/26(62 usable hosts). - Assigning the network or broadcast IP to a router interface: Configuring
192.168.0.64/26or192.168.0.127/26on a Cisco IOS interface throwsBad mask /26 for address. - Starting a subnet on an unaligned boundary: A
/26(size 64) can only start at.0, .64, .128, .192—never at.32or.96. - Forgetting the default gateway counts as a host: If a room has 30 student PCs plus 1 router gateway interface, you actually need 31 usable host IPs.