TCP/IP

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.

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.

  1. DHCP Client broadcasts a DISCOVER, and the packet is copied and forwarded to DHCP Sever1 and DHCP Sever2.
  2. Server1 and Server2 send an OFFER to Client respectively.
  3. Client can select an OFFER to respond to.
    In the figure 1, Client only responds to the first OFFER received, i.e. Offer S1. And the second Offer S2 is ignored.
  4. Client broadcasts a REQUEST requesting the Offer S1.
  5. 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.
  6. Client broadcasts an ARP to perform ACD (Address Conflict Detection), which is to detect if the IP configuration conflicts with other client.
  7. If ACD fails, Client sends a DECLINE to Server1 to tell the server that the IP configuration is unavailable.
C D V U L