Then, dhcpserve receives this broadcast and replies to desktop1, identifying itself to
desktop1 as a DHCP server. Because desktop1 and dhcpserve are on different
network segments, the router, acting as a relay agent, forwards messages between the
two computers. Chapter 7, “Transmitting DHCP Messages,” discusses relay agents in
more detail. The interactions between
desktop1 and dhcpserve are discussed in the
following sections.
After receiving the initial message from
desktop1, dhcpserve selects an IP address,
192.168.12.25, which is appropriate for the 192.168.12.0 network to which
desktop1
is connected. dhcpserve also chooses other configuration parameters, such as the
subnet mask (255.255.255.0), the address of the router interface on the 192.168.12.0
network, and the address of the GSI DNS server.
dhcpserve uses the DHCP client
configuration rules defined by the network architect and information sent by the
relay agent to determine these parameters. It then returns an offer message that
contains the selected address and parameters to
desktop1.
After desktop1 receives the offer message from dhcpserve, it broadcasts a message
requesting the IP address and other configuration parameters from
dhcpserve. The
DHCP server confirms that the address is still available, and sends the parameters to
desktop1 in the final message of the sequence. When the message arrives, the DHCP
client software on
desktop1 extracts the configuration parameters from the message,
configures the client computer’s IP stack to use the IP address and any other parame-
ters it receives. As soon as the IP stack is configured, the client computer can use
network. The DHCP client software also records the IP address and configuration
parameters locally in a file on
desktop1 for later use.
A total of four messages are exchanged: two messages from the client and two replies
from the server. This sequence of messages may seem confusing and redundant at
first. Why would
desktop1 send back a request for the address and parameters that
dhcpserve returned in the first offer? The extra message exchange makes it possible
to have more than one DHCP server serving a network. Each server receives the
DHCP client’s initial message and sends a response. The DHCP client chooses one of
these responses. Each server whose response is not chosen reclaims the IP address it
offered. This issue is discussed in more detail in Chapter 8, “DHCP Message
Exchanges.”
Restarting desktop1
When
desktop1 is restarted (for example, when it is first turned on in the morning),
it retrieves the IP address and configuration parameters it previously received from
dhcpserve and attempts to reconfirm the configuration. As the next section explains,
reconfirming its configuration gives
desktop1 the opportunity to determine whether
that configuration is still valid. If
desktop1 is moved to a new network segment, it
must get a new IP address.
CHAPTER 2 An Example of DHCP in Operation22
004 3273 CH02 10/3/02 4:58 PM Page 22