
A computer needs an IP address, subnet mask, default gateway and dns server to connect to the internet. These addresses can be configured statically and dynamically. Normally, we configure static IP addresses on network devices like routers, switches, firewalls and servers while we dynamically configure IP addressses on devices like computer, laptops, IP-phones, smartphones and so on. We use DHCP protocol to assign these addresses to the end devices dynamically.
The abbreviation of the DHCP process is DORA, which consist of the following steps.
1- Discover
This step is the first step of the DORA process. It is initiated by the client machine.

In this topology we have a device that request an IP address in order to connect to the internet. Therefore, it sends a “DHCP Discover” message to all devices in the topology. All devices will receive this message, but without the DHCP Server, they ignore it. DHCP server receives the message and continiues the process with the second step.
2- Offer
It sends a “DHCP Offer” message to the device that has requested an IP address from it. The message includes an IP address, subnet mask, default gateway and DNS Server. The IP address will be selected by the DHCP server from its IP-Pool.

3- Request
After the client receives the DHCP Offer message from the DHCP server, it will request the IP address that has been assigned by the DHCP server. With this message, it indicates that it wants to use the assigned IP address.

4- Ack
This is an acknowledgment message from the DHCP server sent to the client. With this message, the DHCP server indicates that the client can start using this IP address.

According to the Wireshark output, we can say that the DHCP Discover message is a broadcast, the DHCP Offer message is a unicast, the DHCP Request message is a broadcast, and the DHCP ACK message is a unicast.

The DHCP protocol uses port 67 (Server) and port 68 (Client), and it uses the UDP protocol. The DHCP protocol has an IP pool and distributes IP addresses from its pool. When the DHCP server assigns an IP address to a device, it keeps the information in its binding table. IP addresses are mostly assigned to a device temporarily, which is referred to as the lease time. When the lease time expires, the DHCP server removes the entry from its binding table. However, client devices can request to reuse the IP addresses that were assigned by the DHCP server before the lease time expires. The lease time can be configured on the DHCP server by the administrator. The duration depends on the infrastructure needs.
Stay tuned for more computer networking content.

Leave a Reply