DHCP
Introduce the working flow of DHCP (Dynamic Host Configuration Protocol).
DHCP is a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway.
Interaction Flow
Figure 1. Flow of DHCP client requesting configuration from DHCP server
As shown in Figure 1, the interaction flow between DHCP server and client is as follows.
- DHCP Client broadcasts a
DISCOVER
, and the packet is copied and forwarded to DHCP Sever1 and DHCP Sever2. - Server1 and Server2 send an
OFFER
to Client respectively. - Client can select an
OFFER
to respond to.
In the figure 1, Client only responds to the firstOFFER
received, i.e.Offer S1
. And the secondOffer S2
is ignored. - Client broadcasts a
REQUEST
requesting theOffer S1
. - Server1 sends an
ACK
to the Client, telling the client that the IP configuration is available. And Server2 will clear the state machine associated with the Client. - Client broadcasts an
ARP
to perform ACD (Address Conflict Detection), which is to detect if the IP configuration conflicts with other client. - If ACD fails, Client sends a
DECLINE
to Server1 to tell the server that the IP configuration is unavailable.