The DHCP Client/Server Exchange

Posted by arlene

Although based on the simple BOOTP protocol, the DHCP protocol client/server exchange is a little more complicated. Both sides communicate using a set of messages, as listed here:

Requesting Configuration Information from the DHCP Server

Living the Web 2.0The communication process between the DHCP client and server is simple. The client initially broadcasts a DHCPDISCOVER message on the local subnet to which it is attached. If known, the client can insert configuration options in this discover packet, such as the IP address and a requested lease time.

All DHCP servers that receive the DHCPDISCOVER request can respond with a DHCPOFFER message, including a suggested IP address and any other options it can offer. Because more than one server can respond to a DHCP request (remember that DHCP packets can be relayed across routers using BOOTP relay agents), it then must decide which offer to accept.

The DHCPOFFER packet is sent as a unicast packet instead of a broadcast packet. The DHCP server can unicast or broadcast messages, which is determined in this way:

When a selection has been made, the client broadcasts another packet that contains a DHCPREQUEST message. This packet must include the server identification option, indicating from which server the client has chosen to accept the offer.

When the servers see this broadcast packet, those not chosen by the client use it as a flag that their offer was not accepted, and no further communications need to take place between the client and these servers. The chosen server binds the client to the addressing configuration information, and then sends the client a DHCPACK acknowledgment message. This packet also contains the set of agreed-upon options and parameters. If the server cannot grant the request—the IP address requested by the client is already in use, for example—the server responds with a DHCPNAK negative acknowledgment message.

After the client receives an acknowledgment packet indicating that it can use the configuration information, it must still perform some checks to be sure that the information is correct and will allow the client to function on the network. A few simple checks are performed. For example, the client can use ARP to check that the IP address it is about to use is not already in use on the network. This can happen when a DHCP server has been configured incorrectly. If there are no challenges, the client has the information it needs and the configuration of its protocol stack is performed. The client now can participate in the network.

If this last-minute test informs the client that the address is already in use, the client sends the DHCP server a DHCPDECLINE message. In this case, or if the client has received a DHCPNAK message from the server, the process backs off for a few seconds and begins again.

If the client does not receive either the DHCPACK or the DHCPNAK message within a set amount of time, it also restarts the configuration process.

Possibly related posts: (automatically generated)
The DHCP Client/Server Exchange

5 Responses to “The DHCP Client/Server Exchange”

  1. Web Monkey provides tutorials, examples of code, and advice on almost every aspect of authoring and deploying a Web site. … Aplus Net Provides

  2. Feedback (m_b_sunderland_gb) Jul 13, 48am I’ m operating a pair of dedicated servers and have (in total) less than two dozen domains, farm. … Dynadot Staff Domain

  3. This rack mountable, Stateful Packet Inspection (SPI) firewall is equipped with support for up to 200 security associations (VPN tunnels). … Security Associations

  4. Software, your web space also has the protection of a shared SSL certificate essential for protecting the sensitive information you are collecting. … Hostway Co

  5. What s happening When a website is requested through a web browser (Internet Explorer, Firefox, etc), the request is first sent to the computer’s Internet Service Provider (ISP) which contacts the domain s name servers to look up the location (IP address) of the web hosting server. … Domain Registrar

Leave a Reply

LogoAlexa CounterFeedBurner Counter