Packet.School
HomeLevelsSandboxPricingAbout
XP1,240
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 process of dividing a large network into smaller networks.

Duration
3min
Level
L5
Type
Lesson
Progress
1/ 6

01Why Subnetting?

  1. Efficiency - Better use of IP addresses
  2. Security - Isolate networks from each other
  3. Performance - Reduce broadcast traffic
  4. Management - Organize the network

02IP Address Structure

IPv4 address consists of 32 bits:

code
192.168.1.100
↓
11000000.10101000.00000001.01100100

Network and Host Part:

code
[Network Part][Host Part]
192.168.1    .100
Network addr  Device addr

03Subnet Mask

Subnet mask separates network and 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
            ↓
         24 bits network
          8 bits host

/24 Example:

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

05Host Calculation

Formula: 2^n - 2 = Number of usable hosts

CIDRHost BitsTotalUsable
/248256254
/257128126
/2666462
/2753230
/2841614
/29386
/30242

Why -2?

  • 1 address: Network address (first)
  • 1 address: Broadcast address (last)

06Special Addresses

Each subnet has 2 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: /26 Subnetting

Let's divide 192.168.1.0/24 into 4 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

08Summary

  • Subnetting = Dividing network
  • Subnet mask separates network and host
  • CIDR notation: /24, /25, /26...
  • Host count: 2^n - 2
Previous
Level 4 Quiz
Next
Subnet Calculation
On this page
  • Why Subnetting?
  • IP Address Structure
  • Subnet Mask
  • CIDR Notation
  • Host Calculation
  • Special Addresses
  • Example: /26 Subnetting
  • Summary
Packet.School

An open, interactive curriculum for computer networking.

v3.0 · MIT22 lessons live

Learn

  • Lessons
  • Sandbox
  • Levels
  • Pricing
  • 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 licensed☕ Support with a coffeebuilt in the open · last updated 2026.05.14