Open In App

What is DHCPv4 Operation?

Prerequisites: DHCP Server

DHCPv4 assigns dynamically IP address and other configuration information to the client. It uses UDP services. DHCPv4 is controlled by a DHCPv4 server that dynamically distributes network configuration parameters such as IP addresses, subnet masks,s and gateway addresses. The DHCPv4 server leases an IP address from the IP address pool to the DHCPv4 client. DHCPv4 is a network protocol that enables the server to automatically assign the IP address to the client. DHCPv4 port number for the server and client is 67 and 68 respectively.



DHCPv4 Components:

Lease Origination:

When DHCPv4 clients boot up it follows a four-step operation to obtain the lease. A client starts the process by broadcasting a DHCPv4 Discover message with its MAC address to all the available DHCPv4 servers.

 

DHCPv4 Discover:

DHCPv4 client broadcasts the DHCPv4DISCOVER message which contains the source address as 0.0.0.0 to every node on the network including the server. DHCPv4DISCOVER message finds the DHCPv4 servers. It uses layer 2 and layer 3 broadcast addresses to communicate with the servers as the DHCPv4 clients don’t have any valid IP address.



DHCPv4 Offer:

When DHCPv4 servers receive the DHCPv4DISCOVER message it reserves an available IP address to lease the client. The server creates an ARP which includes the MAC address of the intended client and the leased IP address. Then, DHCPv4 servers send the DHCPv4OFFER message to the requesting client as unicast which includes the layer 2 MAC address of the server and client as the source and destination address respectively. 

DHCPv4 Request:

Requested DHCPv4 client on receiving offer message it broadcasts DHCPv4 REQUEST message on the network with the address of server whose offer message is selected by the client. The server which is related to that server address checks whether the address to be assigned to the node is available in data storage. This message is used both for lease origination and lease renewal. This message is broadcasted to all the DHCPv4 servers informing them about the accepted offer and informing the intended DHCPv4 server whose offer the client has accepted. 

DHCPv4 Acknowledgement:

DHCPv4 server on receiving the DHCPv4 REQUEST message from the client verifies the lease through ICMP ping to that address to check if it is not used already and creates a new ARP entry for the client lease and unicasts the DHCPv4 ACK message. If the address is assigned, it marks the IP address in storage as unavailable to ensure consistency. The server sends a DHCPv4 ACK packet to the client which contains network information. It is the copy of the DHCPv4OFFER message except for the message which contains the information about configuration and performs ARP lookup to the assigned address. If there is no reply to the ARP, the client knows that it is a valid IP address, and it can use it as its own IP.

Lease Renewal:

 

DHCPv4 working:

DHCPv4 runs in the application layer which dynamically assigns IP addresses to DHCPv4 clients and allocates them the configuration information. The information includes subnet masks, IP addresses, default gateway, and DNS addresses. DHCPv4 is a client-server-based protocol that assigns unique IP addresses from the pool to the requesting DHCPv4 client. 

Applications of DHCPv4:

Article Tags :