The TCP/IP Guide - Version 3.0 (Contents) ` 1171 _ © 2001-2005 Charles M. Kozierok. All Rights Reserved.
Key Concept: Requests from BOOTP clients are normally sent broadcast, to reach
any available DHCP server. However, there are certain exceptions, such as in lease
renewal, when a request is sent directly to a known server. DHCP servers can send
their replies either broadcast to the special port number reserved for DHCP clients, or
unicast using layer two. The DHCP standards specify that layer two delivery should be used
when possible to avoid unnecessary broadcast traffic.
Retransmission of Lost Messages
Using UDP provides benefits such as simplicity and efficiency to DHCP, but since UDP is
unreliable, there is no guarantee that messages will get to their destination. This can lead to
potential confusion on the part of a client. Consider, for example, a client sending a
DHCPDISCOVER message and waiting for DHCPOFFER messages in reply. If it gets no
response, does this mean that there is no DHCP server willing to offer it service, or simply
that its DHCPDISCOVER got “munched” somewhere on the network? The same applies to
most other request/reply sequences, such as a client waiting for a DHCPACK or DHCPNAK
in reply to a DHCPREQUEST or DHCPINFORM.
The fact that messages can be lost means that DHCP itself must keep track of messages
sent and if there is no response, retransmit them. Since there are so many message
exchanges in DHCP, there is much more that can “go wrong”. As in BOOTP, DHCP puts
responsibility for this squarely on the shoulders of the client. This makes sense, since the
client initiates contact and can most easily keep track of messages sent and retransmit
them when needed. A server can't know when a client's request is lost, but a client can
react to a server's reply being lost.
In any request/reply message exchange, the client uses a retransmission timer that is set to
a period of time that represents how long it is reasonable for it to wait for a response. If no
reply is received by the time the timer expires, the client assumes that either its request or
the response coming back was lost. The client then retransmits the request. If this request
again elicits no reply, the client will continue retransmitting for a period of time.
To prevent large numbers of DHCP clients from retransmitting requests simultaneously
(which would potentially clog the network), the client must use a randomized exponential
backoff algorithm to determine when exactly a retransmission is made. As in BOOTP, this is
similar to the technique used to recover from collisions in Ethernet. The DHCP standard
specifies that the delay should be based on the speed of the underlying network between
the client and the server. More specifically, it says that in a standard Ethernet network, the
first retransmission should be delayed 4 seconds plus or minus a random value from 0 to 1
second—in other words, some value is chosen between 3 and 5 seconds. The delay is then
doubled with each subsequent transmission (7 to 9 seconds, then 15 to 17 seconds and so
forth) up to a maximum of 64 +/- 1 second.