The four numbers every subnet question asks for
- Network address: the address with every host bit set to 0 (address AND mask).
- Broadcast address: the network with every host bit set to 1.
- Usable hosts = 2host bits − 2: the network and broadcast addresses can't go to a host.
- Subnet mask: /n is n ones, then zeros. /24 is 255.255.255.0; /26 is 255.255.255.192.
The block-size shortcut
Take the mask's last octet that isn't 255 or 0: block size = 256 − that octet. For /26 it's 256 − 192 = 64, so the networks start at .0, .64, .128 and .192. The address 192.168.1.130 falls in the .128 block: its network is .128 and its broadcast is .191, one less than the next block.
Classes and private ranges
- Class A: 1–126 (default /8). Class B: 128–191 (/16). Class C: 192–223 (/24). Class D, 224–239, is multicast; class E, 240–255, is reserved. 127 is loopback.
- Private ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12 (172.16 to 172.31) and 192.168.0.0/16.
VLSM in one line
Give the biggest subnet its block first, then the next biggest, each block as small as it can be: hosts + 2, rounded up to a power of 2.
Exam traps
- "Hosts" means usable hosts: subtract 2 (except for /31 and /32).
- Subnets needed: 2borrowed bits ≥ the number of subnets. Hosts needed: 2host bits − 2 ≥ the number of hosts.
- 172.16.0.0/12 covers 172.16 to 172.31, not just 172.16.
More simulators: SQL joins, CPU scheduling, page replacement, or all of them.