##
VLSM & Supernetting
VLSM = right-size each subnet instead of wasting a fixed mask. Always allocate largest requirement first.
// the method, step by step
- List every subnet by host count, largest first
- For each: hosts needed + 2 → round up to a power of 2
- Pick the prefix that fits (32 − log₂ block)
- Assign starting at the base address, no overlaps
- Leave room — the next block starts after this broadcast
// VLSM example — carving 192.168.1.0/24
// supernetting (route summarization)
192.168.0.0/24 + 192.168.1.0/24 → 192.168.0.0/23
Combine contiguous blocks by shortening the prefix to the common bits. 4× /24 → one /22, 8× → /21, and so on.
Combine contiguous blocks by shortening the prefix to the common bits. 4× /24 → one /22, 8× → /21, and so on.
// why it works — line up the binary
192.168.0.0 = 11000000.10101000.00000000.00000000
192.168.1.0 = 11000000.10101000.00000001.00000000
First 23 bits match → summary 192.168.0.0/23. The 24th bit differs, so it can't be part of the network mask.