Kaigai Blog living abroad in my twenties

【My Study Note】Overview of DHCP

Infotech Networking

Overview of DHCP


Managing hosts on a network can be a daunting and time consuming task. Every single computer on a modern TCP/IP based network needs to have at least four things specifically configured.

  • IP address
  • subnet mask for the local network
  • primary gateway
  • name server

On their own, these four things don’t seem like much, but when you have to configure them on hundreds of machines it becomes super tedious. Out of these four things, three are likely the same on just about every node on the network. The subnet mask, the primary gateway, and the DNS server. But the last item an IP address needs to be different on every single node on the network.

That could require a lot of tricky configuration work, and this is where DHCP (Dynamic Host Configuration Protocol) comes into play.

DHCP (Dynamic Host Configuration Protocol)

DHCP is an application layer protocol that automates the configuration process of hosts on a network. With DHCP, a machine can query a DHCP server when the computer connects to the network and receive all the networking configuration in one go.

Not only does DHCP reduce the administrative overhead of having to configure lots of network devices on a single network, it also helps address the problem of having to choose what IP to assign to what machine.

Every computer on a network requires an IP for communications, but very few of them require an IP that would be commonly known.

For servers or network equipment on your network, like your gateway router, a static and known IP address is pretty important. For example, the devices on a network need to know the IP of their gateway at all time. If the local DNS server was malfunctioning, network administrators would still need a way to connect to some of these devices through their IP.

Without a static IP configured for a DNS server, it would be hard to connect to it to diagnose any problems if it was malfunctioning.

But for a bunch of client devices like desktops or laptops or even mobile phones, it’s really only important that they have an IP on the right network. It’s much less important exactly which IP that is.

Using DHCP you can configure a range of IP addresses that are set aside for these client devices. This ensures that any of these devices can obtain an IP address when they need one. But solves the problem of having to maintain a list of every node on the network and its corresponding IP.

Few Standard Ways that DHCP can Operate

  • DHCP Dynamic Allocation
  • Automatic Allocation
  • Fixed allocation

DHCP Dynamic Allocation

DHCP dynamic allocation is the most common, and it works how we described it just now.

A range of IP addresses is set aside for client devices and one of these IPs is issued to these devices when they request one. Under a dynamic allocation, the IP of a computer could be different almost every time it connects to the network.

Automatic Allocation

Automatic allocation is very similar to dynamic allocation, in that a range of IP addresses is set aside for assignment purposes.

The main difference here is that the DHCP server is asked to keep track of which IPs it’s assigned to certain devices in the past. Using this information, the DHCP server will assign the same IP to the same machine each time if possible.

Fixed allocation

Fixed allocation requires a manually specified list of MAC address and their corresponding IPs.

When a computer requests an IP, the DHCP server looks for its MAC address in a table and assigns the IP that corresponds to that MAC address.

If the MAC address isn’t found, the DHCP server might fall back to automatic or dynamic allocation, or it might refuse to assign an IP altogether.

This can be used as a security measure to ensure that only devices that have had their MAC address specifically configured at the DHCP server will ever be able to obtain an IP and communicate on the network.

NTP Server

Along with things like IP address, an primary gateway, you could also use DHCP to assign things like NTP servers.

NTP stands for Network Time Protocol and is used to keep all computers on a network synchronized in time.

Just know that DHCP can be used for more than just IP, subnet mask, gateway and DNS server.