Sub topic 11
NAK, Decline, Release and Inform
This chapter covers four DHCP messages that sit outside the normal Discover, Offer, Request, Acknowledge (DORA) exchange. Each one handles a situation DORA does not: a server refusing a request, a client refusing an address, a client giving an address back, and a client asking for settings only.
Prerequisites
This chapter assumes you know the following:
- The DORA exchange and the lease lifecycle (T1 renewal, T2 rebinding, expiry) from earlier chapters.
- That DHCP runs over UDP, with the client on port 68 and the server on port 67.
- The meaning of a subnet mask, default gateway and DNS server.
The full message set
DHCP defines eight message types. They are carried in DHCP option 53 (DHCP Message Type). You already know four of them. This chapter covers the other four, plus the related DHCPNAK that servers send.
| Type value | Message | Sent by | Purpose |
|---|---|---|---|
| 1 | DHCPDISCOVER | Client | Find servers |
| 2 | DHCPOFFER | Server | Propose an address |
| 3 | DHCPREQUEST | Client | Accept an offer, renew, or verify an address |
| 4 | DHCPDECLINE | Client | Reject an address because it is already in use |
| 5 | DHCPACK | Server | Confirm the lease and settings |
| 6 | DHCPNAK | Server | Refuse a request |
| 7 | DHCPRELEASE | Client | Give back an address early |
| 8 | DHCPINFORM | Client | Ask for settings only, with no address |
DHCPNAK: the server says no
A DHCPNAK (negative acknowledgment) tells the client that its request is not acceptable. The client must stop using the address it asked for and start again from Discover.
A server sends a NAK in these common cases:
- The client moved to another network. The client wakes from sleep on a different subnet and sends a REQUEST to confirm its old address. The address does not belong to this subnet, so the server refuses it.
- The lease is gone. The lease expired and the server has already given the address to another client, or the administrator deleted the lease.
- The scope changed. The administrator changed the range or removed a reservation, so the requested address is no longer valid for that client.
- A mismatch in the request. The client asks for an address that the server did not offer.
Reboot with INIT-REBOOT
The "client moved" case is the most common one. A client that still holds a lease record after a reboot does not run full DORA. It skips Discover and broadcasts a DHCPREQUEST that names its old address in option 50 (Requested IP Address). This state is called INIT-REBOOT.
The server then decides:
- If the address is valid on this subnet and free for this client, it sends an ACK.
- If the address is wrong for the subnet, it sends a NAK.
- If the server knows nothing about the address, it should stay silent. A silent server lets the client time out and fall back to Discover, and it avoids a server answering for leases that another server manages.
On receiving a NAK, the client discards its old configuration and restarts at Discover. The whole recovery takes a few seconds, so you rarely notice it.
sudo tcpdump -n -i eth0 -vv 'udp and (port 67 or port 68)'In the capture, look for the option line DHCP-Message Option 53, length 1: NACK. A NAK often appears right after a laptop joins a new network and then is followed by a fresh Discover from the same MAC address.
DHCPDECLINE: the client says no
A DHCPDECLINE is sent by a client that has been offered an address but finds it is already in use. Clients are expected to check an address before using it. The usual method is ARP probing: the client sends ARP requests asking who owns the offered address. If any host replies, there is a conflict.
When that happens the client:
- Sends a DHCPDECLINE to the server. It includes the conflicting address in option 50 and the server identifier in option 54.
- Does not use the address.
- Waits a short time, commonly around 10 seconds, and restarts at Discover.
The server should mark the address as unusable for a period so that it does not offer it again right away. Many servers keep a "bad address" entry until an administrator clears it or a timeout passes.
Typical causes of a conflict:
- A device with a static address inside the DHCP pool.
- A reservation that was not created for a device that uses that address.
- Two DHCP servers with overlapping scopes.
The fix is on the server side. Move the static device out of the pool or add an exclusion, and check for a second server.
DHCPRELEASE: the client gives the address back
A DHCPRELEASE tells the server that the client no longer needs its address. The server can mark the lease as free and offer the address to someone else.
Key properties:
- It is a unicast message sent directly to the server that granted the lease. The client already knows the address and the server identifier, so no broadcast is needed.
- The server does not reply. There is no acknowledgment, so the client cannot know whether the server received it.
- The client stops using the address as soon as it sends the message.
Release is optional. A client that powers off without sending it simply leaves a lease that will expire on its own. This is why short leases matter in places with many short-lived clients, such as guest Wi-Fi.
You can send a Release by hand when you test:
# Linux (ISC dhclient)
sudo dhclient -r eth0 # sends DHCPRELEASE and removes the address
sudo dhclient -v eth0 # runs DORA again
:: Windows (Command Prompt)
ipconfig /release
ipconfig /renewAfter the release, the server's lease table should show the address as free. After the renew, the client typically gets an address again. It may be the same one, because many servers try to give a returning client its previous address. That is not guaranteed unless there is a reservation.
DHCPINFORM: settings without an address
A DHCPINFORM is sent by a client that already has an IP address, usually a static one, and wants other configuration, such as the DNS server, domain name or other options. The client does not want a lease.
The exchange is short:
- The client sends DHCPINFORM and includes its current address in the
ciaddrfield. It can list the options it wants in option 55 (Parameter Request List). - The server replies with a DHCPACK that carries the requested options.
- The server does not allocate an address, does not create a lease, and does not include a lease time.
Windows clients use Inform for several purposes. For example, a machine with a static address can fetch DNS suffix and proxy discovery options this way. A DHCP server can also be asked to send Inform for dynamic DNS updates in some deployments.
Putting the messages together
The table below summarizes how the four messages differ in addressing and replies.
| Message | Typical destination | Server reply | Creates or ends a lease |
|---|---|---|---|
| NAK | Broadcast or relay, depending on the request | None expected | Invalidates the client's claim |
| Decline | Server, usually broadcast or unicast to server ID | None | Marks the address as bad |
| Release | Unicast to the server | None | Ends the lease |
| Inform | Broadcast or unicast to a server | ACK with options | None |
Troubleshooting with these messages
The extra messages are useful clues in a capture:
- NAK right after boot on a known network. The server no longer has the client's lease. Check whether the lease database was reset or whether two servers share a scope.
- NAK loop. The client asks, gets a NAK, discovers and gets the same bad offer. Look for a second server handing out an address from the wrong subnet.
- Decline from the same MAC repeatedly. A static host is using an address inside the pool. Find it with ARP and add an exclusion.
- Pool exhaustion with few real clients. Check for leases that were never released and for bad-address entries from earlier Declines.
- Inform with no lease. This is normal. Do not look for the address in the lease table.
Exercise
A laptop that held 192.168.1.120 on the office network is carried home and woken from sleep. It sends a broadcast DHCPREQUEST for 192.168.1.120 to the home router, whose subnet is 10.0.0.0/24. What does the router's DHCP server send, and what does the laptop do next?
Show answer
The server sends a DHCPNAK, because 192.168.1.120 does not belong to the 10.0.0.0/24 subnet. The laptop discards the old address and starts again at Discover. It then completes DORA and receives a valid 10.0.0.x address.
Exercise
During DORA a client receives an Offer for 192.168.1.50, sends an ARP probe, and gets a reply from another host. Which message does the client send, which option identifies the address, and what should the server do with it?
Show answer
The client sends a DHCPDECLINE with the conflicting address in option 50 (and the server identifier in option 54). The server should mark 192.168.1.50 as unusable for a time and not offer it again right away. The administrator should find the host using that address and exclude it from the pool.
Exercise
A printer has a static address, but you want it to learn the DNS server from DHCP without taking a lease. Which message does it send, and does the server's reply contain a lease time?
Show answer
It sends DHCPINFORM with its address in ciaddr. The server replies with a DHCPACK that carries the requested options and does not contain a lease time, because no lease is created.