Subnet under exam time pressure
Task
Answer ten subnetting questions with a four-minute clock running on each, using the block-size method rather than binary conversion. Speed is the point: you can already do these slowly, and the exam does not give you slowly.
Steps
- Write the block-size table from memory before you start: mask octet 128 is a block of 128, 192 is 64, 224 is 32, 240 is 16, 248 is 8, 252 is 4, 254 is 2, 255 is 1. If you cannot write it from memory, that is the first thing to drill.
- Set a four-minute timer and answer, for each of these, the network address, first and last usable host, broadcast address and usable host count: 192.168.4.100/26, 10.5.7.200/21, 172.16.90.45/19, 192.168.1.33/28, 10.0.0.129/25.
- Now the other direction. For each requirement, give the smallest prefix that fits: 50 hosts, 300 hosts, 1000 hosts, 2 hosts (a router link), 13 hosts.
- Then the VLSM question: you have 192.168.50.0/24 and need subnets for 100, 50, 25 and 10 hosts. Allocate them in order, largest first, and write the four network addresses with no overlap and no waste.
- Mark yourself. Redo every wrong answer by hand, timed again.
Verify
python3 -c "
import ipaddress
for c in ('192.168.4.100/26','10.5.7.200/21','172.16.90.45/19','192.168.1.33/28','10.0.0.129/25'):
n = ipaddress.ip_network(c, strict=False); h = list(n.hosts())
print(c, '->', n.network_address, 'first', h[0], 'last', h[-1], 'bcast', n.broadcast_address, 'usable', len(h))
import math
for need in (50,300,1000,2,13):
p = 32 - math.ceil(math.log2(need + 2))
print('need', need, '-> /' + str(p), 'giving', 2**(32-p) - 2)
base = ipaddress.ip_network('192.168.50.0/24'); nxt = base.network_address
for need, pfx in ((100,25),(50,26),(25,27),(10,28)):
s = ipaddress.ip_network(f'{nxt}/{pfx}'); print('VLSM', need, 'hosts ->', s)
nxt = s.broadcast_address + 1
"
Every line must match your paper. The VLSM block is the one to check hardest: allocating largest first is what makes it fit, and allocating smallest first is the mistake that wastes the /24.
Notes
Two habits that save time in the exam. First, only one octet ever needs work — find it, and treat the rest as fixed. Second, for the "smallest prefix that fits" direction, remember you need the host count plus two, so 30 hosts needs a /27 (30 usable) exactly, and 31 hosts needs a /26.
The /31 exception is worth knowing: RFC 3021 allows a /31 on a point-to-point link with two usable addresses and no broadcast, which is why router links often use one instead of a /30.