Packet.School
HomeLevelsSandboxFreeAbout
XP0
L5 · Advanced Topics
Level 5
6 lessons
  • 01Subnetting Basics
  • 02Subnet Calculation
  • 03What is NAT?
  • 04VPN
  • 05Terminal Commands
  • 06Final Quiz
Levels/L5 · Advanced Topics/Lesson 02
Simulation · 02

Subnet Calculation

You know the theory; now let's learn to calculate at pen-and-paper speed. The whole method rests on one number: block size.

Duration
3min
Level
L5
Type
Simulation
Progress
2/ 6

01Step-by-step calculation

Example: 192.168.10.0/26

Step 1 — Find the mask

code
/26 = 26 one-bits, 6 zero-bits
11111111.11111111.11111111.11000000
= 255.255.255.192

Step 2 — Find the block size

code
256 − 192 = 64
Each subnet spans 64 addresses

Step 3 — List the subnets

code
Subnet 1: 192.168.10.0   – .63
Subnet 2: 192.168.10.64  – .127
Subnet 3: 192.168.10.128 – .191
Subnet 4: 192.168.10.192 – .255

02Quick reference table

CIDRMaskBlock sizeSubnetsHosts/subnet
/24255.255.255.02561254
/25255.255.255.1281282126
/26255.255.255.19264462
/27255.255.255.22432830
/28255.255.255.240161614
/29255.255.255.2488326
/30255.255.255.2524642

03Practice questions

Solve each one yourself first, then check the worked answer — and verify with the calculator at the end.

Q1: How many hosts fit in 10.0.0.0/8?

code
32 − 8 = 24 host bits
2²⁴ − 2 = 16,777,214 hosts

Q2: What is the broadcast address of 172.16.0.0/12?

code
/12 = first 12 bits are network
Range: 172.16.0.0 – 172.31.255.255
Broadcast: 172.31.255.255

Q3: Which subnet does 192.168.1.130/25 belong to?

code
/25 → block size 128
0–127:   first subnet
128–255: second subnet
130 → second subnet: 192.168.1.128/25

04The "which subnet is this IP in?" method

  1. Find the block size (256 − the mask's last octet)
  2. Divide the IP's last octet by the block size
  3. Drop the remainder: the result is the subnet's start

Example: which subnet holds 192.168.1.200/26?

code
Block size = 64
200 ÷ 64 = 3.125  →  3
3 × 64 = 192
Subnet: 192.168.1.192/26

05VLSM (Variable Length Subnet Mask)

Real networks don't give every segment the same size — they cut to fit:

code
Network: 192.168.1.0/24

Department A: needs 100 hosts → /25 (126 hosts)
Department B: needs 50 hosts  → /26 (62 hosts)
Department C: needs 20 hosts  → /27 (30 hosts)
Router links: need 2 hosts    → /30 (2 hosts)
Sandbox · CalculatorSubnet CalculatorEnter your answers to the questions above and check yourself — the binary view shows exactly where a mistake hides.Open tool

06Summary

  • Block size = 256 − the mask's last octet
  • Subnet start = the IP rounded down to the nearest multiple of the block size
  • Broadcast = the next subnet's start − 1
  • VLSM gives every segment exactly as many addresses as it needs
Previous
Subnetting Basics
Next
What is NAT?
On this page
  • Step-by-step calculation
  • Quick reference table
  • Practice questions
  • The "which subnet is this IP in?" method
  • VLSM (Variable Length Subnet Mask)
  • Summary
Packet.School

An open, interactive curriculum for computer networking.

v3.0 · MIT22 lessons live

Learn

  • Lessons
  • Sandbox
  • Levels
  • Free
  • About

Simulations

  • Packet Journey
  • DNS Lookup
  • DHCP Simulator
  • Subnet Calc
  • Network Builder
  • Terminal

Project

  • About
  • Changelog
  • GitHub
  • Contributing
  • Style guide

Newsletter

One short email when a new level ships. No tracking pixels.

© 2026 Packet.School — MIT licensedSupport with a coffeebuilt in the open