TechNet 網路協定: DHCP Architecture


摘自: https://technet.microsoft.com/en-us/library/dd183602(v=ws.10).aspx


DHCP lease process

A DHCP-enabled client obtains a lease for an IP address from a DHCP server. Before the lease expires, the DHCP client must renew the lease or obtain a new lease. Leases are retained in the DHCP server database for a period of time after expiration. By default, this grace period is four hours and cleanup occurs once an hour for a DHCP server running Windows Server 2008. This protects a client’s lease in case the client and server are in different time zones, the internal clocks of the client and server computers are not synchronized, or the client is off the network when the lease expires.


Obtaining a new lease

A DHCP client initiates a conversation with a DHCP server when it is seeking a new lease, renewing a lease, rebinding, or restarting. The DHCP conversation consists of a series of DHCP messages passed between the DHCP client and DHCP servers. The following figure shows an overview of this process when the DHCP server and DHCP client are on the same subnet.
DHCP Lease Process Overview
DHCP Lease Process Overview
1.       The DHCP client requests an IP address by broadcasting a DHCPDiscover message to the local subnet.
2.       The client is offered an address when a DHCP server responds with a DHCPOffer message containing an IP address and configuration information for lease to the client. If no DHCP server responds to the client request, the client sends DHCPDiscover messages at intervals of 0, 4, 8, 16, and 32 seconds, plus a random interval of between -1 second and 1 second. If there is no response from a DHCP server after one minute, the client can proceed in one of two ways:
o       If the client is using the APIPA alternate configuration, the client self-configures an IP address for its interface.
o       If the client does not support alternate configuration, such as APIPA, or if IP auto-configuration has been disabled, the client network initialization fails.
In both cases, the client begins a new cycle of DHCPDiscover messages in the background every five minutes, using the same intervals as before (0, 4, 8, 16, and 32 seconds), until it receives a DHCPOffer message from a DHCP server.
3.       The client indicates acceptance of the offer by selecting the offered address and broadcasting a DHCPRequest message in response.
4.       The client is assigned the address and the DHCP server broadcasts a DHCPAck message in response, finalizing the terms of the lease.
When the client receives acknowledgment, it configures its TCP/IP properties by using the DHCP option information in the reply, and completes its initialization of TCP/IP.
In rare cases, a DHCP server might return a negative acknowledgment to the client. This can happen if a client requests an address that is not valid or a duplicate. If a client receives a negative acknowledgment (DHCPNack), the client must begin the entire lease process again.
When the DHCP client and the DHCP server are on the same IP broadcast subnet, the DHCPDiscover, DHCPOffer, DHCPRequest, and DHCPAck messages are sent to identify clients by means of IP-level broadcasts sent to the limited broadcast address and the media access control (MAC) broadcast address.
When the DHCP server and DHCP client are not on the same subnet, either a router or a host on the DHCP client’s subnet must act as a DHCP relay agent to support the forwarding of DHCP messages between the DHCP client and the DHCP server.

Renewing a lease

The DHCP client first attempts to renew its lease when 50 percent of the original lease time, known as T1, has passed. At this point, the DHCP client sends a unicast DHCPRequest message to the DHCP server that originally granted its lease. If the server is available, and the lease is still available, the server responds with a unicast DHCPAck message, and the lease is renewed.
If the original DHCP server is available, but the client’s current lease is no longer available, the DHCP server responds with a DHCPNack message, and the client immediately starts the process to obtain a new lease. This can happen if the client has changed subnets or if the DHCP server cannot fulfill the lease request for some other reason.
If there is no response from the DHCP server, the client waits until 87.5 percent of the lease time, known as T2, has passed. At T2, the client enters the rebinding state, and broadcasts a DHCPRequest message to attempt to renew the lease from any available DHCP server. If no DHCP server is available by the time the lease expires, the client immediately unbinds itself from the existing lease and starts the process to obtain a new lease, beginning with a DHCPDiscover message.



留言

這個網誌中的熱門文章

網路晶片商的解決方案

工業用網路Industrial Network介紹

TechNet網路技術: VPN