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 01
Lesson · 01

Subnetting Basics

Subnetting is the practice of dividing one large network into smaller, manageable ones. Back in Level 1 we said an address has "a network part and a host part" — subnetting is the art of moving that boundary on purpose.

Duration
3min
Level
L5
Type
Lesson
Progress
1/ 6

01Why subnet?

  1. Efficiency — IP addresses are handed out to match need, not wasted
  2. Security — segments are isolated from each other (accounting ↔ guest Wi-Fi)
  3. Performance — broadcast traffic stays inside small areas
  4. Management — which range belongs to which department is obvious at a glance

02IP address structure

An IPv4 address is 32 bits:

code
192.168.1.100
↓
11000000.10101000.00000001.01100100

Network and host parts

code
[  Network part  ][ Host part ]
 192 . 168 . 1   .    100
 "which network?"     "which device on it?"

03The subnet mask

The subnet mask says where the boundary is: 1s mark the network part, 0s mark the host part.

Subnet maskCIDRNetwork bitsHost bits
255.0.0.0/8824
255.255.0.0/161616
255.255.255.0/24248
255.255.255.128/25257
255.255.255.192/26266

04CIDR notation

code
192.168.1.0/24
            ↓
   first 24 bits: network
   remaining 8 bits: host

The /24 example

code
Mask:   255.255.255.0
Binary: 11111111.11111111.11111111.00000000
        ←──── 24 bits ────→←─ 8 bits ─→
        Network              Host

05Counting hosts

Formula: 2ⁿ − 2 = usable hosts (n = number of host bits)

CIDRHost bitsTotal addressesUsable
/248256254
/257128126
/2666462
/2753230
/2841614
/29386
/30242
Why minus 2?
Two addresses in every subnet are reserved: the first names the network itself (network address), the last addresses everyone on it (broadcast). Neither can be given to a device.

06The special addresses

code
192.168.1.0/24

Network address: 192.168.1.0    (unusable)
First host:      192.168.1.1
Last host:       192.168.1.254
Broadcast:       192.168.1.255  (unusable)

07Example: splitting into four with /26

Let's divide 192.168.1.0/24 into four subnets:

SubnetNetworkHost rangeBroadcast
1192.168.1.0.1 – .62192.168.1.63
2192.168.1.64.65 – .126192.168.1.127
3192.168.1.128.129 – .190192.168.1.191
4192.168.1.192.193 – .254192.168.1.255
Sandbox · CalculatorSubnet CalculatorFeed each row of this table into the calculator; verify network, broadcast, and host range in binary view.Open tool

08Summary

  • Subnetting = slicing a network into logical parts
  • The subnet mask draws the network/host line; CIDR writes it as /24
  • Usable hosts = 2ⁿ − 2 (network + broadcast are reserved)
  • Next lesson: the practical method for doing these sums by hand
Previous
Level 4 Quiz
Next
Subnet Calculation
On this page
  • Why subnet?
  • IP address structure
  • The subnet mask
  • CIDR notation
  • Counting hosts
  • The special addresses
  • Example: splitting into four with /26
  • 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