Calxo Learn

Learn the concept. Understand the formula. Calculate the result.

Lesson 6 of 6 · 10 min

How DHCP gives your device an IP address

Join a four-message conversation, follow an address offer into a lease, and see how renewal keeps your connection configured.

By Calxo AI · Updated

You join Wi-Fi. Who fills in the address?

You enter the Wi-Fi password, wait a moment, and open a website. Somewhere in that short pause, your laptop usually picks up an IP address, a subnet mask, a default gateway, and information about DNS servers. You did not type any of them. Who did the paperwork?

On many IPv4 networks, that job belongs to DHCP: Dynamic Host Configuration Protocol. A device asks for configuration, and a DHCP server supplies it. At home the server is often built into the router. In an office it might be a separate service.

Think of a hotel reception desk. The receptionist assigns an available room and tells you when your booking ends. DHCP assigns an address for a period called a lease. The analogy helps, but a lease can be renewed without changing the address or interrupting a working connection.

Connecting to Wi-Fi and getting an IPv4 configuration are separate steps. Wi-Fi association and authentication establish the link; DHCP then helps configure IP on that link. A Wi-Fi icon alone does not prove that all of this succeeded.

Four messages, one new lease

Let’s follow a laptop joining a simple home LAN without a usable remembered lease. Our server can offer 192.168.1.104. The familiar four-message exchange is often remembered as DORA.

Picture it · A very short conversation

1 · Laptop → local network

Discover

“Is a DHCP server available?”

2 · DHCP server → laptop

Offer

“I can offer 192.168.1.104.”

3 · Laptop → local network

Request

“I would like that offer from this server.”

4 · DHCP server → laptop

Acknowledge

“Confirmed: here is your lease and configuration.”

A new DHCPv4 allocation on a single LAN, with one selected server. The arrows show the conversational direction, not a claim that every message uses the same delivery method.
  1. Discover: the laptop asks whether a DHCP server is available. Without a usable address, it can broadcast using source 0.0.0.0 and destination 255.255.255.255.
  2. Offer: a server proposes an address and configuration. More than one server can respond. An offer is a proposal, not the final lease.
  3. Request: the client selects an offer. In this initial exchange, it broadcasts DHCPREQUEST identifying the chosen server and requested address.
  4. Acknowledge: the chosen server confirms with DHCPACK. The client completes its checks before using the configuration. If it finds the address already in use, it declines the address and tries again.

DHCPv4 uses UDP: the server listens on port 67 and the client on 68. Server replies may be broadcast or unicast depending on client state, flags, and delivery arrangements. A DHCP relay can carry requests to a server on another subnet; ordinary routers do not simply forward the original local broadcast everywhere.

The address comes with useful instructions

One illustrative DHCPv4 configuration
SettingExampleJob
IPv4 address192.168.1.104Identifies this interface on the LAN
Subnet mask255.255.255.0 (/24)Identifies the local subnet boundary
Default gateway192.168.1.1Next hop for destinations using the default route
DNS server192.168.1.1Resolver to ask about domain names
Lease duration8 hoursHow long the allocation is valid without extension

Here the home router is both gateway and DNS forwarder, so those two entries match. They do not have to match in another network. DHCP can supply these settings through options; actual configuration depends on the server and client.

DHCP does not look up website names itself—that is DNS’s job. It does not share your public IPv4 address either—that is the separate translation job covered in our NAT lesson.

A pool is smaller than the whole subnet

Suppose the LAN is 192.168.1.0/24, but the administrator offers only .100 through .119 through DHCP. That is 20 addresses, because both endpoints count: 119 − 100 + 1 = 20.

Picture it · Twenty places at reception

All addresses below begin with 192.168.1.

.100
.101
.102
.103
.104
.105
.106
.107
.108
.109
.110
.111
.112
.113
.114
.115
.116
.117
.118
.119
Blue: four example active leases. Amber: .104 offered to our laptop. Grey: the other 15 pool addresses, assumed available in this simplified snapshot. An offer is not yet a confirmed lease; real servers can temporarily hold offers.

The /24 has more conventional host addresses than this pool. Addresses outside the pool may be set aside for routers, servers, or other purposes. A reservation associates an address with a client identity in the server’s configuration; manual static configuration sets it on the device. Plan both carefully to avoid conflicts.

If the pool is full, the Wi-Fi link may still connect while a new client cannot obtain a lease. That is one possible failure, not a diagnosis you can make from the Wi-Fi icon alone.

An eight-hour lease does not mean an eight-hour cutoff

A client normally tries to extend a lease before it expires. Unless the server supplies different timer values, T1 is halfway through the lease and T2 is seven eighths of the way through.

Picture it · Ask before the booking ends
  1. 0 hours: lease begins.
  2. 4 hours · T1: try renewing with the leasing server.
  3. 7 hours · T2: if still unanswered, broadcast a request to any suitable server.
  4. 8 hours: if no extension succeeds, stop using the expired address and seek configuration again.
Defaults for this example: T1 = 0.5 × 8 = 4 hours; T2 = 0.875 × 8 = 7 hours. A successful renewal starts a new lease timing period. Server settings and client behaviour can vary.

Renewing an existing lease usually uses DHCPREQUEST and DHCPACK rather than repeating every initial DORA step. A returning device can also request a remembered address. The four-message story is a useful first lesson, not every possible DHCP exchange.

Connected, but still waiting for an address?

Check the device’s assigned address, mask, gateway, and DNS information before changing anything. A missing lease could involve an unavailable server, an exhausted pool, a VLAN or relay problem, or blocked traffic. A complete lease with failed web browsing could instead point to DNS, routing, a captive portal, or an upstream problem.

Some systems choose an IPv4 link-local address in 169.254.0.0/16 when no ordinary IPv4 configuration is available. That can be a clue to investigate DHCP, but it is not proof of one specific fault and is not an ordinary Internet-routable address. Do not fix it by guessing an unused address.

DHCPv4 and DHCPv6 are different protocols. IPv6 can also use SLAAC and Router Advertisements. And DHCP configuration does not authenticate a network’s intentions: unmanaged or rogue servers can supply unwanted settings.

Use the explorer below to watch the conversation and change the lease duration. Then try the quiz. You are ready when you can distinguish an offer, a confirmed lease, and a renewal.

Try it · Join the conversation

DHCP conversation explorer

Follow a new IPv4 lease on one LAN. This is an illustration, not a live network test.

Laptop → local network

Is a DHCP server available?

Starting without an IPv4 lease, the client sends DHCPDISCOVER. In this direct-LAN example it uses source 0.0.0.0 and broadcasts to 255.255.255.255.

Looking for a server

The new lease is not confirmed yet.

Default example: T1 at 4 hours · T2 at 7 hours · Expiry at 8 hours.

Times are relative to the lease start. Server-supplied timers can differ. A successful renewal resets the lease timing; expiry only happens if the lease is not extended.

Check your understanding

Choose an answer for every question, then check your work. You can retry as often as you like.

1. Our new client has received DHCPOFFER. What does that mean?
2. With a 24-hour lease and default timer fractions, when are T1 and T2?
3. How many addresses are in a DHCP pool from 192.168.1.100 through 192.168.1.119, including both ends?

0 of 3 answered.

Sources and scope

This lesson covers an illustrative initial DHCPv4 lease, a sample address pool, and default lease timer fractions. Actual options, renewal timers, relay paths, and client behaviour depend on the network.

How Calxo reviews its content