DHCP — Dynamic Host Configuration Protocol — is the network service that automatically assigns an IP address, subnet mask, default gateway, and DNS server address to each device when it joins a network. Without DHCP, every device would need its IP address configured by hand. GCSE Computer Science expects you to describe the DORA handshake.
Why does every device on a network need an IP address?
IP addresses are the postal addresses of the internet. Every device that communicates on a network must have a unique IP address so that data packets can be routed to the correct destination. Without a valid IP address, a device cannot send or receive data on the network.
When there were only a handful of computers on any network, administrators set IP addresses manually — a process called static configuration. Today a school network might have hundreds of devices connecting and disconnecting throughout the day: laptops, tablets, phones, printers. Manually assigning and tracking addresses for all of them would be impractical. DHCP automates the entire process.
What information does DHCP assign?
DHCP gives each device a complete set of network configuration parameters:
| Parameter | What it does |
|---|---|
| IP address | Uniquely identifies this device on the network |
| Subnet mask | Defines which part of the IP address identifies the network and which identifies the device |
| Default gateway | The router's IP address — the path out to other networks and the internet |
| DNS server address | The server that translates domain names (e.g., google.com) into IP addresses |
| Lease duration | How long the device may keep the assigned address before it must renew or request a new one |
What is the DORA process?
DORA is the four-step handshake between a device (the DHCP client) and the DHCP server when a device first joins a network. The name is an acronym of the four message types.
Step 1 — DISCOVER:
The new device has no IP address and does not know where the DHCP server is. It broadcasts a DHCP Discover message to the entire network (destination address 255.255.255.255 — the broadcast address). The message says, in effect, "I need an IP address — is there a DHCP server here?"
Step 2 — OFFER: The DHCP server receives the broadcast and replies with a DHCP Offer message, proposing an IP address from its available pool, along with the subnet mask, gateway, DNS server, and lease duration.
Step 3 — REQUEST: The client accepts the offer and broadcasts a DHCP Request message to confirm it wants the offered address. It broadcasts rather than sending directly so that any other DHCP servers that may have heard the Discover know their offers were not accepted.
Step 4 — ACKNOWLEDGE: The DHCP server sends a DHCP Acknowledge (ACK) message confirming the assignment. The client now configures its network interface with the assigned parameters and is ready to communicate on the network.
| Step | Message | Direction | Purpose |
|---|---|---|---|
| 1 | Discover | Client → Broadcast | "Is there a DHCP server?" |
| 2 | Offer | Server → Client | "Here is an available address" |
| 3 | Request | Client → Broadcast | "I accept that address" |
| 4 | Acknowledge | Server → Client | "Address confirmed — it is yours" |
What is a DHCP lease and what happens when it expires?
The IP address DHCP assigns is not permanent — it is leased for a defined period, typically 24 hours for a home router, or shorter in a busy environment such as a café with many passing customers.
When the lease is about to expire, the client automatically contacts the DHCP server to renew it (steps 3 and 4 of DORA — skipping the initial broadcast). If the device leaves the network before the lease expires, the IP address is eventually returned to the pool of available addresses and reassigned to another device later.
This pooling means a DHCP server can serve far more devices than it has IP addresses to offer at any one moment — because not all devices are connected simultaneously.
What is the difference between a dynamic and a static IP address?
| Type | Assigned by | Stays the same? | Use case |
|---|---|---|---|
| Dynamic (DHCP) | DHCP server automatically | No — may change on reconnection | Laptops, phones, tablets |
| Static (manual) | Network administrator manually | Yes — fixed permanently | Servers, printers, network devices |
Servers and printers are typically given static IP addresses because other devices need to reliably find them at a fixed address. If a printer's IP address changed every day, print jobs would fail. Dynamic addresses suit general-purpose client devices that connect and disconnect frequently.
What happens if there is no DHCP server available?
If a device cannot find a DHCP server after several attempts, most operating systems assign themselves an APIPA address (Automatic Private IP Addressing) in the range 169.254.0.0/16. APIPA allows devices on the same local network segment to communicate with each other, but not with the internet (since the gateway and DNS addresses are also unknown). Seeing a 169.254.x.x address on a device is a clear sign that DHCP has failed — usually because the DHCP server is down or the network cable is unplugged.
Frequently asked questions
Do I need to know specific port numbers for DHCP at GCSE?
DHCP uses UDP port 67 (server) and UDP port 68 (client). Some specifications mention this, but at GCSE level you are primarily expected to describe the DORA process, explain what information DHCP provides, and compare dynamic and static IP assignment. Check your specific exam board's specification to confirm whether port numbers are required.
Can a home router be a DHCP server?
Yes. Home routers almost always include a built-in DHCP server. This is why your phone or laptop automatically receives an IP address when it connects to your home Wi-Fi — the router's DHCP service completes the DORA handshake and assigns an address from its configured pool (typically something like 192.168.1.100 to 192.168.1.200).
What is a DHCP reservation?
A DHCP reservation (sometimes called a static DHCP lease) is a configuration on the DHCP server that always assigns the same IP address to a specific device, identified by its MAC address. This combines the convenience of automatic configuration with the predictability of a static address — the device still goes through the DORA process, but always receives the same address.
Why does DHCP use broadcasting rather than sending directly?
At the start of the DORA process, the new device does not yet have an IP address and does not know the IP address of the DHCP server. Broadcasting (sending to 255.255.255.255) is the only way to reach every device on the local network simultaneously without knowing their addresses. All devices receive the broadcast, but only the DHCP server responds. Once the device has its IP address, subsequent communication (renewals) can be directed specifically to the server's known address.
Explore network protocols and configuration with Professor Turing's step-by-step GCSE tutoring at aitutors.me.