Learn what is the DHCP protocol and how does it work?

Learn what is the DHCP protocol and how does it work?

 

Most of us know that when you connect a device to a network, that device will get an IP address, whether this device is a computer, your smartphone, printers, surveillance cameras, etc. All of these devices get their own IP address, but have you ever thought about how to get These devices to get an IP address automatically as soon as they are connected to the network, and how this IP address differs from one device to another...

 

Learn what is the DHCP protocol and how does it work

In the beginning, DHCP is an acronym for the word Dynamic Host Configuration Protocol. This protocol is responsible for assigning the IP address to each device that is connected to the network automatically without your intervention. It also sets some settings for each device connected to the network so that you can control and control them on those devices to make it easier. You have more control now. There are some terms that you should know before starting how DHCP works within the network.

 

Scope or extent

 

I told you that when any device is connected to that network, the DHCP function is to assign the IP address and settings for the network, but how is the IP address chosen? In fact, the IP address of each device is chosen randomly, but it depends on what is called the DHCP range. Two values: All addresses between that range are assigned to devices connected to the network. An example of this is if you have a DHCP server that has two addresses range from 192.168.1.100 to 192.168.1.200. This means that the DHCP server can accommodate up to 100 devices at one time.

 

Other terms

 

How DHCP works

You should know that there is a DHCP service and there is a server where you can create a server to work as the main server on which we run the service only, or the server can be used to work as a DHCP server on the server, but the most common service is the DHCP Server.

 

Reserved IP

 

Reserved IP

Every time any device connects to the network, some steps are taken that we will mention in the next steps, but there are definitely some devices that are mainly on the network and it is better not to take these steps because they are mostly devices for controlling the network and in case their addresses change The network will be affected, so the so-called IP address is reserved, where a group of addresses are reserved for the uses of these devices and are never changed, unlike other devices.

 

Rental term

 

It is the period of time in which you will continue to have an IP address. When you connect to the network, you are given an IP address and some settings for a period of time, which is called the delay period, which can be for a few minutes, hours, or days, and after the expiration of that period, the device will request its renewal again automatically or you can renew the address of your device through the ipconfig /renew command.

 

How DHCP works

 

How DHCP works

Now that you have read the previous lines and the most important terminology of the DHCP protocol, you will think about the most important question, which is how this protocol works in the network, or how does the device connected to the network obtain an IP address and other settings that help it join that network. It boils down to four steps that I will mention to you. Now in a simple way to know how DHCP works.

 

1- DHCP Discover

 

When a device is connected to the network, this device does not have any information about the network, so it broadcasts a packet of data called DHCP Discover, which contains some information such as the Mac address of the device. That packet is 0.0.0.0 because the device does not have its own IP address on that network, and that packet is directed to the address 255.255.255.255, and this means that it is directed to all devices on the network.

 

2- DHCP Offer

 

When that packet is sent to the network, it reaches all pre-existing devices, including the DHCP server, then the server knows that there is a device that wants to join the network, and therefore it sends a packet of data to respond to this device and offer its services through that packet that contains some data such as the IP address. The subnet mask and the delay time for this address that we talked about earlier, and this stage is the stage in which the DHCP server offers the device the ability to join the network.

 

3- Reply to DHCP Request

 

At this stage, this device responds to the previous stage or the offer stage with approval to join that network with the data that the DHCP server gave you, so after the device gets the IP address that was granted to it, it sends the response to the DHCP server telling it to accept its offer with the IP address And with the other settings that I offered him.

 

4- DHCP Ack

 

This is the last stage in which confirmation is made by the user’s device of assigning the assigned IP address, or in other words, the tenant for it on that network (confirmation of the completion of the lease process), where a notification is sent to confirm that data to the DHCP server, and if the information is correct, you will be connected to the network properly Proper, and in case the data fails, the user's device repeats the four stages again to obtain the IP address and the rest of the information related to that network to be connected. 

Post a Comment

© kingdom of hardware. All rights reserved. Distributed by ASThemesWorld