DHCPv4 is based on the Bootstrap Protocol and provides configuration parameters to DHCP clients on request.
Note
DHCP was first described in RFC 2131. It has been amended multiple times since.DHCP is a client-server protocol where one or more dedicated and designated servers allocate network address and other configuration parameters to dynamically configured hosts. DHCP removes the need to configure devices individually. Instead, clients set their network properties by connecting to the designated DHCP server. This protocol consists of two components: a protocol to deliver host-specific configuration parameters from a DHCP server to a host and a mechanism to allocate network addresses to hosts.
DHCP has a client-server model, where designated DHCP server hosts allocate network addresses and deliver configuration parameters to dynamically configured hosts. DHCP uses a four-message exchange between client and server: DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, and DHCPACK.
This is a typical message exchange between a DHCP Client and the DHCP Servers in the network where the DHCP Client requests an IP address for the first time.
DHCPDISCOVER - The Client broadcasts this message within in its local physical network. This message might be passed on to DHCP Servers not in the same physical network.
DHCPOFFER - Each DHCP Server that receives a DHCPDISCOVER message may respond to the received message and offer an IP address. Thus, the Client might receive more than one DHCPOFFER messages.
DHCPREQUEST - The Client then chooses one DHCP Server from those DHCP Servers that sent out DHCPOFFER messages. The server is chosen based on the configuration parameters offered in the DHCPOFFER message. The Client then broadcasts a DHCPREQUEST to all with the IP address of the DHCP Server which was chosen embedded within the DHCPREQUEST message.
DHCPACK - On the receipt of the DHCPREQUEST from the Client, the DHCP Server chosen by the Client blocks the offered IP address and responds with a DHCPACK message. The blocked IP Address is no longer available for allocation till the IP address is released by the Client voluntarily or is not renewed by the Client.
All other DHCP Servers can then reuse the offered IP address for other requests.
Some of the primary configuration parameters that are shared from a DHCP Server to DHCP Clients are:
After obtaining the parameters through DHCP, a Client will be able to exchange packets with other hosts in the local network and Internet.