What is DHCP Server?
The term DHCP stands for “Dynamic Host Configuration Protocol”. DHCP is a protocol which is commonly used in the networks for the task of dynamic IP addressing configuration. In this system, a device of every user requires at least one IP address to join the network and to get connected with its services.
DHCP provides its users an automated way for the distribution and update of IP addresses and other configuration information on the network. This information is provided to the DHCP client via exchange of a series of messages. These messages are known as DHCP conversations or DHCP transactions. When the DHCP server and the client are located on different subnets, a DHCP relay agent will facilitate the conversation.
How does DHCP Server work?
The DHCP functions on a client-server model. The DHCP has its own set of messages which is being exchanged between the server and the client.
When the client device gets connected to a network or gets boost up, DHCP-DISCOVER message will be sent to the server from the client.
This message is sent 0.0.0.0 as the source address and 255.255.255.255 as the destination address.
If the DHCP server is located on a local subnet, the message will be received directly.
If the server is located on a different subnet, the message will be delivered via a relay agent.
The client will enter “initializing stage” during this first step.
After receiving the DHCP-DISCOVER request message, the server will reply it with a DHCP-OFFER message.
DHCP-OFFER message contains every network configuration settings which are required by the client.
Furthermore, the server will fill the MAC address of the client.
This message is sent to the client directly as a broadcast message.
The client will enter the “selecting stage” within this step.
As a reply to the DHCP-OFFER message, the client will form a DHCP-REQUEST message.
The client will send this message to the server indicating that it wants to accept the network configuration which is in the DHCP-OFFER message.
If there are multiple DHCP servers, the client will receive multiple DHCP-OFFER messages.
However, the client will reply only to the message with IP address of the selected DHCP server.
The client will enter to the “requesting stage” at this step.
After receiving the DHCP-REQUEST from the client, the server will send back a DHCPACK message to the client.
This message indicates that the client is now authorized to use the IP address which is assigned to it.
The client will enter into the “bound stage” during this step.
The DHCP is used to control the network configuration of a host. This is done through a remote server. This is an excellent alternative to time-consuming manual network configuration settings on a network device.
DHCP is a client/server protocol used for providing IP (Internet Protocol) to host automatically with other networking information such as subnet mask default gateway.
So why DHCP is used? Imagine this. You are a network engineer and you have to make a new network for the company. That company has 1000 computers, 20 networks. 50 printers, 15 fingerprint sensors and more. So all these devices connect to this network. So all these devices need IP addresses if you don’t have DHCP you must give IP address each device one by one. Suddenly your boss says we think to add some different network to network and that network has 100 computers. It’s very very difficult and gets a lot of errors in packet looping and more. So you can use DHCP.
Now, look how DHCP is work.
We configure a DHCP server in the server computer or your router. After that DHCP server maintains a database. That database maintains a list IP address and mac address. When a computer or other device is connected to network DHCP automatically check their database and found a free IP address then give this IP address to device and Update table. Basically, DHCP do this work. In large network DHCP high valuable thing. DHCP send their updates using port number 67.