Computer Networks · Problem type

Split a block into subnets

Use this for “Split a /24 block into 5 equal subnets. What is their prefix, and how many hosts does each hold?”

Diagram

network24 bits318375host5 bits40subnet
network 24 + subnet 3 + host 5 = 32 bits, the whole 32-bit word.
Subnets made S = 8
Hosts per subnet h = 30
This is an example. Type your own values to start a new problem.
n
Block’s prefix
example
k
Subnets needed
example
s
Bits borrowed
calculated
p
Subnet prefix
calculated
S
Subnets made
calculated
h
Hosts per subnet
calculated

Formulas

s
=
⌈log₂
k
⌉
3 = ⌈log₂ 5⌉
S
=
2
s
8
=
2
3
p
=
n
+
s
27 = 24 + 3
h
=
2
32 −
p
−
2
30
=
2
32 − 27
−
2

Assumptions

•
Every subnet is the same size; its subnet bits are borrowed from the top of the host bits.
•
Borrowing s bits makes 2ˢ subnets, so s is the smallest whole number with 2ˢ at least k.
•
Each subnet still keeps a network and a broadcast address, so at least 2 host bits must stay.

Step-by-step

WE KNOW
n = /24, k = 5
FIND
bits borrowed (s), subnets made (S), subnet prefix (p), hosts per subnet (h)
Step 1 · Find bits borrowed (s)
Use s = ⌈log₂ k⌉
Each
borrowed
bit
doubles
the
subnets,
so
take
the
fewest
bits
whose
2ˢ
reaches
k
.
⌈log₂
5⌉
=
3,
since
2
2
=
4
<
5
≤
8
=
2
3
s
=
3
Step 2 · Find subnets made (S)
Use S = 2ˢ
Each
borrowed
bit
is
0
or
1,
so
s
bits
number
2ˢ
subnets.
S
=
2
3
S
=
8
Step 3 · Find subnet prefix (p)
Use p = n + s
The
borrowed
bits
join
the
network
part,
so
the
prefix
grows
by
s
.
p
=
24
+
3
p
=
/27
Step 4 · Find hosts per subnet (h)
Use h = 2³²⁻ᵖ − 2
The
32
−
p
host
bits
left
count
the
addresses;
the
network
and
broadcast
are
not
hosts.
h
=
2
32 − 27
−
2
h
=
2
5
−
2
h
=
32
−
2
h
=
30
Check
Put the numbers back in. Both sides should match.
3 = ⌈log₂ 5⌉ ✓
8
=
2
3
✓
27 = 24 + 3 ✓
30
=
2
32 − 27
−
2
✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.

Related lessons

© 2026 SME. All rights reserved.