For a complete description of the terms used below, and for a description of the DHCP protocol, see RFC 2131.
Mac OS 8.1 and earlier (Open Transport 1.3.1 and earlier)
IP Load
Every time the IP stack loads, the DHCP client sends out a DHCPDISCOVER packet. If the Macintosh receives no response to this, IP does not load and any application trying to use IP services returns an error.
Loading IP in this manner does not attempt to keep the same IP address when a computer is restarted. Depending on the DHCP server configuration, the client may receive a different IP address every time the IP stack loads.
IP Unload
When the IP stack unloads, the DHCP client sends a DHCPRELEASE.
Mac OS 8.5.x (OpenTransport 2.0.1 & 2.0.2)
IP Load
The DHCP client was modified in Mac OS 8.5 so that the client would attempt to regain the previously assigned IP address if the lease is still active when the IP stack loads. This makes it much more likely that a computer retains the same IP address when it is restarted.
The IP stack can load in two different states in Mac OS 8.5:
INIT
A client starts up in the INIT phase when:
(a) the previous lease has expired when the client starts up.
(b) there is no previous lease information (this is the first start up with DHCP, or the previous attempt to load IP timed out).
In the INIT state, the Macintosh sends out a DHCPDISCOVER, requesting a lease from any DHCP server on the network. If the Macintosh client receives no response to the DHCPDISCOVER after about a 16-to 20-second wait, DHCP generates a randomly chosen IP address in the range 169.254.0.0 to 169.254.254.255 inclusive and a subnet mask of 255.255.0.0.
INIT-REBOOT
If the client's last assigned DHCP lease has not expired, then the client starts up in the INIT-REBOOT state in an attempt to regain the most recently used IP address. The Macintosh broadcasts a DHCPREQUEST asking to use its last IP address.
The server should respond to a DHCPREQUEST in one of two ways:
2. Server sends the client DHCPNACK, which tells the client that it may not use the requested IP address. The client then moves to the INIT state and sends out DHCPDISCOVER as noted above.
IP Unload
When the IP stack unloads, the DCHP client sends out a DHCPRELEASE. This lets the server know that the client no longer needs the IP address and frees the server to allocate the address to another client.
Mac OS 8.6 and later (Open Transport 2.0.3 and later)
IP Load
The DHCP client behaves similarly to Mac OS 8.5 in that IP initially loads in the INIT state, and loads in the INIT-REBOOT state (sending out a DHCPREQUEST) if its previously assigned lease has not expired. However, unlike Mac OS 8.5, if no DHCP server responds and INIT-REBOOT times out, the computer automatically reverts to the INIT state, send out a DHCPDISCOVER, and search for another DHCP server on the network.
If there is no response to the DHCPDISCOVER after a few tries, it picks a randomly generated IP address as in Mac OS 8.5.
IP Unload
When the IP stack unloads, the DHCP client no longer sends a DHCPRELEASE.
Furthermore, once a DHCP lease is obtained, the IP stack does not unload, regardless of whether or not "Load Only When Needed" is checked (this is not true for PPP links, since this wouldn't allow users to automatically hang up after a specified period of idle time). The Macintosh unloads the IP stack only if it is shut down, restarted, or inactivated in the TCP/IP control panel. In addition, the stack unloads on a PowerBook when it is put to sleep. Otherwise, it continuse to renew the DHCP lease.
Note: Open Transport 2.5.1 and 2.5.2 have an issue which can cause the client not to renew the lease properly if the renewal time is longer than 1 hour. For additional information please see article 25049: "Mac OS: DHCP Issues With Open Transport 2.5.1 and 2.5.2"
TCP/IP Options (Mac OS 8.6)
For administrators who prefer the 8.1 DHCP client behavior, the TCP/IP Options control panel allows users to revert to the old behavior. By checking the box for "don't retain DHCP lease on shutdown, " the Macintosh always starts up with DHCPDISCOVER, and always send a DHCPRELEASE upon unloading the IP stack.