DHCP Protocol
Introduction
DHCP (Dynamic Host Configuration Protocol) is a TCP/IP layer application. It’s a standard designed to simplify IP address management on a network.
This protocol uses a client/server model, enabling centralized network management. A server maintains a pool of dynamic IP addresses.
The server assigns IP addresses to connecting clients, providing necessary configuration information without prior network knowledge.
The server logs IP address usage, tracking which addresses are in use and for how long. Releasing an IP address when a host disconnects allows another host to use it.
” alt=”Example of a managed network with DHCP”>
Figure 1: Example of a managed network with DHCP
IP Allocation Mechanisms
DHCP uses three IP allocation mechanisms:
- Automatic Allocation: The server assigns a permanent, random IP address to a client upon its first connection. This is suitable for networks with stable client numbers.
- Dynamic Allocation: The server provides temporary IP addresses. When an IP address expires, the client must request a new one to remain connected.
- Manual Allocation: The network administrator manually assigns IP addresses via the DHCP server, providing greater control and preventing unauthorized access.
Features and Objectives of the DHCP Server
- Allows clients to configure and operate on a network without manual intervention.
- Enables complete network configuration by the DHCP server without administrator intervention for each client.
- Eliminates the need for a separate server on each subnet; the DHCP server can operate across routers or using relay agents.
- Handles multiple configuration requests, selecting the most appropriate response.
- Coexists with manually configured hosts.
- Provides BOOTP client service.
- Ensures no IP address is used by multiple clients simultaneously.
DHCP Operation
DHCP evolved from Bootstrap Protocol (BOOTP), an early method for automatic IP assignment. However, DHCP improved upon BOOTP to handle larger networks. DHCP retains BOOTP’s basic UDP frame communication system:
A new computer lacking network configuration information cannot obtain an IP address. A DHCP client sends a broadcast packet with connection details and port usage.
The DHCP server responds with a packet containing the requested information.
The communication can be explained by the messages exchanged between the DHCP server and clients:
DHCP Messages
DHCP uses various messages for successful configuration. These are categorized as client requests (mostly information requests) and server responses.
1) Client Messages:
- DHCPDISCOVER: Locates available DHCP servers on the network.
- DHCPREQUEST: Used for various actions, such as renewing an IP address or requesting a new assignment.
- DHCPDECLINE: Informs the server that an assigned address is already in use.
- DHCPRELEASE: Releases an IP address, allowing the server to assign it to another host.
- DHCPINFORM: A client with an assigned address requests local network parameter information.
2) Server Messages:
- DHCPOFFER: The server responds to a DHCPDISCOVER packet, providing initial parameters and an IP address range.
- DHCPACK: Confirms IP address assignment to a client.
- DHCPNAK: Sent to a client with an expired IP address or in response to a DHCPDECLINE.
DHCP Communication
When a new client connects to a DHCP network, it first broadcasts a DHCPDISCOVER message to locate the DHCP server.
The server responds with a DHCPOFFER containing initial parameters and an IP address range. The client can accept (DHCPREQUEST) or decline (DHCPDECLINE) the offer. The server confirms the assignment with a DHCPACK message.
” alt=”Example of DHCP Communication”>
Figure 2: Example of DHCP Communication
Figures:
[1] http://i.technet.microsoft.com/cc786002.439904eb-392e-4411-acc1-e72b85e47b69 (en-us, WS.10). Gif
[2] http://docs.sun.com/source/820-2981/images/dhcp-diag.gif