Section 1 configuring the DHCP server-theoretical part (I)

Source: Internet
Author: User

I,Learn about DHCP servers

Dynamic Host Configuration (DHCP)
Protocol) is a protocol designed and developed by IETF (Internet team) to automatically allocate TCP/IP parameters to computers in TCP/IP networks. DHCP avoids errors caused by manual IP Address Setting and address conflicts caused by IP Address Allocation to the workstation. DHCP provides secure, reliable, and simple TCP/IP network settings, reducing the burden on configuring IP addresses.

 

1. How DHCP works


In the working principle of DHCP, three IP Address Allocation Modes are provided.

1) automatic allocation: After the DHCP Client successfully obtains an IP address from the DHCP server for the first time, the IP address is permanently used.

2) manual allocation: the DHCP server administrator specifies the IP address.

The above is rarely used. Because IPv4 is not enough, it is impossible to set a permanent IP address for the client.

3) Dynamic Allocation: After the DHCP Client obtains the IP address from the DHCP server for the first time, it is not permanently used. Instead, after each use, the DHCP client needs to release the IP address, used by other clients.

 

2. DHCP lease Process

The process in which a client obtains an IP address from a DHCP server is called a DHCP lease. The lease process consists of four steps:

(1) The client requests the IP address (the client sends the DHCP discover broadcast package), and the client searches for the server in the network.
(2) The server responds (the server sends a DHCP offer broadcast packet) and the server responds to the service from the client.
(3) The client selects an IP address (the client sends a DHCP request broadcast packet), and the client sends a service request to the target server.

(4) The server determines the lease (the server sends a DHCP ack broadcast packet), and the server provides the IP address service to the client.

1) client request IP Address

When a DHCP Client is started, the client does not have an IP address. Therefore, the client must obtain a valid IP address through DHCP. At this time, the customer will send DHCP discover discovery information to find the DHCP server in broadcast mode (because the IP address of the DHCP server is unknown to the client.


The broadcast contains the MAC address and computer name of the DHCP client, so that the DHCP server determines which client sends the request.

The client sends DHCP discover

DHCP Client Broadcast Request IP Address

Source IP Address: 0.0.0.0

Target IP Address: Broadcast bandwidth 255.255 (broadcast address)


2) Server Response
When the DHCP server receives information from the IP Address requested by the client, it checks whether there is a valid IP address in its IP address pool to the client. If yes, the DHCP server marks the IP address, add it to the DHCP offer message, and then the DHCP server broadcasts a DHCP offer message containing the following information.
The MAC address of the DHCP client.
The valid IP Address Provided by the DHCP server.
Subnet Mask
Default Gateway
Term of lease
The IP address of the DHCP server.

The server responds to the DHCP service from the client.

Source IP Address: 192.168.10.20

Target address: Broadcast bandwidth 255.255 (broadcast address)

IP Address: 192.168.10.101


3) Select the IP address of the client.
The DHCP Client extracts the IP address from the received first DHCP offer message, and the DHCP server that issues the IP address keeps the address, so that the address cannot be assigned to other DHCP clients. after the client receives the DHCP offer message from the first DHCP server and extracts the IP address, the client broadcasts the DHCP request message to all servers, indicating that the client accepts the provided content, the DHCP request message includes the Service Identifier (Server IP address) configured for the IP address of the client. The DHCP server checks the server Identifier Field to determine whether the provided IP address is accepted. If the DHCP offer is rejected, the DHCP server will cancel and retain its IP address for the next IP lease request.


IP address selected by Client

Client Broadcast

Select DHCP server (192.168.10.10)

Target address: 255.255.255.255

Lease: 8 days


4) determine the lease of the server
After receiving the DHCP request message, the DHCP server broadcasts a successful confirmation message to the client in the form of a dhcp ack message. The message contains valid IP address lease and other configurable information. Although the server confirms the client's lease request, the client has not received the server's dhcp ack message. When the client receives the dhcp ack message, it configures the IP address to complete TCP/IP initialization.

Server Validation

Source Address: 192.168.10.10

Target address: 255.255.255.255


5) log on again

Each time a client logs on to the network again, it does not need to send DHCP discover information. Instead, it directly sends the DHCP discover request information containing the previous IP address, 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 confirmation message. If the IP address cannot be assigned to the original DHCP Client (for example, when the IP address has been assigned to another DHCP client), the DHCP server will reply a DHCP Nack denial message to the client. When the original DHCP client receives the message denied by the DHCP Nack, it must resend the DHCP discover information to request the IP address.


The client sends a packet with IP address confirmation to the server.

When the server responds to this IP address, the client uses

If the IP address is used, the client sends a new request.
6) Update the lease

 

When the IP address rented by the DHCP server to the client reaches 50%, the lease needs to be updated. The client directly sends a DHCP request packet to the server providing the lease, requesting that the current IP address lease be updated.


7) The DHCP client cannot find the DHCP server.

 

If the DHCP server cannot be found on the client, the client selects an IP address from the network segment 169.254.0.0 of TCP/IP as its own and continues to communicate with the DHCP server every five minutes. Once the client gets in touch with the DHCP server, the client discards the configured IP address and uses the IP address assigned by the DHCP server.

 

How do we configure the DHCP server ?? Updating. Please wait .........

This article is from the "Liu Jinhua's blog". For more information, contact the author!

Section 1 configuring the DHCP server-theoretical part (I)

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.