Introduction to DHCP
- Before DHCP, network devices required manual configuration of IP addresses, subnet
masks, default gateways, DNS servers, and other settings.
- Manual configuration is impractical for large networks with thousands of devices.
- DHCP (Dynamic Host Configuration Protocol) automates IP address assignment,
reducing administrative overhead.
- DHCP was introduced in 1997 to streamline network configuration.
- Modern devices (desktops, laptops, mobile devices) automatically request an IP address via DHCP when
connecting to a network.
DHCP Process: DORA
- The DHCP process follows a four-step workflow known as DORA:
- Discover
- Offer
- Request
- Acknowledge
- Step 1: Discover
- A device (e.g., a laptop) sends a DHCP Discover message to locate available
DHCP servers.
- The message is sent from
0.0.0.0 (no IP assigned yet) to
255.255.255.255 (broadcast address) over UDP port 68.
- All devices on the local subnet receive the broadcast, including the DHCP server.
- Step 2: Offer
- The DHCP server responds with a DHCP Offer, proposing an available IP address.
- The offer is sent as a broadcast to
255.255.255.255 over UDP port
67.
- If multiple DHCP servers exist, the device may receive multiple offers.
- Step 3: Request
- The device selects an offer and sends a DHCP Request to the chosen DHCP server.
- The request is sent from
0.0.0.0 to 255.255.255.255 over UDP
port 68.
- All devices on the subnet receive the request, but only the selected DHCP server processes it.
- Step 4: Acknowledge
- The DHCP server sends a DHCP Acknowledgment (ACK), confirming the IP address
assignment.
- The ACK is sent as a broadcast to
255.255.255.255 over UDP port
68.
- The device configures its network interface with the assigned IP address.
DHCP Scope and Configuration
- A DHCP scope defines the range of IP addresses and configuration settings a DHCP
server can assign.
- Key components of a DHCP scope:
- IP Address Pool: A range of available IP addresses (e.g.,
192.168.1.100-192.168.1.200).
- Exclusions: IP addresses reserved for static devices (e.g., routers, servers).
- Subnet Mask: Defines the network portion of the IP address.
- Lease Duration: How long a device can use an assigned IP address before
renewal.
- Additional Options: Default gateway, DNS servers, VoIP server addresses, etc.
- DHCP scopes can be configured on servers (e.g., Windows Server) or network devices (e.g., routers).
- Example of a DHCP scope on a router:
- Address pool:
192.168.1.2-192.168.1.254.
- Exclusions:
192.168.1.1 (router), 192.168.1.6 (reserved for a server).
DHCP Reservations
- A DHCP reservation ensures a specific device always receives the same IP address.
- Useful for servers, printers, or network devices requiring consistent IP assignments.
- Reservations are based on the device's MAC address.
- Example:
- Device Prometheus (MAC:
00:1A:2B:3C:4D:5E) is reserved
192.168.1.6.
- Device Odyssey (MAC:
00:1A:2B:3C:4D:5F) is reserved
192.168.1.9.
- Reservations simplify network management by centralizing IP assignments in the DHCP server.
Key Takeaways
- DHCP automates IP address assignment, reducing manual configuration errors.
- The DORA process ensures devices receive an IP address efficiently.
- A DHCP scope defines available IP addresses, exclusions, and configuration options.
- DHCP reservations allow specific devices to retain the same IP address.
- Understanding DHCP is essential for network administration and troubleshooting.