4.3.9 · D3Computer Networks

Worked examples — Subnetting — subnet mask, network - host bits, VLSM

3,534 words16 min readBack to topic

Look at the ruler below: the purple cells to the left of the heavy line are network bits, the coral cells to the right are host bits, and the black line is the mask's dividing line — here drawn at /26. Everything on this page is about where that line falls and where your address lands between two tick marks.

Figure — Subnetting — subnet mask, network - host bits, VLSM

Three more words we reuse constantly — earn them once too:


The scenario matrix

Every subnetting question is one (or a combination) of these cells. Each example below is titled with its cell and its Ex-number so the table and the worked drills line up exactly.

# Case class What makes it tricky Example
C1 Mask cuts the 4th octet classic, block size in last octet Ex 1
C2 Mask cuts the 3rd octet interesting octet is not the last one Ex 2
C3 Mask cuts the 2nd octet interesting octet far left, big blocks Ex 3
C4 Degenerate /31 point-to-point, the rule breaks Ex 4
C5 Degenerate /32 a single host, zero host bits Ex 5
C6 /0 limiting case the whole internet, no network bits fixed Ex 6
C7 Reverse question — given host counts, find the prefix design direction Ex 7
C8 Full VLSM allocation, largest-first many subnets, alignment Ex 8
C9 Real-world word problem translate English → numbers Ex 9
C10 Exam twist — "is host X on the same subnet as host Y?" apply AND, compare Ex 10

Ex 1 · Cell C1 — Mask cuts the 4th octet (the classic)

The figure below draws exactly this: the tick marks are the boundaries , the mint band is the .64 subnet, and the coral dot is host .77 sitting inside it. Notice how the subnet is simply "the band the dot fell into", and the broadcast .79 is the tick just before the next band.

Figure — Subnetting — subnet mask, network - host bits, VLSM

Ex 2 · Cell C2 — Mask cuts the 3rd octet


Ex 3 · Cell C3 — Mask cuts the 2nd octet (big blocks)

The figure makes the scale visible: the ruler now spans the second octet (), the tick spacing is still 16, and the butter band starting at 130's block () is one subnet. Compare its width to the whole ruler to feel how huge a /12 is.

Figure — Subnetting — subnet mask, network - host bits, VLSM

Ex 4 · Cell C4 — Degenerate: the /31 point-to-point


Ex 5 · Cell C5 — Degenerate: the /32 single host


Ex 6 · Cell C6 — Limiting case: /0


Ex 7 · Cell C7 — Reverse question: hosts → prefix


Ex 8 · Cell C8 — Full VLSM allocation, largest-first

The stacked bands below are these four subnets laid on the /24 ruler, largest-first, left to right. Each band's left edge lands exactly on a multiple of its own block size — that alignment is why largest-first works, and the grey band on the right is the leftover .116.255.

Figure — Subnetting — subnet mask, network - host bits, VLSM

Ex 9 · Cell C9 — Real-world word problem


Ex 10 · Cell C10 — Exam twist: same subnet or not?


Recall Quick self-test

/28 block size in the 4th octet? ::: . Usable hosts on a /31 and why? ::: 2 — RFC 3021 drops the network/broadcast reservation for point-to-point links. Smallest prefix for 300 hosts? ::: /23 (). Are 10.0.0.35 and 10.0.0.60 same subnet under /27? ::: Yes, both AND to 10.0.0.32. Interesting octet of /20? ::: The 3rd octet (mask 255.255.240.0). Relationship between and ? ::: ; move the line right and grows while shrinks.


Connections

  • Parent: Subnetting — the laws these examples drill
  • IPv4 Addressing — the 32-bit ruler every example draws on
  • CIDR and Supernetting — the reverse of Ex 7/Ex 8: merging prefixes
  • Routing Tables and Longest Prefix Match — why Ex 5's /32 and Ex 6's /0 matter to routers
  • Default Gateway and ARP — Ex 10's "same subnet?" decides local vs remote delivery
  • Bitwise AND OR — the AND behind Ex 10's shortcut
  • Network and Broadcast Addresses — the two reserved patterns, and where they vanish (Ex 4)