December 5, 2026

DHCP and the DORA Process, Captured Packet by Packet

A router and switch on a shelf with glowing status lights

A computer joining a network has no IP address, no idea where the router is and no DNS server, so it sends its first message from the address 0.0.0.0 to 255.255.255.255, effectively from nobody to everybody. Four packets later it has an address, a gateway, a DNS server and a deadline for asking again. Those four packets are Discover, Offer, Request and Acknowledge, the DORA exchange behind DHCP. To show exactly what happens, this post set up a DHCP server with dnsmasq and a client with dhclient on an isolated virtual Linux network, captured every packet with tcpdump, and compared the result with RFC 2131, the standard that defines the protocol.

Video: PowerCert Animated Videos on YouTube

What DHCP hands out

More than an address

RFC 2131, published in March 1997, still defines how the Dynamic Host Configuration Protocol works. A server leases an IP address for a fixed period and sends the other settings a device needs to use the network. The test server was told to lend addresses between 192.168.50.100 and 192.168.50.150 with a one-hour lease, and to hand out 192.168.50.1 as both the router and the DNS server.

The test network

Two Linux network namespaces, one for the server and one for the client, were joined by a virtual Ethernet cable. The server side had the fixed address 192.168.50.1. The client side started with no address at all. That’s the same position a laptop is in when it joins a home Wi-Fi network for the first time.

Ports and message names

DHCP runs over UDP. According to the RFC, messages to the server go to port 67 and messages to the client go to port 68. The capture filter was simply those two ports.

Black and white concrete hotel building under a calm blue sky

D: Discover

The client shouts

The RFC describes DHCPDISCOVER as a “Client broadcast to locate available servers.” The capture showed it exactly that way:

0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from aa:53:14:60:3c:2d, length 300, xid 0x72a31452
    DHCP-Message (53), length 1: Discover

The source address is 0.0.0.0 because the client has none yet. The destination is the broadcast address, because it doesn’t know where any server is. What identifies the client is its MAC address, aa:53:14:60:3c:2d, carried inside the packet.

The transaction ID

The xid value, 0x72a31452, is the RFC’s “Transaction ID, a random number chosen by the client.” Every reply in the exchange carries the same number. On a busy network with many devices joining at once, that’s how each client picks out the answers meant for it.

Why the label says BOOTP

tcpdump labels the packet “BOOTP/DHCP” because DHCP reuses the older BOOTP packet layout. RFC 2132, which defines the options, says “DHCP options have the same format as the BOOTP ‘vendor extensions’.” The message type itself lives in option 53, which “is used to convey the type of the DHCP message,” with 1 meaning Discover, 2 Offer, 3 Request and 5 ACK. The capture shows that option explicitly: DHCP-Message (53).

O: Offer

A server answers

DHCPOFFER is the server’s response “with offer of configuration parameters,” per the RFC. In the capture:

192.168.50.1.67 > 192.168.50.119.68: BOOTP/DHCP, Reply, length 300, xid 0x72a31452
  Your-IP 192.168.50.119
    DHCP-Message (53), length 1: Offer
    Server-ID (54), length 4: 192.168.50.1
    Lease-Time (51), length 4: 3600

The server proposed 192.168.50.119, identified itself with option 54 as 192.168.50.1, and offered a lease of 3,600 seconds, the one hour it was configured for.

Sent straight to the new address

This Offer went to 192.168.50.119 directly instead of to the broadcast address, even though the client hadn’t accepted that address yet. The packet’s flags field read [none], meaning the client had not set the broadcast bit. The RFC says a client that can’t receive unicast datagrams before it’s configured “SHOULD set the BROADCAST bit in the ‘flags’ field to 1.” Linux’s dhclient can, so it left the bit clear, and the server was free to reply by unicast.

Several offers, one choice

On a network with more than one DHCP server, a client can receive several Offers. It picks one, and the next message tells all of them which.

Gray and white rolled cable

R: Request

Accepting in public

The RFC describes DHCPREQUEST, in this case, as the client “requesting offered parameters from one server.” The capture:

0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from aa:53:14:60:3c:2d, length 300, xid 0x72a31452
    DHCP-Message (53), length 1: Request
    Server-ID (54), length 4: 192.168.50.1
    Requested-IP (50), length 4: 192.168.50.119

The client is still at 0.0.0.0, and the Request is broadcast again, not sent to the server that made the offer.

Why broadcast a reply to one server

The broadcast is deliberate. Option 54, the server identifier, is “the IP address of the selected server,” according to RFC 2132; here that’s 192.168.50.1. Option 50 names the address being accepted. Because every server on the segment sees the message, the chosen one knows to commit the lease, and any others can tell that their offers were turned down.

A: Acknowledge

The lease is committed

DHCPACK is the server’s message “with configuration parameters, including committed network address,” as RFC 2131 puts it. The capture:

192.168.50.1.67 > 192.168.50.119.68: BOOTP/DHCP, Reply, length 300, xid 0x72a31452
  Your-IP 192.168.50.119
    DHCP-Message (53), length 1: ACK
    Server-ID (54), length 4: 192.168.50.1
    Lease-Time (51), length 4: 3600

What the client did with it

dhclient’s own log summed up the exchange: “DHCPOFFER of 192.168.50.119 from 192.168.50.1,” then “DHCPACK of 192.168.50.119,” then “bound to 192.168.50.119.” Running ip addr in the client namespace showed inet 192.168.50.119/24 ... dynamic, and ip route showed default via 192.168.50.1. The router setting from the server had become the client’s default gateway.

One last check

The RFC adds a safety step: the client “SHOULD perform a final check on the parameters (e.g., ARP for allocated network address).” If another device already answers for that address, the client sends DHCPDECLINE, which the RFC defines as “indicating network address is already in use,” and starts over.

When the answer is no

There’s a fifth message that DORA leaves out. DHCPNAK tells the client its “notion of network address is incorrect,” typically when a laptop moves to a different network and asks to keep an address that makes no sense there. The client then drops the address and starts from Discover.

A yellow ethernet cable on a blue background

Leases, renewal and release

The renewal clock

A lease isn’t permanent, but clients don’t wait for it to run out. The RFC sets two timers: “T1 defaults to (0.5 * duration_of_lease)” and “T2 defaults to (0.875 * duration_of_lease).” For a one-hour lease that’s 1,800 and 3,150 seconds.

Why 1,591 and not 1,800

dhclient reported “renewal in 1591 seconds,” not 1,800. The RFC explains that “Times T1 and T2 SHOULD be chosen with some random ‘fuzz’ around a fixed value, to avoid synchronization of client reacquisition.” If every device on a network renewed at exactly the halfway mark after a power outage brought them all up together, the server would be hit by every renewal at once. The randomness spreads them out.

What the client stored

dhclient writes each lease to a file. The saved entry for this test listed fixed-address 192.168.50.119, option dhcp-lease-time 3600, option routers 192.168.50.1, option domain-name-servers 192.168.50.1, and two more lines the server had supplied: option dhcp-renewal-time 1800 and option dhcp-rebinding-time 3150. Those are the RFC’s default T1 and T2, exactly half and seven-eighths of the hour. The client stored the server’s suggested timers and still applied its own random offset when it scheduled the actual renewal. The entry also recorded option dhcp-message-type 5, the code for ACK.

Renewing, then rebinding

At T1 the client enters the RENEWING state and sends a unicast DHCPREQUEST directly to the server that issued the lease. If no acknowledgment comes back by T2, the RFC says the client “moves to REBINDING state and sends (via broadcast)” its request, so that any server able to extend the lease can answer. Only if the lease expires completely does the client give up the address and start again with Discover.

Giving an address back

Running dhclient -r released the lease early. The capture recorded one more packet, this time from the client’s real address straight to the server:

192.168.50.119.68 > 192.168.50.1.67: BOOTP/DHCP, Request from aa:53:14:60:3c:2d, length 300, xid 0x1dc76a46
  Client-IP 192.168.50.119
    DHCP-Message (53), length 1: Release

DHCPRELEASE, in the RFC’s words, is the client “relinquishing network address and cancelling remaining lease.” The transaction ID changed because this was a new transaction. A device that simply disconnects without sending one leaves its lease to run out on its own, after which the server can reuse the address.

When DORA goes wrong

The packet sequence is also a troubleshooting map. A client stuck at Discover with no Offer points to a server that’s down, a full address pool, or a VLAN or firewall blocking broadcasts. A client that gets Offers but never an ACK suggests a server problem after the offer. And an address in the 169.254.x.x range points to self-assignment. RFC 3927 explains that “The IPv4 prefix 169.254/16 is registered with the IANA” for link-local addresses, which hosts can configure for themselves in “environments where no other configuration mechanism is available.” Seeing one on a network that should have DHCP is a strong sign the Discover went unanswered.

Sources

  • RFC 2131, Dynamic Host Configuration Protocol: https://www.rfc-editor.org/rfc/rfc2131
  • RFC 2132, DHCP Options and BOOTP Vendor Extensions: https://www.rfc-editor.org/rfc/rfc2132
  • RFC 3927, Dynamic Configuration of IPv4 Link-Local Addresses: https://www.rfc-editor.org/rfc/rfc3927

920 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *