WO2012065436A1 - Dhcp租约处理方法及装置 - Google Patents

Dhcp租约处理方法及装置 Download PDF

Info

Publication number
WO2012065436A1
WO2012065436A1 PCT/CN2011/075899 CN2011075899W WO2012065436A1 WO 2012065436 A1 WO2012065436 A1 WO 2012065436A1 CN 2011075899 W CN2011075899 W CN 2011075899W WO 2012065436 A1 WO2012065436 A1 WO 2012065436A1
Authority
WO
WIPO (PCT)
Prior art keywords
client
lease
dhcp
pool
detection
Prior art date
Application number
PCT/CN2011/075899
Other languages
English (en)
French (fr)
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 WO2012065436A1 publication Critical patent/WO2012065436A1/zh

Links

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/5053Lease time; Renewal aspects
    • 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 data communication or, in particular, to a DHCP (Dynamic Host Control Protocol) lease processing method and apparatus.
  • DHCP Dynamic Host Control Protocol
  • BACKGROUND In order to avoid the permanent allocation of IP (Internet Protocol) addresses to clients, resulting in insufficient IP address resources, a lease function is provided in DHCP to avoid this situation.
  • the IP address assigned to the client has a certain lease period. For example, the lease period of the Microsoft DHCP server defaults to 8 days. When the lease expires, if the client does not renew the lease, the DHCP server will reclaim the IP address assigned to the client and provide other clients that need the IP address.
  • a primary object of the present invention is to provide a method and apparatus for processing a dynamic host control protocol DHCP lease to solve at least the problem of reduced IP address resource utilization in the related art.
  • a DHCP lease processing method including: obtaining, from a leased pool, a DHCP lease of a client, and sending, to the client, a detection packet that detects whether the DHCP lease of the client is valid, And storing, in the lease pool, the DHCP lease that is currently in use and the client information that is currently valid; and if the response information fed back by the client is not received within the preset time period, resending the If the response message sent by the client is not received, the DHCP lease of the client is invalid, and the resource occupied by the DHCP lease of the client is released.
  • N is a natural number.
  • the obtaining the DHCP lease of the client from the lease pool includes: using the lease detection timer to periodically obtain the DHCP lease of the client from the lease pool, when the lease detection timer expires, from the lease pool in use Obtain the client's DHCP lease.
  • the lease detection timer has a timing of 1 hour.
  • Sending, to the client, a detection packet that is valid for detecting whether the DHCP lease of the client is valid, the method includes: sending, by the client, an address resolution protocol arp packet to the client when the client is in the same subnet as the DHCP server; When the client is not in the same subnet as the DHCP server, the Internet Information Control Protocol icmp message is sent to the client.
  • the releasing the resources occupied by the DHCP lease of the client includes: releasing the resources occupied by the DHCP lease of the client to the overdue lease pool, where the overdue lease pool stores the DHCP lease that has been released in advance and the previous occupation
  • a DHCP lease processing apparatus including: a sending unit, configured to: obtain, from a leased pool, a DHCP lease of a client, and send, to the client, whether to detect a DHCP lease of the client a valid detection packet, where the stored and currently valid DHCP lease and the client information corresponding thereto are stored in the lease pool; if the response of the client is not received within a preset time period, Sending the detection message; the determining unit is configured to: if the detection message sent by the client does not receive the response information fed back by the client, determine that the DHCP lease of the client is invalid, and release the The resource occupied by the client's DHCP lease, where N is a natural number.
  • the sending unit is further configured to: when the client is in the same subnet as the DHCP server, send an address resolution protocol arp message to the client; when the client is not in the same subnet as the DHCP server When the network is in the network, an Internet Information Control Protocol (ICMP) message is sent to the client.
  • ICMP Internet Information Control Protocol
  • the determining unit is further configured to: release the resource occupied by the DHCP lease of the client to the overdue lease pool, where the overdue lease pool stores the DHCP lease that has been released in advance and the DHCP lease that has previously expired Client information.
  • the DHCP lease of the client and the client is used in the lease pool, and the validity of the DHCP lease is detected.
  • the DHCP lease of the client is invalid, and the resources occupied by the DHCP lease of the client are released.
  • the resources occupied by the client that no longer needs the lease can be released, and can be subsequently allocated to other clients for use, thereby improving the availability of the IP address resource. .
  • FIG. 1 is a process flow diagram of a DHCP lease processing method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a process for detecting lease validity according to an embodiment of the present invention
  • FIG. 3 is a flowchart according to the present invention.
  • FIG. 4 is a schematic structural diagram of a DHCP lease processing apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a lease detection module according to an embodiment of the present invention.
  • BEST MODE FOR CARRYING OUT THE INVENTION the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
  • some customers who use the lease no longer need the lease such as: failure, shutdown, etc., but the IP address resources still occupied by these leases cannot be provided to other needs.
  • the client of the lease uses the IP address resource utilization.
  • the embodiment of the present invention provides a DHCP lease processing method, and the processing flow thereof is as shown in FIG.
  • Step 102 Obtain a DHCP lease of the client from the lease pool, and send a detection packet to the client to check whether the DHCP lease of the client is valid, and store, in the lease pool, the currently valid DHCP lease and corresponding thereto.
  • the client information is obtained;
  • Step 104 If the response information fed back by the client is not received within the preset time period, the detection message is resent;
  • Step 106 If the detection message sent consecutively N times does not receive the client
  • the feedback response information determines that the DHCP lease of the client is invalid, and releases the resources occupied by the DHCP lease of the client, where N is a natural number.
  • the DHCP lease of the client and the client is obtained from the lease pool, and the validity of the DHCP lease is detected, and if the detection message sent by the N consecutive times does not receive the response information fed back by the client.
  • the DHCP lease of the client is invalid, and the resources occupied by the DHCP lease of the client are released.
  • the resources occupied by the client that no longer needs the lease can be released, and can be subsequently allocated to other clients for use, thereby improving the availability of the IP address resource. rate.
  • the DHCP lease from the leased pool and the client can have multiple implementation modes.
  • the lease detection timer can be used to periodically obtain the client's DHCP lease from the lease pool. When the lease is detected.
  • the client's DHCP lease is obtained from the lease pool.
  • the above lease detection step is triggered by the detection timer period, which can be set by the user, for example, 50 minutes, 50 seconds, etc.; usually the default is 1 hour.
  • the detection packet can be used in multiple ways, including the address resolution protocol arp packet and the Internet information control protocol icmp packet.
  • the implementation environment of each detection packet is as follows: When the client and the DHCP server are in the same subnet If the client is not in the same subnet as the DHCP server, the client sends an icmp packet to the client.
  • the resources occupied by the DHCP lease of the client are released, and the resources occupied by the client's DHCP lease are released to the overdue lease pool, wherein the overdue lease pool stores the DHCP lease that has been released and the previously leased DHCP lease.
  • Client information if the resources in the available lease pool are used up, the resources can be obtained from the overdue lease pool and then allocated to the client, thereby improving the utilization of the IP address resource.
  • the detection message is resent, and the response timeout timer is used to control, if the response timeout timer expires If the response information fed back by the client is not received, the detection packet is resent.
  • the time to respond to the timeout timer can also be set by the user, for example, 15 minutes, 20 seconds, etc., usually defaults to 2 seconds. Generally, if the client does not respond to the detection message sent more than 3 times, it is considered that the client does not need the DHCP lease originally occupied by the client and releases its corresponding resources.
  • the method provided by the embodiment of the present invention can add a lease legality detection function on the DHCP server, and detect the legality of the client lease by sending an arp packet or an icmp packet, which is simple to implement, does not need to modify the protocol, and only needs to be This can be achieved by adding the above functions to the existing DHCP server function.
  • the flow of the lease validity check is described.
  • Step 202 Configure the lease validity detection parameters (whether the detection is enabled, the response timeout period (default is 2 seconds), the maximum number of detections (default is 3) Times), detection period (default 1 hour));
  • Step 204 triggering lease detection when the detection period expires;
  • Step 206 resetting the detection timer;
  • Step 208 obtaining an undetected lease from the in-use lease pool, if the acquisition fails , indicating that all the leases have been detected, step 210 and step 204 are performed in sequence, otherwise step 212 is performed; step 210, the detection identifiers of all leases are cleared; step 212, the obtained lease is marked with a detection identifier, and the number of detections is set to 0;
  • Step 214 Determine whether the maximum number of detections is met.
  • Step 216 Send detection 4 ⁇ , the number of detections is increased by 1.
  • Step 220 if the detection response is received before the response timeout timer expires, then Step 206, otherwise, step 4 is performed 214;
  • a typical networking of the network environment to which the embodiment of the present invention is applied is as shown in FIG.
  • an embodiment of the present invention further provides a DHCP lease processing apparatus, which is configured as shown in FIG. 4, and includes: a sending unit 401, configured to acquire a DHCP lease of a client from a leased pool, to a client.
  • the determining unit 402 is configured to: if the detection message sent by the N consecutive times does not receive the response information fed back by the client, determine that the DHCP lease of the client is invalid, and release the DHCP lease of the client. Occupied resources, where N is a natural number.
  • the sending unit 401 may be further configured to: when the client is in the same subnet as the DHCP server, send an arp message to the client; when the client is not in the same subnet as the DHCP server, to the client The terminal sends an icmp packet.
  • the determining unit 402 may be further configured to: release the resource occupied by the client's DHCP lease to the overdue lease pool, where the overdue lease pool stores the DHCP lease that has been released in excess and the DHCP lease that has been previously released. Client information.
  • the embodiment of the present invention can implement a lease detection module on the DHCP server.
  • the module and the DHCP server function module need to exchange lease detection information, and the DHCP server is configured to release the available IP address resources in advance.
  • the lease detection module includes the following functional units: a timer function unit, a lease management unit, a detection message sending unit, a detection message receiving unit, and a detection control unit. See Figure 5 for the relationship between the units.
  • the timer function unit manages two timers: a detection timer and a response timeout timer.
  • the detection timer duration must be greater than the response timeout timer duration.
  • the detection timer timing loop trigger detection operation, the default is 1 hour, or the user can manually specify the detection duration.
  • the response timeout timer is used to trigger the timeout event. The validity of the lease is judged in the timeout event.
  • the timeout period is 2 seconds by default.
  • the timeout period can also be manually specified by the user.
  • the lease management unit provides management and maintenance functions for the lease pool.
  • the overdue lease pool the lease information that has been released in the overdue period and the user information that previously occupied the lease are stored, and the lease information stored in the lease pool that has not been used is used.
  • the main operations are: The detection timer expires in the timer function unit expires, the trigger detection control unit acquires a lease user information from the lease pool, and initiates a lease validity detection; the detection control unit determines a lease to be released, Notifying the tenancy management unit to release the user information of the relevant lease in the leased pool; and placing the lease information of the user into the overdue lease pool; the DHCP server function module triggers the lease management unit to obtain an available lease information from the available lease pool, If the available lease pool is empty, it is obtained from the overdue lease pool; the lease that is normally overdue in the available lease pool is placed in the overdue lease pool.
  • the detection transmission unit is configured to construct and transmit an arp or icmp 4 text execution detection function, and the detection operation is triggered by the detection control unit.
  • the detection receiving unit receives the detection response message (arp or icmp response 4) or responds to the timeout event of the timeout timer, and notifies the detection control unit.
  • the detection control unit cooperates with several other functional units to complete lease detection and lease management
  • Determining the lease to be detected notifying the detection message sending unit to perform the detection; at the same time, recording the detected lease information (the detected client IP address, the detected number of times)row receiving the detection result notification of the detection message receiving unit, Trigger detection operation: If the correct response message is received, the detection control unit will trigger the legality detection of the next lease. If it is a timeout event, and the number of detections does not satisfy the maximum number of detections (the default is 3 times), it needs to be for the current lease. Re-initiate detection, otherwise trigger detection of the next lease.
  • the detection operation frequency is controlled by the timer control unit, and the detection timer expires, and the lease is determined to trigger the detection, and the detection action is triggered.
  • the present invention achieves the following technical effects:
  • the DHCP lease from the leased pool and the client is used, and the
  • the DHCP lease of the client is invalid, and the resources occupied by the client's DHCP lease are released.
  • the resources occupied by the client are released, and can be subsequently allocated to other clients for use, which improves the availability of IP address resources.

Landscapes

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

Description

DHCP租约处理方法^置 技术领域 本发明涉及数据通信领 i或, 具体而言, 涉及一种 DHCP ( Dynamic Host Control Protocol , 动态主机控制协议) 租约处理方法及装置。 背景技术 为了避免 IP ( Internet Protocol , 因特网协议 ) 地址永久的分配给客户端, 导致 IP地址资源不足, DHCP中提供了租约功能来避免这种情况。 分配给客户 端的 IP地址都有一定的租约期, 例如, 微软 DHCP服务器的租约期默认为 8 天。 当租约到期后, 如果客户端没有续租约, 则 DHCP服务器会收回分配给该 客户端的 IP地址, 提供其他需要 IP地址的客户端使用。 在租约到期前, 存在 某些使用租约的客户端不再需要该租约的情况, 比如: 发生故障, 关机等, 但 是这些租约仍占用的 IP地址资源不能提供给其他需要租约的客户端使用,导致 IP地址资源利用率降氐。 针对相关技术中 IP地址资源利用率降低的问题,目前尚未提出有效的解决 方案。 发明内容 本发明的主要目的在于提供一种动态主机控制协议 DHCP 租约处理方法 及装置, 以至少解决上述相关技术中 IP地址资源利用率降低的问题。 根据本发明的一个方面, 提供了一种 DHCP租约处理方法, 包括: 从在用 租约池中获取客户端的 DHCP 租约, 向所述客户端发送检测所述客户端的 DHCP租约是否有效的检测报文, 其中, 所述在用租约池中存储正在使用且当 前有效的 DHCP租约及与其对应的客户端信息; 若在预设时间段内未收到所述 客户端反馈的响应信息, 则重新发送所述检测报文; 若连续 N次发送的所述检 测报文均未收到所述客户端反馈的响应信息, 则确定所述客户端的 DHCP租约 无效, 并释放所述客户端的 DHCP租约占用的资源, 其中, N为自然数。 所述从在用租约池中获取客户端的 DHCP租约, 包括: 利用租约检测定时 器周期性从在用租约池中获取客户端的 DHCP 租约, 所述租约检测定时器到 时, 从在用租约池中获取客户端的 DHCP租约。 所述租约检测定时器定时时间为 1小时。 向所述客户端发送检测所述客户端的 DHCP租约是否有效的检测报文, 包 括: 当所述客户端与 DHCP服务器在同一个子网中时, 向所述客户端发送地址 解析协议 arp报文; 当所述客户端与 DHCP服务器不在同一个子网中时, 向所 述客户端发送因特网信息控制协议 icmp报文。 所述释放所述客户端的 DHCP 租约占用的资源, 包括: 将所述客户端的 DHCP租约占用的资源释放至超期租约池, 其中, 所述超期租约池中存储已超 期释放的 DHCP租约以及之前占用所述已超期释放的 DHCP租约的客户端信 息。 所述若在预设时间段内未收到所述客户端反馈的响应信息, 则重新发送所 述检测 4艮文, 包括: 利用响应超时定时器等待客户的响应, 若所述响应超时定 时器超时仍未收到所述客户端反馈的响应信息, 则重新发送所述检测报文, 其 中, 所述响应超时定时器定时时间为 2秒。
N=3。 根据本发明的另一方面, 提供了一种 DHCP租约处理装置, 包括: 发送单 元, 设置为从在用租约池中获取客户端的 DHCP租约, 向所述客户端发送检测 所述客户端的 DHCP租约是否有效的检测报文, 其中, 所述在用租约池中存储 正在使用且当前有效的 DHCP租约及与其对应的客户端信息; 若在预设时间段 内未收到所述客户端的响应, 则重新发送所述检测报文; 确定单元, 设置为若 连续 N次发送的所述检测报文均未收到所述客户端反馈的响应信息,则确定所 述客户端的 DHCP租约无效, 并释放所述客户端的 DHCP租约占用的资源, 其 中, N为自然数。 所述发送单元还设置为: 当所述客户端与 DHCP 月艮务器在同一个子网中 时, 向所述客户端发送地址解析协议 arp报文; 当所述客户端与 DHCP服务器 不在同一个子网中时, 向所述客户端发送因特网信息控制协议 icmp报文。 所述确定单元还设置为: 将所述客户端的 DHCP租约占用的资源释放至超 期租约池, 其中, 所述超期租约池中存储已超期释放的 DHCP租约以及之前占 用所述已超期释放的 DHCP租约的客户端信息。 在本发明实施例中, 从在用租约池中获耳又客户端的 DHCP租约, 并检测该 DHCP租约的有效性, 若连续 N次发送的检测报文均未收到客户端反馈的响应 信息, 则确定客户端的 DHCP租约无效, 并释放客户端的 DHCP租约占用的资 源, 可以将不再需要租约的客户端占用的资源释放, 后续可以分配给其他客户 端使用, 提高了 IP地址资源的可利用率。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不 当限定。 在附图中: 图 1是根据本发明实施例的 DHCP租约处理方法的处理流程图; 图 2是根据本发明实施例的对租约有效性检测的处理流程图; 图 3是才艮据本发明实施例的 DHCP租约处理的典型组网示意图; 图 4是根据本发明实施例的 DHCP租约处理装置的结构示意图; 图 5是根据本发明实施例的租约检测模块的结构示意图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不 冲突的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 相关技术中提到, 在租约到期前, 存在某些使用租约的客户端不再需要该 租约的情况, 比如: 发生故障, 关机等, 但是这些租约仍占用的 IP地址资源不 能提供给其他需要租约的客户端使用, 导致 IP地址资源利用率降低。 为解决上 述技术问题, 本发明实施例提供了一种 DHCP租约处理方法, 其处理流程如图 1所示, 包括: 步骤 102、 从在用租约池中获取客户端的 DHCP租约, 向客户端发送检测 客户端的 DHCP租约是否有效的检测报文, 其中, 在用租约池中存储正在使用 且当前有效的 DHCP租约及与其对应的客户端信息; 步骤 104、 若在预设时间段内未收到客户端反馈的响应信息, 则重新发送 检测报文; 步骤 106、 若连续 N次发送的检测报文均未收到客户端反馈的响应信息, 则确定客户端的 DHCP租约无效, 并释放客户端的 DHCP租约占用的资源, 其 中, N为自然数。 在本发明实施例中, 从在用租约池中获耳又客户端的 DHCP租约, 并检测该 DHCP租约的有效性, 若连续 N次发送的检测 4艮文均未收到客户端反馈的响应 信息, 则确定客户端的 DHCP租约无效, 并释放客户端的 DHCP租约占用的资 源, 可以将不再需要租约的客户端占用的资源释放, 后续可以分配给其他客户 端使用, 提高了 IP地址资源的可利用率。 实施时, 从在用租约池中获耳又客户端的 DHCP租约可以有多种实施方式, 较优的, 可以利用租约检测定时器周期性从在用租约池中获取客户端的 DHCP 租约, 当租约检测定时器到时, 从在用租约池中获取客户端的 DHCP租约。 上述租约检测步骤由检测定时器周期触发, 检测周期可以由用户设置, 例 如, 50分钟, 50秒, 等等; 通常默认为 1小时。 实施时, 检测报文可以有多种, 较优的, 包括地址解析协议 arp报文和因 特网信息控制协议 icmp报文, 各检测报文的实施环境如下: 当客户端与 DHCP服务器在同一个子网中时, 向客户端发送 arp报文; 当客户端与 DHCP服务器不在同一个子网中时, 向客户端发送 icmp报文。 实施时, 释放所述客户端的 DHCP 租约占用的资源, 将客户端的 DHCP 租约占用的资源释放至超期租约池, 其中, 超期租约池中存储已超期释放的 DHCP租约以及之前占用已超期释放的 DHCP租约的客户端信息。 在后续应用 中, 若可用租约池中的资源被使用完时, 可以从超期租约池中获取资源进而分 配给客户端, 提高了 IP地址资源的利用率。 实施时, 若在预设时间段内未收到所述客户端反馈的响应信息, 则重新发 送检测 4艮文, 较优的, 可以利用响应超时定时器进行控制, 若响应超时定时器 超时仍未收到客户端反馈的响应信息, 则重新发送检测报文。 响应超时定时器 的时间也可以由用户设置, 例如, 15分钟, 20秒, 等等, 通常默认为 2秒。 通常, 若发送了超过 3次的检测报文客户端均没有回应, 则认为客户端已 经不需要其原先占用的 DHCP租约, 将其对应的资源释放。 釆用本发明实施例提供的方法可以在 DHCP 服务器上添加了一个租约合 法性检测功能, 通过发送 arp报文或者 icmp报文检测客户端租约的合法性, 实 现简单, 不需要修改协议, 只需要在现有 DHCP服务器功能中添加上述功能即 可实现。 现对租约有效性检测的流程进行描述, 流程图请参见图 2: 步骤 202、 配置租约有效性检测参数 (是否启用检测, 响应超时时长 (默 认是 2秒一次), 最大检测次数 (默认是 3次), 检测周期 (默认 1小时)); 步骤 204、 当检测周期到时, 触发租约检测; 步骤 206 重置检测定时器; 步骤 208、 从在用租约池中获取未检测租约, 如果获取失败, 说明所有租 约已经检测完成, 依次执行步骤 210及步骤 204 , 否则执行步骤 212; 步骤 210、 将所有租约的检测标识清零; 步骤 212、 给获取的租约打上检测标识, 检测次数设置为 0; 步骤 214 判断是否满足最大检测次数, 若是, 执行步骤 222, 否则, 执 行步骤 216; 步骤 216、 发送检测 4艮文, 检测次数加 1 ; 步骤 218、 重置检测定时器和响应超时定时器, 开始计时; 步骤 220、 如果在响应超时定时器超时前收到检测响应 4艮文, 则执行步骤 206, 否则, 执行步 4聚 214; 步骤 222、 将当前租约从在用租约池移到超期租约池, 清除检测标识及已 检测次数后, 执行步骤 206。 实施时, 本发明实施例应用的网络环境的典型组网如图 3所示, 包括客户 端 1、 2 , 交换机, DHCP服务器, 客户端 2经中间网络与 DHCP服务器连接。 基于同一发明构思, 本发明实施例还提供了一种 DHCP租约处理装置, 其 结构如图 4所示, 包括: 发送单元 401 , 设置为从在用租约池中获取客户端的 DHCP租约, 向客户 端发送检测客户端的 DHCP租约是否有效的检测 4艮文, 其中, 在用租约池中存 储正在使用且当前有效的 DHCP租约及与其对应的客户端信息; 若在预设时间 段内未收到客户端的响应, 则重新所述检测报文; 确定单元 402 , 设置为若连续 N次发送的检测报文均未收到客户端反馈的 响应信息, 则确定客户端的 DHCP租约无效, 并释放客户端的 DHCP租约占用 的资源, 其中, N为自然数。 在一个实施例中, 发送单元 401还可以设置为: 当客户端与 DHCP服务器在同一个子网中时, 向客户端发送 arp报文; 当客户端与 DHCP服务器不在同一个子网中时, 向客户端发送 icmp报文。 在一个实施例中, 确定单元 402还可以设置为: 将客户端的 DHCP租约占 用的资源释放至超期租约池, 其中, 超期租约池中存储已超期释放的 DHCP租 约以及之前占用已超期释放的 DHCP租约的客户端信息。 实施时, 本发明实施例可以在 DHCP服务器端实现一个租约检测模块, 该 模块与 DHCP服务器功能模块需要交互租约检测信息,设置为 DHCP服务器提 前释放可用的 IP地址资源。 租约检测模块包含如下功能单元: 定时器功能单元、 租约管理单元、 检测 报文发送单元、 检测报文接收单元、 检测控制单元, 各单元之间关系参见图 5。 定时器功能单元管理两个定时器: 检测定时器和响应超时定时器。 检测定 时器时长必须大于响应超时定时器时长。 检测定时器定时循环触发检测操作, 默认为 1小时一次, 也可以由用户手 工指定检测时长。 响应超时定时器用来触发超时事件, 在超时事件中对租约的有效性进行判 断, 超时时长,默认为 2秒, 也可以由用户手工指定超时时长。 租约管理单元提供租约池的管理和维护功能, 主要有三个租约池: 在用租 约池、 超期租约池、 可用租约池, 在用租约池中存储当前有效、 正在使用的租 约及相关的用户信息, 超期租约池中存储已超期释放的租约及之前占用该租约 的用户信息, 可用租约池中存储的未曾分配使用过的租约信息。 主要操作有: 定时器功能单元中的检测定时器超时时长到期, 触发检测控制单元从租约 池中获取一个租约的用户信息, 并发起租约有效性检测; 检测控制单元决策出需要释放的租约, 通知租约管理单元释放在用租约池 中相关租约的用户信息; 并将该用户的租约信息放入超期租约池; 由 DHCP 服务器功能模块触发租约管理单元从可用租约池中获取一个可 用的租约信息, 如果可用租约池已空, 就从超期租约池中获取; 将可用租约池中正常超期释放的租约放入超期租约池中。 检测 4艮文发送单元设置为构造和发送 arp或者 icmp 4艮文执行检测功能,检 测操作由检测控制单元触发。 检测 4艮文接收单元接收检测响应 4艮文 (arp或 icmp响应 4艮文)或响应超时定 时器的超时事件, 通知检测控制单元。 检测控制单元与其他几个功能单元相互协作完成租约检测和租约管理功
决策出需要检测的租约, 通知检测报文发送单元进行检测; 同时需要记录 被检测的租约信息 (被检测的客户端 IP地址, 已检测次数 )„ 收到检测报文接收单元的检测结果通知, 触发检测操作: 如果是收到正确 响应报文, 检测控制单元将触发下一个租约的合法性检测, 如果是超时事件, 且检测次数不满足最大检测次数(默认为 3 次), 需要针对当前租约重新发起 检测, 否则触发下一个租约的检测。 检测操作频率由定时器控制单元控制, 检测定时器超时时长到期, 决策出 需要触发检测的租约, 触发检测动作。 与租约池单元交互,获取待检测租约;通知租约池被检测租约的检测结果。 从以上的描述中, 可以看出, 本发明实现了如下技术效果: 在本发明实施例中, 从在用租约池中获耳又客户端的 DHCP租约, 并检测该
DHCP租约的有效性, 若连续 N次发送的检测报文均未收到客户端反馈的响应 信息, 则确定客户端的 DHCP租约无效, 并释放客户端的 DHCP租约占用的资 源, 可以将不再需要租约的客户端占用的资源释放, 后续可以分配给其他客户 端使用, 提高了 IP地址资源的可利用率。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以 用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多 个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码 来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 并且在某些 情况下, 可以以不同于此处的顺序执行所示出或描述的步骤, 或者将它们分别 制作成各个集成电路模块, 或者将它们中的多个模块或步骤制作成单个集成电 路模块来实现。 这样, 本发明不限制于任何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领 域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的 ^"神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之 内。

Claims

权 利 要 求 书
1. 一种动态主机控制协议 DHCP租约处理方法, 包括:
从在用租约池中获取客户端的 DHCP租约, 向所述客户端发送检测 所述客户端的 DHCP租约是否有效的检测报文, 其中, 所述在用租约池 中存储正在使用且当前有效的 DHCP租约及与其对应的客户端信息; 若在预设时间段内未收到所述客户端反馈的响应信息, 则重新发送 所述检测 艮文;
若连续 N次发送的所述检测 4艮文均未收到所述客户端反馈的响应信 息, 则确定所述客户端的 DHCP租约无效, 并释放所述客户端的 DHCP 租约占用的资源, 其中, N为自然数。
2. 根据权利要求 1所述的方法, 其中, 所述从在用租约池中获取客户端的 DHCP租约, 包括: 利用租约检测定时器周期性从在用租约池中获取客 户端的 DHCP租约, 所述租约检测定时器到时, 从在用租约池中获取客 户端的 DHCP租约。
3. 才艮据权利要求 2所述的方法, 其中, 所述租约检测定时器定时时间为 1 小时。
4. 才艮据权利要求 1所述的方法, 其中, 向所述客户端发送检测所述客户端 的 DHCP租约是否有效的检测 4艮文, 包括:
当所述客户端与 DHCP服务器在同一个子网中时, 向所述客户端发 送地址解析协议 arp 艮文;
当所述客户端与 DHCP月艮务器不在同一个子网中时, 向所述客户端 发送因特网信息控制协议 icmp报文。
5. 根据权利要求 1至 4任一项所述的方法, 其中, 所述释放所述客户端的 DHCP租约占用的资源, 包括: 将所述客户端的 DHCP租约占用的资源 释放至超期租约池, 其中, 所述超期租约池中存储已超期释放的 DHCP 租约以及之前占用所述已超期释放的 DHCP租约的客户端信息。
6. 根据权利要求 1至 4任一项所述的方法, 其中, 所述若在预设时间段内 未收到所述客户端反馈的响应信息, 则重新发送所述检测报文, 包括: 利用响应超时定时器等待客户的响应, 若所述响应超时定时器超时仍未 收到所述客户端反馈的响应信息, 则重新发送所述检测报文, 其中, 所 述响应超时定时器定时时间为 2秒。
7. 根据权利要求 1至 4任一项所述的方法, 其中, N=3。
8. —种动态主机控制协议 DHCP租约处理装置, 包括:
发送单元, 设置为从在用租约池中获取客户端的 DHCP租约, 向所 述客户端发送检测所述客户端的 DHCP租约是否有效的检测报文,其中, 所述在用租约池中存储正在使用且当前有效的 DHCP租约及与其对应的 客户端信息; 若在预设时间段内未收到所述客户端的响应, 则重新发送 所述检测 艮文;
确定单元, 设置为若连续 N次发送的所述检测 4艮文均未收到所述客 户端反馈的响应信息, 则确定所述客户端的 DHCP租约无效, 并释放所 述客户端的 DHCP租约占用的资源, 其中, N为自然数。
9. 根据权利要求 8所述的装置, 其中, 所述发送单元还设置为:
当所述客户端与 DHCP服务器在同一个子网中时, 向所述客户端发 送地址解析协议 arp 艮文;
当所述客户端与 DHCP月艮务器不在同一个子网中时, 向所述客户端 发送因特网信息控制协议 icmp报文。
10. 根据权利要求 8或 9所述的装置, 其中, 所述确定单元还设置为: 将所 述客户端的 DHCP租约占用的资源释放至超期租约池, 其中, 所述超期 租约池中存储已超期释放的 DHCP租约以及之前占用所述已超期释放的 DHCP租约的客户端信息。
PCT/CN2011/075899 2010-11-18 2011-06-17 Dhcp租约处理方法及装置 WO2012065436A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010550088.6 2010-11-18
CN2010105500886A CN101997920A (zh) 2010-11-18 2010-11-18 Dhcp租约处理方法及装置

Publications (1)

Publication Number Publication Date
WO2012065436A1 true WO2012065436A1 (zh) 2012-05-24

Family

ID=43787490

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/075899 WO2012065436A1 (zh) 2010-11-18 2011-06-17 Dhcp租约处理方法及装置

Country Status (2)

Country Link
CN (1) CN101997920A (zh)
WO (1) WO2012065436A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110661897A (zh) * 2018-06-29 2020-01-07 华为技术有限公司 管理地址的方法和装置

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101997920A (zh) * 2010-11-18 2011-03-30 中兴通讯股份有限公司 Dhcp租约处理方法及装置
CN103714183B (zh) * 2014-01-10 2017-02-15 浪潮(北京)电子信息产业有限公司 一种元数据租约期限的动态获取方法和系统
CN104579827A (zh) * 2014-12-24 2015-04-29 北京华胜天成科技股份有限公司 一种ip地址冲突检测方法及装置
CN110661902B (zh) * 2019-09-26 2022-06-03 浪潮商用机器有限公司 一种监测客户端续约的方法
CN115002077B (zh) * 2021-03-01 2024-03-22 炬芯科技股份有限公司 一种dhcp客户端获取ip地址的方法及相关设备
CN113110927A (zh) * 2021-04-19 2021-07-13 上海商汤科技开发有限公司 一种任务调度方法、装置、计算机设备和存储介质
CN113572830A (zh) * 2021-07-16 2021-10-29 牙木科技股份有限公司 地址分配方法、地址分配系统及计算机可读存储介质
CN115460176B (zh) * 2022-09-29 2023-10-03 苏州浪潮智能科技有限公司 Dhcp服务器无效地址回收方法、装置、设备、介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1450756A (zh) * 2002-04-08 2003-10-22 华为技术有限公司 一种接入设备实时探测以太网接入计算机在线状态的方法
US20060218252A1 (en) * 2005-03-22 2006-09-28 Cisco Technology, Inc., A Corporation Of California Remote survivable DHCP for a DHCP relay agent
CN1941722A (zh) * 2006-08-29 2007-04-04 杭州华为三康技术有限公司 通过探测客户端维护dhcp安全特性表的方法与装置
CN101325587A (zh) * 2007-06-11 2008-12-17 中兴通讯股份有限公司 一种dhcp会话监测方法
CN101997920A (zh) * 2010-11-18 2011-03-30 中兴通讯股份有限公司 Dhcp租约处理方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1450756A (zh) * 2002-04-08 2003-10-22 华为技术有限公司 一种接入设备实时探测以太网接入计算机在线状态的方法
US20060218252A1 (en) * 2005-03-22 2006-09-28 Cisco Technology, Inc., A Corporation Of California Remote survivable DHCP for a DHCP relay agent
CN1941722A (zh) * 2006-08-29 2007-04-04 杭州华为三康技术有限公司 通过探测客户端维护dhcp安全特性表的方法与装置
CN101325587A (zh) * 2007-06-11 2008-12-17 中兴通讯股份有限公司 一种dhcp会话监测方法
CN101997920A (zh) * 2010-11-18 2011-03-30 中兴通讯股份有限公司 Dhcp租约处理方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110661897A (zh) * 2018-06-29 2020-01-07 华为技术有限公司 管理地址的方法和装置

Also Published As

Publication number Publication date
CN101997920A (zh) 2011-03-30

Similar Documents

Publication Publication Date Title
WO2012065436A1 (zh) Dhcp租约处理方法及装置
EP2879419B1 (en) Ipv6 address stateless auto-configuration system, data card, and implementation method thereof
EP2012485A1 (en) Management method, apparatus and system of session connection
US20130080614A1 (en) Client Aware DHCP Lease Management
JP2014527785A5 (ja) 端末の立ち上がり周期を調整する方法、装置、端末、コンピュータプログラム及び記憶媒体
US8332513B2 (en) Method and device for detecting connectivity termination of internet protocol version 6 access networks
WO2015127601A1 (zh) 一种多播发送装置、多播接收装置和多播传输确定方法
JP5604389B2 (ja) 通信システム、ルータ装置及びルータ切替方法
US9319438B2 (en) Communication terminal that performs network packet communication using sip servers, control method for the communication terminal, and storage medium
US20100039956A1 (en) Method and system for performing keep-alive monitoring on subscriber sessions
JP5079000B2 (ja) 通信ネットワーク接続装置
WO2008141572A1 (fr) Procédé et système servant à réaliser un contrôle d'entretien sur des sessions clients
CA2522846A1 (en) Methods and apparatuses for optimizing resource management in cdma2000 wireless ip networks
WO2017000625A1 (zh) 动态主机配置协议dhcp服务器管理方法及装置
WO2011085612A1 (zh) 状态同步的处理方法及装置
CN101951327B (zh) 一种iSCSI网络系统以及检测网络故障的方法
JP2011129968A (ja) 通信端末装置
CN104009961A (zh) 一种PPPoE会话标识分配方法及设备
CN101888319A (zh) 获取终端设备的网络接入信息的方法和装置
WO2013178178A2 (zh) 资源释放方法及装置
WO2012119386A1 (zh) 一种接入网络中的认证方法、设备和系统
JP2005287044A (ja) Ipネットワークに接続された装置の発見の方法、及び、この方法を実行する装置
CN114124314B (zh) 控制客户端上线的方法、网络设备及客户端
CN100409645C (zh) 一种宽带接入用户管理方法
CN108781215B (zh) 网络服务实现方法、服务控制器及通信系统

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

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

Country of ref document: EP

Kind code of ref document: A1