The Wayback Machine - https://web.archive.org/web/20240731125042/https://www.geeksforgeeks.org/working-of-dynamic-host-configuration-protocol/
Open In App

Working of Dynamic Host Configuration Protocol

Last Updated : 11 Aug, 2020
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report

Dynamic Host Configuration Protocol (DHCP) is a network management protocol used in networks to dynamically assign IP addresses & other network configuration information like default gateway, mask, DNS server address etc.

DHCP server automatically assigns IP address to various devices in network. This in turn reduces work of Network Administrator to manually assign IP address to various devices.

Automatic IP address assignment process undergoes four message exchange. These messages are abbreviated as Discover, Offer, Request & Acknowledgement (DORA). The following table gives the detail of these four messages.


Message Detail
Discover This is message sent by DHCP client to discover a DHCP server.
Offer Sent by DHCP server to lease unique IP address and other parameters needed to client.
Request Sent by DHCP client asking server to lease parameters listed in Offer message.
Acknowledgement Sent by DHCP server to assign IP address, mask, default router & DNS server address to client.

But there is conflict, DHCP IP address leasing uses layer 3 protocol i.e, Internet Protocol. This means that DHCP uses IP packets. But we know that hosts have no IP address initially then how they form IP packets? Actually they uses two reserved IP address for this purpose.

  1. 0.0.0.0 –
    An IP address reserved to use as sender’s address for hosts that doesn’t have IP address assigned yet.

  2. 255.255.255.255 –
    This is local broadcast IP address. Packets sent to this address are broadcast over local data link. Routers do not forward packet containing this address as destination address.

But, there’s still problem remaining. What if DHCP server is not available on local LAN and present outside of local LAN? DORA messages needs to be exchanged. For this purpose “IP helper address” which is actually IP address of DHCP server, is configured in routers.

Now packets containing 255.255.255.255 are updated to IP helper address as destination address. This helps DORA messages to exchanged outside of the local LAN.


Figure – DHCP messages exchange with help of IP helper address


  1. PC1 sends Discover message but doesn’t find DHCP server in local LAN.
  2. R1 now receive IP packet and change destination address to DHCP server address i.e., 14.0.10.1 and sender address to its own outgoing interface address i.e., Gi0/2 interface address. R1 does this because of configuration of IP helper address.
  3. IP packet forwarded by R1 is received by DHCP server and respond to this Discover message.
  4. Server now send Offer message with source address as its own IP address and destination address as Gi0/2 interface address of R1. Actually it reverse the address of IP packet received.
  5. R1 receive the Offer message and forward it to PC1.
  6. Request and Acknowledge message are also exchanged as discussed in above steps.

Similar Reads

Dynamic Host Configuration Protocol (DHCP)
Dynamic Host Configuration Protocol is a network protocol used to automate the process of assigning IP addresses and other network configuration parameters to devices (such as computers, smartphones, and printers) on a network. Instead of manually configuring each device with an IP address, DHCP allows devices to connect to a network and receive al
14 min read
Introduction of Virtual Router Redundancy Protocol (VRRP) and its configuration
VRRP is an open standard protocol, which is used to provide redundancy in a network. It is a network layer protocol (protocol number-112). The number of routers (group members) in a group acts as a virtual logical router which will be the default gateway of all the local hosts. If one router goes down, one of the other group members can take place
4 min read
File transfer protocol server configuration using cisco packet tracer
In this article we are going to design a file transfer protocol server configuration in cisco packet tracer and checking the connectivity for uploading and downloading the file from remote PC. Objectives: To Configure FTP Services on Server.To Upload a File into the FTP Server from Remote PC.To Download a File from the FTP Server from Remote PC.Pro
3 min read
Hot Standby Router Protocol (HSRP) and Virtual Router Redundancy Protocol (VRRP)
Hot Standby Router Protocol (HSRP) is a CISCO proprietary protocol used to provide redundancy in a network. Only one router is the active router while others will be in standby state i.e the standby router will be responsible for forwarding the traffic when the active router fails. Virtual Router Redundancy Protocol (VRRP) is an open standard proto
3 min read
Difference between Stop and Wait protocol and Sliding Window protocol
Introduction: Both Stop and Wait protocol and Sliding Window protocol are the techniques to the solution of flow control handling. The main difference between Stop-and-wait protocol and Sliding window protocol is that in Stop-and-Wait Protocol, the sender sends one frame and wait for acknowledgement from the receiver whereas in sliding window proto
4 min read
Difference between File Transfer Protocol (FTP) and Secure File Transfer Protocol (SFTP)
FTP (File Transfer Protocol) It is a protocol that is used to transfer or copy the file from one host to another host. But there may be some problems like different file names and different file directories while sending and receiving a files in different hosts or systems. And in FTP, a secure channel is not provided to transfer the files between t
3 min read
Difference between Serial Line Internet Protocol (SLIP) and Point-to-Point Protocol (PPP)
The main difference between the Serial Line Internet Protocol (SLIP) and Point-to-Point Protocol (PPP) is that Serial Line Internet Protocol is the Predecessor protocol of Point-to-Point Protocol. On the other hand, Point-to-Point Protocol is the Successor protocol of Serial Line Internet Protocol. Features of SLIP: Simple: SLIP is a simple protoco
4 min read
Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) in Data Link Layer
Layer 2 or the Datalink layer provides physical addressing and access to media. It defines how data is to be formatted for transmission and how access to the network is to be controlled. It also provides error detection, ensuring data on higher layers is formatted correctly for transmission. Cisco Discovery Protocol (CDP) and Link Layer Discovery P
2 min read
Difference between Border Gateway Protocol (BGP) and Routing Information Protocol (RIP)
1. Border Gateway Protocol (BGP): In BGP, Transmission Control Protocol is used. It is a type of mesh topology or design. It works by two independent networks (Autonomous Systems or AS) exchanging routing information. The two routers agree to exchange information about how to reach certain IP-ranges. BGP uses Transmission Control Protocol (TCP) por
2 min read
Difference between Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP)
1. Spanning Tree Protocol (STP) : STP is also known as spanning tree protocol is a layer 2 (Data link layer) protocol, it runs on switches and bridges. The IEEE standard of STP is 802.1D. STP is a feature used to prevent loops when using redundant switches. For example, we have three switches they are all linked together and without STP a loop coul
4 min read
Article Tags :
three90RightbarBannerImg