DHCP (Gratuitous ARP)
Here, I will explain the relationship between Gratuitous ARP and DHCP.
Gratuitous ARP is a type of ARP packet that is mainly used to check if the same IP address has already been assigned to another host when a host IP address is assigned.
Unlike normal ARP packets, the Target Protocol Address field is set to the one assigned or about to be assigned to you.
Gratuitous ARP is an ARP packet requesting its own IP address.
Original ARP is used to resolve MAC addresses corresponding to IP addresses. What's the point of requesting your own IP address?
Gratuitous means "free of charge; out of favor; gratuitous; needless."
Is it really pointless?
The first use is to detect duplication of IP addresses due to misconfiguration, etc.
Under normal circumstances, even if you send an ARP request for your own IP address, there should be no reply from other terminals.
But what if you got a reply?
You can see that the IP address is already in use by another device.
With this mechanism, it is possible to check whether IP addresses are duplicated within the same network.
When a Windows 2000-based computer boots up, it broadcasts a packet containing the computer's IP address within the network to prevent IP address duplication.
As a second use, VRRP also uses Gratuitous ARP.
This is done not to check for duplicate IP addresses, but to update the ARP caches on network equipment on the same segment.
Doing so will force the update of the correspondence between IP addresses and MAC addresses.
The explanation of Gratuitous ARP has become long, but let's return to the main topic, the relationship between Gratuitous ARP and DHCP.
After receiving configuration information such as an IP address from the DHCP server, the DHCP client sends Gratuitous ARP to check for duplicate IP addresses.
This is because the same IP address has already been assigned, either by manual configuration or from another DHCP server, and it is possible that the IP addresses are duplicated within the same subnet.