Dynamic Host Configuration Protocol (DHCP)

Dynamic Host Configuration Protocol (DHCP) is an application layer protocol used to distribute network configuration parameters, such as IP addresses, subnet masks, default gateways, etc. to hosts on a TCP/IP network. Assigning network parameters using DHCP reduces the amount of work of a network administrator, since there is no need to statically configure parameters on each device.

DHCP employs a client-server architecture; a DHCP client is configured to request network parameters from a DHCP server. A DHCP server is configured with a pool of available IP addresses and assigns one of them to the DHCP client. Besides IP addresses, a DHCP server can provide some additional network parameters, such as:

  • subnet mask
  • default gateway
  • domain name
  • DNS server

Here is an overview of the DHCP process:

how dhcp works

As you can see from the picture above, a DHCP client goes through the four-step process:

1. A DHCP client sends a broadcast packet (DHCPDiscover) to discover DHCP servers on the network.

2. The DHCP server receives the DHCPDiscover packet and respond with a DHCPOffer packet, offering IP addressing information to the DHCP client.

3. If there is more than one DHCP server on the network segment and the DHCP client receives more than one DHCPOffer packets, the client will accept the first DHCPOffer packet. The DHCP client responds by broadcasting a DHCPRequest packet, requesting network parameters from the DHCP server.

4. The DHCP server approves the lease with a DHCPACK (Acknowledgement) packet. The packet includes the lease duration and other configuration information.

 

DHCP uses a well-known UDP port number 67 for the DHCP server, and the UDP port number 68 for the client.
Geek University 2022