Subnetting & VLSM
Read this concept as one more decision made about a packet in flight. The widget below lets you change the inputs and watch the consequence instead of memorising the rule.
Why it matters
Real networks need subnets of very different sizes, and a single fixed mask wastes addresses on point-to-point links while starving large LANs. VLSM lets an administrator borrow bits unevenly from the host portion.
On the wire
A /30 subnet leaves two usable hosts for a point-to-point link while a /24 can serve a large LAN, and both appear in routing tables as prefixes of different lengths. Each subnet boundary falls on a power-of-two address so the mask can be applied with a bitwise AND.
When it breaks
Overlapping subnets make longest-prefix matching choose a more specific route than intended, so traffic takes a wrong next hop. An address assigned outside its subnet mask causes a host to ARP for a neighbor that is not on the link.
Subnet calculator
Borrow host bits: click a subnet, then move an address inside it to see the mask do its work.
4 equal subnets from 203.0.113.0/24
VLSM borrows bits unevenly: /26 for 62 hosts, /27 for 30, /30 for a 2-host WAN link.
Network and broadcast addresses are reserved
203.0.113.1 & /26 = 203.0.113.0 → on-link with this mask