DHCP SERVER
The Dynamic Host Configuration Protocol (DHCP) is used to automatically assign TCP/IP settings to clients
IP Addresses come from a pool that is
defined in the DHCP servers database called a Scope.
The server
grants the IP address for a specified amount of time called a Lease.
DHCP Configuration Process
The DHCP process is a four step process
The client first initializes a limited TCP/IP stack and has been configured to automatically receive a lease for an IP address from a DHCP server on the network.
The client requests this lease by a network broadcast. The IP address of the DHCP server is unknown and the client has not yet received an IP so it uses 0.0.0.0 as the source address and 255.255.255.255 as the destination address.
This request is sent in a DHCPDISCOVER message, which contains the client's hardware MAC address and computer name.
The DHCP server sends a broadcast message to the client in the form of a DHCPOFFER message. The client will take the first IP lease it receives, if there are multiple DHCP servers on the network other requests will be ignored.
After the client receives an offer it broadcasts to all DHCP servers that it has accepted an offer .The Broadcast is in the form of a DHCPREQUEST message and includes the server identifier (IP address of the server) whose offer was accepted
All other DHCP Servers retract their offers
DHCP server broadcasts a successful ACK to the client in a DHCPACK message, containing a valid IP lease address. After the client receives ACK it is fully initialized and stores the lease in the registry.
DHCP Lease Renewal
All DHCP clients will attempt to renew their lease when 50% of the lease time has expired. From the Initial DHCP server the client obtained the lease from. The client sends a DHCPREQUEST message
If the DHCP Server is available, the lease is renewed and a successful DHCPACK acknowledgement is sent with any updated parameters.
If the Client does not receive a DHCPACK, the client will continue to still use the lease because 50% is still available.
If the DHCP lease was not successful on the first attempt, the client will attempt to renew the lease from the initial DHCP after rebooting, directly after 50% of lease completion. If unsuccessful the client will continue to still use the same lease because 50% is still available.
If the client was unable to renew the lease at the initial 50% attempt from the initial DHCP server. The client will attempt to renew the lease at 87.5% of lease completion by contacting any available DHCP server on the network.
After the lease expires the client will un-initialize the lease and attempt to renew the lease, in the same fashion the client initially obtained the lease and the entire process will start all over again. If the client is unable to obtain a lease, the client's TCP/IP stack will not function and network errors will occur.