Can you imagine manually setting the TCP/IP settings for all devices within a network? Including an IP, default gateway, subnet mask and DNS etc. Even if you have 2-3 devices or 1000 devices, there will always be significant costs and labour time associated for a Network Administrator, especially for larger sized enterprise networks. Looking to cut down on costs for your IT Team? Here is the solution- DHCP; this stands for Dynamic Host Configuration Protocol.
Using a DHCP, the configuration of network devices is much easier, as the DHCP works on a client-server model and is a protocol with its own set of information; below is everything you need to know about the DHCP protocol:
Now let’s have a look at the massagers that are used during the DHCP process.
- DHCPDISCOVER– This is the first communication between the client and server. This message is sent out by the client that requests DHCP settings, as a broadcast message the destination address is set to 255.255.255.255.
- DHCPOFFER – This is the response message that is sent by the server directly to the DHCP client, this also contains the network configuration settings offered by the server.
- DHCPREQUEST – A confirmation message from the client that has been accepted by the network configuration in the DHCPOFFER.
- DHCPACK – This is the message from the DHCP server in response to the DHCPREQUEST that is received from the client. This message signals the final process that is started by DHCPDISCOVER; this is an acknowledgement from the server effectively authorising the DHCP client to start using the network configuration.
- DHCPNAK – This message is the opposite of the DHCPACK, it is sent by the DHCP server when it is not able to satisfy the correct DHCPREQUEST message from the client.
- DHCPDECLINE – This type of message is sent from the client to the server should the client finds that an IP address which is being requested by the client is already taken by the server.
- DHCPINFORM – This message is sent from the client in the event that the IP address is statically configured for the client and only other network settings are required for the process to be completed dynamically.
- DHCPRELEASE – The message is sent from the client when they wish to terminate the lease of the network address with the appropriate server.
Now we are familiar with the messages types, let’s see the steps of the DHCP communication between client and server.
When connecting the device to the network, the DHCP service for the client sends out the DHCPDISCOVER message to the network (via broadcast) to find the correct DHCP server. The protocol uses UDP port 67, and when the DHCP server receives the DCHPDISCOVERY from the client, it replies back with the DCHPOFFER message that contains all the network settings that the server is setup to provide. If the DHCP server is in a different subnet then this message (DHCPOFFER) is sent to the DHCP relay agent that in turn sends to the message to the correct subnet. After receiving the DHCPOFFER, the client then sends the DHCPREQUEST to the server that wants to accept the network settings. Once the DHCP server receives the clients message (DHCPREQUEST) it then returns the DHCPACK message to the client and finally the client has access to and is ready to use the IP address.
The network settings that are assigned by the server to the client are on a lease basis. Before the expiration of the contracted amount of time, the client should renew the lease time should they wish to continue.