当前位置:网站首页>DHCP service
DHCP service
2022-07-19 02:51:00 【Yunsheng】
DHCP(Dynamic Host Configuration Protocol, Dynamic Host Configuration Protocol ) It's a LAN Of Network protocol , Use UDP Agreement work , There are two main uses : To the internal network or Network services Suppliers are automatically assigned IP Address , To users or internal network administrators as for all Computer As a means of central management , stay RFC 2131 Detailed description in .DHCP Yes 3 Ports , among UDP67 and UDP68 For the normal DHCP Service port , Respectively as DHCP Server and DHCP Client Service port for ;546 Port number is used for DHCPv6 Client, Not for DHCPv4, Is for DHCP failover service , This is a service that needs to be opened specially ,DHCP failover Is used to do " hot standby " Of .
The form of distribution
First ﹐ There must be at least one DHCP Work on the Internet ﹐ It will monitor the Internet DHCP request ﹐ And negotiate with the client TCP/IP Setting environment of . It offers two kinds of IP Positioning mode ﹕
AutomaticAllocation
Automatically assigned ﹕ once DHCP For the first time, the client succeeded from DHCP The server is rented to IP After address ﹐ Always use this address .
DynamicAllocation
Dynamic allocation : When DHCP First time from HDCP The server is rented to IP After address ﹐ The address is not used permanently ﹐ As long as the lease expires ﹐ The client has to release (release) This IP Address ﹐ For other workstations . Of course ﹐ The client can continue ahead of other hosts (renew) lease ﹐ Or rent something else IP Address .
working principle
for the first time Sign in When ﹕
1. seek Server. When DHCP The first time a client logs into the network ﹐ That is to say, the customer finds that there is no IP Data setting ﹐ It will send a message to the network DHCPDISCOVER Packet . Because the client does not know which network it belongs to ﹐ So the source address of the packet will be 0.0.0.0﹐ The destination address is 255.255.255.255﹐ Then attach Dhcpdiscover Information about ﹐ Broadcast to the Internet .
stay Windows By default ,Dhcpdiscover The waiting time of is preset to 1 second ﹐ That is, when the client will be the first Dhcpdiscover After the package is delivered ﹐ stay 1 If you don't get a response in seconds ﹐ It's going to be a second time Dhcpdiscover radio broadcast . If there is no response ﹐ There will be four times for the client Dhcpdiscover radio broadcast ( Including the first time )﹐ Except for waiting for the first time 1 Seconds away ﹐ The remaining three waiting times are 9﹑13﹑16 second . If you don't get it DHCP Server response ﹐ The client will display an error message ﹐ Declare Dhcpdiscover The failure of the . after ﹐ Based on the user's choice ﹐ The system will continue to 5 Repeat in minutes Dhcpdiscover The process of .
2. Provide IP Rental address . When DHCP The server listens to Dhcpdiscover After the broadcast ﹐ It'll be in the range of addresses that haven't been leased yet ﹐ Choose the empty one in the front IP, Together with others TCP/IP Set up , Respond to the client with a DHCPOFFER Packet .
Because the client didn't at the beginning IP Address ﹐ So in its Dhcpdiscover It will be included in the package MAC Address information ﹐ And there's a XID Number to identify the packet ﹐DHCP The server responded Dhcpoffer The packet is then passed to the client requesting the lease based on this information . According to the server settings ﹐Dhcpoffer The packet will contain information about the term of the lease .
3. Accept IP lease . If the client receives more than one on the network DHCP Server response ﹐ Only one of them will be selected Dhcpoffer nothing more ( Usually the first one to arrive )﹐ And will send a Dhcprequest Broadcast packets ﹐ Tell all DHCP Server it will specify which server to accept IP Address .
meanwhile ﹐ The client will also send a ARP Packet ﹐ Check if there are any other machines on the Internet using this IP Address ﹔ If you find this IP Already occupied ﹐ The client will send out a DHCPDECLINE Packet to DHCP Server ﹐ Refuse to accept it Dhcpoffer﹐ And resend Dhcpdiscover Information .
in fact ﹐ Not all DHCP Clients will unconditionally accept DHCP Server's offer﹐ In particular, these hosts are installed with other TCP/IP Related customer software . The client can also use Dhcprequest Propose to the server DHCP choice ﹐ And these choices will be filled in with different numbers in DHCPOptionField Inside ﹕
In other words ﹐ stay DHCP The settings on the server ﹐ Not all clients accept ﹐ The client can keep some of its own TCP/IP Set up . And the initiative is always on the client side .
4. Lease confirmation . When DHCP The server received from the client Dhcprequest after ﹐ Will send a message to the client DHCPACK Respond ﹐ To confirm IP The formal entry into force of the lease ﹐ It ends a complete DHCP working process .
边栏推荐
猜你喜欢
随机推荐
4、AsyncTool框架的一些思考
使用gatekeeper限制kubernetes创建特定类型的资源
SQL之CASE WHEN用法详解
第一篇博客------自我介绍
Let's learn about awk~
Common English business mail phrases
纯虚函数
5、AsyncTool框架竟然有缺陷?
Circular statements and functions of shell scripts
HCIP第一天_HCIA复习
regular expression
An example of C language callback function & sprinf practical application
Dynamic programming - 01 knapsack problem
Brief introduction of Feature Engineering and its implementation of sklearn
解决WIN10连接共享打印机出现0x00000709的错误
Shell script for, while loop statements, price guessing games
安装.NET提示“无法建立到信任根颁发机构的证书链”(方法简单有下载地址)
多层数据包结构及TCP三次握手
Arm cross compiler naming rules
Firewall firewall








