WO2016202126A1 - Method and device of reclaiming ip address and dynamic host configuration protocol server - Google Patents

Method and device of reclaiming ip address and dynamic host configuration protocol server Download PDF

Info

Publication number
WO2016202126A1
WO2016202126A1 PCT/CN2016/082082 CN2016082082W WO2016202126A1 WO 2016202126 A1 WO2016202126 A1 WO 2016202126A1 CN 2016082082 W CN2016082082 W CN 2016082082W WO 2016202126 A1 WO2016202126 A1 WO 2016202126A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration protocol
host configuration
dynamic host
protocol client
retransmission time
Prior art date
Application number
PCT/CN2016/082082
Other languages
French (fr)
Chinese (zh)
Inventor
蒋康康
谢铁民
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016202126A1 publication Critical patent/WO2016202126A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects

Definitions

  • the present application relates to, but is not limited to, the field of network communication, and in particular, to an IP address recovery method and apparatus, and a dynamic host configuration protocol server.
  • DHCP Dynamic Host Configuration Protocol
  • the DHCP server dynamically assigns IP addresses and other parameters to DHCP clients.
  • DHCP is a one-way driver protocol.
  • the server is completely passive, and its actions and behaviors are basically triggered by the client's request behavior.
  • the client initiates the application, renewal, and release of the IP address, and the server manages the used IP address through the lease mechanism.
  • the server allocates the available IP address and the lease term of the IP address to the client. When the lease expires, if the client wants to continue to use the IP address, the client must initiate a renewal request, and if it wants to terminate the use during use.
  • the condition for the server to reclaim the IP address is that the lease expires or the client actively releases.
  • the client In the actual network, the client is often shut down, the client disconnects the network cable (such as the laptop is removed), the network link fails, etc., which will cause the client to actually disconnect from the server, but the server cannot know the client. Whether it is online, so during the IP address lease period, the IP address will be occupied until the lease expires, and the lease period is usually set to several hours or even several days, which will cause the IP address resources to be effectively used.
  • the main technical problem to be solved by the present application is to provide an IP address recovery method, device and action
  • the host configuration protocol server solves the problem that the IP address of the client that is offline due to shutdown, disconnection, or link failure cannot be recovered in time due to shutdown of the IP address of the related technology, resulting in wasted IP resources.
  • an IP address recovery method including:
  • the IP address occupied by the dynamic host configuration protocol client is recovered.
  • the step of determining whether the dynamic host configuration protocol client is offline according to the response of the dynamic host configuration protocol client to the ICMP probe packet includes:
  • the dynamic host configuration protocol client When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
  • the determining, according to the response of the dynamic host configuration protocol client to the ICMP probe packet, determining whether the dynamic host configuration protocol client is offline, determining the dynamic host The method for configuring the protocol client to respond to the ICMP probe packet is as follows:
  • the dynamic host configuration protocol client After the ICMP probe packet is sent to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If the number of consecutive responses not received is greater than or equal to the maximum number of retransmissions N, the determination is performed. The dynamic host configuration protocol client does not respond normally;
  • the ICMP probe packet After the ICMP probe packet is sent to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If no response is received within the set retransmission time, the current retransmission time is determined. Whether it is greater than the retransmission time threshold, if the current retransmission time is greater than the retransmission time threshold, it is determined that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not If the retransmission time threshold is greater than the retransmission time threshold, the ICMP probe packet is resent to the dynamic host configuration protocol client after the retransmission time is extended;
  • a response is received within the set retransmission time. If no response is received within the set retransmission time, it is determined that the response is not received continuously. Whether the number of responses is greater than or equal to the maximum number of retransmissions N. If the number n of consecutive responses is greater than or equal to the maximum number of retransmissions N, it is determined that the dynamic host configuration protocol client does not respond normally; If the number of times of the response is less than the maximum number of retransmissions N, it is determined whether the current retransmission time is greater than the retransmission time threshold.
  • the dynamic host configuration protocol client does not respond normally. If it is determined whether the current retransmission time is not greater than the retransmission time threshold, the ICMP probe message is retransmitted to the dynamic host configuration protocol client after the retransmission time is extended.
  • the method before the step of sending an ICMP probe message to the dynamic host configuration protocol client for the first time, the method further includes: determining whether the detection period expires, if the detection period expires, Sending an ICMP probe packet to the dynamic host configuration protocol client.
  • the detection period is equal to an IP address lease/M, and the M is a positive integer.
  • the retransmission time threshold is equal to a detection period/K; and the K is a positive integer less than 10.
  • the step of reclaiming an IP address occupied by the dynamic host configuration protocol client includes:
  • the dynamic host configuration protocol client is deleted from the address allocation list, and the IP address is returned to the free address pool.
  • the ICMP probe message is an ICMP Echo Request message.
  • the application further provides a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • an IP address recovery apparatus including:
  • the message sending module is configured to send an ICMP probe message to the dynamic host configuration protocol client;
  • the processing module is configured to determine whether the dynamic host configuration protocol client is offline according to the response of the dynamic host configuration protocol client to the ICMP probe packet;
  • a recycling module configured to reclaim an IP address occupied by the dynamic host configuration protocol client when the dynamic host configuration protocol client is offline.
  • the processing module is configured to:
  • the dynamic host configuration protocol client When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
  • the processing module is configured to determine whether the dynamic host configuration protocol client responds normally to the ICMP probe packet, including:
  • the processing module determines whether a response is received within the set retransmission time, and if the number of consecutive responses is not greater than or equal to the maximum weight If the number of transmissions is N, it is determined that the dynamic host configuration protocol client does not respond normally;
  • the processing module determines whether a response is received within the set retransmission time, and if no response is received within the set retransmission time. And determining whether the current retransmission time is greater than a retransmission time threshold. If the current retransmission time is greater than the retransmission time threshold, determining that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not greater than the retransmission time Threshold, after the retransmission time is extended, the ICMP probe packet is resent to the dynamic host configuration protocol client;
  • the processing module determines whether a response is received within the set retransmission time, and if no response is received within the set retransmission time. And determining whether the number of times the response is not received continuously is greater than or equal to the maximum number of retransmissions N, and if the number n of consecutive responses not received is greater than or equal to the maximum number of retransmissions N, determining The dynamic host configuration protocol client does not respond normally; if the number of consecutively received responses is less than the maximum number of retransmissions N, it is determined whether the current retransmission time is greater than the retransmission time threshold, and if the current retransmission time is greater than the retransmission time Threshold, determining that the dynamic host configuration protocol client does not respond normally; if it is determined whether the current retransmission time is not greater than the retransmission time threshold, extending the retransmission time and resending the ICMP
  • the present application also provides a dynamic host configuration protocol server, including the IP address recovery device as described above.
  • the application provides an IP address recovery method, a device, and a dynamic host configuration protocol server, wherein the IP address recovery method includes sending an ICMP probe packet to the dynamic host configuration protocol client; and the client detects the ICMP probe packet according to the dynamic host configuration protocol.
  • the response is to determine whether the dynamic host configuration protocol client is offline. If the dynamic host configuration protocol client is offline, the IP address occupied by the dynamic host configuration protocol client is reclaimed; because the offline client is not shut down due to shutdown, disconnection, or link failure.
  • the ICMP probe packet is responded to, so the IP address occupied by the client is recovered in time, and the IP address is not occupied until the lease expires. This improves the timeliness of IP address recovery and the use of IP addresses. rate.
  • FIG. 1 is a schematic diagram of a two-layer networking in the first embodiment of the present application.
  • FIG. 2 is a schematic diagram of a three-layer networking in the first embodiment of the present application.
  • FIG. 3 is a schematic flowchart of an IP address recovery method in Embodiment 1 of the present application.
  • FIG. 4 is a schematic structural diagram of an IP address recovery apparatus in Embodiment 2 of the present application.
  • FIG. 5 is a schematic flowchart of an IP address recovery method in Embodiment 3 of the present application.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • the Layer 2 networking shown in FIG. 1 and the Layer 3 networking shown in FIG. 2 are present in the network.
  • the method for recovering the IP address provided by the embodiment of the present invention is applicable.
  • the method includes:
  • Step S301 Send an ICMP probe packet to the dynamic host configuration protocol client.
  • the ICMP probe packet may be a PING request packet, such as an ICMP Echo Request packet.
  • Step S302 According to the response of the dynamic host configuration protocol client to the ICMP probe packet, determine whether the dynamic host configuration protocol client is offline. If the dynamic host configuration protocol client is offline, go to step S303; if the dynamic host configuration protocol client Online, proceeding to step S304;
  • Step S303 retrieve the IP address occupied by the dynamic host configuration protocol client.
  • Step S304 The IP address occupied by the dynamic host configuration protocol client is not recovered.
  • the ICMP probe packet can be used to actively determine whether the dynamic host configuration protocol client is online, and the IP address occupied by the dynamic host configuration protocol client can be immediately recovered after the offline is determined, thereby avoiding offline.
  • the IP address of the dynamic host configuration protocol client has been occupied during the lease period, resulting in wasted IP address resources.
  • the step of determining whether the dynamic host configuration protocol client is offline according to the response of the dynamic host configuration protocol client to the ICMP probe packet includes:
  • the dynamic host configuration protocol client When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
  • the method for determining whether the dynamic host configuration protocol client responds normally to the ICMP probe packet may be any one of the following manners:
  • Manner 1 After sending an ICMP probe packet to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If the number of consecutive responses not received is greater than or equal to the maximum number of retransmissions N, then the determination is performed. The dynamic host configuration protocol client does not respond normally;
  • Manner 2 After sending an ICMP probe packet to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If no response is received within the set retransmission time, Determining whether the current retransmission time is greater than the retransmission time threshold. If the current retransmission time is greater than the retransmission time threshold, determining that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not greater than the retransmission time threshold, the extension is extended. Retransmit the ICMP probe message to the dynamic host configuration protocol client after the retransmission time;
  • Manner 3 After sending an ICMP probe message to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If no response is received within the set retransmission time, the judgment is not received continuously. Whether the number n of responses is greater than or equal to the maximum number of retransmissions N. If the number n of consecutive responses is greater than or equal to the maximum number of retransmissions N, it is determined that the dynamic host configuration protocol client does not respond normally; if the response is not received continuously If the number of times n is less than the maximum number of retransmissions N, it is determined whether the current retransmission time is greater than the retransmission time threshold.
  • the ICMP probe packet is retransmitted to the dynamic host configuration protocol client after the retransmission time is extended.
  • the value of the maximum number of retransmissions in the first mode and the third mode may be set according to a specific application scenario.
  • the rules for extending the retransmission time in the second and third modes may also be flexibly set according to specific application scenarios, such as extending and fixing. Duration, or doubled, and so on.
  • a detection period may also be set, and the step S301 is performed only when the detection period expires; that is, in the foregoing step S301, the ICMP is sent to the dynamic host configuration protocol client for the first time.
  • the method for recovering the IP address further includes: determining whether the detection period expires, and if the detection period expires, sending the ICMP detection packet to the dynamic host configuration protocol client; if the detection period is not expired, Then, it returns a step of judging whether the detection period has expired.
  • the detection period is equal to the IP address lease period/M
  • M is a positive integer according to the actual situation and the specific application scenario
  • the value of M may be 60.
  • the retransmission time threshold may be equal to the detection period/K according to the actual situation and the specific application scenario; and K is a positive integer less than 10, for example, equal to 2. Both the probing period and the retransmission time can be clocked by the corresponding timer.
  • the step of recovering the IP address occupied by the dynamic host configuration protocol client includes:
  • the Dynamic Host Configuration Protocol client is removed from the address allocation list and the IP address is returned to the free address pool and can be marked as idle before being returned to the free address pool.
  • Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the embodiment further provides an IP address recovery device, which can be applied to a dynamic host configuration protocol server.
  • the method includes:
  • the message sending module 1 is configured to send an ICMP probe message to the dynamic host configuration protocol client.
  • the processing module 2 is configured to determine, according to the dynamic host configuration protocol client response to the ICMP probe packet, whether the dynamic host configuration protocol client is offline;
  • the recovery module 3 is configured to reclaim the IP address occupied by the dynamic host configuration protocol client when the dynamic host configuration protocol client is offline.
  • the ICMP probe packet can be used to actively determine whether the dynamic host configuration protocol client is online, and the IP address occupied by the dynamic host configuration protocol client can be immediately recovered after the offline is determined, thereby avoiding dynamic after offline.
  • the IP address of the host configuration protocol client has been occupied during the lease period, resulting in wasted IP address resources.
  • processing module 2 is configured to:
  • the dynamic host configuration protocol client When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
  • the processing module 2 is configured to determine that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, and may be any one of the following manners:
  • Manner 1 After the packet sending module 1 sends an ICMP probe packet to the dynamic host configuration protocol client, the processing module 2 determines whether a response is received within the set retransmission time, and if the response is not received continuously If the number of responses is greater than or equal to the maximum number of retransmissions N, it is determined that the dynamic host configuration protocol client does not respond normally;
  • Manner 2 After the packet sending module 1 sends an ICMP probe message to the dynamic host configuration protocol client, the processing module 2 determines whether a response is received within the set retransmission time, if there is no response within the set retransmission time. If the response is received, it is determined whether the current retransmission time is greater than the retransmission time threshold. If the current retransmission time is greater than the retransmission time threshold, it is determined that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not greater than the retransmission The time threshold is used to retransmit the ICMP probe message to the dynamic host configuration protocol client after the retransmission time is extended.
  • Manner 3 After the packet sending module 1 sends an ICMP probe message to the dynamic host configuration protocol client, the processing module 2 determines whether a response is received within the set retransmission time, if there is no response within the set retransmission time. Receiving a response, determining whether the number n of consecutively received responses is greater than or equal to the maximum number of retransmissions N, and if the number n of consecutively received responses is greater than or equal to the maximum number of retransmissions N, determining that the dynamic host configuration protocol client is not If the number of consecutive times that the response is not received is less than the maximum number of retransmissions N, it is determined whether the current retransmission time is greater than the retransmission time threshold.
  • the dynamic is determined.
  • the host configuration protocol client does not respond normally; if it is determined whether the current retransmission time is not greater than the retransmission time threshold, the ICMP probe packet is resent to the dynamic host configuration protocol client after the retransmission time is extended.
  • the values of the N values in the foregoing modes 1 and 3 can be set according to specific application scenarios.
  • the rules for extending the retransmission time in the second and third modes can also be flexibly set according to specific application scenarios, such as extending a fixed duration or extending. Double and so on.
  • the detection period may also be set, and only the packet sending module 1 sends an ICMP probe packet to the dynamic host configuration protocol client when the probe period expires; that is, the packet sending module 1 Before sending an ICMP probe packet to the dynamic host configuration protocol client for the first time, it is further configured to: determine whether the probe period expires, and send an ICMP probe packet to the dynamic host configuration protocol client if the probe period expires; If there is no expiration, it will be re-evaluated whether the detection period expires.
  • the detection period is equal to the IP address lease period/M
  • M is a positive integer according to the actual situation and the specific application scenario, and the value of M may be 60.
  • the retransmission may also be set according to the actual situation and the specific application scenario setting.
  • the time threshold is equal to the detection period /K; K is a positive integer less than 10, for example equal to two. Both the probing period and the retransmission time can be clocked by the corresponding timer.
  • the recycling module 3 is configured to:
  • the Dynamic Host Configuration Protocol client is removed from the address allocation list and the IP address is returned to the free address pool and can be marked as idle before being returned to the free address pool.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • FIG. 5 For a better understanding of the present application, the present application is further described below with a specific example, as shown in FIG. 5, including:
  • Step S501 The DHCP server allocates an IP address to the DHCP client, and uses the time when the IP address is assigned as the starting time for detecting the DHCP client.
  • Step S502 the DHCP server sets a PING detection period, an initial retransmission time, and a detection maximum allowable failure number N;
  • the PING detection period IP address lease period/60; the initial retransmission time is 3 seconds; the PING detection maximum allowable failure number N is 3 times, 4 times, or 5 times;
  • Step S503 the PING detection timer is turned on, and the number of detection failures is set to 0;
  • Step S504 determining whether the PING detection timer expires; if the PING detection timer expires, proceeding to step S505, if the PING detection timer has not timed out, returning to determine whether the PING detection timer has timed out;
  • Step S505 the DHCP server sends a PING request to the DHCP client, and initializes the retransmission timer.
  • step S506 it is determined whether the PING response message returned by the DHCP client is received before the retransmission timer expires. If the PING response message returned by the DHCP client cannot be received before the retransmission timer expires, the process proceeds to step S507. If the retransmission timer does not time out before receiving the PING response message returned by the DHCP client, proceeding to step S511;
  • Step S507 the number of detection failures is increased by one
  • Step S508 determining whether the number of detection failures is greater than the maximum number of failed detections; If the number of failed detections is not greater than the maximum number of failed detections, the process proceeds to step S509; if the number of failed detections is greater than the maximum number of failed detections, the process proceeds to step S512;
  • step S509 the DHCP server lengthens the retransmission timer to determine whether the retransmission timer duration is greater than the retransmission time threshold. If the retransmission timer duration is not greater than the retransmission time threshold, proceed to step S510; if retransmission timing If the duration of the device is greater than the retransmission time threshold, proceed to step S512;
  • the retransmission time threshold PING detection period/2;
  • Step S510 the DHCP server resets the retransmission timer, and retransmits the PING request, and then proceeds to step S506;
  • Step S511 the DHCP client is online, the retransmission timer is closed, and then proceeds to step S503;
  • step S512 the DHCP client is offline, and the DHCP server reclaims the IP address occupied by the client, marks the idle state, returns the pool to the free address, and deletes the client data from the address allocation table.
  • each module/unit in the above embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program stored in the memory by a processor. / instruction to achieve its corresponding function.
  • Embodiments of the invention are not limited to any specific form of combination of hardware and software.
  • IP The address recovery method includes: sending an ICMP probe packet to the dynamic host configuration protocol client; determining, according to the dynamic host configuration protocol client response to the ICMP probe packet, whether the dynamic host configuration protocol client is offline; if the dynamic host configuration protocol client Offline, reclaiming the IP address occupied by the dynamic host configuration protocol client; because the offline client does not respond to the ICMP probe packet due to shutdown, disconnection, or link failure, the IP address occupied by the client is timely. Recycling, without the IP address being occupied until the lease expires, can improve the timeliness of IP address recovery and the utilization of IP addresses.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

Disclosed are a method and device of reclaiming an IP address and a dynamic host configuration protocol (DHCP) server. The method comprises: transmitting an ICMP detection packet to a DHCP client; determining, according to a response of the DHCP client to the ICMP detection packet, whether the DHCP client is offline; and if the DHCP client is offline, reclaiming an IP address occupied by the DHCP client. As a client in an offline state caused by shutdown, a disconnection or a link failure will not respond to the ICMP detection packet, reclaiming the IP address occupied by the client in real time, rather than leaving the IP address occupied until an expiration of a subscription, facilitates real-time reclaiming and utilization of the IP address.

Description

IP地址回收方法、装置及动态主机配置协议服务器IP address recovery method, device and dynamic host configuration protocol server 技术领域Technical field
本申请涉及但不限于网络通信领域,尤其是一种IP地址回收方法、装置及动态主机配置协议服务器。The present application relates to, but is not limited to, the field of network communication, and in particular, to an IP address recovery method and apparatus, and a dynamic host configuration protocol server.
背景技术Background technique
DHCP(Dynamic Host Configuration Protocol,动态主机配置协议)基于客户/服务器(Client/Server)模型,DHCP服务器为DHCP客户端动态分配IP地址和其他参数。DHCP是一个单向驱动协议,服务器完全是被动的,其动作、行为基本完全由客户端的请求行为而激发。客户端发起IP地址的申请、续租和释放,服务器通过租期机制来管理所使用的IP地址。服务器为客户端分配可用IP地址和此IP地址的使用租期,在此租期期满时,客户端如果要继续使用此IP地址,必须发起续租请求,而在使用过程中如果想终止使用,可以发送释放请求结束租期;对于服务器端,记录每个已分配IP地址的租期,租期期满,如果客户端没有续租,则回收此IP地址,将此IP地址标记为空闲状态,并返还给地址池;如果租期没有期满,但是收到了客户端的释放请求,也会回收此IP地址,并将此IP地址标记为空闲状态,返还给地址池。从以上所述可以看到,服务器端回收IP地址的条件是租约期满或者客户端主动释放。在实际网络中经常遇到客户端关机、客户端断开网线(比如笔记本电脑被移走)、网络链路故障等情况,将会造成客户端实际已经跟服务器断开,但是服务器无法知道客户端是否在线,因此在IP地址租期内,该IP地址将一直被占用直到租期期满,而租期通常被设置为几个小时甚至几天时间,这将造成IP地址资源的不能有效利用。DHCP (Dynamic Host Configuration Protocol) is based on the client/server model. The DHCP server dynamically assigns IP addresses and other parameters to DHCP clients. DHCP is a one-way driver protocol. The server is completely passive, and its actions and behaviors are basically triggered by the client's request behavior. The client initiates the application, renewal, and release of the IP address, and the server manages the used IP address through the lease mechanism. The server allocates the available IP address and the lease term of the IP address to the client. When the lease expires, if the client wants to continue to use the IP address, the client must initiate a renewal request, and if it wants to terminate the use during use. You can send a release request to end the lease; for the server, record the lease of each assigned IP address, and the lease expires. If the client does not renew the lease, the IP address is reclaimed and the IP address is marked as idle. And return to the address pool; if the lease period has not expired, but the client's release request is received, the IP address is also reclaimed, and the IP address is marked as idle and returned to the address pool. As can be seen from the above, the condition for the server to reclaim the IP address is that the lease expires or the client actively releases. In the actual network, the client is often shut down, the client disconnects the network cable (such as the laptop is removed), the network link fails, etc., which will cause the client to actually disconnect from the server, but the server cannot know the client. Whether it is online, so during the IP address lease period, the IP address will be occupied until the lease expires, and the lease period is usually set to several hours or even several days, which will cause the IP address resources to be effectively used.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本申请要解决的主要技术问题是,提供一种IP地址回收方法、装置及动 态主机配置协议服务器,解决相关技术的IP地址回收时对因关机、断线、链路故障导致离线的客户端的IP地址不能进行及时回收导致IP资源浪费的问题。The main technical problem to be solved by the present application is to provide an IP address recovery method, device and action The host configuration protocol server solves the problem that the IP address of the client that is offline due to shutdown, disconnection, or link failure cannot be recovered in time due to shutdown of the IP address of the related technology, resulting in wasted IP resources.
为解决上述技术问题,本申请提供一种IP地址回收方法,包括:To solve the above technical problem, the present application provides an IP address recovery method, including:
向动态主机配置协议客户端发送ICMP探测报文;Send an ICMP probe packet to the dynamic host configuration protocol client.
根据所述动态主机配置协议客户端对该ICMP探测报文的响应,判断所述动态主机配置协议客户端是否离线;Determining whether the dynamic host configuration protocol client is offline according to the response of the dynamic host configuration protocol client to the ICMP probe packet;
若所述动态主机配置协议客户端离线,回收所述动态主机配置协议客户端占用的IP地址。If the dynamic host configuration protocol client is offline, the IP address occupied by the dynamic host configuration protocol client is recovered.
在本申请的一种实施例中,所述根据所述动态主机配置协议客户端对该ICMP探测报文的响应,判断所述动态主机配置协议客户端是否离线的步骤包括:In an embodiment of the present application, the step of determining whether the dynamic host configuration protocol client is offline according to the response of the dynamic host configuration protocol client to the ICMP probe packet includes:
在确定所述动态主机配置协议客户端对该ICMP探测报文正常响应时,判断所述动态主机配置协议客户端未离线;When it is determined that the dynamic host configuration protocol client responds normally to the ICMP probe packet, determining that the dynamic host configuration protocol client is not offline;
在确定所述动态主机配置协议客户端对该ICMP探测报文未正常响应时,判断所述动态主机配置协议客户端离线。When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
在本申请的一种实施例中,所述根据所述动态主机配置协议客户端对该ICMP探测报文的响应,判断所述动态主机配置协议客户端是否离线的步骤中,判断所述动态主机配置协议客户端对所述ICMP探测报文是否正常响应的方式包括:In an embodiment of the present application, the determining, according to the response of the dynamic host configuration protocol client to the ICMP probe packet, determining whether the dynamic host configuration protocol client is offline, determining the dynamic host The method for configuring the protocol client to respond to the ICMP probe packet is as follows:
向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,若连续未收到响应的次数大于或等于最大重传次数N,则判定所述动态主机配置协议客户端未正常响应;After the ICMP probe packet is sent to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If the number of consecutive responses not received is greater than or equal to the maximum number of retransmissions N, the determination is performed. The dynamic host configuration protocol client does not respond normally;
or
向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,则判断当前重传时间是否大于重传时间阈值,如果当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间不 大于重传时间阈值,则延长所述重传时间后向所述动态主机配置协议客户端重发ICMP探测报文;After the ICMP probe packet is sent to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If no response is received within the set retransmission time, the current retransmission time is determined. Whether it is greater than the retransmission time threshold, if the current retransmission time is greater than the retransmission time threshold, it is determined that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not If the retransmission time threshold is greater than the retransmission time threshold, the ICMP probe packet is resent to the dynamic host configuration protocol client after the retransmission time is extended;
or
向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,则判断连续未收到响应的次数是否大于或等于最大重传次数N,如果连续未收到响应的次数n大于或等于最大重传次数N,则判定所述动态主机配置协议客户端未正常响应;如果连续未收到响应的次数n是否小于最大重传次数N,则判断当前重传时间是否大于重传时间阈值,如果判断当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间是否不大于重传时间阈值,则延长所述重传时间后向所述动态主机配置协议客户端重发ICMP探测报文。After sending an ICMP probe message to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If no response is received within the set retransmission time, it is determined that the response is not received continuously. Whether the number of responses is greater than or equal to the maximum number of retransmissions N. If the number n of consecutive responses is greater than or equal to the maximum number of retransmissions N, it is determined that the dynamic host configuration protocol client does not respond normally; If the number of times of the response is less than the maximum number of retransmissions N, it is determined whether the current retransmission time is greater than the retransmission time threshold. If it is determined that the current retransmission time is greater than the retransmission time threshold, it is determined that the dynamic host configuration protocol client does not respond normally. If it is determined whether the current retransmission time is not greater than the retransmission time threshold, the ICMP probe message is retransmitted to the dynamic host configuration protocol client after the retransmission time is extended.
在本申请的一种实施例中,在首次进行到向动态主机配置协议客户端发送ICMP探测报文的步骤之前,所述方法还包括:判断探测周期是否期满,如果探测周期期满,则向所述动态主机配置协议客户端发送ICMP探测报文。In an embodiment of the present application, before the step of sending an ICMP probe message to the dynamic host configuration protocol client for the first time, the method further includes: determining whether the detection period expires, if the detection period expires, Sending an ICMP probe packet to the dynamic host configuration protocol client.
在本申请的一种实施例中,所述探测周期等于IP地址租期/M,所述M为正整数。In an embodiment of the present application, the detection period is equal to an IP address lease/M, and the M is a positive integer.
在本申请的一种实施例中,所述重传时间阈值等于探测周期/K;所述K为小于10的正整数。In an embodiment of the present application, the retransmission time threshold is equal to a detection period/K; and the K is a positive integer less than 10.
在本申请的一种实施例中,所述回收所述动态主机配置协议客户端占用的IP地址的步骤包括:In an embodiment of the present application, the step of reclaiming an IP address occupied by the dynamic host configuration protocol client includes:
将所述动态主机配置协议客户端从地址分配列表中删除,并将所述IP地址返还空闲地址池。The dynamic host configuration protocol client is deleted from the address allocation list, and the IP address is returned to the free address pool.
在本申请的一种实施例中,所述ICMP探测报文为ICMP Echo Request报文。In an embodiment of the present application, the ICMP probe message is an ICMP Echo Request message.
本申请另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。The application further provides a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
为了解决上述问题,本申请还提供了一种IP地址回收装置,包括: In order to solve the above problem, the present application further provides an IP address recovery apparatus, including:
报文发送模块,设置成向动态主机配置协议客户端发送ICMP探测报文;The message sending module is configured to send an ICMP probe message to the dynamic host configuration protocol client;
处理模块,设置成根据所述动态主机配置协议客户端对该ICMP探测报文的响应情况判断所述动态主机配置协议客户端是否离线;The processing module is configured to determine whether the dynamic host configuration protocol client is offline according to the response of the dynamic host configuration protocol client to the ICMP probe packet;
回收模块,设置成在所述动态主机配置协议客户端离线时,回收所述动态主机配置协议客户端占用的IP地址。And a recycling module configured to reclaim an IP address occupied by the dynamic host configuration protocol client when the dynamic host configuration protocol client is offline.
在本申请的一种实施例中,所述处理模块是设置成:In an embodiment of the present application, the processing module is configured to:
在确定所述动态主机配置协议客户端对该ICMP探测报文正常响应时,判断所述动态主机配置协议客户端未离线;When it is determined that the dynamic host configuration protocol client responds normally to the ICMP probe packet, determining that the dynamic host configuration protocol client is not offline;
在确定所述动态主机配置协议客户端对该ICMP探测报文未正常响应时,判断所述动态主机配置协议客户端离线。When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
在本申请的一种实施例中,所述处理模块是设置成判断所述动态主机配置协议客户端对所述ICMP探测报文是否正常响应的方式包括:In an embodiment of the present application, the processing module is configured to determine whether the dynamic host configuration protocol client responds normally to the ICMP probe packet, including:
处理模块在报文发送模块向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,若连续未收到响应的次数大于或等于最大重传次数N,则判定所述动态主机配置协议客户端未正常响应;After the packet sending module sends an ICMP probe packet to the dynamic host configuration protocol client, the processing module determines whether a response is received within the set retransmission time, and if the number of consecutive responses is not greater than or equal to the maximum weight If the number of transmissions is N, it is determined that the dynamic host configuration protocol client does not respond normally;
or
处理模块在报文发送模块向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,则判断当前重传时间是否大于重传时间阈值,如果当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间不大于重传时间阈值,则延长所述重传时间后向所述动态主机配置协议客户端重发ICMP探测报文;After the packet sending module sends an ICMP probe message to the dynamic host configuration protocol client, the processing module determines whether a response is received within the set retransmission time, and if no response is received within the set retransmission time. And determining whether the current retransmission time is greater than a retransmission time threshold. If the current retransmission time is greater than the retransmission time threshold, determining that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not greater than the retransmission time Threshold, after the retransmission time is extended, the ICMP probe packet is resent to the dynamic host configuration protocol client;
or
处理模块在报文发送模块向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,判断连续未收到响应的次数是否大于或等于最大重传次数N,如果连续未收到响应的次数n大于或等于最大重传次数N,则判定所述 动态主机配置协议客户端未正常响应;如果连续未收到响应的次数n是否小于最大重传次数N,则判断当前重传时间是否大于重传时间阈值,如果判断当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间是否不大于重传时间阈值,则延长所述重传时间后向所述动态主机配置协议客户端重发ICMP探测报文。After the packet sending module sends an ICMP probe message to the dynamic host configuration protocol client, the processing module determines whether a response is received within the set retransmission time, and if no response is received within the set retransmission time. And determining whether the number of times the response is not received continuously is greater than or equal to the maximum number of retransmissions N, and if the number n of consecutive responses not received is greater than or equal to the maximum number of retransmissions N, determining The dynamic host configuration protocol client does not respond normally; if the number of consecutively received responses is less than the maximum number of retransmissions N, it is determined whether the current retransmission time is greater than the retransmission time threshold, and if the current retransmission time is greater than the retransmission time Threshold, determining that the dynamic host configuration protocol client does not respond normally; if it is determined whether the current retransmission time is not greater than the retransmission time threshold, extending the retransmission time and resending the ICMP to the dynamic host configuration protocol client Probe packets.
为了解决上述问题,本申请还提供了一种动态主机配置协议服务器,包括如上所述的IP地址回收装置。In order to solve the above problem, the present application also provides a dynamic host configuration protocol server, including the IP address recovery device as described above.
本申请的有益效果是:The beneficial effects of the application are:
本申请提供了IP地址回收方法、装置及动态主机配置协议服务器,其中,IP地址回收方法包括向动态主机配置协议客户端发送ICMP探测报文;根据动态主机配置协议客户端对该ICMP探测报文的响应,判断动态主机配置协议客户端是否离线;若动态主机配置协议客户端离线,回收动态主机配置协议客户端占用的IP地址;因为因关机、断线、链路故障导致离线的客户端不会对ICMP探测报文进行响应,因此对该客户端占用的IP地址进行及时回收,而不使该IP地址一直被占用直到租期期满,可以提升IP地址回收的及时性和IP地址的利用率。The application provides an IP address recovery method, a device, and a dynamic host configuration protocol server, wherein the IP address recovery method includes sending an ICMP probe packet to the dynamic host configuration protocol client; and the client detects the ICMP probe packet according to the dynamic host configuration protocol. The response is to determine whether the dynamic host configuration protocol client is offline. If the dynamic host configuration protocol client is offline, the IP address occupied by the dynamic host configuration protocol client is reclaimed; because the offline client is not shut down due to shutdown, disconnection, or link failure. The ICMP probe packet is responded to, so the IP address occupied by the client is recovered in time, and the IP address is not occupied until the lease expires. This improves the timeliness of IP address recovery and the use of IP addresses. rate.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1为本申请实施例一中的两层组网示意图;1 is a schematic diagram of a two-layer networking in the first embodiment of the present application;
图2为本申请实施例一中的三层组网示意图;2 is a schematic diagram of a three-layer networking in the first embodiment of the present application;
图3为本申请实施例一中的IP地址回收方法流程示意图;3 is a schematic flowchart of an IP address recovery method in Embodiment 1 of the present application;
图4为本申请实施例二中的IP地址回收装置结构示意图;4 is a schematic structural diagram of an IP address recovery apparatus in Embodiment 2 of the present application;
图5为本申请实施例三中的IP地址回收方法流程示意图。FIG. 5 is a schematic flowchart of an IP address recovery method in Embodiment 3 of the present application.
本发明的较佳实施方式Preferred embodiment of the invention
下面通过具体实施方式结合附图对本申请作进一步详细说明。 The present application will be further described in detail below with reference to the accompanying drawings.
实施例一:Embodiment 1:
请参见图1和图2所示,显示网络中存在图1所示的二层组网和图2所示的三层组网。针对这些组网本实施例提供的IP地址回收方法都适用,该方法具体请参见图3所示,包括:Referring to FIG. 1 and FIG. 2, the Layer 2 networking shown in FIG. 1 and the Layer 3 networking shown in FIG. 2 are present in the network. The method for recovering the IP address provided by the embodiment of the present invention is applicable. For the specific method, as shown in FIG. 3, the method includes:
步骤S301:向动态主机配置协议客户端发送ICMP探测报文;该ICMP探测报文可以是PING请求报文,例如ICMP Echo Request报文;Step S301: Send an ICMP probe packet to the dynamic host configuration protocol client. The ICMP probe packet may be a PING request packet, such as an ICMP Echo Request packet.
步骤S302:根据动态主机配置协议客户端对该ICMP探测报文的响应,判断动态主机配置协议客户端是否离线,若动态主机配置协议客户端离线,进行到步骤S303;若动态主机配置协议客户端在线,进行到步骤S304;Step S302: According to the response of the dynamic host configuration protocol client to the ICMP probe packet, determine whether the dynamic host configuration protocol client is offline. If the dynamic host configuration protocol client is offline, go to step S303; if the dynamic host configuration protocol client Online, proceeding to step S304;
步骤S303:回收动态主机配置协议客户端占用的IP地址。Step S303: Retrieve the IP address occupied by the dynamic host configuration protocol client.
步骤S304:不回收动态主机配置协议客户端占用的IP地址。Step S304: The IP address occupied by the dynamic host configuration protocol client is not recovered.
可见,本实施例利用ICMP探测报文可主动对动态主机配置协议客户端是否在线进行判断,并在判断离线后即可立即对该动态主机配置协议客户端占用的IP地址进行回收,避免离线后的动态主机配置协议客户端的IP地址在租期内一直被占用而造成IP地址资源浪费。It can be seen that, in this embodiment, the ICMP probe packet can be used to actively determine whether the dynamic host configuration protocol client is online, and the IP address occupied by the dynamic host configuration protocol client can be immediately recovered after the offline is determined, thereby avoiding offline. The IP address of the dynamic host configuration protocol client has been occupied during the lease period, resulting in wasted IP address resources.
可选地,上述步骤S302中,根据动态主机配置协议客户端对ICMP探测报文的响应,判断动态主机配置协议客户端是否离线的步骤包括:Optionally, in the step S302, the step of determining whether the dynamic host configuration protocol client is offline according to the response of the dynamic host configuration protocol client to the ICMP probe packet includes:
在确定所述动态主机配置协议客户端对该ICMP探测报文正常响应时,判断所述动态主机配置协议客户端未离线;When it is determined that the dynamic host configuration protocol client responds normally to the ICMP probe packet, determining that the dynamic host configuration protocol client is not offline;
在确定所述动态主机配置协议客户端对该ICMP探测报文未正常响应时,判断所述动态主机配置协议客户端离线。When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
可选地,判断动态主机配置协议客户端对ICMP探测报文是否正常响应的方式可以是以下方式中的任意一种:Optionally, the method for determining whether the dynamic host configuration protocol client responds normally to the ICMP probe packet may be any one of the following manners:
方式一:向动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,若连续未收到响应的次数大于或等于最大重传次数N,则判定所述动态主机配置协议客户端未正常响应;Manner 1: After sending an ICMP probe packet to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If the number of consecutive responses not received is greater than or equal to the maximum number of retransmissions N, then the determination is performed. The dynamic host configuration protocol client does not respond normally;
方式二:向动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,则 判断当前重传时间是否大于重传时间阈值,如果当前重传时间大于重传时间阈值,则判定动态主机配置协议客户端未正常响应;如果判断当前重传时间不大于重传时间阈值,则延长重传时间后向动态主机配置协议客户端重发ICMP探测报文;Manner 2: After sending an ICMP probe packet to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If no response is received within the set retransmission time, Determining whether the current retransmission time is greater than the retransmission time threshold. If the current retransmission time is greater than the retransmission time threshold, determining that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not greater than the retransmission time threshold, the extension is extended. Retransmit the ICMP probe message to the dynamic host configuration protocol client after the retransmission time;
方式三:向动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,判断连续未收到响应的次数n是否大于或等于最大重传次数N,如果连续未收到响应的次数n大于或等于最大重传次数N,则判定动态主机配置协议客户端未正常响应;如果连续未收到响应的次数n是否小于最大重传次数N,则判断当前重传时间是否大于重传时间阈值,如果判断当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间是否不大于重传时间阈值,则延长重传时间后向所述动态主机配置协议客户端重发ICMP探测报文。Manner 3: After sending an ICMP probe message to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If no response is received within the set retransmission time, the judgment is not received continuously. Whether the number n of responses is greater than or equal to the maximum number of retransmissions N. If the number n of consecutive responses is greater than or equal to the maximum number of retransmissions N, it is determined that the dynamic host configuration protocol client does not respond normally; if the response is not received continuously If the number of times n is less than the maximum number of retransmissions N, it is determined whether the current retransmission time is greater than the retransmission time threshold. If it is determined that the current retransmission time is greater than the retransmission time threshold, it is determined that the dynamic host configuration protocol client does not respond normally; If it is determined whether the current retransmission time is not greater than the retransmission time threshold, the ICMP probe packet is retransmitted to the dynamic host configuration protocol client after the retransmission time is extended.
上述方式一和三中的最大重传次数N值可以根据具体的应用场景进行设定;上述方式二和三中延长重传时间的规则也可根据具体应用场景进行灵活设定,例如延长一固定时长,或者延长一倍等等。The value of the maximum number of retransmissions in the first mode and the third mode may be set according to a specific application scenario. The rules for extending the retransmission time in the second and third modes may also be flexibly set according to specific application scenarios, such as extending and fixing. Duration, or doubled, and so on.
可选地,在本实施例中,还可设置探测周期,只有在探测周期期满时才进行到上述步骤S301;也即在上述步骤S301中在首次进行到向动态主机配置协议客户端发送ICMP探测报文的步骤之前,所述IP地址回收方法还包括:判断探测周期是否期满,如果探测周期期满,才向动态主机配置协议客户端发送ICMP探测报文;如果探测周期没有期满,则返回判断探测周期是否期满的步骤。Optionally, in this embodiment, a detection period may also be set, and the step S301 is performed only when the detection period expires; that is, in the foregoing step S301, the ICMP is sent to the dynamic host configuration protocol client for the first time. Before the step of detecting the packet, the method for recovering the IP address further includes: determining whether the detection period expires, and if the detection period expires, sending the ICMP detection packet to the dynamic host configuration protocol client; if the detection period is not expired, Then, it returns a step of judging whether the detection period has expired.
可选地,本实施例中,也可以根据实际情况和具体应用场景,设置探测周期等于IP地址租期/M,M为正整数,M的取值可为60。可选地,本上述方式二和方式三中,也可以根据实际情况和具体应用场景,设置重传时间阈值等于探测周期/K;K为小于10的正整数,例如等于2。探测周期和重传时间都可通过相应的计时器计时。Optionally, in this embodiment, the detection period is equal to the IP address lease period/M, and M is a positive integer according to the actual situation and the specific application scenario, and the value of M may be 60. Optionally, in the foregoing manners 2 and 3, the retransmission time threshold may be equal to the detection period/K according to the actual situation and the specific application scenario; and K is a positive integer less than 10, for example, equal to 2. Both the probing period and the retransmission time can be clocked by the corresponding timer.
可选地,上述步骤S303中,所述将动态主机配置协议客户端占用的IP地址进行回收的步骤包括: Optionally, in the foregoing step S303, the step of recovering the IP address occupied by the dynamic host configuration protocol client includes:
将动态主机配置协议客户端从地址分配列表中删除,并将IP地址返还空闲地址池,且在返回空闲地址池之前,还可将其标记为空闲状态。The Dynamic Host Configuration Protocol client is removed from the address allocation list and the IP address is returned to the free address pool and can be marked as idle before being returned to the free address pool.
本发明实施例另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
实施例二:Embodiment 2:
本实施例还提供了一种IP地址回收装置,该IP地址回收装置可应用于动态主机配置协议服务器,请参见图4,其包括:The embodiment further provides an IP address recovery device, which can be applied to a dynamic host configuration protocol server. Referring to FIG. 4, the method includes:
报文发送模块1,设置成向动态主机配置协议客户端发送ICMP探测报文;The message sending module 1 is configured to send an ICMP probe message to the dynamic host configuration protocol client.
处理模块2,设置成根据动态主机配置协议客户端对该ICMP探测报文的响应,判断动态主机配置协议客户端是否离线;The processing module 2 is configured to determine, according to the dynamic host configuration protocol client response to the ICMP probe packet, whether the dynamic host configuration protocol client is offline;
回收模块3,设置成在动态主机配置协议客户端离线时,回收动态主机配置协议客户端占用的IP地址。The recovery module 3 is configured to reclaim the IP address occupied by the dynamic host configuration protocol client when the dynamic host configuration protocol client is offline.
本实施例利用ICMP探测报文可主动对动态主机配置协议客户端是否在线进行判断,并在判断离线后即可立即对该动态主机配置协议客户端占用的IP地址进行回收,避免离线后的动态主机配置协议客户端的IP地址在租期内一直被占用而造成IP地址资源浪费。In this embodiment, the ICMP probe packet can be used to actively determine whether the dynamic host configuration protocol client is online, and the IP address occupied by the dynamic host configuration protocol client can be immediately recovered after the offline is determined, thereby avoiding dynamic after offline. The IP address of the host configuration protocol client has been occupied during the lease period, resulting in wasted IP address resources.
可选地,处理模块2是设置成:Optionally, the processing module 2 is configured to:
在确定所述动态主机配置协议客户端对该ICMP探测报文正常响应时,判断所述动态主机配置协议客户端未离线;When it is determined that the dynamic host configuration protocol client responds normally to the ICMP probe packet, determining that the dynamic host configuration protocol client is not offline;
在确定所述动态主机配置协议客户端对该ICMP探测报文未正常响应时,判断所述动态主机配置协议客户端离线。When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
可选地,处理模块2是设置成判断所述动态主机配置协议客户端对该ICMP探测报文未正常响应的方式可以是以下方式中的任意一种:Optionally, the processing module 2 is configured to determine that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, and may be any one of the following manners:
方式一:处理模块2在报文发送模块1向动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,若连续未收到 响应的次数大于或等于最大重传次数N,则判定所述动态主机配置协议客户端未正常响应;Manner 1: After the packet sending module 1 sends an ICMP probe packet to the dynamic host configuration protocol client, the processing module 2 determines whether a response is received within the set retransmission time, and if the response is not received continuously If the number of responses is greater than or equal to the maximum number of retransmissions N, it is determined that the dynamic host configuration protocol client does not respond normally;
方式二:处理模块2在报文发送模块1向动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,则判断当前重传时间是否大于重传时间阈值,如果当前重传时间大于重传时间阈值,则判定动态主机配置协议客户端未正常响应;如果判断当前重传时间不大于重传时间阈值,则延长重传时间后向动态主机配置协议客户端重发ICMP探测报文;Manner 2: After the packet sending module 1 sends an ICMP probe message to the dynamic host configuration protocol client, the processing module 2 determines whether a response is received within the set retransmission time, if there is no response within the set retransmission time. If the response is received, it is determined whether the current retransmission time is greater than the retransmission time threshold. If the current retransmission time is greater than the retransmission time threshold, it is determined that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not greater than the retransmission The time threshold is used to retransmit the ICMP probe message to the dynamic host configuration protocol client after the retransmission time is extended.
方式三:处理模块2在报文发送模块1向动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,判断连续未收到响应的次数n是否大于或等于最大重传次数N,如果连续未收到响应的次数n大于或等于最大重传次数N,则判定动态主机配置协议客户端未正常响应;如果连续未收到响应的次数n是否小于最大重传次数N,则判断当前重传时间是否大于重传时间阈值,如果判断当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间是否不大于重传时间阈值,则延长重传时间后向所述动态主机配置协议客户端重发ICMP探测报文。Manner 3: After the packet sending module 1 sends an ICMP probe message to the dynamic host configuration protocol client, the processing module 2 determines whether a response is received within the set retransmission time, if there is no response within the set retransmission time. Receiving a response, determining whether the number n of consecutively received responses is greater than or equal to the maximum number of retransmissions N, and if the number n of consecutively received responses is greater than or equal to the maximum number of retransmissions N, determining that the dynamic host configuration protocol client is not If the number of consecutive times that the response is not received is less than the maximum number of retransmissions N, it is determined whether the current retransmission time is greater than the retransmission time threshold. If it is determined that the current retransmission time is greater than the retransmission time threshold, the dynamic is determined. The host configuration protocol client does not respond normally; if it is determined whether the current retransmission time is not greater than the retransmission time threshold, the ICMP probe packet is resent to the dynamic host configuration protocol client after the retransmission time is extended.
上述方式一和三中的N值可以根据具体的应用场景进行设定;上述方式二和三中延长重传时间的规则也可根据具体应用场景进行灵活设定,例如延长一固定时长,或者延长一倍等等。The values of the N values in the foregoing modes 1 and 3 can be set according to specific application scenarios. The rules for extending the retransmission time in the second and third modes can also be flexibly set according to specific application scenarios, such as extending a fixed duration or extending. Double and so on.
可选地,在本实施例中,还可设置探测周期,只有在探测周期期满时才由报文发送模块1向动态主机配置协议客户端发送ICMP探测报文;也即报文发送模块1在首次向动态主机配置协议客户端发送ICMP探测报文之前,还设置成:判断探测周期是否期满,如果探测周期期满,才向动态主机配置协议客户端发送ICMP探测报文;如果探测周期没有期满,则重新判断探测周期是否期满。Optionally, in this embodiment, the detection period may also be set, and only the packet sending module 1 sends an ICMP probe packet to the dynamic host configuration protocol client when the probe period expires; that is, the packet sending module 1 Before sending an ICMP probe packet to the dynamic host configuration protocol client for the first time, it is further configured to: determine whether the probe period expires, and send an ICMP probe packet to the dynamic host configuration protocol client if the probe period expires; If there is no expiration, it will be re-evaluated whether the detection period expires.
可选地,本实施例中,也可以根据实际情况和具体应用场景,设置探测周期等于IP地址租期/M,M为正整数,M的取值可为60。可选地,本上述方式二和方式三中,也可以根据实际情况和具体应用场景设置,设置重传 时间阈值等于探测周期/K;K为小于10的正整数,例如等于2。探测周期和重传时间都可通过相应的计时器计时。Optionally, in this embodiment, the detection period is equal to the IP address lease period/M, and M is a positive integer according to the actual situation and the specific application scenario, and the value of M may be 60. Optionally, in the foregoing manners 2 and 3, the retransmission may also be set according to the actual situation and the specific application scenario setting. The time threshold is equal to the detection period /K; K is a positive integer less than 10, for example equal to two. Both the probing period and the retransmission time can be clocked by the corresponding timer.
可选地,回收模块3是设置成:Optionally, the recycling module 3 is configured to:
将动态主机配置协议客户端从地址分配列表中删除,并将IP地址返还空闲地址池,且在返回空闲地址池之前,还可将其标记为空闲状态。The Dynamic Host Configuration Protocol client is removed from the address allocation list and the IP address is returned to the free address pool and can be marked as idle before being returned to the free address pool.
实施例三:Embodiment 3:
为了更好的理解本申请,下面以一个具体的示例对本申请做进一步的说明,请参见图5所示,包括:For a better understanding of the present application, the present application is further described below with a specific example, as shown in FIG. 5, including:
步骤S501,DHCP服务器为DHCP客户端分配IP地址,并将分配IP地址的时刻作为探测该DHCP客户端的起始时刻;Step S501: The DHCP server allocates an IP address to the DHCP client, and uses the time when the IP address is assigned as the starting time for detecting the DHCP client.
步骤S502,DHCP服务器设置PING探测周期、初始重传时间、以及探测最大允许失败次数N;Step S502, the DHCP server sets a PING detection period, an initial retransmission time, and a detection maximum allowable failure number N;
可选地,所述PING探测周期=IP地址租期/60;所述初始重传时间为3秒;所述PING探测最大允许失败次数N为3次、4次或5次;Optionally, the PING detection period=IP address lease period/60; the initial retransmission time is 3 seconds; the PING detection maximum allowable failure number N is 3 times, 4 times, or 5 times;
步骤S503,开启PING探测定时器,将探测失败次数设为0;Step S503, the PING detection timer is turned on, and the number of detection failures is set to 0;
步骤S504,判断PING探测定时器是否超时;如果PING探测定时器超时,进行到步骤S505,如果PING探测定时器没有超时,则返回判断PING探测定时器是否超时的步骤;Step S504, determining whether the PING detection timer expires; if the PING detection timer expires, proceeding to step S505, if the PING detection timer has not timed out, returning to determine whether the PING detection timer has timed out;
步骤S505,DHCP服务器向DHCP客户端发送PING请求,并对重传定时器进行初始化;Step S505, the DHCP server sends a PING request to the DHCP client, and initializes the retransmission timer.
步骤S506,判断重传定时器未超时前能否收到DHCP客户端返回的PING应答报文,如果重传定时器未超时前不能收到DHCP客户端返回的PING应答报文,进行到步骤S507;如果重传定时器未超时前可以收到DHCP客户端返回的PING应答报文,则进行到步骤S511;In step S506, it is determined whether the PING response message returned by the DHCP client is received before the retransmission timer expires. If the PING response message returned by the DHCP client cannot be received before the retransmission timer expires, the process proceeds to step S507. If the retransmission timer does not time out before receiving the PING response message returned by the DHCP client, proceeding to step S511;
步骤S507,探测失败次数加1;Step S507, the number of detection failures is increased by one;
步骤S508,判断探测失败次数是否大于探测最大允许失败次数;如果探 测失败次数不大于探测最大允许失败次数,进行到步骤S509;如果探测失败次数大于探测最大允许失败次数,进行到步骤S512;Step S508, determining whether the number of detection failures is greater than the maximum number of failed detections; If the number of failed detections is not greater than the maximum number of failed detections, the process proceeds to step S509; if the number of failed detections is greater than the maximum number of failed detections, the process proceeds to step S512;
步骤S509,DHCP服务器将重传定时器时长加长一倍,判断重传定时器时长是否大于重传时间阈值;如果重传定时器时长不大于重传时间阈值,进行到步骤S510;如果重传定时器时长大于重传时间阈值,则进行到步骤S512;In step S509, the DHCP server lengthens the retransmission timer to determine whether the retransmission timer duration is greater than the retransmission time threshold. If the retransmission timer duration is not greater than the retransmission time threshold, proceed to step S510; if retransmission timing If the duration of the device is greater than the retransmission time threshold, proceed to step S512;
可选地,所述重传时间阈值=PING探测周期/2;Optionally, the retransmission time threshold=PING detection period/2;
步骤S510,DHCP服务器重置重传定时器,并重传PING请求,再进行到步骤S506;Step S510, the DHCP server resets the retransmission timer, and retransmits the PING request, and then proceeds to step S506;
步骤S511,DHCP客户端在线,关闭重传定时器,再进行到步骤S503;Step S511, the DHCP client is online, the retransmission timer is closed, and then proceeds to step S503;
步骤S512,DHCP客户端离线,DHCP服务器收回该客户端所占用IP地址,并标记为空闲状态,返还给空闲地址池,同时将客户端数据从地址分配表中删除。In step S512, the DHCP client is offline, and the DHCP server reclaims the IP address occupied by the client, marks the idle state, returns the pool to the free address, and deletes the client data from the address allocation table.
以上内容是结合具体的实施方式对本申请所作的进一步详细说明,不能认定本申请的具体实施只局限于这些说明。对于本申请所属技术领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本申请的保护范围。The above content is a further detailed description of the present application in conjunction with the specific embodiments, and the specific implementation of the present application is not limited to the description. It will be apparent to those skilled in the art that the present invention can be made in the form of the present invention without departing from the scope of the present invention.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本发明实施例不限制于任何特定形式的硬件和软件的结合。One of ordinary skill in the art will appreciate that all or a portion of the above steps may be performed by a program to instruct related hardware, such as a processor, which may be stored in a computer readable storage medium, such as a read only memory, disk or optical disk. Wait. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the above embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program stored in the memory by a processor. / instruction to achieve its corresponding function. Embodiments of the invention are not limited to any specific form of combination of hardware and software.
工业实用性Industrial applicability
提供了IP地址回收方法、装置及动态主机配置协议服务器,其中,IP 地址回收方法包括向动态主机配置协议客户端发送ICMP探测报文;根据动态主机配置协议客户端对该ICMP探测报文的响应,判断动态主机配置协议客户端是否离线;若动态主机配置协议客户端离线,回收动态主机配置协议客户端占用的IP地址;因为因关机、断线、链路故障导致离线的客户端不会对ICMP探测报文进行响应,因此对该客户端占用的IP地址进行及时回收,而不使该IP地址一直被占用直到租期期满,可以提升IP地址回收的及时性和IP地址的利用率。 Providing an IP address recovery method, device, and dynamic host configuration protocol server, wherein IP The address recovery method includes: sending an ICMP probe packet to the dynamic host configuration protocol client; determining, according to the dynamic host configuration protocol client response to the ICMP probe packet, whether the dynamic host configuration protocol client is offline; if the dynamic host configuration protocol client Offline, reclaiming the IP address occupied by the dynamic host configuration protocol client; because the offline client does not respond to the ICMP probe packet due to shutdown, disconnection, or link failure, the IP address occupied by the client is timely. Recycling, without the IP address being occupied until the lease expires, can improve the timeliness of IP address recovery and the utilization of IP addresses.

Claims (12)

  1. 一种IP地址回收方法,包括:An IP address recovery method includes:
    向动态主机配置协议客户端发送ICMP探测报文;Send an ICMP probe packet to the dynamic host configuration protocol client.
    根据所述动态主机配置协议客户端对该ICMP探测报文的响应,判断所述动态主机配置协议客户端是否离线;Determining whether the dynamic host configuration protocol client is offline according to the response of the dynamic host configuration protocol client to the ICMP probe packet;
    若所述动态主机配置协议客户端离线,回收所述动态主机配置协议客户端占用的IP地址。If the dynamic host configuration protocol client is offline, the IP address occupied by the dynamic host configuration protocol client is recovered.
  2. 如权利要求1所述的IP地址回收方法,其中,所述根据所述动态主机配置协议客户端对该ICMP探测报文的响应,判断所述动态主机配置协议客户端是否离线的步骤包括:The method for recovering an IP address according to claim 1, wherein the step of determining whether the dynamic host configuration protocol client is offline according to the response of the dynamic host configuration protocol client to the ICMP probe message comprises:
    在确定所述动态主机配置协议客户端对该ICMP探测报文正常响应时,判断所述动态主机配置协议客户端未离线;When it is determined that the dynamic host configuration protocol client responds normally to the ICMP probe packet, determining that the dynamic host configuration protocol client is not offline;
    在确定所述动态主机配置协议客户端对该ICMP探测报文未正常响应时,判断所述动态主机配置协议客户端离线。When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
  3. 如权利要求1所述的IP地址回收方法,其中,所述根据所述动态主机配置协议客户端对该ICMP探测报文的响应,判断所述动态主机配置协议客户端是否离线的步骤中,判断所述动态主机配置协议客户端对所述ICMP探测报文是否正常响应的方式包括:The method for recovering an IP address according to claim 1, wherein the step of determining whether the dynamic host configuration protocol client is offline is determined according to the response of the dynamic host configuration protocol client to the ICMP probe packet The manner in which the dynamic host configuration protocol client responds normally to the ICMP probe packet includes:
    向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,若连续未收到响应的次数大于或等于最大重传次数N,则判定所述动态主机配置协议客户端未正常响应;After the ICMP probe packet is sent to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If the number of consecutive responses not received is greater than or equal to the maximum number of retransmissions N, the determination is performed. The dynamic host configuration protocol client does not respond normally;
    or
    向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,则判断当前重传时间是否大于重传时间阈值,如果当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间不大于重传时间阈值,则延长所述重传时间后向所述动态主机配置协议客户端重发ICMP探测报文; After the ICMP probe packet is sent to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If no response is received within the set retransmission time, the current retransmission time is determined. Whether it is greater than the retransmission time threshold, if the current retransmission time is greater than the retransmission time threshold, it is determined that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not greater than the retransmission time threshold, the weight is extended Retransmitting an ICMP probe message to the dynamic host configuration protocol client after the transmission time;
    or
    向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,则判断连续未收到响应的次数是否大于或等于最大重传次数N,如果连续未收到响应的次数n大于或等于最大重传次数N,则判定所述动态主机配置协议客户端未正常响应;如果连续未收到响应的次数n是否小于最大重传次数N,则判断当前重传时间是否大于重传时间阈值,如果判断当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间是否不大于重传时间阈值,则延长所述重传时间后向所述动态主机配置协议客户端重发ICMP探测报文。After sending an ICMP probe message to the dynamic host configuration protocol client, it is determined whether a response is received within the set retransmission time. If no response is received within the set retransmission time, it is determined that the response is not received continuously. Whether the number of responses is greater than or equal to the maximum number of retransmissions N. If the number n of consecutive responses is greater than or equal to the maximum number of retransmissions N, it is determined that the dynamic host configuration protocol client does not respond normally; If the number of times of the response is less than the maximum number of retransmissions N, it is determined whether the current retransmission time is greater than the retransmission time threshold. If it is determined that the current retransmission time is greater than the retransmission time threshold, it is determined that the dynamic host configuration protocol client does not respond normally. If it is determined whether the current retransmission time is not greater than the retransmission time threshold, the ICMP probe message is retransmitted to the dynamic host configuration protocol client after the retransmission time is extended.
  4. 如权利要求3所述的IP地址回收方法,在首次进行到向动态主机配置协议客户端发送ICMP探测报文的步骤之前,所述方法还包括:判断探测周期是否期满,如果探测周期期满,则向所述动态主机配置协议客户端发送ICMP探测报文。The method for recovering an IP address according to claim 3, before the step of transmitting an ICMP probe message to the dynamic host configuration protocol client for the first time, the method further includes: determining whether the detection period expires, if the detection period expires Sending an ICMP probe message to the dynamic host configuration protocol client.
  5. 如权利要求4所述的IP地址回收方法,其中,所述探测周期等于IP地址租期/M,所述M为正整数。The IP address recovery method according to claim 4, wherein the detection period is equal to an IP address lease/M, and the M is a positive integer.
  6. 如权利要求5所述的IP地址回收方法,其中,所述重传时间阈值等于探测周期/K;所述K为小于10的正整数。The IP address recovery method according to claim 5, wherein said retransmission time threshold is equal to a detection period / K; and said K is a positive integer less than 10.
  7. 如权利要求1-6任一项所述的IP地址回收方法,其中,所述回收所述动态主机配置协议客户端占用的IP地址的步骤包括:The method for recovering an IP address according to any one of claims 1-6, wherein the step of reclaiming an IP address occupied by the dynamic host configuration protocol client comprises:
    将所述动态主机配置协议客户端从地址分配列表中删除,并将所述IP地址返还空闲地址池。The dynamic host configuration protocol client is deleted from the address allocation list, and the IP address is returned to the free address pool.
  8. 如权利要求1-6任一项所述的IP地址回收方法,其中,所述ICMP探测报文为ICMP Echo Request报文。The method for recovering an IP address according to any one of claims 1-6, wherein the ICMP probe message is an ICMP Echo Request message.
  9. 一种IP地址回收装置,包括:An IP address recovery device includes:
    报文发送模块,设置成向动态主机配置协议客户端发送ICMP探测报文;The message sending module is configured to send an ICMP probe message to the dynamic host configuration protocol client;
    处理模块,设置成根据所述动态主机配置协议客户端对该ICMP探测报文的响应,判断所述动态主机配置协议客户端是否离线; The processing module is configured to determine, according to the dynamic host configuration protocol client response to the ICMP probe packet, whether the dynamic host configuration protocol client is offline;
    回收模块,设置成在所述动态主机配置协议客户端离线时,回收所述动态主机配置协议客户端占用的IP地址。And a recycling module configured to reclaim an IP address occupied by the dynamic host configuration protocol client when the dynamic host configuration protocol client is offline.
  10. 如权利要求9所述的IP地址回收装置,其中,所述处理模块是设置成:The IP address recovery device of claim 9, wherein the processing module is configured to:
    在确定所述动态主机配置协议客户端对该ICMP探测报文正常响应时,判断所述动态主机配置协议客户端未离线;When it is determined that the dynamic host configuration protocol client responds normally to the ICMP probe packet, determining that the dynamic host configuration protocol client is not offline;
    在确定所述动态主机配置协议客户端对该ICMP探测报文未正常响应时,判断所述动态主机配置协议客户端离线。When it is determined that the dynamic host configuration protocol client does not respond normally to the ICMP probe packet, the dynamic host configuration protocol client is determined to be offline.
  11. 如权利要求10所述的IP地址回收装置,其中,所述处理模块是设置成判断所述动态主机配置协议客户端对所述ICMP探测报文是否正常响应的方式包括:The IP address recovery device of claim 10, wherein the processing module is configured to determine whether the dynamic host configuration protocol client responds normally to the ICMP probe message, including:
    处理模块在报文发送模块向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,若连续未收到响应的次数大于或等于最大重传次数N,则判定所述动态主机配置协议客户端未正常响应;After the packet sending module sends an ICMP probe packet to the dynamic host configuration protocol client, the processing module determines whether a response is received within the set retransmission time, and if the number of consecutive responses is not greater than or equal to the maximum weight If the number of transmissions is N, it is determined that the dynamic host configuration protocol client does not respond normally;
    or
    处理模块在报文发送模块向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,则判断当前重传时间是否大于重传时间阈值,如果当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间不大于重传时间阈值,则延长所述重传时间后向所述动态主机配置协议客户端重发ICMP探测报文;After the packet sending module sends an ICMP probe message to the dynamic host configuration protocol client, the processing module determines whether a response is received within the set retransmission time, and if no response is received within the set retransmission time. And determining whether the current retransmission time is greater than a retransmission time threshold. If the current retransmission time is greater than the retransmission time threshold, determining that the dynamic host configuration protocol client does not respond normally; if it is determined that the current retransmission time is not greater than the retransmission time Threshold, after the retransmission time is extended, the ICMP probe packet is resent to the dynamic host configuration protocol client;
    or
    处理模块在报文发送模块向所述动态主机配置协议客户端发送ICMP探测报文后,判断在设定的重传时间内是否收到响应,如果在设定的重传时间内没有收到响应,判断连续未收到响应的次数是否大于或等于最大重传次数N,如果连续未收到响应的次数n大于或等于最大重传次数N,则判定所述动态主机配置协议客户端未正常响应;如果连续未收到响应的次数n是否小 于最大重传次数N,则判断当前重传时间是否大于重传时间阈值,如果判断当前重传时间大于重传时间阈值,则判定所述动态主机配置协议客户端未正常响应;如果判断当前重传时间是否不大于重传时间阈值,则延长所述重传时间后向所述动态主机配置协议客户端重发ICMP探测报文。After the packet sending module sends an ICMP probe message to the dynamic host configuration protocol client, the processing module determines whether a response is received within the set retransmission time, and if no response is received within the set retransmission time. And determining whether the number of consecutive failures of receiving the response is greater than or equal to the maximum number of retransmissions N. If the number n of consecutive responses not received is greater than or equal to the maximum number of retransmissions N, determining that the dynamic host configuration protocol client does not respond normally If the number of consecutive responses not received n is small If the maximum number of retransmissions is N, it is determined whether the current retransmission time is greater than the retransmission time threshold. If it is determined that the current retransmission time is greater than the retransmission time threshold, it is determined that the dynamic host configuration protocol client does not respond normally; If the transmission time is not greater than the retransmission time threshold, the ICMP probe packet is retransmitted to the dynamic host configuration protocol client after the retransmission time is extended.
  12. 一种动态主机配置协议服务器,包括如权利要求9-11任一项所述的IP地址回收装置。 A dynamic host configuration protocol server comprising the IP address recovery device of any of claims 9-11.
PCT/CN2016/082082 2015-06-19 2016-05-13 Method and device of reclaiming ip address and dynamic host configuration protocol server WO2016202126A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510345439.2A CN106331190A (en) 2015-06-19 2015-06-19 IP address withdrawing method and device, and dynamic host configuration protocol server
CN201510345439.2 2015-06-19

Publications (1)

Publication Number Publication Date
WO2016202126A1 true WO2016202126A1 (en) 2016-12-22

Family

ID=57544827

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/082082 WO2016202126A1 (en) 2015-06-19 2016-05-13 Method and device of reclaiming ip address and dynamic host configuration protocol server

Country Status (2)

Country Link
CN (1) CN106331190A (en)
WO (1) WO2016202126A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3800853A4 (en) * 2018-06-29 2021-06-23 Huawei Technologies Co., Ltd. Address management method and device

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106936942A (en) * 2017-03-07 2017-07-07 迈普通信技术股份有限公司 A kind of dhcp address recovery system and method
CN107172226A (en) * 2017-03-27 2017-09-15 联想(北京)有限公司 A kind of information processing method and server
CN107612660A (en) * 2017-09-28 2018-01-19 上海盈联电信科技有限公司 Network node scanning method
CN108092829B (en) * 2018-01-31 2021-07-06 深信服科技股份有限公司 Cluster splitting processing method, SDN controller and storage medium
CN113067742A (en) * 2020-01-02 2021-07-02 中国移动通信有限公司研究院 IPoE processing method and device and home gateway
CN112004161A (en) * 2020-07-09 2020-11-27 视联动力信息技术股份有限公司 Processing method and device of address resources, terminal equipment and storage medium
CN114374670B (en) * 2021-12-29 2024-04-30 中国电信股份有限公司 Method and device for managing IP resource pool, DHCP server and storage medium
CN115065664B (en) * 2022-06-17 2024-01-26 北京天融信网络安全技术有限公司 Internet protocol address recycling method, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335652A (en) * 2007-06-29 2008-12-31 华为技术有限公司 Status detection method, apparatus and system of dynamic host configuring protocol
CN101453447A (en) * 2007-12-03 2009-06-10 华为技术有限公司 Customer aging method for dynamic host configuration protocol DHCP and access equipment
US20090300176A1 (en) * 2008-06-03 2009-12-03 Canon Kabushiki Kaisha Information processing apparatus, control method therefor, and computer-readable storage medium
CN101729314A (en) * 2009-11-26 2010-06-09 福建星网锐捷网络有限公司 Method and device for recovering dynamic table entries and dynamic host configuration protocol snoopingsnooping equipment
CN103763405A (en) * 2014-01-21 2014-04-30 福建三元达通讯股份有限公司 Method for quickly recovering DHCP leases

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335652A (en) * 2007-06-29 2008-12-31 华为技术有限公司 Status detection method, apparatus and system of dynamic host configuring protocol
CN101453447A (en) * 2007-12-03 2009-06-10 华为技术有限公司 Customer aging method for dynamic host configuration protocol DHCP and access equipment
US20090300176A1 (en) * 2008-06-03 2009-12-03 Canon Kabushiki Kaisha Information processing apparatus, control method therefor, and computer-readable storage medium
CN101729314A (en) * 2009-11-26 2010-06-09 福建星网锐捷网络有限公司 Method and device for recovering dynamic table entries and dynamic host configuration protocol snoopingsnooping equipment
CN103763405A (en) * 2014-01-21 2014-04-30 福建三元达通讯股份有限公司 Method for quickly recovering DHCP leases

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3800853A4 (en) * 2018-06-29 2021-06-23 Huawei Technologies Co., Ltd. Address management method and device

Also Published As

Publication number Publication date
CN106331190A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
WO2016202126A1 (en) Method and device of reclaiming ip address and dynamic host configuration protocol server
US8838723B2 (en) High availability management system for stateless components in a distributed master-slave component topology
US8086732B1 (en) Method and apparatus for rate limiting client requests
JP4851585B2 (en) COMMUNICATION METHOD FOR SYSTEM COMPRISING CLIENT DEVICE AND MULTIPLE SERVER DEVICE, ITS COMMUNICATION PROGRAM, CLIENT DEVICE, AND SERVER DEVICE
US7496038B2 (en) Method for faster detection and retransmission of lost TCP segments
WO2019057007A1 (en) Method and device for detecting communication connection
US7971099B2 (en) Method for enabling faster recovery of client applications in the event of server failure
JP2006094510A (en) High-reliability massaging using clock with synchronized rate
JP2011119853A (en) Communication equipment and communication method
WO2013177841A1 (en) Detection method and device for link keep alive between ac and ap
CN107995233B (en) Method for establishing connection and corresponding equipment
CN103825777A (en) DMZ server switching method and device
WO2016101457A1 (en) Terminal and terminal call soft switching method
CN1917427B (en) Method and equipment for quick recovering environment of portal authentication
CN103929286A (en) Data transmission control method and device
US10680930B2 (en) Method and apparatus for communication in virtual network
CN113852445B (en) Method, system, equipment and storage medium for improving data transmission reliability
WO2016197498A1 (en) Method and device for preventing network attack, and storage medium
RU2019128102A (en) TERMINAL DEVICE, REFERENCE NETWORK DEVICE AND COMMUNICATION CONTROL METHOD
JP4645839B2 (en) Security communication apparatus and sequence number management method
JP2010205234A (en) Monitoring system, network apparatus, monitoring information providing method, and program
JP6089518B2 (en) Transfer device, transfer method, and transfer program
WO2014206235A1 (en) Message sending and processing method, device and system
JP5834365B2 (en) Method and apparatus for operation of Diameter routing
JP2017034627A (en) System and method for communication control

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16810867

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16810867

Country of ref document: EP

Kind code of ref document: A1