In the course of learning the DHCP protocol, we may find many important points, especially the use of DHCP servers. Here we will mainly introduce how the DHCP server automatically assigns IP addresses to the DHCP Client and how the DHCP Service implements DHCP relay proxy across subnets.
Principle of automatic IP Address Allocation for a DHCP service
DHCP uses the Client/Server) model. The Network Administrator establishes one or more maintenance TCP/IP configurations and provides them to the DHCP server of the client. The server database contains the following information.
Valid configuration parameters for all clients on the network.
Valid IP addresses that are maintained in the address pool assigned to the client and reserved addresses that are manually assigned.
The lease duration provided by the server.
By installing and configuring the DHCP server on the network, DHCP-enabled clients can dynamically obtain their IP addresses and related configuration parameters each time they start and join the network. The DHCP server provides the configuration to the requesting client in the form of address lease.
In the following three cases, the DHCP client will apply for a new IP address.
The computer is started as a DHCP client for the first time.
The IP address of the DHCP client has been withdrawn by the server and provided to other DHCP clients for use for some reason, such as when the lease term expires or the connection is disconnected.
The DHCP client releases the rented IP address and requires a new IP address. The general process of applying for a new IP address from a DHCP Client is shown in Figure 6. The specific process is as follows.
1) After the DHCP Client is set to "automatically obtain an IP address", it is called "not bound" because no IP address is bound to it ". At this time, the DHCP client can only provide limited communication capabilities, such as sending and broadcasting messages, but it cannot send unicast messages because it does not have its own IP address.
2) The DHCP client tries to "lease" an IP address from the DHCP server, and the DHCP client enters "initialization ". This DHCP client without an unbound IP address sends a DHCP exploration message with the source IP address 0.0.0.0 to the network to check which DHCP server can assign an IP address to it.
3) All DHCP servers on the sub-network receive this exploration message. DHCP servers determine whether they have the right to assign an IP address to the client.
4) after determining the right to provide the DHCP service for the corresponding client, the DHCP server starts to respond and broadcasts a DHCP message to the network, including information about the unrented IP address and related configuration parameters.
5) The DHCP Client evaluates the received message from the DHCP server and makes two choices. 1. If the IP address used by the server is accepted, the server sends a request message, the selected IP address is specified in the message and the server is requested to provide the lease. Another option is to reject the server by sending a denial message, and then start from step 1st.
6) After receiving the confirmation message, the DHCP server sends a confirmation message to clients that are allowed to provide the DHCP service based on the current IP address usage and related configuration options, it contains the assigned IP address and related DHCP configuration options.
7) after receiving a message from the DHCP server, the client binds the IP address and enters the "binding status ". In this way, the client has its own IP address and can communicate on the network.
Principle of two DHCP relay proxies
In a large network, multiple subnets may exist. The DHCP Client obtains the IP address after receiving a response from the DHCP server through a network broadcast message. However, broadcast messages cannot span subnets. Therefore, if the DHCP client and server are in different subnets, can the client still apply for an IP address from the server? This requires DHCP relay proxy. DHCP relay proxy is actually a software technology. A computer installed with a DHCP relay proxy is called a DHCP relay proxy server. It undertakes communication tasks between DHCP clients and servers in different subnets.
The relay proxy is a small program that transfers DHCP/BOOTP messages between clients and servers on different subnets. According to RFC), DHCP/BOOTP relay proxy is part of DHCP and BOOTP standards and functions.