CN103825974A - DHCP contract extension processing method and device - Google Patents
DHCP contract extension processing method and device Download PDFInfo
- Publication number
- CN103825974A CN103825974A CN201410062579.4A CN201410062579A CN103825974A CN 103825974 A CN103825974 A CN 103825974A CN 201410062579 A CN201410062579 A CN 201410062579A CN 103825974 A CN103825974 A CN 103825974A
- Authority
- CN
- China
- Prior art keywords
- dhcp
- rental period
- dhcp client
- configuration protocol
- host configuration
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Landscapes
- Small-Scale Networks (AREA)
Abstract
The invention provides a DHCP contract extension processing method and device. The DHCP contract extension processing method includes the steps that after a server receives a DHCP-REQUEST contract extension request message of a client side, whether the client side can use an IP address or not is judged according to the IP address, carried by the contract extension request message, of the client side, if not, the tenancy term of the client side is set to be 0, and if yes, the tenancy term of the client side is set according to the duration of the tenancy term of an address pool where the IP address belongs, the tenancy term of the client side is filled into a DHCP response message, and the response message is sent to the client side in a unicast mode; after the client side receives the DHCP-ACK response message, the tenancy term carried by the response message is analyzed, if the tenancy term is 0, the IP address which is used at present is released, and if the tenancy term is not 0, the tenancy term is renewed. By means of the DHCP contract extension processing method and device, the problem that the client side can not sense 50% of contract extension through relay networking is solved, and the DHCP contract extension processing speed is effectively increased.
Description
Technical field
The present invention relates to network communications technology field, relate in particular to a kind of DHCP renewed treaty processing method and device.
Background technology
When dhcp client and Dynamic Host Configuration Protocol server be not during at the same network segment, need to carry out IP application IP addresses by DHCP relay.Because there is certain rental period the IP address of dynamic assignment, therefore require dhcp client to send to Dynamic Host Configuration Protocol server the request of renewed treaty before expiring, its renewed treaty process is as follows.
In the time that the rental period reaches 50%, dhcp client sends the DHCP-REQUEST renewed treaty request message of clean culture to Dynamic Host Configuration Protocol server.Because this renewed treaty message sends to Dynamic Host Configuration Protocol server from dhcp client clean culture, the IP address that the object IP address of message is Dynamic Host Configuration Protocol server, therefore, this renewed treaty message is without DHCP relay processing, and the giaddr field in message is 0.Giaddr field for fill dhcp client send after request message through the IP address of first DHCP relay.Dynamic Host Configuration Protocol server receives after this renewed treaty message, if do not allow dhcp client to continue to use this IP address, responds DHCP-NAK message.Because giaddr field in the renewed treaty message receiving is 0, Dynamic Host Configuration Protocol server can only broadcast transmission DHCP-NAK message.If DHCP relay and Dynamic Host Configuration Protocol server be not in same local area network (LAN), DHCP relay cannot be received this DHCP-NAK message, therefore, also cannot forward this DHCP-NAK message to dhcp client, finally cause the dhcp client failed situation of cannot real-time perception renewing a contract.
Summary of the invention
In view of this, the invention provides a kind of Dynamic Host Configuration Protocol server renewed treaty processing unit, be applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, described dhcp client from Dynamic Host Configuration Protocol server respectively in the different network segments, this device can be arranged in Dynamic Host Configuration Protocol server, and this device specifically comprises:
Message receiving element, sends DHCP-REQUEST renewed treaty request message for receiving the clean culture of dhcp client, and in described renewed treaty request message, does not carry the IP address of DCHP trunking;
Rental period setting unit, be used for the IP address of the dhcp client carrying according to this renewed treaty request message, judge whether this dhcp client can use this IP address, if cannot use, the rental period that dhcp client is set is 0, if can use, be set the rental period of this dhcp client according to the rental period duration of address pool under this IP address;
Message response unit, for arranging after the rental period of dhcp client, is filled into the rental period of this dhcp client in DHCP response message, and this response message clean culture is sent to dhcp client.
The invention provides a kind of Dynamic Host Configuration Protocol server renewed treaty processing method, be applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, described dhcp client and Dynamic Host Configuration Protocol server are respectively in the different network segments, and the method comprises:
The clean culture that Dynamic Host Configuration Protocol server receives dhcp client sends DHCP-REQUEST renewed treaty request message, and in described renewed treaty request message, does not carry the IP address of DCHP trunking;
Dynamic Host Configuration Protocol server is according to the IP address of the dhcp client carrying in this renewed treaty request message, judge whether this dhcp client can use this IP address, if cannot use, the rental period that dhcp client is set is 0, if can use, be set the rental period of this dhcp client according to the rental period duration of address pool under this IP address;
Dynamic Host Configuration Protocol server arranged after the rental period of dhcp client, the rental period of this dhcp client is filled in DHCP response message, and this response message clean culture is sent to dhcp client.
The invention provides a kind of dhcp client renewed treaty processing unit, be applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, described dhcp client from Dynamic Host Configuration Protocol server respectively in the different network segments, this device can be arranged in dhcp client, and this device specifically comprises:
Packet sending unit, sends DHCP-REQUEST renewed treaty request message to described Dynamic Host Configuration Protocol server for clean culture;
Rental period control unit, for receiving after the DHCP-ACK response message of Dynamic Host Configuration Protocol server, resolves the rental period of carrying in this response message, if this rental period is 0, discharges the IP address of current use, if this rental period is not 0, upgrades the rental period.
The invention provides a kind of dhcp client renewed treaty processing method, be applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, described dhcp client and Dynamic Host Configuration Protocol server are respectively in the different network segments, and the method comprises:
Described dhcp client clean culture sends DHCP-REQUEST renewed treaty request message to described Dynamic Host Configuration Protocol server;
Described dhcp client, receiving after the DHCP-ACK response message of Dynamic Host Configuration Protocol server, is resolved the rental period of carrying in this response message, if this rental period is 0, discharges the IP address of current use, if this rental period is not 0, upgrades the rental period.
The invention solves through DHCP relay networking in the situation that, the dhcp client failed problem of cannot perception 50% renewing a contract, has effectively promoted DHCP renewed treaty processing speed.
Accompanying drawing explanation
Fig. 1 is the logical construction of Dynamic Host Configuration Protocol server renewed treaty processing unit and the schematic diagram of underlying hardware environment thereof in one embodiment of the present invention.
Fig. 2 is the flow chart of Dynamic Host Configuration Protocol server renewed treaty processing method in one embodiment of the present invention.
Fig. 3 is the logical construction of dhcp client renewed treaty processing unit and the schematic diagram of underlying hardware environment thereof in one embodiment of the present invention.
Fig. 4 is the flow chart of dhcp client renewed treaty processing method in one embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in detail.
According to RFC2131, if not receiving Dynamic Host Configuration Protocol server in the time of 50% renewed treaty, dhcp client replys, continue to use original IP address, until rental period while reaching 87.5%, broadcast transmission DHCP-REQUEST renewed treaty message.Owing to being broadcasting packet, DHCP relay can be received.DHCP relay is filled giaddr field, and DHCP-REQUEST renewed treaty message repeating to Dynamic Host Configuration Protocol server.Dynamic Host Configuration Protocol server sends to DHCP relay according to the address of giaddr field the unsuccessful DHCP-NAK message clean culture of renewing a contract, and DHCP relay forwards the packet to dhcp client again.Dhcp client is received after DHCP-NAK message, discharges the IP address of current use, again applies for new IP address.
From said process, can find out, the rental period 50% to 87.5% during, dhcp client using always Dynamic Host Configuration Protocol server do not allow its continue use IP address, perception is in time renewed a contract unsuccessfully.If enabled control access user function on Dynamic Host Configuration Protocol server, only forward the customer flow that uses legitimate ip address, the failed user that renews a contract cannot access external network resource.
The invention provides a kind of Dynamic Host Configuration Protocol server renewed treaty processing unit, be applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, be embodied as example with software below and describe, but the present invention does not get rid of such as other implementations such as hardware or logical device.As shown in Figure 1, the hardware environment of this device operation generally includes CPU, internal memory, nonvolatile memory and other hardware.This device is as the virtual bench of a logic level, and it moves by CPU.This device comprises message receiving element, rental period setting unit and message response unit.Please refer to the concrete implementation step of Fig. 2.
The invention provides a kind of dhcp client renewed treaty processing unit, be applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, be embodied as example with software below and describe, but the present invention does not get rid of such as other implementations such as hardware or logical device.As shown in Figure 3, the hardware environment of this device operation generally includes CPU, internal memory, nonvolatile memory and other hardware.This device is as the virtual bench of a logic level, and it moves by CPU.This device comprises packet sending unit and rental period control unit.Please refer to the concrete implementation step of Fig. 4.
Dynamic Host Configuration Protocol server adopts dynamic assignment mode distributing IP address to dhcp client, and specifies the rental period of this IP address, after this rental period expires, will regain this IP address.If dhcp client wish continue use this IP address, the rental period 50% time, need renew a contract to Dynamic Host Configuration Protocol server application.
Dhcp client sends DHCP-REQUEST renewed treaty request message by clean culture and renews a contract to Dynamic Host Configuration Protocol server application, and the object IP address of this renewed treaty request message is dhcp server ip address.Dynamic Host Configuration Protocol server receives after this renewed treaty request message, according to the dhcp client IP address in ciaddr field in this message, search the dhcp client lease data of record, check that whether this dhcp client is legal, whether allow to continue to use current IP address.If do not find the dhcp client lease record of coupling, or the address Policy of Dynamic Host Configuration Protocol server changes, and do not allow this dhcp client to continue to use current IP address, and the rental period that this dhcp client is set is 0; If find the dhcp client lease record of coupling, allow dhcp client to continue to use current IP address, the rental period that this dhcp client is set is the rental period duration of address pool under this IP address.Determining after the rental period of this dhcp client, the rental period of this dhcp client is filled in DHCP response message, the IP address of not carrying DHCP relay equipment in the renewed treaty request message receiving due to Dynamic Host Configuration Protocol server, therefore this response message clean culture is sent to dhcp client by Dynamic Host Configuration Protocol server.
Preferably, the DHCP response message that Dynamic Host Configuration Protocol server sends is DHCP-ACK response message.No matter whether Dynamic Host Configuration Protocol server allows dhcp client to continue to use current IP address, all adopts DHCP-ACK response message to reply.This be due to the rental period 50% time, dhcp client sends DHCP-REQUEST renewed treaty request message to Dynamic Host Configuration Protocol server by clean culture, this renewed treaty request message is without DHCP relay processing, therefore, the giaddr field in this renewed treaty message is 0.If adopt existing processing mode, in the time that Dynamic Host Configuration Protocol server does not allow dhcp client to continue to use current IP address, by broadcast transmission DHCP-NAK message, if the DHCP relay in network and Dynamic Host Configuration Protocol server be not in same local area network (LAN), DHCP relay cannot receive this message, therefore, also cannot forward this message to dhcp client.If Dynamic Host Configuration Protocol server adopts DHCP-ACK response message, in the situation that giaddr field is 0, can, according to the dhcp client IP address in ciaddr field in renewed treaty request message, the clean culture of DHCP-ACK response message be sent to dhcp client, and forward without DHCP relay.
Preferably, the encapsulation process of this DHCP-ACK response message comprises: DHCP-ACK type is filled into option53 (DHCP Message Type, the DHCP type of message) field in DHCP response message; The dhcp client rental period of Dynamic Host Configuration Protocol server setting is filled into option51 (DHCP Address Lease Time, the dhcp address rental period) field in DHCP response message; The object IP address of DHCP response message is set to dhcp client and makes the IP address of current use.DHCP-ACK response message through above-mentioned encapsulation can clean culture send to dhcp client.
Dhcp client is receiving after the DHCP-ACK response message of Dynamic Host Configuration Protocol server, if this message is renewed treaty response message, resolve the rental period in this renewed treaty response message, if this rental period is 0, represent that this IP address does not allow to continue to use, discharge this IP address, and send DHCP-DISCOVER message and again apply for new IP address.If this rental period is not 0, upgrade the rental period, continue to use current IP address.
Preferably, dhcp client, upgrading after the rental period, resets the renewed treaty timer expiry time so that reclocking, when timing reach the rental period 50% time, carry out above-mentioned renewed treaty process.
The present invention is by the improvement to DHCP renewed treaty reciprocal process, solved in through DHCP relay networking situation, and the dhcp client failed problem of cannot perception 50% renewing a contract, has effectively promoted DHCP renewed treaty processing speed.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of making, be equal to replacement, improvement etc., within all should being included in the scope of protection of the invention.
Claims (12)
1. a Dynamic Host Configuration Protocol server renewed treaty processing unit, is applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, and described dhcp client and Dynamic Host Configuration Protocol server respectively, in the different network segments, is characterized in that, this device comprises:
Message receiving element, sends DHCP-REQUEST renewed treaty request message for receiving the clean culture of dhcp client, and in described renewed treaty request message, does not carry the IP address of DCHP trunking;
Rental period setting unit, be used for the IP address of the dhcp client carrying according to this renewed treaty request message, judge whether this dhcp client can use this IP address, if cannot use, the rental period that dhcp client is set is 0, if can use, be set the rental period of this dhcp client according to the rental period duration of address pool under this IP address;
Message response unit, for arranging after the rental period of dhcp client, is filled into the rental period of this dhcp client in DHCP response message, and this response message clean culture is sent to dhcp client.
2. device as claimed in claim 1, is characterized in that:
Described DHCP response message is DHCP-ACK response message.
3. device as claimed in claim 2, is characterized in that:
DHCP-ACK type is filled into the option53 field in described DHCP response message.
4. device as claimed in claim 1, is characterized in that:
The described dhcp client rental period is filled into the option51 field in described DHCP response message.
5. a Dynamic Host Configuration Protocol server renewed treaty processing method, is applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, and described dhcp client and Dynamic Host Configuration Protocol server respectively, in the different network segments, is characterized in that, the method comprises the following steps:
The clean culture that Dynamic Host Configuration Protocol server receives dhcp client sends DHCP-REQUEST renewed treaty request message, and in described renewed treaty request message, does not carry the IP address of DCHP trunking;
Dynamic Host Configuration Protocol server is according to the IP address of the dhcp client carrying in this renewed treaty request message, judge whether this dhcp client can use this IP address, if cannot use, the rental period that dhcp client is set is 0, if can use, be set the rental period of this dhcp client according to the rental period duration of address pool under this IP address;
Dynamic Host Configuration Protocol server arranged after the rental period of dhcp client, the rental period of this dhcp client is filled in DHCP response message, and this response message clean culture is sent to dhcp client.
6. method as claimed in claim 5, is characterized in that:
Described DHCP response message is DHCP-ACK response message.
7. method as claimed in claim 6, is characterized in that:
DHCP-ACK type is filled into the option53 field in described DHCP response message.
8. method as claimed in claim 5, is characterized in that:
The described dhcp client rental period is filled into the option51 field in described DHCP response message.
9. a dhcp client renewed treaty processing unit, is applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, and described dhcp client and Dynamic Host Configuration Protocol server respectively, in the different network segments, is characterized in that, this device comprises:
Packet sending unit, sends DHCP-REQUEST renewed treaty request message to described Dynamic Host Configuration Protocol server for clean culture;
Rental period control unit, for receiving after the DHCP-ACK response message of Dynamic Host Configuration Protocol server, resolves the rental period of carrying in this response message, if this rental period is 0, discharges the IP address of current use, if this rental period is not 0, upgrades the rental period.
10. device as claimed in claim 9, is characterized in that:
Rental period control unit, is further used for, upgrading after the rental period, refreshing the renewed treaty timer expiry time.
11. 1 kinds of dhcp client renewed treaty processing methods, are applied in the network that comprises dhcp client, DHCP relay equipment and Dynamic Host Configuration Protocol server, and described dhcp client and Dynamic Host Configuration Protocol server respectively, in the different network segments, is characterized in that, the method comprises:
Described dhcp client clean culture sends DHCP-REQUEST renewed treaty request message to described Dynamic Host Configuration Protocol server;
Described dhcp client, receiving after the DHCP-ACK response message of Dynamic Host Configuration Protocol server, is resolved the rental period of carrying in this response message, if this rental period is 0, discharges the IP address of current use, if this rental period is not 0, upgrades the rental period.
12. methods as claimed in claim 11, is characterized in that, the method further comprises:
Upgrading after the rental period, refresh the renewed treaty timer expiry time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410062579.4A CN103825974B (en) | 2014-02-24 | 2014-02-24 | DHCP renewed treaty processing method and processing devices |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410062579.4A CN103825974B (en) | 2014-02-24 | 2014-02-24 | DHCP renewed treaty processing method and processing devices |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103825974A true CN103825974A (en) | 2014-05-28 |
CN103825974B CN103825974B (en) | 2017-11-14 |
Family
ID=50760797
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410062579.4A Active CN103825974B (en) | 2014-02-24 | 2014-02-24 | DHCP renewed treaty processing method and processing devices |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103825974B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111478788A (en) * | 2020-02-29 | 2020-07-31 | 新华三信息安全技术有限公司 | Abnormal offline recovery method, device and equipment and machine-readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1937632A (en) * | 2005-09-23 | 2007-03-28 | 中兴通讯股份有限公司 | Address distributing method for broadband wireless access system |
US20080065747A1 (en) * | 2006-09-11 | 2008-03-13 | Fujitsu Limited | Relay agent device and proxy address leasing device |
CN101330531A (en) * | 2008-07-31 | 2008-12-24 | 杭州华三通信技术有限公司 | Method for processing DHCP address allocation and DHCP relay |
CN102523316A (en) * | 2011-12-23 | 2012-06-27 | 杭州华三通信技术有限公司 | Address distribution method and address distribution device |
CN102752152A (en) * | 2012-07-24 | 2012-10-24 | 杭州华三通信技术有限公司 | Method and device used for configuring VRRP (Virtual Router Redundancy Protocol) backup group |
-
2014
- 2014-02-24 CN CN201410062579.4A patent/CN103825974B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1937632A (en) * | 2005-09-23 | 2007-03-28 | 中兴通讯股份有限公司 | Address distributing method for broadband wireless access system |
US20080065747A1 (en) * | 2006-09-11 | 2008-03-13 | Fujitsu Limited | Relay agent device and proxy address leasing device |
CN101330531A (en) * | 2008-07-31 | 2008-12-24 | 杭州华三通信技术有限公司 | Method for processing DHCP address allocation and DHCP relay |
CN102523316A (en) * | 2011-12-23 | 2012-06-27 | 杭州华三通信技术有限公司 | Address distribution method and address distribution device |
CN102752152A (en) * | 2012-07-24 | 2012-10-24 | 杭州华三通信技术有限公司 | Method and device used for configuring VRRP (Virtual Router Redundancy Protocol) backup group |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111478788A (en) * | 2020-02-29 | 2020-07-31 | 新华三信息安全技术有限公司 | Abnormal offline recovery method, device and equipment and machine-readable storage medium |
CN111478788B (en) * | 2020-02-29 | 2022-02-22 | 新华三信息安全技术有限公司 | Abnormal offline recovery method, device and equipment and machine-readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN103825974B (en) | 2017-11-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9210124B2 (en) | Method, apparatus, and system for allocating public IP address | |
US10075412B2 (en) | Client aware DHCP lease managment | |
CN102685270B (en) | Method and equipment for distributing dynamic addresses | |
US10142159B2 (en) | IP address allocation | |
CN104378455B (en) | IP address distribution method and device | |
US20210119965A1 (en) | Address Management Method and Apparatus | |
US11343224B2 (en) | Method for renewing IP address and apparatus | |
CN103888551A (en) | Internet protocol address obtaining method in network, relay device and system | |
EP2888863B1 (en) | Method and apparatus for configuring dhcp client | |
WO2018103400A1 (en) | Wireless fidelity wifi connection method and related product | |
US20220345437A1 (en) | Systems and methods for improving arp/nd performance on host communication devices | |
CN102082835B (en) | Method and device for distributing IP (internet protocol) addresses | |
CN102238245B (en) | Address allocation method and equipment | |
CN104168140A (en) | VTEP abnormal condition processing method and device | |
CN111935335A (en) | DHCP address allocation method and device | |
US9521109B2 (en) | Systems, methods, and computer-readable media for allocation and renewal of IP addresses | |
KR20180070677A (en) | Resource acquisition method and apparatus | |
CN105979202B (en) | Data transmission method and device | |
CN106412146B (en) | The method and apparatus that a kind of dhcp client updates IP | |
CN106878481B (en) | Method, device and system for acquiring Internet Protocol (IP) address | |
CN101237460A (en) | Processing method, system and device upon lease status change of DHCP Server | |
CN104410727B (en) | Address distribution method, client, server and address allocation system | |
CN103825974A (en) | DHCP contract extension processing method and device | |
WO2016177185A1 (en) | Method and apparatus for processing media access control (mac) address | |
CN106034166B (en) | Network parameter configuration method and device of local area network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Applicant after: Xinhua three Technology Co., Ltd. Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base Applicant before: Huasan Communication Technology Co., Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |