Instiq
Chapter 3 · Network applications·v1.0.0·Updated 7/10/2026·~14 min

What's changed: Initial version

3.2DHCP and address distribution

Key points

Covers the DHCP four-message exchange (DISCOVER/OFFER/REQUEST/ACK), temporary address assignment via lease, the DHCP relay agent used across multiple segments, static (reserved) allocation for servers and similar devices, and DHCP scope design decisions in a multi-segment environment.

DHCP (Dynamic Host Configuration Protocol) automatically distributes IP addresses to clients, but the essential design question for a network specialist is: "how do you distribute addresses from one DHCP server across multiple VLANs and segments?" Because broadcasts are, in principle, confined to a single segment, distributing addresses across multiple segments requires deliberate design. This section covers both the precise message exchange and the practical distribution design.

3.2.1The DHCP four-message exchange (DORA)

  • (1) DISCOVER: a broadcast the client sends to find a DHCP server, sent while it still has no IP address of its own.
  • (2) OFFER: the message a DHCP server sends in response to DISCOVER, proposing "I can lend you this address" (if multiple servers exist, multiple OFFERs may arrive).
  • (3) REQUEST: the client picks one of the offered addresses and broadcasts a request for it, which also signals other servers that their OFFERs were declined.
  • (4) ACK: the requested server confirms the address assignment, along with configuration such as the subnet mask, default gateway, and DNS server. These four steps are collectively called DORA.

3.2.2Leases and static allocation

  • A lease is the time limit on a DHCP-assigned address. The client attempts its first renewal (resending REQUEST) once 50% of the lease period has elapsed. If renewal keeps failing and the lease expires, the address becomes available for reassignment to another client.
  • Static allocation (a DHCP reservation) configures the server to always hand out the same IP address to a given client MAC address. It is used for devices that need a consistently fixed IP, such as servers or network equipment, giving the convenience of centralized management without manual static configuration on each device.

3.2.3DHCP relay agents and multi-segment distribution

  • DHCP DISCOVER/REQUEST messages are broadcasts and, in principle, are not forwarded across routers. So to serve multiple segments (VLANs) from a single DHCP server, the DHCP relay agent function must be enabled on the gateway (L3 switch or router) of each segment.
  • When a relay agent receives a broadcast from a client, it forwards it to the DHCP server as a unicast, and when the response arrives, it broadcasts it back (or delivers it directly to the client). While relaying, the agent sets its own IP address in the giaddr field, which the server uses to determine which segment's scope to allocate an address from.
Exam point

Most-tested: "DORA = DISCOVER -> OFFER -> REQUEST -> ACK," "lease renewal is first attempted at 50% of the lease period," and "broadcasts do not cross routers, so a relay agent forwards them." Also remember how the relay agent conveys segment information to the server via the giaddr field.

Suppose an office building has three floors (each its own VLAN/segment), and you want to consolidate a single DHCP server in the head-office server room to centrally manage IP addresses for the whole building. As the physical design, first enable the DHCP relay agent on each floor's L3 switch (the default gateway for that VLAN), configuring the DHCP server's IP address as the relay destination. On the DHCP server side, create a separate scope per floor (e.g., 1F = 192.168.1.0/24, 2F = 192.168.2.0/24, 3F = 192.168.3.0/24), so that the server can automatically determine which scope to allocate from based on the giaddr (the segment's gateway IP) that the relay agent sets when forwarding. In this design, devices such as each floor's printers or NAS are configured with static allocation (bound to their MAC address) so they always receive the same IP, while ordinary PCs and phones receive a dynamic lease as usual. Further, to accommodate growth in the number of users per floor, keep ample spare addresses in each scope, and differentiate lease duration by use case—e.g., a longer lease (say, one week) for office PCs and a short lease (say, two hours) for guest Wi-Fi—so the limited address space is reused efficiently. Multi-segment DHCP distribution is thus achieved by combining "relaying via relay agents" with "per-segment scope design."

OrderMessageSenderType
1DISCOVERClientBroadcast
2OFFERDHCP server(Typically) broadcast or unicast
3REQUESTClientBroadcast
4ACKDHCP server(Typically) broadcast or unicast
Warning

Trap: "DHCP broadcasts are automatically forwarded across routers" is wrong—broadcasts, in principle, stay within a single segment, and relay agents must be explicitly enabled on each gateway to serve multiple segments. Also wrong: "renewal is not attempted until just before the lease expires"—the first renewal attempt happens at 50% of the lease period.

DHCP DORA, relay.
Automatic address assignment

3.2.4Section summary

  • DHCP distributes addresses via the four-step DISCOVER -> OFFER -> REQUEST -> ACK (DORA) exchange
  • A lease renewal is first attempted at 50% elapsed; use static allocation for devices needing a fixed IP such as servers
  • Since broadcasts do not cross segments, multi-segment distribution combines a DHCP relay agent with per-segment scope design

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. An office is split into three VLANs, and a single DHCP server should distribute addresses to all of them. Which feature must be configured on each VLAN's L3 switch to meet this requirement?

Q2. You want a file server to always receive the same IP address, but still want to manage IP addresses centrally via the DHCP server. Which configuration is most appropriate?

Q3. At what point does a DHCP client first attempt to renew its leased IP address?

Check your understandingPractice questions for Chapter 3: Network applications