Friday, August 24, 2012

DHCP Process


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.

  1. A client boots and initializes its network hardware
  2. The client sends out a DHCPDISCOVER message formatted as follows:
    1. The source MAC is the client's MAC
    2. The destination MAC is all 1's indicating a hardware-layer broadcast (FFFFFF-FFFFFF)
    3. The message type is set to DHCPDISCOVER
  3. The server hears the DHCPDISCOVER request and responds
    1. The source MAC is the server's MAC
    2. The destination MAC is the client's MAC
    3. The message type is DHCPOFFER containing:
      1. 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).
      2. List of DHCP configuration parameters
    4. Client responds with DHCPREQUEST message and does one or more of the following:
      1. requests values for the server-offered parameters from a single server (rejecting all offers from other servers)
      2. confirm the correctness of the previously allocated  IP  address (after the client had rebooted or lost connection to the network)
      3. Requests extension of the lease on the specific address already supplied.
    5. The server responds with
      1. a DHCPACKnowledge to confirm the server-offered options and  IP  previously confirmed by the client -
        - or-
      2. DHCPNOACKnowledge to reject the server-offered options.
        - or -
      3. DHCPDECLINE message to indicate to the server the address is in use.
    6. The client retains the information throughout the period of its lease.
    7. 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:

Powered by Blogger.