A phone holding an unexpired DHCPv4 lease rejoins Wi-Fi after two days away; when does its INIT-REBOOT request get a DHCPACK, a DHCPNAK, or silence?
answer
- verify, don't rediscover
- requested address, empty ciaddr
- wrong subnet means NAK
- no record means stay quiet
- keep it only for the unexpired lease
basics
~20 sA DHCPv4 client in INIT-REBOOT broadcasts a DHCPREQUEST naming its remembered address. A server ACKs if its record matches, NAKs if the address or subnet is wrong, and stays silent if it has no record of the client.
solid answer
~50 sAfter a reconnection RFC 2131 has the client verify its remembered address instead of starting over. In `INIT-REBOOT` it broadcasts a `DHCPREQUEST` with the address in the `requested IP address` option, `ciaddr` zero and no `server identifier`, then waits in `REBOOTING`. A server first checks the subnet: if the requested address does not belong to the network the request came from, it SHOULD send `DHCPNAK`. On the right subnet it NAKs if its record says the client should hold a different address, and sends `DHCPACK` if the record matches. If it has **no record** of the client it MUST stay silent, so that servers that do not share state can coexist on one wire. After a NAK the phone goes to `INIT` and runs the full exchange. After silence it retransmits, then MAY keep the old address for the rest of its unexpired lease.
go deeper
Recall that a device returning to a network first asks to keep its remembered address, and that the server can agree, refuse, or not answer.
Explain the INIT-REBOOT request layout — requested address option, zero ciaddr, no server identifier — and how it differs from a renewal.
Diagnose the outcomes: a wrong-subnet NAK, silence from a server without a record, a minute-long wait before the old address returns, and how a NAK is delivered to an unconfigured client.
Weigh the silence rule's tradeoff: it lets uncoordinated servers share a link, at the cost of letting a client keep an address no server will vouch for.
## Why a returning client rechecks A phone that leaves the Wi-Fi for two days may come back to the same network, a different VLAN, or a network whose server has changed. RFC 2131 §3.7 says a client SHOULD use DHCP to "reacquire or verify its IP address" whenever the local network may have changed, "e.g., at system boot time or after a disconnection." When the client remembers an address whose lease has not expired, it can take the short path of §3.2 and §4.4.2 rather than the full four-message exchange. Take a concrete case: the phone was granted a seven-day lease the morning it left. Two days later it is still before `T1` (three and a half days), so the lease is valid and the address is worth asking for. ## What the INIT-REBOOT request carries The client enters **`INIT-REBOOT`**, sends one message and moves to **`REBOOTING`** to wait. RFC 2131 §4.3.2 and Table 4 fix its contents: | Field | INIT-REBOOT `DHCPREQUEST` | Why | |---|---|---| | Delivery | broadcast | the client is not yet sure its address works here | | `requested IP address` option | MUST carry the remembered address | this is what the server checks | | `ciaddr` | MUST be zero | the client has not yet confirmed the address | | `server identifier` option | MUST NOT be present | any server that knows the client may answer | | `client identifier` option | the same one used to get the lease | the lease is keyed on it | | `xid` | a new random value | to match the reply | Contrast this with a renewal, where the address sits in `ciaddr` and the requested-address option is absent; the two layouts are how a server tells "verify me" from "extend me". ## How a server decides RFC 2131 §4.3.2 gives the server's checks in order: 1. **Is the client on the right network?** The server applies the subnet mask of the interface the request arrived on, or the remote subnet named by `giaddr` if a relay forwarded it, to the requested address. If it does not match, the server SHOULD send **`DHCPNAK`**. No client record is needed for this check. 2. **Is the client's idea of its address right?** On the right network, if the server's record says something else (the address went to another client, or the client is bound to a different one), it SHOULD send **`DHCPNAK`**. 3. **Does the server know the client at all?** If it has **no record**, it "MUST remain silent, and MAY output a warning to the network administrator." The RFC calls this necessary "for peaceful coexistence of non-communicating DHCP servers on the same wire": a server that knows nothing must not contradict one that does. 4. Otherwise the record matches and the server sends **`DHCPACK`**. RFC 2131 §3.2 adds a related rule: a server that sees a request for an expired binding owned by *another* server SHOULD NOT send a `DHCPNAK` unless the servers maintain coherency through an explicit mechanism. ## How the NAK reaches a client with no working address A client being refused may hold an address or mask that is wrong for the link, and "may not be answering ARP requests." So the server never unicasts the NAK to the requested address: - with `giaddr` zero, the server **broadcasts** the `DHCPNAK` to `255.255.255.255`; - with `giaddr` set, it sets the **broadcast bit** so the relay agent broadcasts the NAK onto the client's segment. ## What the client does with each outcome - **`DHCPACK`** — the client records the expiry as the time it sent the request plus the lease in the ACK and moves to `BOUND`. If it then finds the address already in use, it MUST send `DHCPDECLINE` and restart. - **`DHCPNAK`** — it "cannot reuse its remembered network address" and goes to `INIT`, then runs the full exchange for a new one. - **Silence** — it retransmits with the usual randomised doubling back-off; RFC 2131 gives four retransmissions over about 60 seconds as an example. If neither an ACK nor a NAK arrives, it **MAY** keep the remembered address "for the remainder of the unexpired lease" and moves to `BOUND`. ## Reading the symptoms The silence rule explains a familiar complaint: a device that takes about a minute to come up and then appears with its old address. That is a client whose request reached no server holding its record — the server was replaced, its lease database was lost, or the request reached only a server that did not grant the lease. The client is behaving correctly; whether the address is still safe depends on whether anyone else has since been given it. If the phone's lease had already **expired** during its absence, the short path no longer applies: on expiry RFC 2131 sends a client to `INIT`. It may still name the old address as a hint, because the `requested IP address` option MAY appear in a `DHCPDISCOVER` and servers attempt to return the same address to a client.
- Why must a DHCPv4 server with no record of an INIT-REBOOT client stay silent instead of sending DHCPNAK?Several servers that do not share state may serve one link. If one that never granted the lease could refuse it, it would knock a correctly configured client off the address another server gave it. RFC 2131 therefore has a server without a record stay silent, so only a server that knows the client, or that can see the subnet is wrong, ever refuses.
- What does a DHCPv4 client do differently if its remembered lease expired while it was away?Expiry sends the client to `INIT`, so it cannot use the `INIT-REBOOT` short path or fall back to the old address when no server answers. It runs the full exchange, and may name the old address in the `requested IP address` option of its `DHCPDISCOVER` as a hint; servers try to return the same address when it is still free.
saying these in an interview costs you the question
- In INIT-REBOOT the client puts its remembered address in ciaddr.
- Any DHCP server that does not recognise the client should send a DHCPNAK.
- The server unicasts the DHCPNAK to the address the client asked for.
- A client that hears nothing must give up its address and start over at once.
- INIT-REBOOT names the original server in the server identifier option.