Dynamic Host Configuration Protocol
1. What is DHCP ?
DHCP stands
for Dynamic Host Configuration Protocol. It is an Application Layer Protocol
that provides
configuration parameters to Internet hosts. DHCP consists of two components
- a protocol for delivering
host-specific configuration parameters from a DHCP server to a host and
a mechanism for allocation of
network addresses to hosts.
DHCP is built on a client-server model, where designated DHCP server hosts
allocate
network addresses and deliver configuration parameters to dynamically configured
hosts. The term "server"
refers to a host providing initialization parameters through DHCP, and the
term "client" refers to a host
requesting initialization parameters from a DHCP server. A client and server
may negotiate for the transmission
of only those parameters required by the client or specific to a particular
subnet.
The configuration parameters include those defined in the Host Requirements
RFCs like
IP-Address, subnet mask, MTU etc.,. After obtaining parameters via DHCP,
a DHCP client should be able to
exchange packets with any other host in the Internet.
2. Definition of useful terms.
a. "DHCP client"
A DHCP client is an
Internet host using DHCP to obtain
configuration parameters such as a network address.
b. "DHCP server"
A DHCP server
is an Internet host that returns configuration
parameters to DHCP clients.
c. "BOOTP relay agent"
A BOOTP relay
agent or relay agent is an Internet host or router
that passes DHCP messages between DHCP clients and DHCP servers.
DHCP is designed to use the same relay agent behavior as specified
in the BOOTP protocol specification.
d. "binding"
A binding is
a collection of configuration parameters, including
at least an IP address, associated with or "bound to" a DHCP
client. Bindings are managed by DHCP servers.
e. "lease"
The period over which a network address is allocated to a client.
3. How does DHCP work ?
3.1 Client-server interaction - allocating a network address
DHCP uses UDP as its transport protocol. DHCP messages from a client
to a server are sent to the 'DHCP server' port (67), and DHCP
messages from a server to a client are sent to the 'DHCP client' port (68).
The following summary of the protocol exchanges between clients and
servers describes the basic DHCP protocol :1. The client broadcasts a DHCPDISCOVER message on its local physical
subnet. The DHCPDISCOVER message may include options that suggest
values for the network address and lease duration. BOOTP relay
agents may pass the message on to DHCP servers not on the same
physical subnet.2. Each server may respond with a DHCPOFFER message that includes an
available network address (and other configuration parameters in DHCP
options). The server transmits the DHCPOFFER message to the client,
using the BOOTP relay agent if necessary.
3. The client receives one or more DHCPOFFER messages from one or more
servers. The client may choose to wait for multiple responses.
The client chooses one server from which to request configuration
parameters, based on the configuration parameters offered in the
DHCPOFFER messages. A DHCPREQUEST message is
broadcasted and relayed through DHCP/BOOTP relay agents
to the same set of DHCP servers that received the original
DHCPDISCOVER message
4. The servers receive the DHCPREQUEST broadcast from the client.
Those servers not selected by the DHCPREQUEST message use the
message as notification that the client has declined that server's
offer. The server selected in the DHCPREQUEST message commits the
binding for the client to persistent storage and responds with a
DHCPACK message containing the configuration parameters for the
requesting client.5. The client receives the DHCPACK message with configuration
parameters and performs a final check on the parameters
(e.g., ARP for allocated network address), and notes the
duration of the lease specified in the DHCPACK message.
At this point, the client is configured. If the client detects that the
address is already in use (e.g., through the use of ARP), the
client MUST send a DHCPDECLINE message to the server and restarts
the configuration process.If the client receives a DHCPNAK message, the client restarts the configuration process. 6. The client may choose to relinquish its lease on a network address by sending a DHCPRELEASE message to the server.
Useful References and Bibliography