The Dynamic Host Configuration Protocol (DHCP) is a network protocol that is used to
configure network devices so that they can communicate on an IP network.
A DHCP client uses the DHCP protocol to acquire configuration information,
such as an IP address, a default route and one or more DNS
server addresses from a DHCP server. The DHCP client then uses this
information to configure its host. Once the configuration process is complete,
the host is able to communicate on the internet.
The DHCP server maintains a database of
available IP addresses and configuration information. When it receives a
request from a client, the DHCP server determines the network to which the DHCP
client is connected, and then allocates an IP address or prefix that is
appropriate for the client, and sends configuration information appropriate for
that client.
Because the DHCP protocol must work correctly
even before DHCP clients have been configured, the DHCP server and DHCP client
must be connected to the same network link. In larger networks, this is
not practical. On such networks, each network link contains one or more DHCP
relay agents. These DHCP relay agents receive messages from DHCP clients and
forward them to DHCP servers. DHCP servers send responses back to the relay
agent, and the relay agent then sends these responses to the DHCP client on the
local network link.
Now, How DHCP Works in an Ethernet/IP LAN environment and assumes
the client is obtaining a fresh lease without foreknowledge of the DHCP
server's IP address. Note that this is highly simplified.
- A client boots and initializes its network hardware
- The client sends out a DHCPDISCOVER message formatted as follows:
- The source MAC is the client's MAC
- The destination MAC is all 1's indicating a hardware-layer broadcast (FFFFFF-FFFFFF)
- The message type is set to DHCPDISCOVER
- The server hears the DHCPDISCOVER request and responds
- The source MAC is the server's MAC
- The destination MAC is the client's MAC
- The message type is DHCPOFFER containing:
- Server-provided IP address from pool of free addresses (the server should but is not required to check for address conflicts before offering the IP address).
- List of DHCP configuration parameters
- Client responds with DHCPREQUEST message and does one or more of the following:
- requests values for the server-offered parameters from a single server (rejecting all offers from other servers)
- confirm the correctness of the previously allocated IP address (after the client had rebooted or lost connection to the network)
- Requests extension of the lease on the specific address already supplied.
- The server responds with
- a DHCPACKnowledge
to confirm the server-offered options and
IP previously
confirmed by the client -
- or- - a DHCPNOACKnowledge
to reject the server-offered options.
- or - - a DHCPDECLINE message to indicate to the server the address is in use.
- The client retains the information throughout the period of its lease.
- The client sends a DHCPRELEASE message to release its IP address at the DHCP server when it is leaving the network.
DHCP Process |
0 comments:
Post a Comment