Skip to content
🌐 Networking & Communications • 9 min read • Published December 2026

IPv4 Subnetting, CIDR & VLSM Practical Guide for Networking Students

Subnetting trips up more IT and CS students than almost any other topic in Networks & Communications—not because the math is hard, but because people try to memorize tables instead of learning two simple rules. Here is the exact method I teach in lab classes, plus a complete worked VLSM campus design.

Aligned with IETF RFC 4632, RFC 1918 & RFC 3021 Reviewed by Academic Utility Suite Editorial & IT Faculty

⚡ Four Rules That Solve 95% of Subnetting Exam Questions

  • ✓ Host Bits = 32 − CIDR: A /26 leaves 32 − 26 = 6 host bits, giving 2^6 = 64 total addresses and 62 usable hosts.
  • ✓ Block Size ("Magic Number"): Subtract the interesting octet of the mask from 256. For 255.255.255.192, block size is 256 − 192 = 64.
  • ✓ Always Sort Largest First in VLSM: Allocate your biggest department before smaller ones so every block lands on its natural boundary without overlap.
  • ✓ Router-to-Router Links Use /30 (or /31): A WAN serial link needs only 2 host IPs—putting a /24 between two routers wastes 252 addresses.

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 IP11000000.10101000.00001010.01101001192.168.10.105
Mask (/26)11111111.11111111.11111111.11000000255.255.255.192
Network (AND)11000000.10101000.00001010.01000000192.168.10.64
Broadcast11000000.10101000.00001010.01111111192.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:

  1. Find the interesting octet — the first octet in the subnet mask that is not 255. For 255.255.255.224 (/27), it is the 4th octet (224).
  2. Compute the block size: 256 − 224 = 32. Subnets jump by multiples of 32: 0, 32, 64, 96, 128, 160, 192, 224.
  3. Bracket your host IP: If your host is 172.16.5.140/27, 140 sits between 128 and 160.
  4. 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
/24255.255.255.00.0.0.255256254Standard floor LAN
/25255.255.255.1280.0.0.127128126Large department VLAN
/26255.255.255.1920.0.0.636462Computer lab (40–60 PCs)
/27255.255.255.2240.0.0.313230Faculty room / small lab
/28255.255.255.2400.0.0.151614Server rack / printers
/29255.255.255.2480.0.0.786Small management VLAN
/30255.255.255.2520.0.0.342Router-to-router WAN link
/31255.255.255.2540.0.0.122*RFC 3021 point-to-point
/32255.255.255.2550.0.0.011Single 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 LAN60192.168.0.0/26.1 – .62.632
2. Student Lab28192.168.0.64/27.65 – .94.952
3. Library12192.168.0.96/28.97 – .110.1112
4. Server Room5192.168.0.112/29.113 – .118.1191
5. Router WAN2192.168.0.120/30.121 – .122.1230

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.1 is 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

  1. Forgetting to add +2 before choosing a VLSM block: If a lab needs 30 usable hosts, a /27 has 32 total addresses and 30 usable—it fits. If a lab needs 31 hosts, /27 is 1 host short; you must step up to /26 (62 usable hosts).
  2. Assigning the network or broadcast IP to a router interface: Configuring 192.168.0.64/26 or 192.168.0.127/26 on a Cisco IOS interface throws Bad mask /26 for address.
  3. Starting a subnet on an unaligned boundary: A /26 (size 64) can only start at .0, .64, .128, .192—never at .32 or .96.
  4. 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.
🌐 Interactive Networking Lab Tool + Classroom Challenge

Check Your Subnetting & VLSM Plans Live

Enter any IPv4 address and CIDR prefix to inspect binary AND/OR steps, split equal subnets, plan VLSM allocations, or run the seeded Classroom Lab Challenge (SN1).

Launch IPv4 Subnet, CIDR & VLSM Calculator →

Continue Reading Academic Guides

Academic Utility Suite

Install Academic Utility Suite

Add to your home screen for instant launch and 100% offline calculator access.

Academic Utility Suite

Install on iPhone / iPad

  1. 1 Tap the Share button ⬆️ in Safari's bottom or top toolbar.
  2. 2 Scroll down and tap "Add to Home Screen" ➕.
  3. 3 Tap Add in the top-right corner to launch calculators offline anytime.