</>
ShikshaCSLearn. Code. Grow.
🔍
☕ Support Us
ShikshaCSâ€ēNotesâ€ēComputer Networks
Computer Networks
🕒 8 min read

DHCP (Dynamic Host Configuration Protocol)

How your device automatically gets an IP address the moment it joins a network.

The Problem DHCP Solves

Every device on a network needs a valid, unique IP address to communicate — but manually configuring this on every single device (especially in a busy office or public Wi-Fi with constantly changing devices) would be impractical and error-prone. DHCP automates this entire process, assigning IP addresses (and other network settings) automatically the moment a device connects.

The DHCP Process (DORA)

The process is often remembered by the acronym DORA: Discover (the new device broadcasts a request asking 'is there a DHCP server here?'), Offer (a DHCP server responds, offering an available IP address), Request (the device formally requests to use that specific offered address), Acknowledge (the server confirms and finalizes the assignment). This entire 4-step exchange typically completes in a fraction of a second.

What Else DHCP Provides

Beyond just an IP address, DHCP also typically provides the subnet mask, the default gateway (router address needed to reach other networks), and DNS server addresses — everything a device needs to fully participate on the network, all delivered automatically in one exchange, without any manual configuration by the user.

IP Address Leases

DHCP doesn't assign an IP address permanently — it grants a 'lease' for a specific duration (commonly 24 hours, but configurable). Before the lease expires, the device typically requests a renewal (often getting the SAME address again if it's still in use); if a device disconnects and doesn't renew, that IP address eventually becomes available for the DHCP server to assign to a different device.

Static vs Dynamic Assignment

Most everyday devices (phones, laptops) use DHCP's dynamic assignment for convenience. However, servers, printers, and other infrastructure devices that need a CONSISTENT, predictable address are often manually configured with a static IP instead, sometimes combined with a DHCP reservation (where the DHCP server always assigns that same specific device the same specific IP, based on its MAC address).

🌍 Real-World Use

The moment you connect your phone to a coffee shop's Wi-Fi, DHCP automatically assigns it a usable IP address, gateway, and DNS server within milliseconds — without DHCP, you'd need to manually type in correct network configuration values every single time you joined a new network, which would be completely impractical for public Wi-Fi.

💡 Pro Tip

Memorize the acronym DORA (Discover, Offer, Request, Acknowledge) — this exact 4-step sequence is one of the most reliably asked short-answer questions in Computer Networks exams covering DHCP.

đŸ§Ē Quick Self-Test

Check what you just learned — no pressure, just practice.

1. What does the acronym DORA stand for in the DHCP process?

2. Besides an IP address, what else does DHCP commonly provide?

3. What is a DHCP 'lease'?

← Back to all Notes