Table of contents
1.
Introduction
2.
How DORA Works?
2.1.
Discover
2.2.
Offer
2.3.
Request
2.4.
Acknowledge
3.
Frequently Asked Questions
3.1.
What occurs if multiple servers make an offer?
3.2.
Can a client reject an offered IP?
3.3.
How secure is DHCP?
4.
Conclusion
Last Updated: Aug 13, 2025
Easy

DHCP Dora Process

Author Pallavi singh
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

The digital age has made the internet an integral part of our daily lives, with the DHCP DORA process playing a pivotal role in how devices connect to networks effortlessly. This article breaks down the DHCP DORA process, a sequence critical for dynamic IP address allocation, into its four fundamental stages: Discover, Offer, Request, and Acknowledge. 

DHCP Dora Process

By understanding this process, students can gain insights into the seamless connectivity that underpins our networked world, covering theoretical aspects and practical applications through detailed examples and code.

How DORA Works?

The DHCP DORA process ensures devices on a network can obtain IP addresses dynamically, fostering efficient network management and connectivity. Let's explore each stage in detail.

Discover

The Discover phase kicks off the process when a device (the DHCP client) broadcasts a message to find available DHCP servers. This DHCPDISCOVER message uses 0.0.0.0 as its source IP, aiming to reach any server that can offer an IP address.

Example Code:

from scapy.all import *
dhcp_discover = Ether(dst="ff:ff:ff:ff:ff:ff") / IP(src="0.0.0.0", dst="255.255.255.255") / UDP(sport=68, dport=67) / BOOTP(op=1) / DHCP(options=[("message-type", "discover"), "end"])
sendp(dhcp_discover)


This Python code snippet demonstrates creating and sending a DHCP Discover packet using Scapy, illustrating the initial step in the DORA process.

Offer

In response to the Discover message, DHCP servers on the network send back an Offer. This message includes a potential IP address for the client, along with other vital network configuration details. If there are multiple DHCP servers, the client might receive several offers.

Example Code:

def send_offer(client_mac):
    offered_ip = "192.168.1.10"
    dhcp_offer = Ether(dst=client_mac) / IP(src="192.168.1.1", dst="255.255.255.255") / UDP(sport=67, dport=68) / BOOTP(op=2, yiaddr=offered_ip) / DHCP(options=[("message-type", "offer"), ("server_id", "192.168.1.1"), "end"])
    sendp(dhcp_offer)


This example outlines how a DHCP server might craft an Offer message, suggesting an IP address and necessary network settings to the client.

Request

Following the Offer, the client selects an IP address and broadcasts a DHCP Request message to indicate acceptance. This message also informs other servers that the client has made its selection, prompting them to retract their offers.

Example Code:

def send_request(server_ip, requested_ip):
    dhcp_request = Ether(dst="ff:ff:ff:ff:ff:ff") / IP(src="0.0.0.0", dst="255.255.255.255") / UDP(sport=68, dport=67) / BOOTP(op=1) / DHCP(options=[("message-type", "request"), ("server_id", server_ip), ("requested_addr", requested_ip), "end"])
    sendp(dhcp_request)


This code segment shows the formation of a DHCP Request packet, including the server's IP and the desired IP address.

Acknowledge

The Acknowledge stage concludes the process, with the DHCP server sending a DHCPACK message to confirm the IP address lease. This acknowledgment allows the client to start utilizing the assigned IP address.

Example Code:

def send_ack(client_mac, client_ip):
    dhcp_ack = Ether(dst=client_mac) / IP(src="192.168.1.1", dst=client_ip) / UDP(sport=67, dport=68) / BOOTP(op=2) / DHCP(options=[("message-type", "ack"), "end"])
    sendp(dhcp_ack)


This final snippet illustrates a server sending an Acknowledgment, cementing the IP lease agreement with the client.

Frequently Asked Questions

What occurs if multiple servers make an offer?

The client picks one based on internal criteria, typically the first received offer.

Can a client reject an offered IP?

Yes, through a DHCPDECLINE message, if the IP is in use or otherwise unsuitable.

How secure is DHCP?

Without built-in security features, DHCP can be vulnerable; protective network measures are crucial.

Conclusion

The DHCP DORA process is a fundamental mechanism enabling devices to connect to networks smoothly. By dissecting each of its stages—Discover, Offer, Request, and Acknowledge—this article aims to equip readers with a solid understanding of dynamic IP allocation. Through detailed explanations and code examples, we've covered both the theory and practical aspects, offering a comprehensive insight into this essential networking process.

You can refer to our guided paths on the Coding Ninjas. You can check our course to learn more about DSADBMSCompetitive ProgrammingPythonJavaJavaScript, etc. 

Also, check out some of the Guided Paths on topics such as Data Structure and AlgorithmsCompetitive ProgrammingOperating SystemsComputer Networks, DBMSSystem Design, etc., as well as some Contests, Test Series, and Interview Experiences curated by top Industry Experts.

Live masterclass