1-2Obtaining IP Addresses DynamicallyA DHCP client undergoes the following four phases to dynamically obtain an IP address from a DHCPserver:1) Discover: In this phase, the DHCP client tries to find a DHCP server by broadcasting aDHCP-DISCOVER packet.2) Offer: In this phase, the DHCP server offers an IP address. After the DHCP server receives theDHCP-DISCOVER packet from the DHCP client, it chooses an unassigned IP address from theaddress pool according to the priority order of IP address assignment and then sends the IPaddress and other configuration information together in a DHCP-OFFER packet to the DHCP client.The sending mode is decided by the flag filed in the DHCP-DISCOVER packet, refer to section"DHCP Packet Format” for details.3) Select: In this phase, the DHCP client selects an IP address. If more than one DHCP server sendsDHCP-OFFER packets to the DHCP client, the DHCP client only accepts the DHCP-OFFERpacket that first arrives, and then broadcasts a DHCP-REQUEST packet containing the assignedIP address carried in the DHCP-OFFER packet.4) Acknowledge: In this phase, the DHCP servers acknowledge the IP address. Upon receiving theDHCP-REQUEST packet, only the selected DHCP server returns a DHCP-ACK packet to theDHCP client to confirm the assignment of the IP address to the client, or returns a DHCP-NAKpacket to refuse the assignment of the IP address to the client. When the client receives theDHCP-ACK packet, it broadcasts an ARP packet with the assigned IP address as the destinationaddress to detect the assigned IP address, and uses the IP address only if it does not receive anyresponse within a specified period.z After the client receives the DHCP-ACK message, it will probe whether the IP address assigned bythe server is in use by broadcasting a gratuitous ARP packet. If the client receives no responsewithin specified time, the client can use this IP address. Otherwise, the client sends aDHCP-DECLINE message to the server and requests an IP address again.z If there are multiple DHCP servers, IP addresses offered by other DHCP servers are assignable toother clients.Updating IP Address LeaseAfter a DHCP server dynamically assigns an IP address to a DHCP client, the IP address keeps validonly within a specified lease time and will be reclaimed by the DHCP server when the lease expires. Ifthe DHCP client wants to use the IP address for a longer time, it must update the IP lease.By default, a DHCP client updates its IP address lease automatically by unicasting a DHCP-REQUESTpacket to the DHCP server when half of the lease time elapses. The DHCP server responds with aDHCP-ACK packet to notify the DHCP client of a new IP lease if the server can assign the same IPaddress to the client. Otherwise, the DHCP server responds with a DHCP-NAK packet to notify theDHCP client that the IP address will be reclaimed when the lease time expires.