
What is “DHCP”?

..

Let's say you bought a router for your home and you want to use it to be able to communicate over the Internet and the outside world. Simply put, all you need to do is log into this router, type in the password, and then you're done, but what happened when you tried to log into the router?

First, there is what is called a “private IP” and a “public IP”:

The “public IP” is the number that represents your location on the world wide web, so of course it must be unique. In other words, no two devices have the same IP value.

But with the prosperity and the increase in the number of devices in the world, each device must have a unique IP, and of course the number of IPs in the world is limited, so engineers came up with the idea of having a “private IP”.

Instead of each device having its own IP, we will make only the router have a “public IP”, and then we will make the devices connected to this router only have a private IP, which is a value that becomes private only within each network. This private IP can be similar to a device located on a specific router, with a device located on another router, i.e. another network, but there should not be two devices located on the same network or the router should have the same private IP.

Question: What is “DHCP”?

As we said above, each device on a specific router must have its own private IP, and it should also not be similar to any other device on the same network or within the same router.

Previously, when you wanted to log into a router, you had to specify your private IP, but then a problem arose: you could set a value for your private IP that was similar to another device on the same network unintentionally, and as a result, neither you nor the other device would be able to access the Internet.

Then they came up with the idea of “DHCP,” which is a service whose function is to distribute private IP values to devices within a single network, so that you can regulate the devices and the network without you intervening and determining the value yourself.

That is, it does it automatically, which is why it is called Dynamic Host Configuration Protocol.
This service can be inside your router, or it can be located on your own server, like in large corporate networks, etc.

This service works in steps called DORA, which is an abbreviation for
Discover, Offer, Request, Acknowledge.