Comprehensive introduction to DHCP servers

Source: Internet
Author: User

Previously, we resolved the DHCP service content. Here we will mainly introduce the content of the DHCP server. Let's take a closer look at the application environment and Message format of the DHCP server. Hope to help you.

DHCP server

Application Environment of the DHCP server

The DHCP server is usually used for IP Address Allocation in the following scenarios:

• Large network scale, manual configuration requires a lot of work, and it is difficult to centrally manage the entire network.

• The number of hosts in the network is greater than the number of IP addresses supported by the network, so you cannot assign a fixed IP address to each host. A large number of users must dynamically obtain their own IP addresses through the DHCP service, and the number of concurrent users is also limited.

• There are few hosts with fixed IP addresses in the network. Most hosts do not use fixed IP addresses.

DHCP packet type

• DHCPDISCOVER: client broadcast discovers available DHCP servers.

• DHCPOFFER: the server responds to the DHCPDISCOVER packet of the client and provides various configuration parameters to the client.

• DHCPREQUEST:

■ The client requests the server address and other configuration parameters;

■ After the client logs on again, check that the original address and other configuration parameters are correct;

■ The client applies to the server for an extension of the address and other configuration parameters.

• DHCPACK: the server sends the allocated address and other configuration parameters to the client.

• DHCPNAK: the server notifies the client that the requested address is invalid or has expired.

• DHCPDECLINE: the client notifies the server that the assigned address has been used by other devices.

• DHCPRELEASE: the client waives the address it uses.

• DHCPINFORM: the client applies for local configuration parameters from the server when the client address has been allocated ).

Packet interaction between the DHCP client and the server

A typical message interaction process.

Figure DHCP Client-to-Server Message Interaction

To obtain valid Dynamic IP addresses, the DHCP Client interacts with the server in different stages. There are usually three modes:

• DHCP client first logon to the network

When a DHCP client logs on to the network for the first time, it establishes contact with the DHCP server through four phases:

■ Discovery stage: the stage in which the DHCP client looks for a DHCP server. The client sends the DHCPDISCOVER packet in broadcast mode, and only the DHCP server responds.

■ Provision stage: the IP address provision stage of the DHCP server. After receiving the DHCPDISCOVER packet from the client, the DHCP server selects an unallocated IP address from the IP address pool and assigns it to the client to send the DHCPOFFER packet containing the rental IP address and other settings to the client.

■ Selection phase: the phase in which the DHCP Client selects an IP address. If Multiple DHCP servers send DHCPOFFER packets to the client, the client only accepts the first DHCPOFFER packet received, and then responds to the DHCP server in broadcast mode to the DHCPREQUEST packets, this information contains the IP Address requested from the selected DHCP server.

■ Confirmation phase: the phase in which the DHCP server confirms the IP addresses provided. When the DHCP server receives the DHCPREQUEST packet from the DHCP client, it sends the packet containing the IP address and other settings of the DHCPACK to the client. Then, the DHCP client binds its TCP/IP protocol component to the NIC.

Except for the server selected by the DHCP client, the IP addresses not allocated by other DHCP servers can still be applied for by other clients.

• The DHCP client logs on to the network again.

When the DHCP client attempts to log on to the network again, follow these steps:

■ After the DHCP client correctly logs on to the network for the first time and then logs on to the network, it only needs to broadcast the DHCPREQUEST packet containing the last assigned IP address, and does not need to send the DHCPDISCOVER packet again.

■ After the DHCP server receives the DHCPREQUEST message, if the address requested by the client is not assigned, the DHCP server returns the DHCPACK confirmation message, notifying the DHCP client to continue using the original IP address.

■ If the IP address cannot be assigned to the DHCP client, for example, if it has been assigned to another client, the DHCP server returns the DHCPNAK packet. After receiving the request, the client resends the DHCPDISCOVER message to request a new IP address.

• The IP address lease validity period of the DHCP Client is extended.

The Dynamic IP address assigned by the DHCP server to the client usually has a certain lease term. After the expiration, the server will reclaim the IP address. If the DHCP Client wants to continue using the IP address, update the IP address lease, for example, extend the IP address lease ).

In actual use, when the DHCP client starts or the IP address Lease Term reaches half, the DHCP Client automatically sends a DHCPREQUEST packet to the DHCP server to update the IP address lease. If the IP address is valid, the DHCP server responds to the DHCPACK message and notifies the DHCP client that a new IP lease has been obtained.

Configuration on PC

In Windows XP, win2000, or DOS, you can use the ipconfig/release command to actively release the IP address. Run [winipcfg/release] On the Window 98 graphic interface to actively release IP addresses. Different Operating System commands may vary. The user's PC sends the DHCPRELEASE message to the DHCP server. Then, use the ipconfig/renew command in the DOS environment of your PC or run [winipcfg/update] on the graphic interface to apply for a new IP address. Then, your PC sends a DHCPDISCOVER packet to the DHCP server.

You can also use the ipconfig/renew command or run [winipcfg/update] On the GUI to update the IP address lease.

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.