TITLE
    Open Transport: DHCP Client Behavior
Article ID:
Created:
Modified:
58372
5/12/99
10/30/00

TOPIC

    Different versions of Open Transport behave differently when discovering, renewing, and releasing a DHCP lease. This article describes the behavior of the DHCP client in different versions of Open Transport.


DISCUSSION

    In response to customer feedback, Apple has changed the DHCP client implementation in Mac OS 8.5, and again in Mac OS 8.6. A given DHCP client may behave in unexpected ways with certain DHCP servers. This document aids in troubleshooting DHCP issues by providing a reference for the expected behavior of each version of Open Transport and the Mac OS.

    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:


      1. Server sends the client DHCPACK, which tells the client that it may use the requested IP address. In this case the client proceeds with a new lease on the same IP address.

      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.


    If the Macintosh begins in the INIT-REBOOT state and receives no response to its DHCPREQUEST, this attempt to load the IP stack fails and the client has no IP services. The state of the client is changed so the next stack load starts in the INIT state described 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.


Document Information
Product Area: Communications-Networking
Category: Open Transport
Sub Category: General Topics

Copyright © 2000 Apple Computer, Inc. All rights reserved.