Basics of DHCP Protocol
We will explain one of the most important network protocols. It is DHCP. DHCP is an abbreviation from Dynamic Host Configuration Protocol. This protocol is protocol layer 7 (application layer).
The main task of this protocol is to give network configuration parameters to all users who request it. The network configuration parameters include the following parameters:
This protocol involves two main roles:
DHCP server – this device assigns network configuration parameters.
DHCP clients – devices that require network configuration parameters.
After DHCP clients receive network configuration parameters, they can communicate with hosts outside their LAN. Generally, there are three situations:
The first situation is that host has static network parameters and it can communicate only in its LAN.
Second, the host is configured to get dynamic network parameters. But for some reason, it doesn't get network configuration parameters. Then the host configures itself. It will get a private APIPA IP address. This allows the host to communicate within its LAN, but not outside this network.
And the last situation is that host is configured to get dynamic network parameters. And after the DHCP process, the host gets network configuration parameters and it can communicate with hosts in its LAN and with hosts outside their LAN network.
Now, We will explain the DHCP process. In the next figure, we can see the basic process of DHCP.
Fig. 1. DHCP
There are four main steps in DHCP process communication between DHCP client (host) and DHCP server.
Step 1. DHCP client sends broadcast message DISCOVERY. The DHCP client doesn't know where the DHCP server is, and it doesn't know if there is one server or if there are multiple servers. Because of that, the DHCP client sends this message. And this way DHCP client tries to find a DHCP server.
Step 2. The DHCP server sends unicast message OFFER. The DHCP server received a DISCOVERY message and after that, it sends an OFFER message to the DHCP client and provides various configuration parameters.
Step 3. DHCP client sends unicast message REQUEST. The DHCP client sends this message to the DHCP server and in this way confirms the received network configuration parameters. If there is more than one DHCP server in the network, the DHCP client receives more than one DHCP OFFER message. The DHCP client takes the first message it receives.
Step 4. The DHCP server sends unicast message ACK (ACKNOWLEDGMENT). In this message, the DHCP server tells the DHCP client that it agrees that the DHCP client can use the assigned network parameters.
In this first article about the Basics of DHCP, we explained basic messages and process communication between DHCP client and DHCP server.
If you have more questions about DHCP, please email us at email@example.com.