What is DHCP, and why is it used?

The DHCP is a perfect example of how technology can facilitate our lives, both as clients and network administrators. It is an IP manager that automatically allocates addresses to the connected devices, keeps the information about them, and reuses the IPs after they run out.

What is DHCP?

DHCP stands for Dynamic Host Configuration Protocol. It is a network protocol for managing IP networks that has a version for IPv4 and IPv6. The protocol defines DHCP client and DHCP server. The server is responsible for assigning IP addresses to the DHCP clients automatically and also keeping a record of the assigned IP addresses and their time to expire. It also provides other network settings like DNS server, gateway, subnet mask, and more.

The important thing about it is that it manages the network automatically, without the need of an operator who supervises it. That saves a lot of effort, especially for larger interconnected networks with a lot of hosts. 

We use DHCP because:

  • It automatically assigns IP addresses to the newly connected devices. It does it without the need for human intervention. 
  • It is easy to set up and manage. Configuring the DHCP server is an easy task. 
  • It removes the chance of IP conflict, the problem of two devices with the same IP address. In a case of IP conflict, both devices won’t be able to use the network. 
  • No human errors. If people need to assign IP addresses manually, there is a high chance of human errors, while with Dynamic Host Configuration Protocol, a machine is doing all the IP address assignments. 

How does DHCP work?

There are 4 stages of the Dynamic Host Configuration Protocol process:

1. Discover. The DHCP client will broadcast a message that it is on the network and that it wants an IP address.

2. Offer/ The DHCP server, like all other devices on the network, will get the discover message, and it will offer an available IP address from the IP pool that it manages.

3. Request. The DHCP client will receive the Dynamic Host Configuration Protocol offer and needs to accept it. It will send a DHCP request with the acceptance of the provided IP address back to the Dynamic Host Configuration Protocol server.

4. Acknowledgment. The DHCP server receives the request, writes it down (what IP address was given, to which MAC, for how long), and acknowledges it. It will send all network information needed like DNS server, subnet mask, gateway, etc. 

Why might we not need it in the future? 

Currently, we can’t imagine the world without it, but soon it might become absolute. Why? Because of the IPv6. While the older IPv4 does not have a built-in mechanism for IP allocation, the newer IPv6 has. It is called SLAAC, and it is a part of the new protocol. 

SLAAC stands for Stateless Address Auto Configuration. It is another method of automatic IP configuration where the newly connected device will get an IP address based on listening to the router advertisement (RA), and the part for the host will use the device’s MAC address. The Stateless part means that there is no need for DHCP on the network to assign new IP addresses, and the DNS settings can be obtained from the RA. 

IPv6 still works with Dynamic Host Configuration Protocol (DHCPv6). It is needed when you want a stateful network where you have better control over who and when it connects on the network. 

So the DHCP will remain only if we are not satisfied enough with the SLAAC option. 

Conclusion

DHCP is an important technology that saved everybody time and problems. It definitely has its place in the hall of fame of networking. It auto assigns IP addresses, and manages them. 

Related Posts

Leave a Reply

Your email address will not be published.