Packet.School
HomeLevelsSandboxFreeAbout
XP0
L3 · Protocols
Level 3
5 lessons
  • 01HTTP/HTTPS
  • 02How DNS Works?
  • 03DHCP
  • 04TCP vs UDP
  • 05Level 3 Quiz
Levels/L3 · Protocols/Lesson 03
Lesson · 03

DHCP

DHCP is the protocol that automatically hands out IP addresses and network configuration to devices joining a network. If your phone can reach the internet the moment it connects to Wi-Fi, you have DHCP to thank.

Duration
3min
Level
L3
Type
Lesson
Progress
3/ 5

01Why DHCP?

Without DHCP, every device would need a manually assigned IP: slow, typo-prone, and worst of all — assign the same IP twice and you get an IP conflict.

With DHCP:

  • A device gets an IP automatically the moment it joins
  • Central management: the whole range is controlled from one place
  • When a device leaves, its IP returns to the pool — nothing is wasted

02What DHCP provides

More than just an IP arrives in a single exchange:

ItemExample
IP address192.168.1.100
Subnet mask255.255.255.0
Default gateway192.168.1.1
DNS server8.8.8.8
Lease time24 hours

03The DORA process

DHCP works in four steps — the initials spell DORA:

1. Discover

code
Client → "Any DHCP server on this network? I need an IP!" → Broadcast

2. Offer

code
DHCP Server → "192.168.1.100 is free, want it?" → Client

3. Request

code
Client → "Yes, I'd like 192.168.1.100" → Server

4. Acknowledge

code
Server → "Done, it's yours for 24 hours" → Client

The client doesn't have an IP yet, so its first message goes out as a broadcast — it shouts to everyone on the network, and whichever server has an answer replies.

04IP lease

An IP address isn't granted forever, it's leased:

  • Lease time — how long the IP is valid
  • Renewal — halfway through, the device quietly asks to renew
  • Release — if the device leaves, the IP returns to the pool

Example: a device with an 8-hour lease asks for renewal at hour 4; if renewed, the clock restarts.

05Where does the DHCP server live?

EnvironmentWho serves DHCP
HomeA service inside your router
OfficeA dedicated DHCP server
Large networksWindows/Linux server clusters

06Static vs dynamic IP

StaticDynamic (DHCP)
Assigned by handAssigned automatically
Never changesMay change when the lease ends
Servers, printersClient devices

There's a middle path too: DHCP reservation — a MAC address is paired with an IP, so the device always gets the same address while management stays central.

07Try it yourself

Sandbox · ProtocolDHCP SimulatorPlay through all four DORA steps with full lease details.Open tool

08Summary

  • DHCP = automatic IP and network configuration
  • DORA = Discover, Offer, Request, Acknowledge
  • IPs are leased and renewed at half-life
  • At home your router does this; servers usually run static IPs
Previous
How DNS Works?
Next
TCP vs UDP
On this page
  • Why DHCP?
  • What DHCP provides
  • The DORA process
  • IP lease
  • Where does the DHCP server live?
  • Static vs dynamic IP
  • Try it yourself
  • 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