The Dynamic Host Configuration Protocol (DHCP) is a network protocol which is designed to allocate appropriate IP addresses and related network parameters for subnetworks automatically so that devices can communicate on an IP network. This protocol makes it easier to add new devices and join into a corporate network such as printers, mobile phones, tablets, laptops, PCs, etc. This is greatly beneficial for large corporate network, where networks are constantly changing and would be hard to manage such as schools, companies, etc.
How DHCP Works?
DHCP works on 4 stages called as DORA
When a client computer boots and connected to the internet, a DHCPDISCOVER message is sent from client to server. Here, the DHCP client sends a broadcast packet to discover DHCP on the network. The client sent the message of 0.0.0.0 as the source address and 255.255.255.255 as the destination address. If the DHCP server resides on the network, the client directly receives a message. Here the client enters the initializing stage during this step.
Once the DHCP server receives the DHCPDISCOVER request, it then replies with DHCPOFFER message. This message contains all the network configuration settings which are required by the client such as client IP address, subnet mask, default gateway IP address, DNS IP address, IP lease time and DHCP server IP address. It also broadcasts a DHCP offer message over the Ethernet network informing the client that it is available. The client enters the selecting stage during this step.
Once the client receives the DHCP Offer message, it broadcasts a DHCPREQUEST message in reply to DHCPOFFER, requesting for network parameters from DHCP server over ethernet network available on the same subnet. If more than one DHCP server responds on the same subnet, the client receives multiple DHCPOFFER messages. It then selects one of the DHCP servers and enters the IP address of the selected server in the DHCP server identifier field of the DHCPREQUEST message.
Once the server receives DHCPREQUEST from the client, it checks if the IP address shown in the DHCP Server Identifier field matches its own. And if it does, the DHCP Server approves the lease with a DHCPACK (Acknowledgement) packet which includes the lease duration and other configuration information for the client. The client configures a network interface using the transferred data, finally connecting to the internet.
Advantage of DHCP
- Once configured, it doesn’t need to re-configure. Automatically, each network devices receives standard parameters to be able to communicate with other devices on the network.
- It provides a quick, automatic and central management for the distribution of IP addresses within a network.
- Minimizes configuration error caused by manual assigning of IP address configuration and reduce network administration.
To learn Cisco Certification.