TCPIP Utilities

Internet CS

How DHCP clients communicate with DHCP servers and obtain a configuration.

 

Please comment on this article here

 

DHCP clients use two different processes to communicate with DHCP servers and obtain a configuration. The lease process steps vary depending on whether the client is initializing or renewing its lease.

The initialization process occurs when a client computer first starts and attempts to join the network. The renewal process occurs after a client has a lease, but needs to renew that lease with the server.

 

Initial lease process

The first time a DHCP-enabled client starts, it automatically follows an initialization process to obtain a lease from a DHCP server. The steps for this process are:

  1. The DHCP client broadcasts a DHCP discover message to the local subnet.
  2. A DHCP server can respond with a DHCP offer message (DHCPOFFER) that contains an offered IP address for lease to the client.
  3. If no DHCP servers respond to the client discovery request, the client can proceed in either of two ways:
    • If the client is running under Windows 2000 and IP auto-configuration has not been disabled, the client self-configures an IP address for use with automatic client configuration.
    • If the client is not running under Windows 2000 (or IP auto-configuration has been disabled), the client fails to initialize. Instead, if left running, it continues to resend DHCP discover messages in the background (four times every five minutes) until it receives a DHCP offer message from a server.
  4. As soon as a DHCP offer message is received, the client selects the offered address by replying to the server with a DHCP request.
  5. Typically, the offering server sends a DHCP acknowledgement message (DHCPACK) , approving the lease.

    Also, other DHCP options information is included in the acknowledgement.

  6. Once the client receives acknowledgment, it configures its TCP/IP properties using the information in the reply and joins the network.

The following illustration shows the lease process between the DHCP server and client.

lease process between the DHCP server and client

 

 Note:

  • In rare cases, a DHCP server can alternately return a DHCP negative acknowledgment message (DHCPNAK) to the client for step 5. This can happen when a client requests an invalid or duplicate address for the network. If a client receives a negative acknowledgement, the current initialization process fails. In this case, the client starts over at step 1, repeating the process as outlined above.

Lease renewal process

When a DHCP client shuts down and restarts (on the same subnet), it typically obtains a lease for the same IP address it had prior to the shutdown.

After 50 percent of the client lease time elapses, the client tries to renew its lease with the DHCP server as follows:

  1. The client sends a DHCP request message (DHCPREQUEST) directly to the server that leased it, to renew and extend its current address lease.
  2. If the server is reachable, it typically sends a DHCP acknowledgement message (DHCPACK) to the client, which renews the current lease.

    Also, as in the initial lease process, other DHCP options information is included in this reply. If any options information has changed since the client first obtained its lease, the client updates its configuration accordingly.

  3. If the client is unable to communicate with its original DHCP server, the client waits until it reaches a rebinding state When the client reaches this state, it attempts to renew its current lease with any available DHCP server.
  4. If a server responds with a DHCP offer message (DHCPOFFER) to update the current client lease, the client can renew its lease based on the offering server and continue operation.
  5. If the lease expires and no server has been contacted, the client must immediately discontinue using its leased IP address.
  6. The client then follows the same process used during its initial startup operation to obtain a new IP address lease.

 

 

eXTReMe Tracker

Links: