Week 7 · Lesson 4

Designing a Subnet for a Host Count

Lessons 2 and 3 answered “given a prefix, what do I get?”. Now we reverse the problem: given a required number of hosts, which prefix should I choose? This is how real address plans are built, and it is a guaranteed exam skill.

CCNA 200-301 Domain 1.7 IPv4 Addressing Verified 2026-10-11
Part 1

The reverse problem

Forward questions give you a mask and ask for hosts. Design questions give you hosts and ask for a mask. The engine is still usable = 2h − 2, but you now solve it for h, then convert prefix = 32 − h.

Definition — smallest fitting prefix. For a required host count N, pick the smallest host-bit count h such that 2h − 2 ≥ N. The subnet prefix is then 32 − h. “Smallest h” means the largest prefix that still fits — wasting as few addresses as possible.

Two phrases to keep straight. “Smallest prefix that fits” (in common course language) actually means the smallest subnet, i.e. the largest prefix number: /26 is smaller in size than /24. We will always phrase it as “the tightest prefix” to avoid confusion: find the tightest prefix (largest /n) whose usable count still covers N.

Host-count to prefix · type a requirement
N = 50

Part 2

The 4-step design method

Run these four steps in order for every design question.

  1. Write the requirement N (hosts needed in the segment).
  2. Find h: the smallest host-bit count with 2h − 2 ≥ N. In practice, add 2 to N, then round up to the next power of two; the exponent is h.
  3. Convert to a prefix: prefix = 32 − h.
  4. If you are subdividing an existing block, borrowed bits s = new prefix − original prefix, and the block splits into 2s subnets.

Step 2 is the one students fumble, so here is the trick made explicit: N + 2 gives the minimum number of addresses you need. Round that up to the next power of 2. For 50 hosts, 50 + 2 = 52, round up to 64 = 26, so h = 6, prefix = /26.

Exam tip. “3 hosts” is the classic trap. A student who thinks “smallest subnet” and reaches for /30 gets 2 usable — not enough. The correct answer is /29, the tightest prefix whose 6 usable addresses cover 3. Always test the candidate one step smaller to prove it fails.
Part 3

Worked: 50, 200, 3, 500 hosts

Pick a requirement and watch the four steps produce the prefix.

Worked designs · select a requirement

      

Notice that 500 hosts forces a prefix shorter than /24: the subnet must span two /24 blocks. A /23 covers third-octet pairs such as 0–1, 2–3, and so on — Lesson 5 generalises this non-octet case.

Part 4

The borrow formula

When you take an existing network and split it, you borrow bits from the host part and add them to the network part. Each borrowed bit doubles the number of subnets and halves the size of each.

Definition — borrow formula. If you borrow s host bits, you create 2s equal subnets, and the new prefix is original prefix + s. Equivalently, subnets = 2(new prefix − original prefix).
Borrowed bits sSubnets 2sNew prefix from /24Hosts each
12/25126
24/2662
38/2730
416/2814
532/296

Read the table as a trade-off: every bit you borrow doubles the subnet count and halves the hosts. That is the entire economics of subnetting in one line.

Borrow calculator · parent prefix plus borrowed bits

Part 5

Carving an address space into subnets

Here is the standard workflow for “take network X and produce subnets of size Y”:

  1. Confirm the required host count fits the chosen prefix (Step 2 above).
  2. Compute the block increment in the magic octet.
  3. Walk the multiples of the increment from the network address, writing each subnet.
  4. For each subnet list: network, first usable, last usable, broadcast.

Example: divide 192.168.1.0/24 into four equal /26 subnets. Borrow 2 bits (26 − 24 = 2) → 22 = 4 subnets, increment 256 − 192 = 64.

Carve a block · type a parent network, pick a subnet prefix
#SubnetNetworkFirst usableLast usableBroadcast

Check any row of that design: subnet 2 network .64, broadcast .127, usable .65–.126 = 126 − 65 + 1 = 62 addresses. Every subnet yields exactly 62 usable hosts, and the four blocks tile the /24 with no gaps: .0–.63, .64–.127, .128–.191, .192–.255.

Full design drills

Drill A: A floor needs 100 hosts. Smallest fitting prefix?
  h=6 gives 62 < 100; h=7 gives 126 ≥ 100 -> /25 (126 usable)

Drill B: A floor needs 25 hosts. Smallest fitting prefix?
  h=4 gives 14 < 25; h=5 gives 30 ≥ 25 -> /27 (30 usable)

Drill C: A link needs exactly 2 hosts. Smallest fitting prefix?
  h=2 gives 2 ≥ 2 -> /30 (2 usable)

Drill D: A site needs 1000 hosts. Smallest fitting prefix?
  h=9 gives 510 < 1000; h=10 gives 1022 ≥ 1000 -> /22 (1022 usable)

Drill E: Split 172.16.0.0/24 into 8 equal subnets. Which prefix, and list the first three.
  borrow s = 3 -> /27, 2^3 = 8 subnets, increment 256−224 = 32
  #1 172.16.0.0/27   (.1-.30,  bc .31)
  #2 172.16.0.32/27  (.33-.62, bc .63)
  #3 172.16.0.64/27  (.65-.94, bc .95)

Verify Drill E subnet 1: broadcast .31, usable .1–.30 = 30 − 1 + 1 = 30 = 25 − 2. Correct, and the increment of 32 keeps the blocks contiguous.

Part 6

Key terms & sources

Design (reverse) problem

Choosing a prefix from a required host count rather than the other way round.

Borrowed bits (s)

Host bits reassigned to the network part; create 2s subnets.

Subnets = 2s

The borrow formula linking borrowed bits to subnet count.

Block increment

256 − mask value in the magic octet; the size and spacing of each subnet.

Tightest prefix

The largest /n (smallest subnet) whose usable hosts still cover the requirement.

  1. Pummill, R. & Manning, B. RFC 1878: Variable Length Subnet Table For IPv4 (1995) (host-per-mask table used to size subnets). rfc-editor.org/rfc/rfc1878.
  2. Fuller, V. & Li, T. RFC 4632: Classless Inter-Domain Routing (CIDR) (2006). rfc-editor.org/rfc/rfc4632.
  3. Cisco. CCNA (200-301) Exam Topics, IPv4 Addressing and Subnetting. cisco.com.
Part 7 · Your turn

Review

Check what you have learned with these review questions.

Review · 6 questions

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.