Application layer: Dynamic Host Configuration Protocol (DHCP)

1. Application layer: Dynamic Host Configuration Protocol (DHCP)

Source of notes:
Teacher from the University of Science and Technology of China: Overview of the Application Layer
Teacher from the University of Science and Technology of China: Dynamic Host Configuration Protocol (DHCP)

Disclaimer: The study notes are from a teacher at HuUST and are for study reference only.



How to configure the user host so that the user host can access the web server normally?
Need to configure: IP address, subnet mask, default gateway, DNS server.
If these configuration information are configured manually, the workload will be huge and error-prone. The DHCP server can automatically complete these configuration tasks.

DHCP working process
The client broadcasts a DHCP discovery message. The client IP address, that is, the source IP address is 0.0.0.0 (because no IP address has been assigned yet), and the destination IP address is 255.255.255.255 (broadcast address) because the client does not know the network. Which is the DHCP server?
The DHCP discovery message is encapsulated with the transaction ID, the MAC address of the DHCP client, etc.


After receiving the discovery message, the DHCP server checks the database according to the client's MAC address to see if there is configuration information for the client. If so, it sends a DHCP offer message. If not, it uses the default configuration to construct a DHCP offer message. DHCP offer
message The source IP address is the IP address of the DHCP server and the destination IP address is the broadcast address. When

the client running DHCP receives the offer message, the client checks whether the transaction ID is the transaction ID in the previously sent message. If it is consistent, the client The message provided is for itself.

The client sends a DHCP request message.
The source IP address is 0.0.0.0 (because no IP address has been assigned yet) and the destination IP address is 255.255.255.255 (broadcast address). After the

DHCP server accepts the request message, Send a DHCP confirmation message
IP address -> ARP -> MAC address


After the client sends the request message, the DHCP server sends back a message. There may be three situations
: 1. The new lease period is obtained as expected
2. The client is not allowed to renew the lease period, immediately Stop using the leased IP address
3. The server does not respond to the client’s request message to update the new lease period, and the client resends the request message.


DHCP relay agent
The router does not forward DHCP broadcasts, so the client cannot automatically obtain network configuration information.

Solution: Configure the router with the IP address of the DHCP server so that the router acts as a DHCP relay agent.

Guess you like

Origin blog.csdn.net/weixin_48524215/article/details/131599397