DHCP stands for Dynamic Host Control Protocol. In order to
describe DHCP we need to first describe BOOTP, which it evolved from. BOOTP
protocol was used for assigning IP addresses to diskless workstations. It was
not a dynamic protocol, i.e. it was not assigning the IP addresses dynamically.
It was pulling the addresses from a static BOOTP file which was maintained by
the network administrator. Unlike the BOOTP, DHCP helps you to assign the IP
addresses dynamically to the network computers or any devices that needs IP
address to connect to the internet. The IP addresses delivered by the DHCP are
delivered from a pool which the network administrator created on the DHCP
server. These IP addresses can be assigned permanently or temporarily. DHCP removes
a great part of the drudgery that would be included in manual assignments of IP
addresses. As well as the specific DHCP appliances, most network operating
systems provide DHCP service.
Having described what the DHCP protocol is, let’s look how
it works. When we connect a new device to the network, it broadcasts a
DHCPDISCOVER message. This message is sent to all DHCP servers on the network
and it contains the hostname of the client and the hardware MAC address. Then,
a DHCP server or servers on the subnet, responds with a DHCPOFFER message
containing the offered IP address, subnet mask, duration of the lease and
default gateway. If there are more than one DHCP server in the subnet, the
client will accept the first responding server’s DHCP offer message. DHCPOFFER
message is still in the form of broadcast message since the client still does
not have an IP address. After receiving the DHCPOFFER message, client broadcasts
a DHCPREQUEST message to all the DHCP servers on the network. This DHCPREQUEST
messages means that the client has accepted an DHCP offer and it contains the
IP address of the DHCP server and the IP address accepted. The rationale behind
sending the DHCP server IP is letting other DHCP’s to know that the IP they
sent is not selected so that they can offer that IP to other DHCPDISCOVER
messages. Finally, the DHCP server selected sends an DHCPACK message to the
client. At this point, the server sends the valid IP address and other optional
configuration parameters such as DNS servers.