DHCP (Dynamic Host Configuration Protocol) is a standard protocol developed from the BOOTP protocol for automatically assigning client computer IP addresses, defined in RFC 2131.
By default, Windows-based client computers are configured as DHCP clients (automatically obtaining IP addresses) and can be manually configured with static IP addresses. If the client is configured as a DHCP client and a DHCP server exists on the network, the client computer obtains the IP address and other related information to the DHCP server at startup or when it is connected to the network, such as DNS servers, gateways, WINS servers, and so on. The DHCP server uses the form of a lease to assign IP addresses to client computers. Because the DHCP server requires a fixed IP address and a DHCP client computer to communicate, the DHCP service must have a fixed IP address.
How DHCP Works
A DHCP client communicates with the DHCP server to obtain an IP address lease. In order to obtain an IP address from a DHCP server, four communications between the DHCP client and the DHCP server are performed in standard cases.
1, the DHCP client sends an IP lease request (DHCPDISCOVER). When the client first accesses the network and initializes the TCP/IP connection. For example, TCP/IP connections are initialized when the host system is started, a new network adapter is installed, and a disabled network connection is enabled. Because the client does not have an IP address at this time. Also do not know the IP address of the DHCP server, so will send a DHCPDISCOVER message through the broadcast, request the lease IP address and other parameters. The DHCPDISCOVER message contains the source IP address (0.0.0.0), the destination IP address (255.255.255.255, broadcast address), the source port number (UDP68), Destination port number (UDP67) and information such as the hardware address and host name (identity of the DHCP client) of the DHCP client.
2, the DHCP server provides IP address (DHCPOFFER). All legitimate DHCP servers in the network that receive DHCPDISCOVER messages from clients are broadcast on a dhcpoffer-washed, providing the client with relevant parameters such as IP address. The DHCPOFFER message contains the source IP address (the DHCP server IP address), the destination IP address (255.255.255.255, the client does not have an IP address at this time), the source port number (UDP67), the destination port number (UDP68), the provided IP address and subnet mask, The lease time of the IP address, the server identity (usually the IP address of the server), and the hardware address and host name of the DHCP client.
When a DHCP client sends a DHCPDISCOVER message, and waits for 1S not to receive a dhcpoffer from any DHCP server, the client will broadcast the same DHCPDISCOVER message 4 times at the 2S, 4S, 8S, 16S intervals. If Dhcpoffer is still not received at this time, the client based operating system differs in the following 3 cases:
A Windows 2000-based client will temporarily use an automatic Private IP address as its own IP address, and can still communicate with other hosts that have an automatic private IP address.
Windows XP and Windows SERVER 2003-based clients will take an alternate configuration.
Clients that are based on other operating systems will not be able to connect to TCP/IP networks and cannot perform normal network traffic.
However, in either case, the DHCP client broadcasts the DHCPDISCOVER message again every five minutes, and, in either case, the end of the DHCP operation is indicated.