DHCP is widely used for dynamically assigning IP and other network configuration parameters on systems especially on large scale infrastructure environments. It greatly reduces the administrative overhead of managing IP addresses manually for all the clients and servers.Windows DHCP server is capable of providing below mentioned network configuration components to the client.
• IP Address
• Subnet Mask
Apart from the above DHCP server can be used for various others configurations which we would discuss in the later articles.
Let us go through the process how DHCP allocates IP Address to the client machines.
- When a Client gets connected on the DHCP network it first sends a broadcast DHCPDISCOVER message on the local physical subnet.
- DHCP Server responds to this by sending a DHCPOFFER Packet on broadcast address. This contains IP address and valid subnet mask.
- After receiving the DHCPOFFER the Client then asks for a DHCPREQUEST from the server. If the client has previously had a DHCP assigned IP address and it is restarted, the client will specifically request the previously leased IP address in a special DHCPREQUEST packet
- The DHCP Server then responds with a DHCPACK with source address as DHCP server IP address and Destination address as broadcast (255.255.255.255).In this case the client identifier is the physical address of the client’s network card. Details of client IP address, Subnet Mask, Gateway etc are send to the client In case the server is unable to satisfy the DHCPREQUEST from the client(for whatever reason) it may send a DHCPNAK response.
- The client performs a final check on the DHCPACK response and keeps a note of the lease duration. Now the client is configured with the sent parameters. In case the client detects that the IP is already in use (using ARP) it sends a DHCPDECLINE message to the server and restarts the configuration process. Incase of a DHCPNAK response the client restarts the whole process again. In case of no response from the DHCP server the client would timeout and restart the request process altogether.
DHCP message from client to server is sent on DHCP server UDP port -67 and server to client message are transmitted on client UDP port – 68. You can get more details on this lease process on RFC 2131 which defines the framework for the DHCP protocol.