How a Computer Gets an IP Address from the DHCP Server (DORA)

 What happens if your computer doesn't have an IP (Internet Protocol) address? Certainly, you will not be able to do the things you commonly do. Such as surfing the web, using social media, and connecting to your college applications online. IP addresses do not come pre-loaded with our system; it is assigned to us either from our ISP or from our local network DHCP server. 

We will look at how the actual process works and how the DHCP servers assign us an IP address.

Below is the snippet showing the four steps involved in this process. These four steps are abbreviated with DORA (Discover, Offer, Request, Accept). 

with
 Image source: Wireshark interface

 Let's start with the Discover step first, the first packet in our snippet. Here, you can see the source IP address is 0.0.0.0, which is our system address. Note that we still don't have an IP address yet, which is why it shows 0.0.0.0. The destination address is a broadcast address 255.255.255.255, sending the message to all ports in the network to find (discover) the DHCP server, so that it can be assigned a valid IP address.  

The second step in the process is the Offer. Here, the source IP address is of our DHCP server 192.168.0.1; it can also be of the router (depending on your network, how it is set up, because some routers have the capabilities of assigning IP addresses to clients without depending on a separate DHCP server). The destination address is 192.168.0.10, which is what the DHCP has offered the client. Note that the client has not accepted the offer yet. You can also see below the lease time of the IP address, which is 1 hour; after that time, the client has to renew the lease. There are some other options that the DHCP server has offered, such as subnet mask and more.  

 Image source: Wireshark interface

The third step is the Request. Again, the source IP address is our computer address, which is still 0.0.0.0, and the destination IP address is 255.255.255.255. You may be thinking why the destination IP address is a broadcast address and not the DHCP server's own address which is 192.168.0.1, it is because before the client can request the DHCP server for the new IP address, the client have to make sure nobody else in the network has the same IP, that's why it broadcasts its request to every port on the network and if nobody replies then it proceed on its way to the DHCP. You can see the requested IP address below, which our client is requesting.

In simple terms, our computer is letting everybody know that "hey, I'm getting this IP, nobody else is using it, right? And when everybody says no, then the computer proceeds with its request.

 Image source: Wireshark interface

In the last step, the Acknowledge step, the DHCP server acknowledges or accepts the request and assigns the IP address to our computer 192.168.0.10. You can also see some other options the DHCP server has provided, like subnet mask, lease time, and renewal time (it is the time the computer starts the process of renewing its lease; obviously, the computer will not wait until the last minute to renew its IP address, so 30 minutes before the lease expires it will start the renewal process).

 Image source: Wireshark interface

If you have any questions, drop them down below, and I will be happy to answer them. 


Comments

Popular posts from this blog

Extracting JPEG Images from the network (Wireshark)