DHCP stands for Dynamic Host Configuration Protocol. Rather than manually assigning IP addresses to devices when they join the network, DHCP does this on its own. Once a new device connects to the network, the DHCP is responsible for assigning in network configuration parameters such as subnet mask, default gateway, DNS servers, and an IP address. This saves time and effort as you do not have someone manually doing this every time a device joins the network. It also prevents human error. DHCP's recycle IP addresses when they are done being used. Eg. device has left the network, so its IP address is assigned to another device who needs one.
DHCP works via interactions between the server and client.
DHCP Server : A network device (router/dedicated server) that manages IP address allocation. It maintains a pool of available IP addresses and configuration parameters.
DHCP Client : Any device that connects to the network and requests network configuration parameters from the DHCP server.
You can use the acronym, DORA to remember how the process works.
- Discover
When a device first connects to the network, it figures out where the DHCP Servers are located. It does this by broadcasting a DHCP Discover message.
- Offer
A DHCP Server on the network sees this message and responds with an DHCP Offer message, which offers the client an IP address and lease.
- Request
The client receives this message and responds with a DHCP Request message. This says that the client has accepted the given IP address and lease.
- Acknowledgement
The server sends a DHCP Acknowledgement message which confirms that the client has been given an IP address, the client can start using this IP address to communicate on the network.
Now the device doesn't get to keep this lease and IP address forever. When the DHCP assigns the lease, it has been given with a certain amount of time, say 24 hours, and once that time is up the lease ends and you can no longer connect till you get a new one. You also lose your IP address as you will not be considered as part of the network. So, once the lease is coming to an end, the device sends out a DHCP Request, saying that its lease needs to be renewed and to continue with the same IP address. If possible, the DHCP responds with an DHCP Acknowledgement message saying that the lease has been renewed.
A simple example would be that Rebecca wants to connect to her office's network with a new device. The first thing the device will have to do in order to connect is send a DHCP Discover message. Once a DHCP Server sees it, it will respond with a DHCP Offer containing a lease and the IP address(e.g. 192.168.3.64). The device then accepts it with a DHCP Request message and the server responds with a DHCP Acknowledgement message. Once the time on the lease is starting to finish, the device sends another DHCP Request message in order to continue using it as well as the IP address.
Top comments (0)