Understanding about DHCP

Source: Internet
Author: User

DHCP is one of the most important protocols in network protocols. Every administrator needs to learn this protocol. So how do we understand DHCP and how do we understand DHCP work? Let's take a look at the specific introduction.

DHCP workflow

When using DHCP, you must first have a DHCP server on the network, while other computers execute DHCP clients. When the DHCP client sends a message requesting a dynamic IP address, the DHCP server will provide an available IP address and subnet mask to the client based on the IP address set configured in the current configuration. The workflow is as follows:

DHCP workflow Step 1. Because the client initially does not know the IP address of the DHCP server, the client that sets DHCP to send DHCP discover information to the network in broadcast mode, used to find whether a DHCP server exists in the network. In this way, each computer in the network can receive the broadcast information, but only the DHCP server will respond.

Step 1 of the DHCP workflow, the DHCP server receives the DHCP discover information sent by the client, and selects one from the IP address that has not been assigned by the DHCP server, and send the IP address, subnet mask, gateway address and other information to the requesting client computer DHCP offer information ).

Step 1 of the DHCP workflow, because Multiple DHCP servers may exist in the network, these DHCP servers may return an IP address and related information to the Client Requesting an IP address. In this case, you need to set up a scheme. The general rule is that the DHCP client accepts 1st allocated IP address information DHCP offer information ).

Step 1 of the DHCP workflow, the client sends a DHCP request message in broadcast mode, which contains the content of the IP Address requested from the selected DHCP server. The broadcast method is used to reply to the client to notify all other DHCP servers that the client has selected the IP address provided by a DHCP server.

Step 1 of the DHCP workflow, after the DHCP server receives the DHCP request information broadcast by the DHCP client, the used DHCP server sends a dhcp ack containing its IP address and other settings to the DHCP Client, telling the DHCP client that the IP address can be used, other DHCP servers will reclaim the IP addresses they have provided. The DHCP client binds the received IP address to the NIC of the client.

The above DHCP workflow completes the client's dynamic IP Address allocation process.

After an IP address is allocated for 1st times, the DHCP client does not need to send the DHCP discover broadcast message again every time it logs on to the network again, because the IP address of a DHCP server in the Intranet is already known, therefore, the DHCP request information that contains the previous IP address is directly sent. When the DHCP server receives this information, it will attempt to allow the DHCP client to continue using the original IP address and answer a dhcp ack message. If the IP address is already in use, the DHCP server sends a dhcp nack message to the client. After receiving this message, the client resends the DHCP discover message to request a new IP address. If the IP address of the known DHCP server on the client is invalid, only the broadcast information is resending to find the new DHCP server.

In addition, the IP address assigned by the DHCP server to the DHCP Client is called a lease. Generally, the lease period is set. After the expiration, the DHCP server will reclaim the IP address. If the DHCP Client wants to extend the lease, the lease must be updated.

Tip: When the DHCP Client is started and the lease term is over half the time, the DHCP client will automatically send the lease update information to the DHCP server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.