Why does VLSM allocation have to start with the largest subnet?
My VLSM answer had the right sizes but the grader marked the addresses wrong. The only difference: I allocated the small subnets first. Why does order matter?
1 Answer
Because every subnet must start on a multiple of its own size. A /26 (64 addresses) can only begin at .0, .64, .128, .192. If you allocate a /30 first at .0, the next /26 can't start at .4 — it must jump to .64, wasting .4–.63. Allocating largest-first keeps the cursor aligned automatically: each next block is the same size or smaller, so it always lands on a valid boundary with zero gaps. That's the entire trick behind textbook VLSM: sort by host count descending, size each with 2^n − 2 ≥ hosts, and lay them down consecutively. Try your same problem in /tools/vlsm-planner — it shows the alignment happening and the "next free address" after the plan.