<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Pallavi Bhatiya]]></title><description><![CDATA[Pallavi Bhatiya]]></description><link>https://pallavibhatiya.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 10:34:26 GMT</lastBuildDate><atom:link href="https://pallavibhatiya.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How DHCP Automatically Gives an IP Address? and what is this DORA dance??]]></title><description><![CDATA[How dhcp automatically assign ip addresses]]></description><link>https://pallavibhatiya.hashnode.dev/how-dhcp-automatically-gives-an-ip-address-and-what-is-this-dora-dance</link><guid isPermaLink="true">https://pallavibhatiya.hashnode.dev/how-dhcp-automatically-gives-an-ip-address-and-what-is-this-dora-dance</guid><category><![CDATA[cybersecurity]]></category><category><![CDATA[dhcp]]></category><category><![CDATA[tech ]]></category><category><![CDATA[curiosity]]></category><dc:creator><![CDATA[Pallavi Bhatia]]></dc:creator><pubDate>Sun, 01 Nov 2026 18:38:59 GMT</pubDate><content:encoded><![CDATA[<p>Every time I connect my laptop to Wi-Fi, it gets an IP address. I don’t enter one manually, and I don’t have to figure out which address is available. I realized there’s a whole process running behind something I barely even notice</p>
<p>That's where DHCP comes in.</p>
<p>First, why does my device even need an IP address?</p>
<p>IP address is the address our device uses to communicate over a network.</p>
<p>When I open a website, my laptop needs to send and receive data. For that communication to work, it needs an IP address.</p>
<p>So, what exactly is DHCP?</p>
<p>DHCP stands for Dynamic Host Configuration Protocol.</p>
<p>In simple terms, it automatically provides devices with IP addresses and other network settings, such as the default gateway and DNS servers.</p>
<p>Without DHCP, I’d have to configure these settings manually on every device.DHCP saves us from that hassle.</p>
<p>But how does a device automatically receives an IP address when it doesn’t even have one yet?</p>
<p>That's where things get interesting.</p>
<p>The DORA process: It’s how DHCP assigns an IP address</p>
<p>DHCP follows a four-step process called DORA.</p>
<p>DORA stands for:</p>
<p>- Discover</p>
<p>- Offer</p>
<p>- Request</p>
<p>- Acknowledge</p>
<p>Here's how I understand it:</p>
<p>my device asks for network configuration, a DHCP server offers an available address, my device requests that address, and the server confirms the assignment.</p>
<p>Now, let's break down what happens at each step.</p>
<p>1. Discover: My device looks for a DHCP server</p>
<p>When my laptop joins a network, it needs an IP address, but it doesn't have a valid one yet.</p>
<p>So, it sends a DHCP Discover message to find a DHCP server.</p>
<p>Because the laptop doesn't know the server's address, it initially sends a broadcast on the local network.</p>
<p>In a typical IPv4 DHCP exchange, the client uses "0.0.0.0" as its source IP and "255.255.255.255" as the destination IP.</p>
<p>Basically, my laptop is asking:</p>
<p>"Is there a DHCP server here that can give me an IP address?"</p>
<p>2. Offer: The server responds</p>
<p>The DHCP server receives the Discover message and checks which addresses it can offer from its configured address pool.</p>
<p>It then sends a DHCP Offer containing a proposed IP address and other configuration information.</p>
<p>For example, the server might offer "192.168.1.25".</p>
<p>My laptop now has an offer, but the address hasn't been fully assigned yet.</p>
<p>3. Request: My device chooses an offer</p>
<p>My laptop sends a DHCP Request to indicate that it wants to use the offered IP address.</p>
<p>This message also helps DHCP servers identify which offer the client has selected, particularly when multiple servers respond.</p>
<p>Think of it as saying:</p>
<p>"I'd like to use the address you offered me."</p>
<p>4. Acknowledge: The server confirms the assignment</p>
<p>Finally, the DHCP server sends a DHCP Acknowledgment, commonly called DHCP ACK.</p>
<p>This confirms the lease and provides the configuration the client should use.</p>
<p>Write on Medium</p>
<p>My laptop can now configure its network interface with the assigned IP address and communicate over the network.</p>
<p>That's the DORA process: Discover, Offer, Request, Acknowledge.</p>
<p>Four messages, and my device has its network configuration without me manually entering an IP address.</p>
<p>But where do these broadcast messages actually go?</p>
<p>This was one of the things I wanted to understand better.</p>
<p>When my laptop broadcasts a DHCP Discover message, does every device connected to the internet receive it?</p>
<p>No.</p>
<p>The initial broadcast is confined to the local Layer 2 broadcast domain, typically the same VLAN.</p>
<p>A router doesn't normally forward an IPv4 limited broadcast such as "255.255.255.255" to other networks.</p>
<p>Press enter or click to view image in full size</p>
<p>So, what happens if the DHCP server is on a different network?</p>
<p>That's where a DHCP relay agent comes in. It forwards DHCP requests between the client's network and a DHCP server on another network.</p>
<p>This allows organizations to serve multiple networks without needing a separate DHCP server on every subnet.</p>
<p>Does my device get the same IP address every time?</p>
<p>Not necessarily.</p>
<p>DHCP generally assigns IP addresses through a lease, meaning the client can use the address for a specified period.</p>
<p>When the lease approaches expiration, the client can attempt to renew it.</p>
<p>If I disconnect from Wi-Fi and reconnect later, I might receive the same address again. But DHCP can assign a different one, depending on the server's configuration and address availability.</p>
<p>The important thing is that dynamic addressing doesn't mean my IP address must change every time I connect.</p>
<p>It means the address is managed through DHCP rather than requiring manual configuration.</p>
<p>If DHCP keeps reusing IP addresses, why is IPv4 running out?</p>
<p>This was another question I had.</p>
<p>IPv4 uses 32-bit addresses, providing approximately 4.3 billion possible address combinations.</p>
<p>That might sound like a lot, but there are far more devices and network connections than there are publicly usable IPv4 addresses.</p>
<p>DHCP helps manage address allocation, but it doesn't create additional IPv4 addresses.</p>
<p>And there's another important piece: NAT, which stands for Network Address Translation.</p>
<p>NAT allows multiple devices on a private network to share a public IPv4 address when communicating with external networks.</p>
<p>For example, my laptop, phone, and smart TV can all use private IP addresses on my home Wi-Fi while sharing the same public IPv4 address for internet access.</p>
<p>That's one reason a household doesn't need a separate public IPv4 address for every device.</p>
<p>DHCP and NAT solve different problems: DHCP manages network configuration, while NAT translates addresses between networks.</p>
<p>What happens if DHCP fails?</p>
<p>If a device can't obtain a valid IP configuration, it might not be able to communicate normally on the network.</p>
<p>A few possible causes include:</p>
<p>- The DHCP server is unavailable.</p>
<p>- The address pool has no available addresses.</p>
<p>- A network or relay configuration is incorrect.</p>
<p>- The device can't communicate with the server.</p>
<p>On some operating systems, a device may automatically assign itself an IPv4 link-local address in the "169.254.0.0/16" range.</p>
<p>However, that doesn't mean DHCP has successfully assigned an address. Link-local addressing is intended for communication on the local link and doesn't provide normal internet connectivity by itself.</p>
<p>So, when a device connects to Wi-Fi but can't access the internet, DHCP is one of the things worth checking.</p>
<p>What I took away from learning DHCP</p>
<p>Before looking into DHCP, I knew my devices received IP addresses automatically. I just hadn't thought much about what made that possible.</p>
<p>Now, I understand that there's a process behind it.</p>
<p>My device discovers a DHCP server, receives an offer, requests an address, and gets confirmation through the DORA process.</p>
<p>I also learned that DHCP broadcasts don't travel everywhere, leases help manage address allocation, and DHCP isn't the same thing as NAT.</p>
]]></content:encoded></item></channel></rss>