(1) What is the DHCP Protocol?
DHCP (Dynamic Host Configuration Protocol) is a network protocol for local area networks, working with the UDP protocol. It is primarily used to automatically allocate IP addresses for internal networks or network service providers. DHCP is an application-layer protocol that allows devices to automatically obtain IP addresses and other critical network resources. DHCP uses a client-server model, with clients using UDP port 68 and servers using UDP port 67.
(2) What is the purpose of DHCP?
DHCP (Dynamic Host Configuration Protocol) provides addresses and configuration parameters to hosts on the internet. Based on a Client/Server model, the DHCP service assigns IP addresses to hosts and provides configuration parameters. The main purposes of DHCP are as follows:
a: Ensure that any IP address can only be used by one DHCP client at a time.
b: DHCP can assign permanent fixed IP addresses to users.
c: DHCP allows coexistence with hosts that obtain IP addresses by other means, such as those manually configured.
(3) DHCP Working Process
When using DHCP, there must first be a DHCP server on the network, while other computers are DHCP clients. When a DHCP client program issues a request for a dynamic IP address, the DHCP server provides an available IP address and subnet mask from the currently configured IP address pool, as shown in the following diagram which illustrates the DHCP working process.
From the diagram above, it is clear that the DHCP process is divided into four stages: Discovery (DHCP Discover), Offering (DHCP Offer), Requesting (DHCP Request), and Acknowledgment (DHCP ACK).
Discovery Stage (DHCP Discover):
/>
The diagram above shows the DHCP Discovery stage, where the DHCP client searches for the DHCP server. The DHCP client sends a DHCP Discover packet via broadcast, as it does not know the serverâs IP address, and every host on the network receives this broadcast packet. However, only the DHCP server can respond.
Offering Stage (DHCP Offer)
The diagram above shows the DHCP Offer stage, where the DHCP server offers an IP address. DHCP servers that receive a clientâs DHCP Discover packet on the network respond. These DHCP servers select an available IP address to offer to the client and send a DHCP Offer packet containing the IP address and other settings.
Requesting Stage (DHCP Request)
The diagram above shows the DHCP Request stage, where the DHCP client selects an IP address offered by a DHCP server. When the client receives multiple DHCP Offer packets, it selects data from one DHCP server and responds with a DHCP Request to notify its choice using broadcast. When all DHCP servers on the local area network receive the clientâs DHCP Request, they determine if their IP was chosen by examining the packet. If chosen, the server sends an acknowledgment packet; if not, it does not respond.
Acknowledgment Stage (DHCP ACK)
The diagram above shows the DHCP Acknowledgment stage, where the DHCP server confirms the provided IP address information. Simultaneously, other DHCP servers that were not selected reclaim the IP addresses they had offered.