Real World Maths Busters

The Maths Behind Everyday Life

The story, the formula and a worked example — see exactly where this maths shows up in the world around you.

Back to all stories
Technology 3 min read

Splitting Networks With Subnet Maths

A /24 subnet gives you 254 usable addresses.

IP subnets divide networks using powers of two. A /24 network (255.255.255.0 mask) has 2⁸ = 256 addresses, but 2 are reserved (network and broadcast), leaving 254 usable.

Subnet Sizing

The number after the slash is how many bits are fixed. The remaining bits are for hosts: 32 − 24 = 8 host bits = 2⁸ = 256 addresses.

Hosts=232−n−2\text{Hosts} = 2^{32 - n} - 2

n = subnet prefix length

/22 subnet

  1. 1

    Host bits

    32−22=1032 - 22 = 10
  2. 2

    Total addresses

    210=1,0242^{10} = 1{,}024
  3. 3

    Usable hosts

    1,024−2=1,0221{,}024 - 2 = 1{,}022
Answer

1,022 usable host addresses

The takeaway

Subnet maths is just powers of two minus the reserved addresses. Simple but essential for network design.

Back to all stories