DHCP Process Analysis

Source: Internet
Author: User

We have learned a lot about the content of DHCP. We have already understood the definition and structure of DHCP protocol. Here we will analyze and explain the content of the DHCP work process.

Brief description of DHCP process:

DHCP-Client-A                   DHCP-Server-B        Other-DHCP-Servers
DHCPDISCOVER         →    <receive DISCOVER>       <receive DISCOVER>
                                    ↓                           ↓
<choose an OFFER>       ←           DHCPOFFER               DHCPOFFER
        ↓
DHCPREQUEST          →     <receive REQUEST>      <receive REQUEST>
                                                         ↓
<lease an IP>             ←                          DHCPACK

Dynamic Host Configuration Protocol (DHCP) is a Protocol used to centrally allocate IP addresses and IP address-related information to multiple customers' computers, in this way, IP addresses and TCP/IP settings can be centrally managed to avoid unnecessary address conflicts. Therefore, it is often used in the management of many DOS/Windows computers in the network, this saves the trouble of manually setting and allocating addresses for network administrators.

In addition to convenient management, DHCP can also slightly reduce IP addresses. Suppose there are 50 computers in the network, but there are only 40 IP addresses, but these 50 computers will not start at the same time, and the IP address should meet the requirements. If you use the static IP Address Setting method, you will still encounter difficulties in allocating addresses, because the computer uses random IP addresses, and no matter how the address is allocated, conflicts cannot be avoided, DHCP can avoid this problem. DHCP can also be used to set other IP settings, such as default routes and DNS servers, to reduce the management tasks of a large network.

DHCP is developed from the original BootP protocol. The original purpose is to assign an IP address to a diskless workstation. Currently, more IP addresses are used for centralized IP address management. However, the DHCP protocol also has its disadvantages. For example, a DHCP client computer does not have a fixed IP address, but the IP address that is frequently changed is not suitable for servers that provide network services. In addition, the current DNS Protocol cannot work with DHCP to directly provide host name resolution tasks for DHCP clients.

DHCP Process

DHCP requires the client to interact with the server. The client initiates a request to apply for an IP address to the server through broadcasting, and then the server allocates an IP address and other TCP/IP Settings. The entire process can be divided into the following steps:

IP address lease application: When the DHCP Client's TCP/IP is started for the first time, the DHCP Client program must be executed to set the TCP/IP. At this time, the client's TCP/IP has not been set up, so you can only send DHCP request packets in broadcast mode. The broadcast packets are sent through UDP ports 67 and 68, the broadcast information includes the client's network address and computer name to provide DHCP servers for allocation.

IP address lease: After receiving the broadcast information of the DHCP client, all DHCP servers assign a suitable IP address for this client, and assign the IP address, network mask, lease time, and other information, send back to the DHCP client according to the hardware address provided by the DHCP client. The DHCP server is not restricted in this process, so the client can receive information from multiple IP addresses.

IP address lease option: because the client receives information from multiple IP addresses sent by multiple servers, the client selects an IP address and rejects other IP addresses so that these addresses can be allocated to other customers. The client sends the selected lease information to the server it chooses.

Confirm IP address lease: the server will receive the customer's selection information. If no exception occurs, it will respond to a confirmation message and assign the IP address to the client. The client can use this IP address and related TCP/IP data to set its own TCP/IP stack.

Update lease: in DHCP, each IP Address has a certain lease period. If the lease period has reached, the DHCP server can re-allocate the IP address to other computers. Therefore, each customer's computing machine should continuously lease the IP address it has already rented in advance. The server will respond to the client's request and update the lease period settings of the client. Once the server returns information that cannot be renewed, the DHCP client can only discard the original IP address when the lease period arrives and apply for a new IP address. In order to avoid problems, the lease renewal request process starts when the lease renewal period reaches 50%.

Release IP address lease: the client can actively release its own IP address request, or do not release, but do not renew the lease, wait for the lease period to expire and release the occupied IP Address resources.

DHCP depends on broadcast information. Generally, the client and server are in the same network. However, you can set the vro in the network to forward the BootP broadcast package so that the server and client can be located in two different networks. However, configuring forwarding broadcast information is not a good solution. A better solution is to use a DHCP intermediate computer, where the DHCP intermediate computer and the DHCP client are located in the same network, to respond to the client's lease request. However, it does not maintain DHCP data and has IP Address resources. It only forwards requests to the DHCP server located on another network through TCP/IP, assign and confirm the actual IP address.

Supplementary instructions on DHCP work process:

There are two Protocols: DHCP and BOOTP.

Dhcp ip Address Allocation Process:

After the client connects to the network, it first initializes an incomplete TCP/IP protocol, and then sends a dhcp discover message to all DHCP servers in the network, waiting for the answer from the DHCP server. After receiving the message, the DHCP server returns a dhcp offer message. After receiving the first message, the client sends a dhcp request message to all DHCP servers in the network, this message includes the IP address of the DHCP server that provides the OFFER package. When other DHCP servers receive this message, their OFFER information will be returned, the server that provides the OFFER information also sends a dhcp pack message to the client segment. After receiving the message, the client initializes its own TCP/IP protocol.

The bootp protocol is mainly used in a LAN with a diskless workstation. The client obtains the IP address as follows: first, the BOOTP starts the code to start the client. At this time, the client does not have an IP address, broadcast the IP address 0.0.0.0 request to the network. Then, the server running the BOOTP protocol receives this request, finds the client based on the MAC address provided in the request, and sends a FOUND frame containing the IP address, Server IP address, gateway, and other information. Finally, the client downloads the boot image file from the dedicated TFTP Server Based on the FOUND frame and simulates it as a disk boot. BOOTP disadvantage: You must obtain the MAC address of the client Nic before setting it, And it corresponds to a static IP address. That is to say, BOOTP is not dynamic. In limited IP resources, a pair of BOOTP will cause considerable waste.

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.