WO2012109841A1 - Method and apparatus for keeping network connection alive under a dynamic address configuration - Google Patents

Method and apparatus for keeping network connection alive under a dynamic address configuration Download PDF

Info

Publication number
WO2012109841A1
WO2012109841A1 PCT/CN2011/076435 CN2011076435W WO2012109841A1 WO 2012109841 A1 WO2012109841 A1 WO 2012109841A1 CN 2011076435 W CN2011076435 W CN 2011076435W WO 2012109841 A1 WO2012109841 A1 WO 2012109841A1
Authority
WO
WIPO (PCT)
Prior art keywords
network
dhcp
dynamic host
configuration protocol
host configuration
Prior art date
Application number
PCT/CN2011/076435
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 WO2012109841A1 publication Critical patent/WO2012109841A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • H04L41/0661Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities by reconfiguring faulty entities
    • 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]

Definitions

  • the present invention relates to the field of network connection networking configuration of network devices, and in particular, to a method and apparatus for network connection keep-alive under dynamic address configuration.
  • DHCP Dynamic Host Configuration Protocol
  • B00TP Bootstrap Protocol
  • RARP Reverse Address Resolution Protocol
  • B00TP is used in relatively static environments where each host has a permanent network connection.
  • the administrator creates a B00TP configuration file to define the B00TP parameters for each host.
  • this static mapping method that only provides the host ID to the host parameters is no longer applicable.
  • DHCP is added, which adds automatic allocation.
  • DHCP extends B00TP from two ways: First, DHCP allows the host to use a message to obtain all the configuration information it needs, that is, the protocol for transmitting configuration information. Second, DHCP allows the host to obtain the IP address quickly and dynamically. That is, the mechanism for dynamically allocating IP addresses.
  • DHCP is built on the client-server model, where the specified DHCP server assigns network addresses and passes configuration parameters to dynamically configured hosts.
  • a host can only function as a server when the system administrator explicitly configures the host as a DHCP server.
  • DHCP supports three types of address allocation: In automatic allocation mode, DHCP assigns a permanent IP address to the host. In dynamic allocation mode, DHCP assigns a time-limited IP address to the host. When the time arrives or the host explicitly indicates that the address is abandoned. This address can be used by other hosts again. The IP address of the host in the manual allocation mode is specified by the network administrator. DHCP only tells the host the specified IP address. In these three modes, only the dynamic allocation method can re-apply the IP address that has been assigned to the host but if the host is no longer used at this time. Use. In this way, assigning an address to a host that temporarily accesses the network or in a group does not need to be permanent
  • Dynamic allocation is especially useful when sharing a limited set of IP addresses in a host with an IP address. If a new host wants to permanently access a network and the IP address of the network is very limited, in order to reclaim the IP address when the host is eliminated in the future, dynamic allocation is also a good choice.
  • the DHCP server will inform the client (PC, modem, and any device accessing the network through the DHCP protocol) to the network configuration parameters, and inform the time limit of its use, that is, the lease. If the client uses the DHCP protocol to obtain an IP address and access the network, it must exchange a series of access packets with the DHCP server, and it is in one of six states. As shown in Figure 1, the process is as follows:
  • the client When the client starts for the first time, it first enters the INITIALIZE state. In order to start obtaining an IP address, it will contact all DHCP servers on the local network. For this reason, the client will broadcast a DHCP in its subnet. DISCOVER message, which contains the value of the network address and lease option. If the client and the DHCP server are not in a subnet, the BOOTP relay agent forwards the message to the DHCP server. After the client sends the DHCP DISCOVER broadcast message, it will go to the SELECT state.
  • DHCP OFFER message containing the available network address and other configuration information if it can respond to the client. Therefore, The client may receive zero or more DHCP OFFER response messages.
  • the client in the SELECT state receives DHCP from one or more DHCP servers.
  • the OFFER After the OFFER responds to the message, it must select one (such as the first arriving response) according to certain conditions, and send a DHCP REQUEST message to the selected DHCP server to negotiate the lease with the request.
  • the text must contain a server ID to indicate the selected server, and then the client enters the REQUEST state. If the client does not receive the DHCP OFFER packet before the timer expires, the DHCP DISCOVER broadcast packet is resent.
  • the DHCP server can satisfy the request in the request message.
  • a DHCP ACK (DHCP acknowledgment) message is sent back as a response.
  • the address that the DHCP server provides to a client in the DHCP OFFER packet cannot be provided to another client. However, if the DHCP server does not receive the DHCP REQUEST packet from the client, the DHCP server can provide the address in the DHCP OFFER packet to the client. Provided to another client.
  • the client After receiving the DHCP ACK packet containing the configuration parameters, the client checks the configuration parameters provided in the packet, configures it, and then transfers to the BOUND state. At this point, the client can start using this. Address, if there is an error in the message, send a DHCP DECLINE message and transfer to the INITIALIZE state to restart the process. If the client receives the DHCP NAK packet, it also enters the INITIALIZE state and restarts the entire process.
  • the DHCP protocol allows it to terminate the lease without waiting for the lease to expire. This is especially meaningful when the DHCP server can provide fewer IP addresses than the number of hosts connected to the network. If the client no longer needs an IP address and terminates the lease in time, the DHCP server can reclaim the address and assign it to other clients. , thereby greatly improving the utilization of network resources.
  • the client can release the address by sending a DHCP RELEASE message to the DHCP server. After the release message is sent, the client must stop using the address and cannot use this address to send other datagrams. According to Figure 1, the host that issued the DHCP RELEASE message leaves the BOUND state, and must restart the network access procedure from the INITIALIZE state before using the IP address.
  • a DHCP client When a DHCP client gets an address, it moves to the BOUND state. After entering the BOUND state, the client sets three timers: Control lease updates, rebinds, and expiration.
  • a DHCP server assigns an address to a client, it can specify a certain value for the timer; if the server does not specify a timer value, the client uses the default value.
  • the default value for the first timer is usually half of the total lease.
  • the client When the first timer expires, the client must attempt to update the lease. To request an update, the client sends a DHCP REQUEST message to the server that obtained the lease, moves to the update state and waits for a response.
  • the DHCP REQUEST message contains the IP address that the client is using and requests the server to extend the lease for this address.
  • the server can respond to the client's update request in one of two ways: Instruct the client to stop using the address or agree to the client to continue using the address. If the server agrees to send A DHCP ACK packet is sent, and the DHCP ACK packet may also contain a new value of the client timer. If the server does not agree to continue to use, it sends a DHCP NAK message, so that the client immediately stops the use of the address. After receiving the DHCP ACK packet, the client returns to the BOUND state and continues to use the address. If the DHCP NAK message is received, the client immediately stops using the address and returns to the INITIALIZE state.
  • the second timer starts after the C li en t enters the BOUND state.
  • the default value is 87.5% of the total lease.
  • the client sends the request message, it keeps updating status and waits for the response of the server. If the second timer arrives The client has not received a response from the server, and the client moves from the update state to the re-binding state. At the time of the transfer, the client assumes that the original server is unavailable and starts broadcasting the DHCP REQUEST message to any server on the local network. Any server that can serve the client may respond affirmatively (ie, extend the lease), or negate (ie, refuse to continue using the address). If the client receives a positive response, it returns to the BOUND state and resets both timers. If the client receives a negative response, it moves to the INITIALIZE state and stops using the IP address. It must reacquire a new address before continuing to use the IP address.
  • the client If the client does not receive a response from any server after the third timer expires after the client rebinds the status broadcast request message, the client must stop using the IP address, return to the INITIALIZE state, and start applying again. new address.
  • the client does not actively change its network configuration as long as the DHCP server does not fail and the network deployment does not change.
  • the worst case occurs when the client just gets the network configuration and the DHCP server fails. At this point, if the client does not restart, it must wait for seven-eighth leases. In the actual network, the lease Generally, it is 24 hours, so the user will not be able to access the Internet for almost a whole day.
  • the DHCP server is separated from the gateway server assigned to the client, then once the gateway If the server fails, the situation is even worse: Because the DHCP server is not aware of whether the gateway server is in normal working condition, the DHCP server will not adjust the configuration once the gateway server fails, then all the DHCP server configuration Clients can't access the Internet, and there is no way for the client to fix itself (this is different from scenario 1), even if there are other DHCP servers and gateway servers available on the network.
  • the technical problem to be solved by the present invention is to overcome the problems and defects in the prior art that the client cannot perform automatic monitoring and repair when the gateway device fails, and provide a network connection keep-alive method in the DHCP deployment environment. And equipment.
  • the present invention provides a network connection keep-alive method under DHCP dynamic address configuration, including:
  • the client accesses the network through the dynamic host configuration protocol, it monitors the current network connection. When the network connection fault is detected, the current network configuration is released, and the network access is re-established through the dynamic host configuration protocol.
  • the foregoing method may further have the following feature: the monitoring the connection of the current network comprises: periodically monitoring the connection of the current network.
  • the method may further include the following features, the method further includes: the client further maintaining a blacklist, and rejecting the blacklist when the client performs network access through a dynamic host configuration protocol.
  • the foregoing method may further have the following features, the method further comprising: adding, by the client, the currently associated dynamic host configuration protocol server to the blacklist when the network connection is faulty.
  • the method may further include the following feature, the method further includes: when the dynamic host configuration protocol server on the blacklist meets a preset aging condition, the dynamic host configuration protocol server is removed from the blacklist Deleted.
  • the invention also provides a network connection keep-alive device in a DHCP dynamic address configuration, comprising: a dynamic host configuration protocol module, which is configured to: perform network connection through a dynamic host configuration protocol Enter
  • a network connection monitoring module which is configured to: monitor the connection of the current network after accessing the network;
  • the network configuration adjustment module is configured to: when the network connection monitoring module detects a network connection failure, release the currently used network configuration, and instruct the dynamic host configuration protocol module to re-access the network through the dynamic host configuration protocol.
  • the foregoing apparatus may further have the following feature, the network connection monitoring module is configured to: periodically monitor a connection of a current network.
  • the device may further have the following features, the device further includes a blacklist management module, and the blacklist management module is configured to: maintain a blacklist;
  • the dynamic host configuration protocol module is further configured to: refuse to accept the service provided by the dynamic host configuration protocol server on the blacklist when performing network access through the dynamic host configuration protocol.
  • the device may further have the following features:
  • the blacklist management module is further configured to: when the network connection monitoring module detects a network connection failure, add the currently associated dynamic host configuration protocol server to the blacklist.
  • the foregoing apparatus may further have the following feature: the blacklist management module is further configured to: when the dynamic host configuration protocol server on the blacklist meets a preset aging condition, the dynamic host configuration protocol server is removed from the Remove from the blacklist.
  • the network connection monitoring module and the network configuration adjustment module are mainly added, so that the client can react and adjust the real-time status of the current network environment, thereby improving the network configuration.
  • Robustness and self-healing capabilities for connection failures saves network administrators the time to find faults and solve problems and the time users wait for network connections to be repaired.
  • Figure 1 is a state transition diagram when a DHCP client obtains an IP address using the DHCP protocol to access the network.
  • FIG. 2 is a networking diagram of a DHCP client with a session keep-alive mechanism in a real-world application
  • 3 is a network connection keep-alive device in the DHCP dynamic address configuration of the present invention
  • FIG. 4 is a workflow diagram of a DHCP client with a session keep-alive mechanism.
  • On the client side include:
  • the DHCP protocol module is used to implement the function of the client accessing the network in the DHCP environment; the network access is performed through the dynamic host configuration protocol;
  • the network connection monitoring module is configured to monitor the current network connection after accessing the network; the network configuration adjustment module is configured to perform network configuration adjustment strategies when the network connection monitoring module detects a network connection failure, including: releasing the current use The network configuration instructs the DHCP protocol module to re-access the network through the Dynamic Host Configuration Protocol.
  • the network connection monitoring module is used to periodically monitor the connection of the current network.
  • the device further includes a blacklist management module, configured to maintain a blacklist, and add the currently associated dynamic host configuration protocol server to the blacklist when the network connection monitoring module detects a network connection failure.
  • a blacklist management module configured to maintain a blacklist, and add the currently associated dynamic host configuration protocol server to the blacklist when the network connection monitoring module detects a network connection failure.
  • the dynamic host configuration protocol module is further configured to: when the network access is performed through the dynamic host configuration protocol, refuse to accept the service provided by the dynamic host configuration protocol server on the blacklist.
  • the blacklist management module is further configured to: when the dynamic host configuration protocol server on the blacklist meets a preset aging condition, delete the dynamic host configuration protocol server from the blacklist.
  • the server-side DHCP protocol module indicates that a server configured with a DHCP protocol needs to be deployed to provide a DHCP service on the network, and multiple DHCP servers and their associated gateway devices need to be deployed to provide a redundant backup mechanism, because only one set is provided.
  • the client's DHCP protocol module implements the DHCP client function on the client side to interface with the DHCP server.
  • the network connection monitoring module is responsible for monitoring the connection status with the assigned gateway server after the client obtains the network configuration information through the DHCP protocol and successfully accesses the network.
  • the invention provides a network connection keep-alive method under DHCP dynamic address configuration, which includes: after the client accesses the network through the dynamic host configuration protocol, monitors the current network connection; when the network connection fault is detected, releases the currently used network configuration. , Re-network access through the Dynamic Host Configuration Protocol.
  • the current network connection is periodically monitored.
  • the method further includes: the client further maintains a blacklist, and refuses to accept the service provided by the dynamic host configuration protocol server on the blacklist when the client accesses the network through the dynamic host configuration protocol. ;
  • the method further includes: when the client detects a network connection failure, adding the currently associated dynamic host configuration protocol server to the blacklist.
  • the method further includes deleting the dynamic host configuration protocol server from the blacklist when the dynamic host configuration protocol server on the blacklist meets a preset aging condition.
  • the network connection keep-alive method in the DHCP deployment environment of the present invention includes the following steps: Step A. Deploy two or more network service devices on the local network, where the network service device refers to a DHCP server and a matching gateway. Server
  • Step B The DHCP client performs a network access attempt through the DHCP protocol.
  • Step C If the DHCP client successfully obtains the network configuration parameters and accesses the network, the network connection monitoring module is started to monitor the connection status with the assigned gateway server. If the network access attempt fails, return to step B;
  • Step D If the network connection monitoring module finds that the connection with the assigned gateway server is normal, step E is performed, otherwise step F is performed;
  • Step E Perform normal maintenance of the client-side DHCP protocol, and restart the network connection monitoring module to perform network connection monitoring after a certain period of time, and return to step D;
  • Step F If the current gateway server is unavailable, the network configuration adjustment module sends a DHCP RELEASE message to the currently associated DHCP server, releases the currently used network configuration, and adds the DHCP server to the blacklist for later network connection. In the attempt, the service provided by the user will not be accepted again, and the process proceeds to step B again.
  • Step 1 First, when the DHCP client starts, it creates a blacklist to record the faulty DHCP server and then starts sending DHCP. DISCOVER message;
  • the aging condition is set.
  • the DHCP server in the blacklist meets the aging condition, the DHCP server is deleted from the blacklist.
  • the aging condition may be: setting a timer for the DHCP server corresponding to each blacklist entry, and deleting the DHCP server whose timer expires from the blacklist.
  • Other aging conditions can also be set as needed, which is not limited by the present invention.
  • Step 2 After receiving the DHCP OFFER packet, check whether the DHCP server responding to the packet is in the blacklist and update the blacklist. That is, traverse the blacklist and check whether the timer has timed out. The blacklist entry is deleted. If there is no timeout, it is checked whether it is the DHCP server currently responding to the DHCP OFFER message; then the next blacklist entry is processed until the traversal is completed;
  • Step 3 According to the result returned by the blacklist search operation, if the DHCP server is in the blacklist, the DHCP OFFER packet received by the DHCP server is ignored, and the DHCP OFFER packet responded by other DHCP server is processed. If no other DHCP OFFER response packet is received, the DHCP DISCOVER packet is resent and waits for the response from the DHCP server on the network. If the DHCP server is not in the blacklist, DHCP REQUEST is sent to the DHCP server. Request the network parameter configuration;
  • Step 4 After receiving the DHCP ACK message from the server and obtaining the network configuration parameters, the DHCP client starts a process (connection status monitoring process), and periodically sends an ICMP (Internet Control Message Protocol) Echo (ping) to the assigned gateway server.
  • the request message if the ICMP Echo (ping) reply message of the gateway server is not received for a certain number of times, the gateway server is considered to be faulty, and a DHCP RELEASE message is sent to the DHCP server that has obtained the lease to release the current network configuration. , add this DHCP server to the blacklist, and add the remaining entries in the blacklist.
  • the aging update is performed, the aging update is not performed at this time. When the DHCP OFFER is received, the aging update is performed. At this time, the connection status monitoring process task is completed and exits.
  • the DHCP client returns to the initialization state and resends the DHCP DISCOVER message.
  • the method of updating the blacklist list can also automatically delete the corresponding DHCP server from the blacklist when the timer expires. Or learn how to update regularly.
  • the invention is not limited thereto.
  • the network connection monitoring module and the network configuration adjustment module are mainly added, so that the client can react and adjust the real-time status of the current network environment, thereby improving the network configuration.
  • Robustness and self-healing capabilities for connection failures saves network administrators the time to find faults and solve problems and the time users wait for network connections to be repaired.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or they may be Multiple modules or steps are made into a single integrated circuit module. Thus, the invention is not limited to any particular combination of hardware and software.
  • the embodiment of the present invention mainly adds a network connection monitoring module and a network configuration adjustment module, so that the client can react and adjust the real-time status of the current network environment, thereby improving the robustness of the network configuration and
  • the self-healing capability of the connection failure saves the network administrator's ability to find faults and solve the problem and the time the user waits for the network connection to be repaired.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Small-Scale Networks (AREA)

Abstract

The present invention provides a method for keeping network connection alive under a dynamic address configuration based on dynamic host configuration protocol (DHCP), including: after a client accesses, based on DHCP, a network, it monitors the current network connection; when a network connection failure is detected, the current network configuration in use is released, and the re-access to the network based on DHCP is performed. The present invention also provides an apparatus for keeping network connection alive under a dynamic address configuration based on DHCP. By monitoring the network connection, the present invention enables the client to make response and adjustment to the real-time situation of the current network environment. The robustness of the network configuration and the self-repair capability for the connection failures are improved. Therefore, the energy of a network manager to artificially find and solve the failures is saved, and the time that a client waits for the network connection to be repaired artificially is also saved.

Description

一种动态地址配置下网络连接保活的方法和装置  Method and device for network connection keep-alive under dynamic address configuration
技术领域 Technical field
本发明涉及网络设备的网络连接组网配置领域, 尤其涉及一种动态地址 配置下网络连接保活的方法和装置。  The present invention relates to the field of network connection networking configuration of network devices, and in particular, to a method and apparatus for network connection keep-alive under dynamic address configuration.
背景技术 Background technique
在当今网络设备组网配置中, 动态主机配置协议 ( Dynamic Host Configuration Protocol, DHCP )是应用的非常广泛的一种部署方式, 多用于 企业内部的公司网络组网、 学校内部的教育网络组网等。 它属于应用层, 基 于引导协议(BOOTstrap Protocol, B00TP)。 B00TP和反向地址转换协议 (Reverse Address Resolution Protocol, RARP)类似, 用于相对静态的环境, 其 中每个主机都有一个永久的网络连接。 管理人员创建一个 B00TP配置文件 来定义每个主机的 B00TP参数。 但在主机经常移动和实际主机数目超过了 可获得的主机 IP地址时, 这种只提供从主机标识到主机参数的静态映射方式 不再适用, 为此制订了 DHCP, 它加入了自动分配可再利用的地址和附加的 配置选项的能力。 DHCP从两个方式上扩充了 B00TP: 第一, DHCP可使主 机用一个消息获取它所需要的所有配置信息, 即传送配置信息的协议; 第二, DHCP允许主机快速、 动态地获取 IP地址, 即动态分配 IP地址的机制。  In today's network device networking configuration, Dynamic Host Configuration Protocol (DHCP) is a very widely deployed deployment method. It is mostly used for corporate network networking within the enterprise, education network networking within the school, etc. . It belongs to the application layer and is based on the Bootstrap Protocol (B00TP). Similar to the Reverse Address Resolution Protocol (RARP), B00TP is used in relatively static environments where each host has a permanent network connection. The administrator creates a B00TP configuration file to define the B00TP parameters for each host. However, when the host frequently moves and the actual number of hosts exceeds the available host IP address, this static mapping method that only provides the host ID to the host parameters is no longer applicable. For this purpose, DHCP is added, which adds automatic allocation. The ability to utilize addresses and additional configuration options. DHCP extends B00TP from two ways: First, DHCP allows the host to use a message to obtain all the configuration information it needs, that is, the protocol for transmitting configuration information. Second, DHCP allows the host to obtain the IP address quickly and dynamically. That is, the mechanism for dynamically allocating IP addresses.
DHCP建立在 client-server (客户端-服务器)模型上,其中指定的 DHCP server分配网络地址并向动态配置的主机传送配置参数。只有当系统管理员明 确地配置主机作为 DHCP服务器时, 主机才能作为服务器来工作。  DHCP is built on the client-server model, where the specified DHCP server assigns network addresses and passes configuration parameters to dynamically configured hosts. A host can only function as a server when the system administrator explicitly configures the host as a DHCP server.
DHCP支持三种类型的地址分配: 自动分配方式中 DHCP给主机指定一 个永久的 IP地址; 动态分配方式中 DHCP给主机指定一个有时间限制的 IP 地址, 当时间到达或主机明确表示放弃这个地址时, 这个地址便可以再次被 其他的主机使用; 手工分配方式中主机的 IP地址是由网络管理员指定的, DHCP只是把指定的 IP地址告诉主机。 在这三种方式中, 只有动态分配的方 式可以对已经分配给主机但如果此时该主机已经不再使用的 IP地址重新加以 利用。 这样, 在给一台临时接入网络的主机分配地址或者在一组不需要永久DHCP supports three types of address allocation: In automatic allocation mode, DHCP assigns a permanent IP address to the host. In dynamic allocation mode, DHCP assigns a time-limited IP address to the host. When the time arrives or the host explicitly indicates that the address is abandoned. This address can be used by other hosts again. The IP address of the host in the manual allocation mode is specified by the network administrator. DHCP only tells the host the specified IP address. In these three modes, only the dynamic allocation method can re-apply the IP address that has been assigned to the host but if the host is no longer used at this time. Use. In this way, assigning an address to a host that temporarily accesses the network or in a group does not need to be permanent
IP地址的主机中共享一组有限的 IP地址时, 动态分配显得特别有用。 如果一 台新主机要永久地接入一个网络, 而网络的 IP地址非常有限, 为了在将来这 台主机被淘汰时能回收 IP地址, 这种情况下动态分配也是一个很好的选择。 Dynamic allocation is especially useful when sharing a limited set of IP addresses in a host with an IP address. If a new host wants to permanently access a network and the IP address of the network is very limited, in order to reclaim the IP address when the host is eliminated in the future, dynamic allocation is also a good choice.
在 DHCP的动态分配方式中, DHCP server会将网络配置参数全部告知 client ( PC机、 modem以及任何通过 DHCP协议接入网络的设备), 同时告知 其使用的时间期限, 即租约。 如果 client要使用 DHCP协议获取 IP地址、 接 入网络, 必须与 DHCP server进行一系列的接入报文交换, 且处于六个状态 之一, 如图 1所示, 过程如下:  In the dynamic allocation mode of DHCP, the DHCP server will inform the client (PC, modem, and any device accessing the network through the DHCP protocol) to the network configuration parameters, and inform the time limit of its use, that is, the lease. If the client uses the DHCP protocol to obtain an IP address and access the network, it must exchange a series of access packets with the DHCP server, and it is in one of six states. As shown in Figure 1, the process is as follows:
1、 当 client第一次启动时, 首先进入 INITIALIZE (初始化 )状态, 为了 开始获取一个 IP地址, 它会与本地网络上所有的 DHCP server联系, 为此, client会在其子网内广播一个 DHCP DISCOVER ( DHCP发现)报文, 此报文 中包含关于网络地址和租约选项的值,如果 client和 DHCP server不在一个子 网内, 则 BOOTP中继代理会把这个报文转发给 DHCP server。 client发送完 DHCP DISCOVER广播报文之后 , 转入到 SELECT (选择)状态。  1. When the client starts for the first time, it first enters the INITIALIZE state. In order to start obtaining an IP address, it will contact all DHCP servers on the local network. For this reason, the client will broadcast a DHCP in its subnet. DISCOVER message, which contains the value of the network address and lease option. If the client and the DHCP server are not in a subnet, the BOOTP relay agent forwards the message to the DHCP server. After the client sends the DHCP DISCOVER broadcast message, it will go to the SELECT state.
2、本地网络上所有的 DHCP server收到 DHCP DISCOVER广播报文之后, 如果其能够响应该 client,则广播一个包含可提供的网络地址和其他配置信息 的 DHCP OFFER ( DHCP提供)报文, 因此, client可能会收到零个或多个 DHCP OFFER响应艮文。  2. After receiving the DHCP DISCOVER broadcast message, all DHCP servers on the local network broadcast a DHCP OFFER message containing the available network address and other configuration information if it can respond to the client. Therefore, The client may receive zero or more DHCP OFFER response messages.
3、处于 SELECT状态中的 client在收到一个或多个 DHCP server的 DHCP 3. The client in the SELECT state receives DHCP from one or more DHCP servers.
OFFER响应报文后, 必须根据一定的条件从中选出一个(如第一个到达的响 应), 并向选定的 DHCP server发送 DHCP REQUEST ( DHCP请求)报文以 与其协商租用, 在这个请求报文中必须包含一个服务器标识以指明被选中的 服务器, 然后 client进入到 REQUEST (请求)状态。 如果 client在定时器超 时之前一直没有收到 DHCP OFFER报文, 则重发 DHCP DISCOVER广播报 文。 After the OFFER responds to the message, it must select one (such as the first arriving response) according to certain conditions, and send a DHCP REQUEST message to the selected DHCP server to negotiate the lease with the request. The text must contain a server ID to indicate the selected server, and then the client enters the REQUEST state. If the client does not receive the DHCP OFFER packet before the timer expires, the DHCP DISCOVER broadcast packet is resent.
4、 DHCP server在收到 DHCP REQUEST报文后, 如果可以满足请求报 文中的请求,为确认已接受请求并开始租用,则会发回一个 DHCP ACK( DHCP 确认)报文作为响应, 如果不能满足请求则发回一个 DHCP NAK ( DHCP非 确认)报文作为响应。 DHCP server在 DHCP OFFER报文中提供给某 client 的地址不能提供给另外一个 client, 但如果 DHCP server没有收到该 client的 DHCP REQUEST报文则可以把在 DHCP OFFER报文中提供给该 client的地址 提供给另外的 client。 4. After receiving the DHCP REQUEST message, the DHCP server can satisfy the request in the request message. In order to confirm that the request has been accepted and start the lease, a DHCP ACK (DHCP acknowledgment) message is sent back as a response. Send a DHCP NAK back to the request (DHCP non-DHCP Confirm) the message as a response. The address that the DHCP server provides to a client in the DHCP OFFER packet cannot be provided to another client. However, if the DHCP server does not receive the DHCP REQUEST packet from the client, the DHCP server can provide the address in the DHCP OFFER packet to the client. Provided to another client.
5、 client在收到包含配置参数的 DHCP ACK报文后, 对报文中提供的配 置参数进行检查, 同时进行配置, 之后就转移到 BOUND (已绑定)状态, 此时 client可以开始使用此地址, 如果发现报文中有错误则发送一个 DHCP DECLINE ( DHCP拒绝 ) 4艮文并转入 INITIALIZE状态以重新开始整个过程。 如果 client收到 DHCP NAK报文则同样转入 INITIALIZE状态 , 重新开始整 个过程。  After receiving the DHCP ACK packet containing the configuration parameters, the client checks the configuration parameters provided in the packet, configures it, and then transfers to the BOUND state. At this point, the client can start using this. Address, if there is an error in the message, send a DHCP DECLINE message and transfer to the INITIALIZE state to restart the process. If the client receives the DHCP NAK packet, it also enters the INITIALIZE state and restarts the entire process.
6、处于 BOUND状态的 client如果在某一时刻不再需要分配给它的 IP地 址, DHCP协议允许其终止租用, 而不必等待租约到期。 这对于 DHCP server 可以提供的 IP地址比连到网络的主机数少的情况尤其有意义, 如果 client不 再需要 IP地址时及时终止租用 , DHCP server就可以及时回收此地址并将其 分配给其他 client,从而大大提高网络资源的利用率。为了提早终止租用, client 可以通过向 DHCP server发送一个 DHCP RELEASE ( DHCP释放 ) 4艮文来释 放地址, 发送释放报文后, client必须停止该地址的使用, 不能再使用此地址 发送其他数据报。 根据图 1 所示, 发出 DHCP RELEASE报文的主机离开 BOUND状态, 并且在使用 IP地址前必须从 INITIALIZE状态重新开始网络 接入流程。  6. If the client in the BOUND state no longer needs to assign an IP address to it at a certain time, the DHCP protocol allows it to terminate the lease without waiting for the lease to expire. This is especially meaningful when the DHCP server can provide fewer IP addresses than the number of hosts connected to the network. If the client no longer needs an IP address and terminates the lease in time, the DHCP server can reclaim the address and assign it to other clients. , thereby greatly improving the utilization of network resources. In order to terminate the lease early, the client can release the address by sending a DHCP RELEASE message to the DHCP server. After the release message is sent, the client must stop using the address and cannot use this address to send other datagrams. According to Figure 1, the host that issued the DHCP RELEASE message leaves the BOUND state, and must restart the network access procedure from the INITIALIZE state before using the IP address.
当一个 DHCP client获取到地址时, 它就转移到 BOUND状态。 进入 BOUND状态以后, client设置三个定时器: 控制租用更新、 重新绑定和到期。 一个 DHCP server给 client分配地址时,可为定时器指定确定的值;如果 server 未指定定时器值, client就使用默认值。 第一个定时器的默认值通常是总租约 的一半。当第一个定时器到期时, client必须尝试更新租约。为请求更新, client 发送一个 DHCP REQUEST报文到获得租用处的 server,转移到更新状态并等 待响应。 DHCP REQUEST报文包含此 client正在使用的 IP地址,并请求 server 延长对此地址的租用。 server可以用两种方式之一响应 client的更新请求: 指 示 client停止使用该地址或同意 client继续使用该地址。 如果 server同意就发 送 DHCP ACK报文 ,在 DHCP ACK报文中也可以含有 client定时器的新数值。 如果 server不同意继续使用, 则发送一个 DHCP NAK报文, 使 client立即停 止该地址的使用。 client收到 DHCP ACK报文则返回到 BOUND状态并继续 使用地址, 如果收到 DHCP NAK ^艮文就立即停止使用地址并返回到 INITIALIZE状态。 When a DHCP client gets an address, it moves to the BOUND state. After entering the BOUND state, the client sets three timers: Control lease updates, rebinds, and expiration. When a DHCP server assigns an address to a client, it can specify a certain value for the timer; if the server does not specify a timer value, the client uses the default value. The default value for the first timer is usually half of the total lease. When the first timer expires, the client must attempt to update the lease. To request an update, the client sends a DHCP REQUEST message to the server that obtained the lease, moves to the update state and waits for a response. The DHCP REQUEST message contains the IP address that the client is using and requests the server to extend the lease for this address. The server can respond to the client's update request in one of two ways: Instruct the client to stop using the address or agree to the client to continue using the address. If the server agrees to send A DHCP ACK packet is sent, and the DHCP ACK packet may also contain a new value of the client timer. If the server does not agree to continue to use, it sends a DHCP NAK message, so that the client immediately stops the use of the address. After receiving the DHCP ACK packet, the client returns to the BOUND state and continues to use the address. If the DHCP NAK message is received, the client immediately stops using the address and returns to the INITIALIZE state.
第二个定时器在 Client进入 BOUND状态后开始设置, 默认值为总租约 的 87.5%, client发送请求报文后保持在更新状态并等待 server的响应, 如果 在第二个定时器到期时还没有收到 server的响应,则 client从更新状态转移到 重新绑定状态,在转移时, client假定原来的 server不可用,并开始广播 DHCP REQUEST ^艮文到本地网络上的任意 server。可为 client提供服务的任意 server 可能响应肯定(即延长租用 ), 或否定(即拒绝继续使用地址)。 如果 client 收到一个肯定响应, 它就返回到 BOUND状态并重置两个定时器。 如果 client 收到否定响应, 它就转移到 INITIALIZE状态, 并且停止使用 IP地址, 在继 续使用 IP地址前必须重新获取一个新地址。 The second timer starts after the C li en t enters the BOUND state. The default value is 87.5% of the total lease. After the client sends the request message, it keeps updating status and waits for the response of the server. If the second timer arrives The client has not received a response from the server, and the client moves from the update state to the re-binding state. At the time of the transfer, the client assumes that the original server is unavailable and starts broadcasting the DHCP REQUEST message to any server on the local network. Any server that can serve the client may respond affirmatively (ie, extend the lease), or negate (ie, refuse to continue using the address). If the client receives a positive response, it returns to the BOUND state and resets both timers. If the client receives a negative response, it moves to the INITIALIZE state and stops using the IP address. It must reacquire a new address before continuing to use the IP address.
如果 client在重新绑定状态广播请求报文后,在第三个定时器到期时还没 有从任何一个 server 收到响应, 则 client 必须停止使用 IP地址, 返回到 INITIALIZE状态 , 并重新开始申请一个新地址。  If the client does not receive a response from any server after the third timer expires after the client rebinds the status broadcast request message, the client must stop using the IP address, return to the INITIALIZE state, and start applying again. new address.
在 DHCP协议中,由于 client所有的网络配置均是由 DHCP server下发的, 因而只要 DHCP server没有出现故障且网络部署也没有改变时,则 client是不 会主动更改其网络配置的, 这就带来了一些问题, 考虑下面的两种组网场景: 如果 DHCP server同时也是分配给 client使用的网关服务器,那么一旦此 服务器发生故障,必然导致经其配置的 client不能上网,并且一直持续到 client 进入重绑定状态时,然后 client便会认为原来的服务器不可用,进而重新发送 DHCP DISCOVER报文以开始新一轮的网络接入流程, 此时若网络上还有其 他的 DHCP server可用, 则 client可以获取到新的网络配置并正常接入网络。 在这种场景下,最糟糕的情况发生在 client刚刚获取到网络配置, DHCP server 就出现故障, 此时 client若不重启, 则必须等待八分之七个租约, 而在现实组 网中, 租约一般都为 24小时, 则对于用户来说将几乎一整天都不能上网。  In the DHCP protocol, since all the network configurations of the client are sent by the DHCP server, the client does not actively change its network configuration as long as the DHCP server does not fail and the network deployment does not change. Some problems have arisen, consider the following two networking scenarios: If the DHCP server is also the gateway server assigned to the client, then once this server fails, the client configured by it will not be able to access the Internet, and will continue until the client enters. When the state is re-bound, the client will consider that the original server is unavailable, and then resend the DHCP DISCOVER message to start a new round of network access. At this time, if there are other DHCP servers available on the network, the client You can get a new network configuration and access the network normally. In this scenario, the worst case occurs when the client just gets the network configuration and the DHCP server fails. At this point, if the client does not restart, it must wait for seven-eighth leases. In the actual network, the lease Generally, it is 24 hours, so the user will not be able to access the Internet for almost a whole day.
如果 DHCP server与分配给 client使用的网关服务器分离,那么一旦网关 服务器发生故障, 情况要更加糟糕: 由于 DHCP server对于与其配套的网关 服务器是否处于正常工作状态并不知情, 因而一旦网关服务器发生故障后, DHCP server不会自行调整配置, 那么所有经此 DHCP server配置的 client均 不能上网, 并且对于 client来说, 没有任何方法可以自我修复(这一点与场景 1不同), 即便网络上还有其他可用的 DHCP server与网关服务器。 If the DHCP server is separated from the gateway server assigned to the client, then once the gateway If the server fails, the situation is even worse: Because the DHCP server is not aware of whether the gateway server is in normal working condition, the DHCP server will not adjust the configuration once the gateway server fails, then all the DHCP server configuration Clients can't access the Internet, and there is no way for the client to fix itself (this is different from scenario 1), even if there are other DHCP servers and gateway servers available on the network.
发明内容 Summary of the invention
本发明所要解决的技术问题是: 克服现有技术中存在的当网关设备出现 故障时, client无法进行自动监测和修复的问题和缺陷, 提供一种能在 DHCP 部署环境下, 网络连接保活方法和装置。  The technical problem to be solved by the present invention is to overcome the problems and defects in the prior art that the client cannot perform automatic monitoring and repair when the gateway device fails, and provide a network connection keep-alive method in the DHCP deployment environment. And equipment.
为了解决上述问题, 本发明提供了一种 DHCP动态地址配置下网络连接 保活方法, 包括:  In order to solve the above problem, the present invention provides a network connection keep-alive method under DHCP dynamic address configuration, including:
客户端通过动态主机配置协议接入网络后, 监测当前网络的连接; 当监 测到网络连接故障时, 释放当前使用的网络配置, 重新通过动态主机配置协 议进行网络接入。  After the client accesses the network through the dynamic host configuration protocol, it monitors the current network connection. When the network connection fault is detected, the current network configuration is released, and the network access is re-established through the dynamic host configuration protocol.
优选地, 上述方法还可具有以下特点, 所述监测当前网络的连接包括: 周期性监测当前网络的连接。  Preferably, the foregoing method may further have the following feature: the monitoring the connection of the current network comprises: periodically monitoring the connection of the current network.
优选地, 上述方法还可具有以下特点, 所述方法还包括: 所述客户端还 维护一黑名单, 在所述客户端通过动态主机配置协议进行网络接入时, 拒绝 接受所述黑名单上的动态主机配置协议服务器提供的服务。  Preferably, the method may further include the following features, the method further includes: the client further maintaining a blacklist, and rejecting the blacklist when the client performs network access through a dynamic host configuration protocol. The services provided by the Dynamic Host Configuration Protocol server.
优选地, 上述方法还可具有以下特点, 所述方法还包括: 所述客户端监 测到网络连接故障时, 将当前关联的动态主机配置协议服务器加入所述黑名 单。  Preferably, the foregoing method may further have the following features, the method further comprising: adding, by the client, the currently associated dynamic host configuration protocol server to the blacklist when the network connection is faulty.
优选地, 上述方法还可具有以下特点, 所述方法还包括, 当所述黑名单 上的动态主机配置协议服务器满足预设的老化条件时, 将所述动态主机配置 协议服务器从所述黑名单中删除。  Preferably, the method may further include the following feature, the method further includes: when the dynamic host configuration protocol server on the blacklist meets a preset aging condition, the dynamic host configuration protocol server is removed from the blacklist Deleted.
本发明还提供一种 DHCP动态地址配置下网络连接保活装置, 包括: 动态主机配置协议模块, 其设置为: 通过动态主机配置协议进行网络接 入; The invention also provides a network connection keep-alive device in a DHCP dynamic address configuration, comprising: a dynamic host configuration protocol module, which is configured to: perform network connection through a dynamic host configuration protocol Enter
网络连接监测模块, 其设置为: 在接入网络后, 监测当前网络的连接; 以及  a network connection monitoring module, which is configured to: monitor the connection of the current network after accessing the network;
网络配置调整模块, 其设置为: 当网络连接监测模块监测到网络连接故 障时, 释放当前使用的网络配置, 指示动态主机配置协议模块重新通过动态 主机配置协议进行网络接入。  The network configuration adjustment module is configured to: when the network connection monitoring module detects a network connection failure, release the currently used network configuration, and instruct the dynamic host configuration protocol module to re-access the network through the dynamic host configuration protocol.
优选地, 上述装置还可具有以下特点, 所述网络连接监测模块是设置为: 周期性监测当前网络的连接。  Preferably, the foregoing apparatus may further have the following feature, the network connection monitoring module is configured to: periodically monitor a connection of a current network.
优选地, 上述装置还可具有以下特点, 所述装置还包括黑名单管理模块, 黑名单管理模块设置为: 维护一黑名单;  Preferably, the device may further have the following features, the device further includes a blacklist management module, and the blacklist management module is configured to: maintain a blacklist;
所述动态主机配置协议模块还设置为: 在通过动态主机配置协议进行网 络接入时, 拒绝接受所述黑名单上的动态主机配置协议服务器提供的服务。  The dynamic host configuration protocol module is further configured to: refuse to accept the service provided by the dynamic host configuration protocol server on the blacklist when performing network access through the dynamic host configuration protocol.
优选地, 上述装置还可具有以下特点, 所述黑名单管理模块还设置为: 在所述网络连接监测模块监测到网络连接故障时, 将当前关联的动态主机配 置协议服务器加入所述黑名单。  Preferably, the device may further have the following features: The blacklist management module is further configured to: when the network connection monitoring module detects a network connection failure, add the currently associated dynamic host configuration protocol server to the blacklist.
优选地, 上述装置还可具有以下特点, 所述黑名单管理模块还用于: 当 所述黑名单上的动态主机配置协议服务器满足预设的老化条件时, 将该动态 主机配置协议服务器从所述黑名单中删除。  Preferably, the foregoing apparatus may further have the following feature: the blacklist management module is further configured to: when the dynamic host configuration protocol server on the blacklist meets a preset aging condition, the dynamic host configuration protocol server is removed from the Remove from the blacklist.
釆用本发明所述方法和装置, 与现有技术相比, 主要增加了网络连接监 测模块和网络配置调整模块,从而使得 client能对当前网络环境的实时状况作 出反应与调整,提高了网络配置的健壮性以及对于连接故障的自我修复能力, 从而节省了网络管理员人为查找故障并解决的精力以及用户等待网络连接人 为修复的时间。 附图概述  Compared with the prior art, the network connection monitoring module and the network configuration adjustment module are mainly added, so that the client can react and adjust the real-time status of the current network environment, thereby improving the network configuration. Robustness and self-healing capabilities for connection failures saves network administrators the time to find faults and solve problems and the time users wait for network connections to be repaired. BRIEF abstract
图 1是 DHCP client使用 DHCP协议获取 IP地址从而接入网络时的状态 迁移图;  Figure 1 is a state transition diagram when a DHCP client obtains an IP address using the DHCP protocol to access the network.
图 2是带有会话保活机制的 DHCP client在现实应用中的组网图; 图 3是本发明 DHCP动态地址配置下网络连接保活装置; 图 4是带有会话保活机制的 DHCP client的工作流程图。 2 is a networking diagram of a DHCP client with a session keep-alive mechanism in a real-world application; 3 is a network connection keep-alive device in the DHCP dynamic address configuration of the present invention; FIG. 4 is a workflow diagram of a DHCP client with a session keep-alive mechanism.
本发明的较佳实施方式 Preferred embodiment of the invention
本发明釆用以下技术方案:  The present invention uses the following technical solutions:
如图 2, 3所示:  As shown in Figure 2, 3:
在服务器端, 进行 DHCP协议模块的实现与网络部署;  On the server side, implement the DHCP protocol module and network deployment;
在客户端包括:  On the client side include:
DHCP协议模块, 用于实现 DHCP环境下客户端接入网络的功能; 通过 动态主机配置协议进行网络接入;  The DHCP protocol module is used to implement the function of the client accessing the network in the DHCP environment; the network access is performed through the dynamic host configuration protocol;
网络连接监测模块, 用于在接入网络后, 监测当前网络的连接; 网络配置调整模块, 用于当网络连接监测模块监测到网络连接故障时, 进行网络配置调整的策略, 包括: 释放当前使用的网络配置, 指示 DHCP协 议模块重新通过动态主机配置协议进行网络接入。  The network connection monitoring module is configured to monitor the current network connection after accessing the network; the network configuration adjustment module is configured to perform network configuration adjustment strategies when the network connection monitoring module detects a network connection failure, including: releasing the current use The network configuration instructs the DHCP protocol module to re-access the network through the Dynamic Host Configuration Protocol.
其中, 所述网络连接监测模块是用于周期性监测当前网络的连接。  The network connection monitoring module is used to periodically monitor the connection of the current network.
所述装置还包括黑名单管理模块, 用于维护一黑名单, 以及, 在所述网 络连接监测模块监测到网络连接故障时, 将当前关联的动态主机配置协议服 务器加入所述黑名单。  The device further includes a blacklist management module, configured to maintain a blacklist, and add the currently associated dynamic host configuration protocol server to the blacklist when the network connection monitoring module detects a network connection failure.
所述动态主机配置协议模块还用于: 在通过动态主机配置协议进行网络 接入时, 拒绝接受所述黑名单上的动态主机配置协议服务器提供的服务。  The dynamic host configuration protocol module is further configured to: when the network access is performed through the dynamic host configuration protocol, refuse to accept the service provided by the dynamic host configuration protocol server on the blacklist.
所述黑名单管理模块还用于: 当所述黑名单上的动态主机配置协议服务 器满足预设的老化条件时, 将该动态主机配置协议服务器从所述黑名单中删 除。  The blacklist management module is further configured to: when the dynamic host configuration protocol server on the blacklist meets a preset aging condition, delete the dynamic host configuration protocol server from the blacklist.
其中服务器端的 DHCP协议模块表示需要部署有配置了 DHCP协议的服 务器, 以在网络上提供 DHCP服务, 同时需要部署多台 DHCP server及其配 套的网关设备以提供冗余备份机制, 因为对于只有一套服务设备的网络环境 来说,如果服务设备发生故障,则 client毫无任何办法进行网络配置自我调整 与网络连接修复。 客户端的 DHCP协议模块是指在用户端实现 DHCP客户端 功能, 以与 DHCP server对接。 网络连接监测模块即负责当 client通过 DHCP 协议获取到网络配置信息并成功接入网络后, 对与所分配网关服务器的连接 状态进行监控, 若发现连接出现故障, 则通知网络配置调整模块对当前的网 络配置进行调整, 以达到修复网络连接、 再次能够上网的目的。 本发明提供一种 DHCP动态地址配置下网络连接保活方法, 包括: 客户端通过动态主机配置协议接入网络后, 监测当前网络的连接; 当监 测到网络连接故障时, 释放当前使用的网络配置, 重新通过动态主机配置协 议进行网络接入。 The server-side DHCP protocol module indicates that a server configured with a DHCP protocol needs to be deployed to provide a DHCP service on the network, and multiple DHCP servers and their associated gateway devices need to be deployed to provide a redundant backup mechanism, because only one set is provided. In the network environment of the service device, if the service device fails, the client has no way to adjust the network configuration itself. Repair with the network connection. The client's DHCP protocol module implements the DHCP client function on the client side to interface with the DHCP server. The network connection monitoring module is responsible for monitoring the connection status with the assigned gateway server after the client obtains the network configuration information through the DHCP protocol and successfully accesses the network. If the connection is found to be faulty, the network configuration adjustment module is notified to the current The network configuration is adjusted to achieve the purpose of repairing the network connection and being able to access the Internet again. The invention provides a network connection keep-alive method under DHCP dynamic address configuration, which includes: after the client accesses the network through the dynamic host configuration protocol, monitors the current network connection; when the network connection fault is detected, releases the currently used network configuration. , Re-network access through the Dynamic Host Configuration Protocol.
其中, 周期性监测当前网络的连接。  Among them, the current network connection is periodically monitored.
其中, 所述方法还包括: 所述客户端还维护一黑名单, 在所述客户端通 过动态主机配置协议进行网络接入时, 拒绝接受所述黑名单上的动态主机配 置协议服务器提供的服务;  The method further includes: the client further maintains a blacklist, and refuses to accept the service provided by the dynamic host configuration protocol server on the blacklist when the client accesses the network through the dynamic host configuration protocol. ;
其中, 所述方法还包括, 所述客户端监测到网络连接故障时, 将当前关 联的动态主机配置协议服务器加入所述黑名单。  The method further includes: when the client detects a network connection failure, adding the currently associated dynamic host configuration protocol server to the blacklist.
其中, 所述方法还包括, 当所述黑名单上的动态主机配置协议服务器满 足预设的老化条件时,将所述动态主机配置协议服务器从所述黑名单中删除。  The method further includes deleting the dynamic host configuration protocol server from the blacklist when the dynamic host configuration protocol server on the blacklist meets a preset aging condition.
本发明所述的 DHCP部署环境下网络连接保活方法包括以下步骤: 步骤 A. 在本地网络部署两套及以上的网络服务设备, 这里的网络服务 设备指的是 DHCP server及与之配套的网关服务器;  The network connection keep-alive method in the DHCP deployment environment of the present invention includes the following steps: Step A. Deploy two or more network service devices on the local network, where the network service device refers to a DHCP server and a matching gateway. Server
步骤 B. DHCP client通过 DHCP协议进行网络接入尝试;  Step B. The DHCP client performs a network access attempt through the DHCP protocol.
步骤 C. 若 DHCP client成功获取到网络配置参数并接入网络, 则启动网 络连接监测模块以监控与所分配的网关服务器的连接状态, 若网络接入尝试 失败, 则返回步骤 B;  Step C. If the DHCP client successfully obtains the network configuration parameters and accesses the network, the network connection monitoring module is started to monitor the connection status with the assigned gateway server. If the network access attempt fails, return to step B;
步骤 D. 若网络连接监测模块发现与所分配的网关服务器的连接正常, 则执行步骤 E, 否则执行步骤 F;  Step D. If the network connection monitoring module finds that the connection with the assigned gateway server is normal, step E is performed, otherwise step F is performed;
步骤 E. 进行 client端 DHCP协议的正常维护,并在一定时间后再次启动 网络连接监测模块进行网络连接监控, 返回步骤 D; 步骤 F. 认为当前的网关服务器不可用,则网络配置调整模块发送 DHCP RELEASE报文给当前关联的 DHCP Server, 释放当前所使用的网络配置, 并 将此 DHCP server加入黑名单以便在以后的网络接入尝试中不会再次接受其 提供的服务, 重新转入步骤 B。 Step E. Perform normal maintenance of the client-side DHCP protocol, and restart the network connection monitoring module to perform network connection monitoring after a certain period of time, and return to step D; Step F. If the current gateway server is unavailable, the network configuration adjustment module sends a DHCP RELEASE message to the currently associated DHCP server, releases the currently used network configuration, and adds the DHCP server to the blacklist for later network connection. In the attempt, the service provided by the user will not be accepted again, and the process proceeds to step B again.
下面结合附图对技术方案的实施作进一步的详细描述。  The implementation of the technical solution will be further described in detail below with reference to the accompanying drawings.
如图 4所示, 带有保活机制的 DHCP客户端的具体实现方式如下: 步骤 1 : 首先, DHCP客户端启动时创建一个黑名单列表, 用以对故障的 DHCP服务器进行记录, 然后开始发送 DHCP DISCOVER报文;  As shown in Figure 4, the DHCP client with the keep-alive mechanism is implemented as follows: Step 1: First, when the DHCP client starts, it creates a blacklist to record the faulty DHCP server and then starts sending DHCP. DISCOVER message;
其中,设置老化条件, 当黑名单列表中的 DHCP服务器满足老化条件时, 将该 DHCP服务器从黑名单列表中删除;  The aging condition is set. When the DHCP server in the blacklist meets the aging condition, the DHCP server is deleted from the blacklist.
本实施例中, 老化条件具体可为: 为每个黑名单条目对应的 DHCP服务 器均设置一个定时器, 将定时器时间到达的 DHCP服务器从黑名单列表中删 除。 也可根据需要设置其他老化条件, 本发明对此不作限定。  In this embodiment, the aging condition may be: setting a timer for the DHCP server corresponding to each blacklist entry, and deleting the DHCP server whose timer expires from the blacklist. Other aging conditions can also be set as needed, which is not limited by the present invention.
步骤 2: 收到 DHCP OFFER报文后 , 查找回应此报文的 DHCP server是 否在黑名单中, 同时更新黑名单列表, 即对黑名单列表进行遍历, 并检查其 定时器是否已超时, 若超时, 则删除此黑名单条目, 若没有超时, 则检查其 是否是当前回应 DHCP OFFER报文的 DHCP server; 然后处理下一条黑名单 条目直至遍历完成;  Step 2: After receiving the DHCP OFFER packet, check whether the DHCP server responding to the packet is in the blacklist and update the blacklist. That is, traverse the blacklist and check whether the timer has timed out. The blacklist entry is deleted. If there is no timeout, it is checked whether it is the DHCP server currently responding to the DHCP OFFER message; then the next blacklist entry is processed until the traversal is completed;
步骤 3:根据黑名单查找操作返回的结果,若此 DHCP server在黑名单中, 则对于之前收到的 DHCP OFFER报文不予理睬,并开始处理其他 DHCP server 回应的 DHCP OFFER报文, 如果长时间没有再收到其他的 DHCP OFFER回 应报文,则再次重新发送 DHCP DISCOVER报文并等待网络上的 DHCP server 的响应, 若此 DHCP server不在黑名单中, 则向此 DHCP server发送 DHCP REQUEST ^艮文以请求网络参数配置;  Step 3: According to the result returned by the blacklist search operation, if the DHCP server is in the blacklist, the DHCP OFFER packet received by the DHCP server is ignored, and the DHCP OFFER packet responded by other DHCP server is processed. If no other DHCP OFFER response packet is received, the DHCP DISCOVER packet is resent and waits for the response from the DHCP server on the network. If the DHCP server is not in the blacklist, DHCP REQUEST is sent to the DHCP server. Request the network parameter configuration;
步骤 4:在收到服务器的 DHCP ACK报文,获取了网络配置参数后, DHCP client 启动一个进程 (连接状况监测进程), 向分配的网关服务器定期发送 ICMP ( Internet控制报文协议) Echo (ping) request报文, 若连续一定次数收 不到网关服务器的 ICMP Echo (ping) reply报文的话, 则认为此网关服务器发 生故障,向获得租用处的 DHCP server发送 DHCP RELEASE报文以释放当前 网络配置, 同时将此 DHCP server加入黑名单中, 并对黑名单中的其余条目 进行老化更新, 也可以不在此时进行老化更新, 在接收到 DHCP OFFER时进 行老化更新, 此时该连接状况监测进程任务完成并退出, DHCP client返回到 初始化状态, 重新发送 DHCP DISCOVER报文。 Step 4: After receiving the DHCP ACK message from the server and obtaining the network configuration parameters, the DHCP client starts a process (connection status monitoring process), and periodically sends an ICMP (Internet Control Message Protocol) Echo (ping) to the assigned gateway server. The request message, if the ICMP Echo (ping) reply message of the gateway server is not received for a certain number of times, the gateway server is considered to be faulty, and a DHCP RELEASE message is sent to the DHCP server that has obtained the lease to release the current network configuration. , add this DHCP server to the blacklist, and add the remaining entries in the blacklist. If the aging update is performed, the aging update is not performed at this time. When the DHCP OFFER is received, the aging update is performed. At this time, the connection status monitoring process task is completed and exits. The DHCP client returns to the initialization state and resends the DHCP DISCOVER message.
对黑名单列表进行更新的方式也可以在定时器定时时间到达时自动将对 应的 DHCP服务器从黑名单列表中删除。 或者釆取定时更新的方式。 本发明 对此不作限定。  The method of updating the blacklist list can also automatically delete the corresponding DHCP server from the blacklist when the timer expires. Or learn how to update regularly. The invention is not limited thereto.
釆用本发明所述方法和装置, 与现有技术相比, 主要增加了网络连接监 测模块和网络配置调整模块,从而使得 client能对当前网络环境的实时状况作 出反应与调整,提高了网络配置的健壮性以及对于连接故障的自我修复能力, 从而节省了网络管理员人为查找故障并解决的精力以及用户等待网络连接人 为修复的时间。  Compared with the prior art, the network connection monitoring module and the network configuration adjustment module are mainly added, so that the client can react and adjust the real-time status of the current network environment, thereby improving the network configuration. Robustness and self-healing capabilities for connection failures saves network administrators the time to find faults and solve problems and the time users wait for network connections to be repaired.
显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可 以用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布 在多个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程 序代码来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 或 者将它们分别制作成各个集成电路模块, 或者将它们中的多个模块或步骤制 作成单个集成电路模块来实现。 这样, 本发明不限制于任何特定的硬件和软 件结合。  Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or they may be Multiple modules or steps are made into a single integrated circuit module. Thus, the invention is not limited to any particular combination of hardware and software.
工业实用性 Industrial applicability
与现有技术相比, 本发明的实施例主要增加了网络连接监测模块和网络 配置调整模块, 从而使得 client 能对当前网络环境的实时状况作出反应与调 整, 提高了网络配置的健壮性以及对于连接故障的自我修复能力, 从而节省 了网络管理员人为查找故障并解决的精力以及用户等待网络连接人为修复的 时间。  Compared with the prior art, the embodiment of the present invention mainly adds a network connection monitoring module and a network configuration adjustment module, so that the client can react and adjust the real-time status of the current network environment, thereby improving the robustness of the network configuration and The self-healing capability of the connection failure saves the network administrator's ability to find faults and solve the problem and the time the user waits for the network connection to be repaired.

Claims

权 利 要 求 书 Claim
1、 一种动态主机配置协议(DHCP )动态地址配置下网络连接保活方法, 包括:  A network connection keep-alive method in a dynamic host configuration protocol (DHCP) dynamic address configuration, including:
客户端通过动态主机配置协议接入网络后, 监测当前网络的连接; 当监 测到网络连接故障时, 释放当前使用的网络配置, 重新通过动态主机配置协 议进行网络接入。  After the client accesses the network through the dynamic host configuration protocol, it monitors the current network connection. When the network connection fault is detected, the current network configuration is released, and the network access is re-established through the dynamic host configuration protocol.
2、 如权利要求 1所述的方法, 其中, 所述监测当前网络的连接包括: 周 期性监测当前网络的连接。  2. The method of claim 1, wherein the monitoring the connection of the current network comprises: periodically monitoring the connection of the current network.
3、 如权利要求 1所述的方法, 其中, 所述方法还包括: 所述客户端还维 护一黑名单, 在所述客户端通过动态主机配置协议进行网络接入时, 拒绝接 受所述黑名单上的动态主机配置协议服务器提供的服务。  3. The method according to claim 1, wherein the method further comprises: the client further maintaining a blacklist, and rejecting the black when the client performs network access through a dynamic host configuration protocol. The services provided by the Dynamic Host Configuration Protocol server on the list.
4、 如权利要求 3所述的方法, 其中, 所述方法还包括: 所述客户端监测 到网络连接故障时,将当前关联的动态主机配置协议服务器加入所述黑名单。  The method of claim 3, wherein the method further comprises: adding, by the client, the currently associated dynamic host configuration protocol server to the blacklist when the network connection is faulty.
5、 如权利要求 3所述的方法, 其中, 所述方法还包括, 当所述黑名单上 的动态主机配置协议服务器满足预设的老化条件时, 将所述动态主机配置协 议服务器从所述黑名单中删除。  The method of claim 3, wherein the method further comprises: when the dynamic host configuration protocol server on the blacklist meets a preset aging condition, the dynamic host configuration protocol server from the Removed from the blacklist.
6、 一种动态主机配置协议(DHCP )动态地址配置下网络连接保活装置, 包括:  6. A network connection keep-alive device under dynamic host configuration protocol (DHCP) dynamic address configuration, including:
动态主机配置协议模块, 其设置为: 通过动态主机配置协议进行网络接 入;  A dynamic host configuration protocol module, which is configured to: perform network access through a dynamic host configuration protocol;
网络连接监测模块, 其设置为: 在接入网络后, 监测当前网络的连接; 以及  a network connection monitoring module, which is configured to: monitor the connection of the current network after accessing the network;
网络配置调整模块, 其设置为: 当网络连接监测模块监测到网络连接故 障时, 释放当前使用的网络配置, 指示动态主机配置协议模块重新通过动态 主机配置协议进行网络接入。  The network configuration adjustment module is configured to: when the network connection monitoring module detects a network connection failure, release the currently used network configuration, and instruct the dynamic host configuration protocol module to re-access the network through the dynamic host configuration protocol.
7、 如权利要求 6所述的装置, 其中, 所述网络连接监测模块是设置为: 周期性监测当前网络的连接。 7. The apparatus according to claim 6, wherein the network connection monitoring module is configured to: periodically monitor a connection of a current network.
8、 如权利要求 6所述的装置, 其中, 所述装置还包括黑名单管理模块, 所述黑名单管理模块设置为: 维护一黑名单; 所述动态主机配置协议模块还设置为: 在通过动态主机配置协议进行网 络接入时, 拒绝接受所述黑名单上的动态主机配置协议服务器提供的服务。 The device of claim 6, wherein the device further includes a blacklist management module, the blacklist management module is configured to: maintain a blacklist; and the dynamic host configuration protocol module is further configured to: When the dynamic host configuration protocol performs network access, it refuses to accept the services provided by the dynamic host configuration protocol server on the blacklist.
9、 如权利要求 8所述的装置, 其中, 所述黑名单管理模块还设置为: 在 所述网络连接监测模块监测到网络连接故障时, 将当前关联的动态主机配置 协议服务器加入所述黑名单。  The device of claim 8, wherein the blacklist management module is further configured to: when the network connection monitoring module detects a network connection failure, add the currently associated dynamic host configuration protocol server to the black List.
10、 如权利要求 8所述的装置, 其中, 所述黑名单管理模块还设置为: 当所述黑名单上的动态主机配置协议服务器满足预设的老化条件时, 将该动 态主机配置协议服务器从所述黑名单中删除。  The device of claim 8, wherein the blacklist management module is further configured to: when the dynamic host configuration protocol server on the blacklist meets a preset aging condition, the dynamic host configuration protocol server Remove from the blacklist.
PCT/CN2011/076435 2011-02-17 2011-06-27 Method and apparatus for keeping network connection alive under a dynamic address configuration WO2012109841A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110039883.3 2011-02-17
CN201110039883.3A CN102647290B (en) 2011-02-17 2011-02-17 The method and apparatus that a kind of dynamic address configuration lower network connects keep-alive

Publications (1)

Publication Number Publication Date
WO2012109841A1 true WO2012109841A1 (en) 2012-08-23

Family

ID=46659875

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076435 WO2012109841A1 (en) 2011-02-17 2011-06-27 Method and apparatus for keeping network connection alive under a dynamic address configuration

Country Status (2)

Country Link
CN (1) CN102647290B (en)
WO (1) WO2012109841A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10047015B2 (en) 2012-01-20 2018-08-14 Free Form Fibers, Llc High strength ceramic fibers and methods of fabrication
US10676391B2 (en) 2017-06-26 2020-06-09 Free Form Fibers, Llc High temperature glass-ceramic matrix with embedded reinforcement fibers
US10876227B2 (en) 2016-11-29 2020-12-29 Free Form Fibers, Llc Fiber with elemental additive(s) and method of making
US11362256B2 (en) 2017-06-27 2022-06-14 Free Form Fibers, Llc Functional high-performance fiber structure
US20220224626A1 (en) * 2021-01-12 2022-07-14 Hewlett Packard Enterprise Development Lp System and method for dynamic tuning of neighbor aging
US11761085B2 (en) 2020-08-31 2023-09-19 Free Form Fibers, Llc Composite tape with LCVD-formed additive material in constituent layer(s)
US12006605B2 (en) 2019-09-25 2024-06-11 Free Form Fibers, Llc Non-woven micro-trellis fabrics and composite or hybrid-composite materials reinforced therewith

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102904972B (en) * 2011-07-27 2017-05-03 康佳集团股份有限公司 Local area network DHCP (Dynamic host configuration protocol) address fault seamless switching method and implementation system thereof
CN105847465A (en) * 2016-06-07 2016-08-10 武汉虹信通信技术有限责任公司 Network connection monitoring method and system for DHCP (dynamic host configuration protocol)
CN106412146B (en) * 2016-11-01 2019-09-06 杭州迪普科技股份有限公司 The method and apparatus that a kind of dhcp client updates IP
CN108667944B (en) * 2017-03-30 2021-04-30 杭州海康威视数字技术股份有限公司 DHCP configuration method and DHCP client
CN111200620B (en) * 2018-11-16 2022-07-19 上海诺基亚贝尔股份有限公司 Method, apparatus and computer readable medium for updating network connection configuration

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1536838A (en) * 2003-04-09 2004-10-13 华为技术有限公司 Method for detecting user access state
CN1909482A (en) * 2005-08-05 2007-02-07 华为技术有限公司 Method for realizing detection of DHCP service performance
CN101953139A (en) * 2008-02-15 2011-01-19 思科技术公司 DHCP initialization responsive to network layer connectivity

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101197811B (en) * 2006-12-04 2011-05-11 中兴通讯股份有限公司 Method for improving server reliability in dynamic main unit configuration protocol under proxy mode
CN101090309A (en) * 2007-07-18 2007-12-19 杭州华三通信技术有限公司 Method for implementing DHCP service redundant and DHCP server
CN101729559B (en) * 2009-12-03 2012-12-19 中兴通讯股份有限公司 Method and system for realizing backup of DHCP server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1536838A (en) * 2003-04-09 2004-10-13 华为技术有限公司 Method for detecting user access state
CN1909482A (en) * 2005-08-05 2007-02-07 华为技术有限公司 Method for realizing detection of DHCP service performance
CN101953139A (en) * 2008-02-15 2011-01-19 思科技术公司 DHCP initialization responsive to network layer connectivity

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10047015B2 (en) 2012-01-20 2018-08-14 Free Form Fibers, Llc High strength ceramic fibers and methods of fabrication
US10882749B2 (en) 2012-01-20 2021-01-05 Free Form Fibers, Llc High strength ceramic fibers and methods of fabrication
US10876227B2 (en) 2016-11-29 2020-12-29 Free Form Fibers, Llc Fiber with elemental additive(s) and method of making
US11788213B2 (en) 2016-11-29 2023-10-17 Free Form Fibers, Llc Method of making a multi-composition fiber
US10676391B2 (en) 2017-06-26 2020-06-09 Free Form Fibers, Llc High temperature glass-ceramic matrix with embedded reinforcement fibers
US11362256B2 (en) 2017-06-27 2022-06-14 Free Form Fibers, Llc Functional high-performance fiber structure
US12006605B2 (en) 2019-09-25 2024-06-11 Free Form Fibers, Llc Non-woven micro-trellis fabrics and composite or hybrid-composite materials reinforced therewith
US11761085B2 (en) 2020-08-31 2023-09-19 Free Form Fibers, Llc Composite tape with LCVD-formed additive material in constituent layer(s)
US20220224626A1 (en) * 2021-01-12 2022-07-14 Hewlett Packard Enterprise Development Lp System and method for dynamic tuning of neighbor aging
US11398971B1 (en) * 2021-01-12 2022-07-26 Hewlett Packard Enterprise Development Lp System and method for dynamic tuning of neighbor aging

Also Published As

Publication number Publication date
CN102647290B (en) 2016-10-19
CN102647290A (en) 2012-08-22

Similar Documents

Publication Publication Date Title
WO2012109841A1 (en) Method and apparatus for keeping network connection alive under a dynamic address configuration
US10122679B2 (en) Method, relay agent, and system for acquiring internet protocol address in network
US6732165B1 (en) Simultaneous network configuration of multiple headless machines
Droms RFC2131: Dynamic Host Configuration Protocol
US9800457B2 (en) Network management
US9143479B2 (en) DHCP proxy in a subscriber environment
EP2369815B1 (en) Managing distributed address pools within network devices
US20050108432A1 (en) Automatic address management method
US7991856B2 (en) Network system
WO2006005790A1 (en) System, network entities and computer programs for configuration management of a dynamic host configuration protocol framework
US8924519B2 (en) Automated DNS configuration with local DNS server
US10979360B2 (en) Resource obtaining method and apparatus
WO2003036838A1 (en) A method for setting up a ipoa channel based default administration channel
US7912958B2 (en) Method and apparatus for automatic IP allocation bootstrapping of embedded network management cards used in networked uninterruptible power supplies and other supported devices
EP2658206B1 (en) Ip address configuration method, device and system
EP2888863B1 (en) Method and apparatus for configuring dhcp client
EP1641192B1 (en) Method and device for detecting connectivity termination within an internet protocol version 6 access networks
KR20050065346A (en) System and method for managing protocol network failures in a cluster system
US8291111B1 (en) Responding to a DHCPLEASEQUERY message
CN101325587A (en) Method for monitoring DHCP conversation
US20110004673A1 (en) Address determination apparatus, communication system, address determination method, and program
EP2345230B1 (en) Method and apparatus for allocating network resources from one address realm to clients in a different address realm
US7564854B2 (en) Network architecture with a light-weight TCP stack
CN111225080B (en) Method for acquiring gateway down-hanging equipment information
WO2018006684A1 (en) Message processing method and device, and router

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: 11858996

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: 11858996

Country of ref document: EP

Kind code of ref document: A1