CN103945016B - A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy - Google Patents

A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy Download PDF

Info

Publication number
CN103945016B
CN103945016B CN201410145280.5A CN201410145280A CN103945016B CN 103945016 B CN103945016 B CN 103945016B CN 201410145280 A CN201410145280 A CN 201410145280A CN 103945016 B CN103945016 B CN 103945016B
Authority
CN
China
Prior art keywords
configuration protocol
dynamic host
host configuration
server
protocol server
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.)
Active
Application number
CN201410145280.5A
Other languages
Chinese (zh)
Other versions
CN103945016A (en
Inventor
江少广
王宏
濮斌
苏静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Zhongke Yilian Communication Technology Co ltd
Original Assignee
Jiangsu Zhongke Yilian Communication Technology Co Ltd
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 Jiangsu Zhongke Yilian Communication Technology Co Ltd filed Critical Jiangsu Zhongke Yilian Communication Technology Co Ltd
Priority to CN201410145280.5A priority Critical patent/CN103945016B/en
Publication of CN103945016A publication Critical patent/CN103945016A/en
Application granted granted Critical
Publication of CN103945016B publication Critical patent/CN103945016B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention provides a kind of method and system of Dynamic Host Configuration Protocol server redundancy, wherein, the method includes:Main Dynamic Host Configuration Protocol server and spare Dynamic Host Configuration Protocol server start, and the main Dynamic Host Configuration Protocol server and spare Dynamic Host Configuration Protocol server share IP address pond;If main Dynamic Host Configuration Protocol server work, main Dynamic Host Configuration Protocol server cooperate with spare Dynamic Host Configuration Protocol server to obtain standby server list;Main Dynamic Host Configuration Protocol server is by the spare Dynamic Host Configuration Protocol server on the standby server list synchronization of acquisition to the standby server list;After main Dynamic Host Configuration Protocol server breaks down, judgement is switched over by the spare Dynamic Host Configuration Protocol server in the standby server list, is switched by the spare Dynamic Host Configuration Protocol server for meeting switching condition and continues to work based on the IP address pond for main Dynamic Host Configuration Protocol server.The present invention takes full advantage of IP address in the case of Dynamic Host Configuration Protocol server master-slave redundancy.

Description

A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy
Technical field
The present invention relates to dynamic host configuration protocol DHCP server active-standby switch field more particularly to a kind of DHCP services The method and system of device redundancy.
Background technology
With the extensive use of computer network and the continuous expansion of network size, the maintenance and management work of network is got over Come more difficult and numerous and diverse, therefore a series of management and configuration protocol are proposed to the automatic management of network.1993 In October in year, dynamic host configuration protocol DHCP becomes standard agreement, for the automatic distribution of IP address.
Host in network obtains the IP address and mesh network of oneself to Dynamic Host Configuration Protocol server according to the regulation of DHCP protocol The information such as pass, dns server address.DHCP protocol is defined in RFC2131, this specification defines Dynamic Host Configuration Protocol server and visitor Interactive standards between the end of family.
There is a situation where that multiple Dynamic Host Configuration Protocol server are described to same LAN in RFC2131.In RFC2131 documents Description in, the IP address range that each Dynamic Host Configuration Protocol server possesses is Uncrossed, that is, independent work between Dynamic Host Configuration Protocol server Make.After every Dynamic Host Configuration Protocol server receives the DHCPDISCOVER broadcasting packets of client transmission, this clothes can be sent to client Idle IP address, client select an available IP address in these different DHCPOFFER in device address pool of being engaged in.
In catenet, in order to ensure the reliability of DHCP service, need to realize the redundancy of Dynamic Host Configuration Protocol server.It is general Way is, according to 8:2 ratio divides IP available address pool total in network, wherein 80% IP address distributes to main clothes Business device, 20% IP address distribute to backup server.After main Dynamic Host Configuration Protocol server breaks down, made by backup Dynamic Host Configuration Protocol server Service is provided clients with remaining 20%IP addresses.This mechanism meets the demand of backup to a certain extent, however this The either main Dynamic Host Configuration Protocol server work of method or the work of spare Dynamic Host Configuration Protocol server, the IP address that can distribute to dhcp client are equal Only part IP address, so as to cause the waste of IP address.
Invention content
The present invention provides a kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy, how to solve in Dynamic Host Configuration Protocol server In the case of master-slave redundancy, the technical issues of making full use of IP address.
In order to solve the above technical problems, a kind of method of Dynamic Host Configuration Protocol server redundancy of the present invention, the method includes:
Main Dynamic Host Configuration Protocol server and spare Dynamic Host Configuration Protocol server start, and the main Dynamic Host Configuration Protocol server and spare Dynamic Host Configuration Protocol server are shared IP address pond;
If main Dynamic Host Configuration Protocol server work, main Dynamic Host Configuration Protocol server cooperate with spare Dynamic Host Configuration Protocol server to obtain standby server list;
Main Dynamic Host Configuration Protocol server will be spare on the standby server list synchronization of acquisition to the standby server list Dynamic Host Configuration Protocol server;
After main Dynamic Host Configuration Protocol server breaks down, cut by the spare Dynamic Host Configuration Protocol server in the standby server list Judgement is changed, is switched by the spare Dynamic Host Configuration Protocol server for meeting switching condition and continued for main Dynamic Host Configuration Protocol server based on the IP address Chi works Make.
Further, the main Dynamic Host Configuration Protocol server collaboration standby server obtains standby server list, including:
Main Dynamic Host Configuration Protocol server fixed time broadcast heartbeat packet;
The spare Dynamic Host Configuration Protocol server for receiving the heartbeat packet of main Dynamic Host Configuration Protocol server broadcast returns to unicast to main Dynamic Host Configuration Protocol server Heartbeat packet;
If main Dynamic Host Configuration Protocol server receives the unicast heartbeat packet returned from spare Dynamic Host Configuration Protocol server, by the spare DHCP Server storage is into standby server list;
If main DHCP is come from without receiving to spare DHCP service existing in standby server list in preset time The unicast heartbeat packet that device returns, then delete corresponding spare Dynamic Host Configuration Protocol server from the standby server list.
Further, it is described after main Dynamic Host Configuration Protocol server breaks down, by spare in the standby server list Dynamic Host Configuration Protocol server switches over judgement, when meeting switching condition, switches and is continuing with the IP address for main Dynamic Host Configuration Protocol server Pond provides service, including:
After main Dynamic Host Configuration Protocol server breaks down, the spare Dynamic Host Configuration Protocol server of the standby server list is received standby The corresponding standby server of minimum IP address is searched with server list, judges whether itself is the standby server, if so, It is then main Dynamic Host Configuration Protocol server by itself switching;
If standby server switching fails for main Dynamic Host Configuration Protocol server, then by removing the standby server in standby server list Except standby server standby server list lookup minimum the corresponding standby server of IP address, until find it is standby It is without the standby server for lookup in main Dynamic Host Configuration Protocol server or standby server list with server successful switch.
Further, the method further includes:
Main Dynamic Host Configuration Protocol server provides DHCP leases file, the DHCP generated in service process after work for dhcp client History lease cache file;
When main Dynamic Host Configuration Protocol server is in standby server list, DHCP leases file and the DHCP history leases for judging to obtain It, will be in updated content synchronization to newest standby server list after at least one in cache file three changes Spare Dynamic Host Configuration Protocol server;
After the spare Dynamic Host Configuration Protocol server switching in standby server list is main Dynamic Host Configuration Protocol server, also based on DHCP leases File, the work of DHCP history leases cache file.
Further, the spare Dynamic Host Configuration Protocol server switching is after main Dynamic Host Configuration Protocol server, further includes:
The virtual ip address that the main Dynamic Host Configuration Protocol server before the binding switching of main Dynamic Host Configuration Protocol server after switching uses.
Further, the method further includes:
If main Dynamic Host Configuration Protocol server does not work, spare Dynamic Host Configuration Protocol server is established the available server comprising own IP address and is arranged Table, and broadcast heartbeat packet;
The standby server received after the heartbeat packet that other standby servers are broadcasted, to broadcasting the heartbeat packet Standby server returns to unicast heartbeat packet;
If standby server receives the unicast heartbeat packet returned from other spare Dynamic Host Configuration Protocol server, by this other it is standby It is stored with Dynamic Host Configuration Protocol server into the available server list;
Spare Dynamic Host Configuration Protocol server is in the corresponding spare Dynamic Host Configuration Protocol server of available server list lookup minimum IP address, judgement Whether itself is the spare Dynamic Host Configuration Protocol server, if it is, being main Dynamic Host Configuration Protocol server by itself switching;
If standby server switching fails for main Dynamic Host Configuration Protocol server, then by removing the standby server in available server list Except standby server available server list lookup minimum the corresponding standby server of IP address, until find it is standby It is main Dynamic Host Configuration Protocol server with server successful switch;
After the heartbeat packet for receiving main Dynamic Host Configuration Protocol server fixed time broadcast, spare Dynamic Host Configuration Protocol server is gone off the air heartbeat packet, to The main Dynamic Host Configuration Protocol server returns to unicast heartbeat packet.
In order to solve the above technical problems, the present invention also provides a kind of Dynamic Host Configuration Protocol server redundant system, the system comprises Main Dynamic Host Configuration Protocol server and the spare Dynamic Host Configuration Protocol server that IP address pond is shared with main Dynamic Host Configuration Protocol server, wherein,
The main Dynamic Host Configuration Protocol server, for after it starts and works, spare Dynamic Host Configuration Protocol server being cooperateed with to obtain active service Device list;By the spare Dynamic Host Configuration Protocol server in the standby server list synchronization of acquisition to the standby server list;
The spare Dynamic Host Configuration Protocol server, for main Dynamic Host Configuration Protocol server to be cooperateed with to obtain standby server list;Receive main DHCP The standby server list that server is sent;And after main Dynamic Host Configuration Protocol server breaks down, by standby in standby server list Judgement is switched over Dynamic Host Configuration Protocol server, when meeting switching condition, switches and continues based on the IP for main Dynamic Host Configuration Protocol server Location pond works.
Further, main Dynamic Host Configuration Protocol server is cooperateed with spare Dynamic Host Configuration Protocol server obtains standby server list, including:
Main Dynamic Host Configuration Protocol server, for fixed time broadcast heartbeat packet;Receive the unicast heart returned from spare Dynamic Host Configuration Protocol server After jumping packet, which is stored into standby server list;If it is not received by provide for oneself in preset time The unicast heartbeat packet returned with spare Dynamic Host Configuration Protocol server existing in server list, then by for spare Dynamic Host Configuration Protocol server from It is deleted in the standby server list;
Spare Dynamic Host Configuration Protocol server after receiving the heartbeat packet of main Dynamic Host Configuration Protocol server broadcast, is returned to main Dynamic Host Configuration Protocol server Receipt broadcasts heartbeat packet.
Further, the spare Dynamic Host Configuration Protocol server, after working as main Dynamic Host Configuration Protocol server failure, by standby server Spare Dynamic Host Configuration Protocol server in list switches over judgement, when meeting switching condition, switches and continues to make for main Dynamic Host Configuration Protocol server Service is provided with the IP address pond, including:
The spare Dynamic Host Configuration Protocol server, it is described standby by receiving for after judging that main Dynamic Host Configuration Protocol server breaks down With the spare Dynamic Host Configuration Protocol server of server list in the corresponding standby server of standby server list lookup minimum IP address, sentence Whether disconnected itself is the standby server, if it is, being main Dynamic Host Configuration Protocol server by itself switching;And judging spare clothes When being engaged in device switching as the failure of main Dynamic Host Configuration Protocol server, by the standby server in standby server list in addition to the standby server Continue the corresponding standby server of IP address in standby server list lookup minimum, until the standby server success found Switch be in main Dynamic Host Configuration Protocol server or standby server list without for lookup standby server.
Further, which is characterized in that
The main Dynamic Host Configuration Protocol server is additionally operable to after work provide generation DHCP leases in service process for dhcp client Information, DHCP history lease cache files;And in standby server list, DHCP leases information and the DHCP for judging to obtain After at least one in history lease cache file three changes, by updated content synchronization to newest active service Spare Dynamic Host Configuration Protocol server in device list;
Spare Dynamic Host Configuration Protocol server in the standby server list is additionally operable to switching after main Dynamic Host Configuration Protocol server, to be based on DHCP leases file and the work of DHCP history leases cache file.
Further,
The standby server is additionally operable to itself switching as after main Dynamic Host Configuration Protocol server, the main DHCP before binding switching takes The virtual ip address that business device uses.
Further, which is characterized in that
The spare Dynamic Host Configuration Protocol server is additionally operable to after judging that main Dynamic Host Configuration Protocol server does not work, and is established comprising itself IP The available server list of address, and broadcast heartbeat packet;It receives after the heartbeat packet that other standby servers are broadcasted, Xiang Guang The standby server for broadcasting the heartbeat packet returns to unicast heartbeat packet;If receive the unicast returned from other spare Dynamic Host Configuration Protocol server Heartbeat packet then stores other spare Dynamic Host Configuration Protocol server into the available server list;In available server list lookup The corresponding spare Dynamic Host Configuration Protocol server of minimum IP address, judges whether itself is the spare Dynamic Host Configuration Protocol server, if it is, by itself Switch as main Dynamic Host Configuration Protocol server;And after judging standby server switching for the failure of main Dynamic Host Configuration Protocol server, then by available clothes The standby server being engaged in device list in addition to the standby server is corresponded in the IP address of available server list lookup minimum Standby server, until the standby server successful switch that finds is main Dynamic Host Configuration Protocol server;Main Dynamic Host Configuration Protocol server is received to determine When the heartbeat packet broadcasted after, spare Dynamic Host Configuration Protocol server is gone off the air heartbeat packet, and unicast heartbeat packet is returned to the main Dynamic Host Configuration Protocol server.
The active and standby Dynamic Host Configuration Protocol server of the embodiment above ensure that using the identical address pool for storing whole IP address Either master server work or standby server work can use whole IP address, provide the utilization of IP address Rate.
Description of the drawings
Fig. 1 is the method flow diagram of the Dynamic Host Configuration Protocol server master-slave redundancy of the present embodiment;
Fig. 2 is the system composition figure of the Dynamic Host Configuration Protocol server master-slave redundancy of the present embodiment.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature mutually can arbitrarily combine.
Fig. 1 is the method flow diagram of the Dynamic Host Configuration Protocol server master-slave redundancy of the present embodiment.
The main Dynamic Host Configuration Protocol server of S101 and spare Dynamic Host Configuration Protocol server start, the main Dynamic Host Configuration Protocol server and spare Dynamic Host Configuration Protocol server Shared IP address pond;
Configuration file is set for each Dynamic Host Configuration Protocol server, configuration file includes standby usage mark, IP address lease duration, IP Address pool information;Dynamic Host Configuration Protocol server starts according to configuration file;
S102 judges whether main Dynamic Host Configuration Protocol server works, if work, performs step S103;Otherwise, step S104 is performed;
The main Dynamic Host Configuration Protocol server of S103 cooperates with spare Dynamic Host Configuration Protocol server to obtain standby server list, performs S105;
The method that main Dynamic Host Configuration Protocol server cooperates with spare Dynamic Host Configuration Protocol server to obtain standby server list includes:Main DHCP service Device fixed time broadcast heartbeat packet;The spare Dynamic Host Configuration Protocol server of the heartbeat packet of main Dynamic Host Configuration Protocol server broadcast is received to main Dynamic Host Configuration Protocol server Return to unicast heartbeat packet;If main Dynamic Host Configuration Protocol server receives the unicast heartbeat packet returned from spare Dynamic Host Configuration Protocol server, should Spare Dynamic Host Configuration Protocol server is stored into standby server list;If main DHCP is come from without receiving to active service in preset time The unicast heartbeat packet that existing spare Dynamic Host Configuration Protocol server returns in device list, then by corresponding spare Dynamic Host Configuration Protocol server from described standby It is deleted in server list;
After the work of main Dynamic Host Configuration Protocol server, main Dynamic Host Configuration Protocol server provides IP Rental Services for dhcp client, and generates DHCP leases file, DHCP history lease cache files;The lease file includes multiple lease entries, and each lease entry is equal Record IP address, lease entry-into-force time, lease end time, the MAC Address of binding, user rs host name, status information;Wherein, IP address be the IP address leased, lease entry-into-force time and lease end time record be it is corresponding lease IP address it is effective when Between range, binding MAC Address record be rent whether the NIC address of this IP, state recording this lease entry change Become, such as whether client extends lease to be continuing with this IP address.When dhcp client does not use this rent About entry or lease entry it is expired after, main Dynamic Host Configuration Protocol server deletes the lease entry from lease file, this lease Entry is added to DHCP history lease cache files;
The spare Dynamic Host Configuration Protocol server of S104 selects main Dynamic Host Configuration Protocol server of the server as work, performs step S103;
Main Dynamic Host Configuration Protocol server of the server as work is selected from spare Dynamic Host Configuration Protocol server, including:
Spare Dynamic Host Configuration Protocol server foundation includes the available server list of own IP address, and broadcast heartbeat packet;It is described standby It is received after the heartbeat packet that other standby servers are broadcasted with server, is returned to the standby server for broadcasting the heartbeat packet Unicast heartbeat packet;
If standby server receives the unicast heartbeat packet returned from other spare Dynamic Host Configuration Protocol server, by this other it is standby It is stored with Dynamic Host Configuration Protocol server into the available server list;
Spare Dynamic Host Configuration Protocol server is in the corresponding spare Dynamic Host Configuration Protocol server of available server list lookup minimum IP address, judgement Whether itself is the spare Dynamic Host Configuration Protocol server, if it is, being main Dynamic Host Configuration Protocol server by itself switching;
If standby server switching fails for main Dynamic Host Configuration Protocol server, then by removing the standby server in available server list Except standby server available server list lookup minimum the corresponding standby server of IP address, until find it is standby It is main Dynamic Host Configuration Protocol server with server successful switch;
Main Dynamic Host Configuration Protocol server after switching continues fixed time broadcast heartbeat packet, receives the heart of main Dynamic Host Configuration Protocol server fixed time broadcast After jumping packet, spare Dynamic Host Configuration Protocol server is gone off the air heartbeat packet, and unicast heartbeat packet is returned to the main Dynamic Host Configuration Protocol server;
Standby usage can also be identified and broadcasted together, so as to receive the heart when broadcasting heartbeat packet by primary, spare Dynamic Host Configuration Protocol server The spare Dynamic Host Configuration Protocol server for jumping packet judges that the heartbeat packet of broadcast comes autonomous Dynamic Host Configuration Protocol server or spare Dynamic Host Configuration Protocol server;
The main Dynamic Host Configuration Protocol server of S105 will be spare on the standby server list synchronization to standby server list of acquisition Dynamic Host Configuration Protocol server;
Spare Dynamic Host Configuration Protocol server in S106 standby server lists judges whether main DHCP breaks down, if there is event Barrier, switches over judgement, by meeting the spare of switching condition by the spare Dynamic Host Configuration Protocol server in the standby server list Dynamic Host Configuration Protocol server switching continues to work based on the IP address pond for main Dynamic Host Configuration Protocol server;
Standby server judges that the method that main Dynamic Host Configuration Protocol server breaks down is:When standby server is in the first preset duration The interior heartbeat packet of signal, such as broadcast for being not received by main Dynamic Host Configuration Protocol server and sending, then it is assumed that event occurs in main Dynamic Host Configuration Protocol server Barrier;
After the spare Dynamic Host Configuration Protocol server in standby server list judges that main Dynamic Host Configuration Protocol server breaks down, search most The corresponding standby server of small IP address, judges whether itself is the standby server, if it is, based on itself switching Dynamic Host Configuration Protocol server;
If the spare Dynamic Host Configuration Protocol server in standby server list judges that standby server switching is main DHCP service Device fails, then by the standby server in standby server list in addition to the standby server in standby server list lookup The minimum corresponding standby server of IP address, until the standby server successful switch found is main Dynamic Host Configuration Protocol server or spare Without the standby server for lookup in server list;Judge method of the standby server switching for the failure of main Dynamic Host Configuration Protocol server For:The signal that main Dynamic Host Configuration Protocol server transmission is not received by the second preset duration then judges handover failure, wherein, second is default Time length ratio the first preset duration duration is long.
In other embodiments, to ensure taking over seamlessly for active/standby server, main Dynamic Host Configuration Protocol server needs will be after work The DHCP leases file generated in service process is provided for dhcp client, DHCP history lease cache files be synchronized to it is described standby With the spare Dynamic Host Configuration Protocol server in server list;When main Dynamic Host Configuration Protocol server judge obtain standby server list, After at least one in DHCP leases file and DHCP history lease cache file threes changes, i.e., by updated content The spare Dynamic Host Configuration Protocol server being synchronized in newest standby server list.Treat the spare DHCP service in standby server list Device switching is after main Dynamic Host Configuration Protocol server, works based on DHCP leases file, DHCP history lease cache files and IP address pond.
Further, it is transparent to client to protect the active and standby Dynamic Host Configuration Protocol server switching action of sign, it can be in spare Dynamic Host Configuration Protocol server Switch after main Dynamic Host Configuration Protocol server, to be continuing with the virtual ip address identical with the main Dynamic Host Configuration Protocol server before switching, so no matter How active and standby Dynamic Host Configuration Protocol server switches, and the server virtual IP address to communicate with dhcp client is unique, will not interrupt The business of DHCP customer sides.
After main Dynamic Host Configuration Protocol server switches, since the MAC Address of main DHCP switches, need to notify DHCP client End updates the MAC Address of main Dynamic Host Configuration Protocol server, to maintain the network connection between dhcp client and Dynamic Host Configuration Protocol server.
Fig. 2 is the system composition figure of the Dynamic Host Configuration Protocol server redundancy of the present embodiment.
The system includes main Dynamic Host Configuration Protocol server and the spare Dynamic Host Configuration Protocol server in IP address pond is shared with main Dynamic Host Configuration Protocol server, In,
Main Dynamic Host Configuration Protocol server, for spare Dynamic Host Configuration Protocol server after it starts and works, to be cooperateed with to obtain standby server row Table;And by the spare Dynamic Host Configuration Protocol server in the standby server list synchronization of acquisition to the standby server list;
The main Dynamic Host Configuration Protocol server is additionally operable to after work provide generation DHCP leases in service process for dhcp client Information, DHCP history lease cache files;The lease file includes multiple lease entries, and each lease entry is with recording IP Location, lease entry-into-force time, lease end time, the MAC Address of binding, user rs host name, status information;Wherein, IP address is The IP address leased, lease entry-into-force time and lease end time record be the corresponding effective time range for leasing IP address, The MAC Address record of binding has been to rent whether the NIC address of this IP, state recording this lease entry change, such as Whether client extends lease to be continuing with this IP address;When dhcp client do not use this lease entry or After person's lease entry is expired, main Dynamic Host Configuration Protocol server deletes the lease entry from lease file, this lease entry is added To DHCP history lease cache files;
Spare Dynamic Host Configuration Protocol server, for main Dynamic Host Configuration Protocol server to be cooperateed with to obtain standby server list;Receive main DHCP service The standby server list that device is sent;And after main Dynamic Host Configuration Protocol server breaks down, by spare in standby server list Dynamic Host Configuration Protocol server switches over judgement, when meeting switching condition, switches and continues for main Dynamic Host Configuration Protocol server based on the IP address Pond works.
Above-mentioned main Dynamic Host Configuration Protocol server is cooperateed with spare Dynamic Host Configuration Protocol server obtains standby server list, including:
Main Dynamic Host Configuration Protocol server, for fixed time broadcast heartbeat packet;Receive the unicast heart returned from spare Dynamic Host Configuration Protocol server After jumping packet, which is stored into standby server list;If it is not received by provide for oneself in preset time The unicast heartbeat packet returned with spare Dynamic Host Configuration Protocol server existing in server list, then by for spare Dynamic Host Configuration Protocol server from It is deleted in the standby server list;
Spare Dynamic Host Configuration Protocol server after receiving the heartbeat packet of main Dynamic Host Configuration Protocol server broadcast, is returned to main Dynamic Host Configuration Protocol server Receipt broadcasts heartbeat packet.
Above-mentioned spare Dynamic Host Configuration Protocol server is judged after main Dynamic Host Configuration Protocol server breaks down, by standby server list Spare Dynamic Host Configuration Protocol server switch over judgement, when meeting switching condition, switch as main Dynamic Host Configuration Protocol server, including:
The spare Dynamic Host Configuration Protocol server, after judging that main Dynamic Host Configuration Protocol server breaks down, by receiving the spare clothes Be engaged in device list spare Dynamic Host Configuration Protocol server in the corresponding standby server of standby server list lookup minimum IP address, judge from Whether body is the standby server, if it is, being main Dynamic Host Configuration Protocol server by itself switching;And judging standby server Switch when failing for main Dynamic Host Configuration Protocol server, continued by the standby server in standby server list in addition to the standby server In the corresponding standby server of IP address of standby server list lookup minimum, until the standby server successful switch found Be in main Dynamic Host Configuration Protocol server or standby server list without for lookup standby server.
Standby server judges that the method that main Dynamic Host Configuration Protocol server breaks down is:When standby server is in the first preset duration The interior heartbeat packet of signal, such as broadcast for being not received by main Dynamic Host Configuration Protocol server and sending, then it is assumed that event occurs in main Dynamic Host Configuration Protocol server Barrier.
Standby server judges that the switching of other standby servers is for the method for main Dynamic Host Configuration Protocol server failure:It is default second Duration be not received by the signal that main Dynamic Host Configuration Protocol server is sent then judge switching be by, wherein, the second preset duration is than first in advance If duration duration is long.
Above-mentioned standby server, it may also be used for after judging that main Dynamic Host Configuration Protocol server does not work, a server is selected to make For the main Dynamic Host Configuration Protocol server of work, including:Standby server establishes the available server list for including own IP address, and broadcasts Heartbeat packet;Standby server is received after the heartbeat packet that other standby servers are broadcasted, to broadcast the heartbeat packet it is spare Server returns to unicast heartbeat packet;If standby server receives the unicast heartbeat returned from other spare Dynamic Host Configuration Protocol server Packet, then store other spare Dynamic Host Configuration Protocol server into the available server list;Standby server is arranged in available server The corresponding spare Dynamic Host Configuration Protocol server of table search minimum IP address, judges whether itself is the spare Dynamic Host Configuration Protocol server, if it is, It is main Dynamic Host Configuration Protocol server by itself switching;And after judging standby server switching for the failure of main Dynamic Host Configuration Protocol server, then by Standby server in available server list in addition to the standby server is in the IP of available server list lookup minimum The corresponding standby server in location, until the standby server successful switch found is main Dynamic Host Configuration Protocol server;
Due to the main Dynamic Host Configuration Protocol server after switching still can fixed time broadcast heartbeat packet, spare Dynamic Host Configuration Protocol server receiving come After the heartbeat packet of autonomous Dynamic Host Configuration Protocol server broadcast, heartbeat packet of going off the air returns to unicast heartbeat packet to the main Dynamic Host Configuration Protocol server.
Standby usage can also be identified and broadcasted together, so as to receive the heart when broadcasting heartbeat packet by primary, spare Dynamic Host Configuration Protocol server The spare Dynamic Host Configuration Protocol server for jumping packet judges that the heartbeat packet of broadcast comes autonomous Dynamic Host Configuration Protocol server or spare Dynamic Host Configuration Protocol server.
In other embodiments, to ensure taking over seamlessly for active/standby server, the main Dynamic Host Configuration Protocol server is additionally operable in work It is provided after work for dhcp client and DHCP leases information, DHCP history lease cache files is generated in service process;And sentencing At least one in the standby server list for acquisition, DHCP leases information and DHCP history lease cache file threes of breaking is sent out After changing, by the spare Dynamic Host Configuration Protocol server in updated content synchronization to newest standby server list.It is described spare Spare Dynamic Host Configuration Protocol server in server list is additionally operable to switching as after main Dynamic Host Configuration Protocol server, based on DHCP leases file, DHCP History lease cache file and the work of IP address pond.
Further, transparent to client to protect the active and standby Dynamic Host Configuration Protocol server switching action of sign, the standby server is also used In itself switching is continued and visitor for the virtual ip address that after main Dynamic Host Configuration Protocol server, the main Dynamic Host Configuration Protocol server before binding switching uses Family end communicates, and no matter how active and standby Dynamic Host Configuration Protocol server switches in this way, and the virtual ip address to communicate with dhcp client is unique, The business of DHCP customer sides will not be interrupted.After main Dynamic Host Configuration Protocol server switches, since the MAC Address of main DHCP is cut It changes, needs the MAC Address that dhcp client is notified to update main Dynamic Host Configuration Protocol server.
One of ordinary skill in the art will appreciate that all or part of step in the above method can be instructed by program Related hardware is completed, and described program can be stored in computer readable storage medium, such as read-only memory, disk or CD Deng.Optionally, all or part of step of above-described embodiment can also be realized using one or more integrated circuits, accordingly Ground, the form that hardware may be used in each module/unit in above-described embodiment are realized, can also use the shape of software function module Formula is realized.The present invention is not limited to the combinations of the hardware and software of any particular form.
It should be noted that the present invention can also have other various embodiments, without departing substantially from of the invention spiritual and its essence In the case of, those skilled in the art can make various corresponding changes and deformation according to the present invention, but these are corresponding Change and deform the protection domain that should all belong to appended claims of the invention.

Claims (8)

  1. A kind of 1. method of Dynamic Host Configuration Protocol server redundancy, which is characterized in that the method includes:
    Main Dynamic Host Configuration Protocol server and spare Dynamic Host Configuration Protocol server start, and the main Dynamic Host Configuration Protocol server and spare Dynamic Host Configuration Protocol server are with sharing IP Location pond;
    If main Dynamic Host Configuration Protocol server work, main Dynamic Host Configuration Protocol server cooperate with spare Dynamic Host Configuration Protocol server to obtain standby server list;
    Main Dynamic Host Configuration Protocol server takes the spare DHCP on the standby server list synchronization of acquisition to the standby server list Business device;
    After main Dynamic Host Configuration Protocol server breaks down, switched over and sentenced by the spare Dynamic Host Configuration Protocol server in the standby server list It is disconnected, switched by the spare Dynamic Host Configuration Protocol server for meeting switching condition and continue to work based on the IP address pond for main Dynamic Host Configuration Protocol server;
    Wherein, after main Dynamic Host Configuration Protocol server breaks down, the spare Dynamic Host Configuration Protocol server for receiving the standby server list exists The corresponding standby server of standby server list lookup minimum IP address, judges whether itself is the standby server, if It is then main Dynamic Host Configuration Protocol server by itself switching to be;
    If standby server switching for main Dynamic Host Configuration Protocol server fail, then by standby server list in addition to the standby server Standby server standby server list lookup minimum the corresponding standby server of IP address, until the spare clothes that find Business device successful switch is nothing in main Dynamic Host Configuration Protocol server or standby server list for the standby server of lookup;
    Main Dynamic Host Configuration Protocol server provides the DHCP leases file generated in service process, DHCP history after work for dhcp client Lease cache file;
    When main Dynamic Host Configuration Protocol server is in standby server list, DHCP leases file and the DHCP history lease caching for judging to obtain It, will be standby in updated content synchronization to newest standby server list after at least one in file three changes Use Dynamic Host Configuration Protocol server;
    After the spare Dynamic Host Configuration Protocol server switching in standby server list is main Dynamic Host Configuration Protocol server, also based on DHCP leases text Part, the work of DHCP history leases cache file.
  2. 2. the method as described in claim 1, which is characterized in that the main Dynamic Host Configuration Protocol server collaboration standby server obtains spare Server list, including:
    Main Dynamic Host Configuration Protocol server fixed time broadcast heartbeat packet;
    The spare Dynamic Host Configuration Protocol server for receiving the heartbeat packet of main Dynamic Host Configuration Protocol server broadcast returns to unicast heartbeat to main Dynamic Host Configuration Protocol server Packet;
    If main Dynamic Host Configuration Protocol server receives the unicast heartbeat packet returned from spare Dynamic Host Configuration Protocol server, by the spare DHCP service Device is stored into standby server list;
    If main DHCP is returned in preset time without receiving to come to spare Dynamic Host Configuration Protocol server existing in standby server list The unicast heartbeat packet returned, then delete corresponding spare Dynamic Host Configuration Protocol server from the standby server list.
  3. 3. the method as described in claim 1, which is characterized in that the spare Dynamic Host Configuration Protocol server switching is main Dynamic Host Configuration Protocol server Afterwards, it further includes:
    The virtual ip address that the main Dynamic Host Configuration Protocol server before the binding switching of main Dynamic Host Configuration Protocol server after switching uses.
  4. 4. method as claimed in claim 2, which is characterized in that the method further includes:
    If main Dynamic Host Configuration Protocol server does not work, spare Dynamic Host Configuration Protocol server foundation includes the available server list of own IP address, and Broadcast heartbeat packet;
    The standby server is received after the heartbeat packet that other standby servers are broadcasted, to broadcast the heartbeat packet it is spare Server returns to unicast heartbeat packet;
    If standby server receives the unicast heartbeat packet returned from other spare Dynamic Host Configuration Protocol server, by this other it is spare Dynamic Host Configuration Protocol server is stored into the available server list;
    Spare Dynamic Host Configuration Protocol server judges itself in the corresponding spare Dynamic Host Configuration Protocol server of available server list lookup minimum IP address Whether it is the spare Dynamic Host Configuration Protocol server, if it is, being main Dynamic Host Configuration Protocol server by itself switching;
    If standby server switching for main Dynamic Host Configuration Protocol server fail, then by available server list in addition to the standby server Standby server available server list lookup minimum the corresponding standby server of IP address, until the spare clothes that find Device successful switch be engaged in as main Dynamic Host Configuration Protocol server;
    After the heartbeat packet for receiving main Dynamic Host Configuration Protocol server fixed time broadcast, spare Dynamic Host Configuration Protocol server is gone off the air heartbeat packet, to the master Dynamic Host Configuration Protocol server returns to unicast heartbeat packet.
  5. 5. a kind of Dynamic Host Configuration Protocol server redundant system, which is characterized in that taken the system comprises main Dynamic Host Configuration Protocol server and with main DHCP Business device shares the spare Dynamic Host Configuration Protocol server in IP address pond, wherein,
    The main Dynamic Host Configuration Protocol server, for spare Dynamic Host Configuration Protocol server after it starts and works, to be cooperateed with to obtain standby server row Table;By the spare Dynamic Host Configuration Protocol server in the standby server list synchronization of acquisition to the standby server list;
    The spare Dynamic Host Configuration Protocol server, for main Dynamic Host Configuration Protocol server to be cooperateed with to obtain standby server list;Receive main DHCP service The standby server list that device is sent;And after main Dynamic Host Configuration Protocol server breaks down, by spare in standby server list Dynamic Host Configuration Protocol server switches over judgement, when meeting switching condition, switches and continues for main Dynamic Host Configuration Protocol server based on the IP address Pond works, wherein,
    The spare Dynamic Host Configuration Protocol server, for after judging that main Dynamic Host Configuration Protocol server breaks down, by receiving the spare clothes Be engaged in device list spare Dynamic Host Configuration Protocol server in the corresponding standby server of standby server list lookup minimum IP address, judge from Whether body is the standby server, if it is, being main Dynamic Host Configuration Protocol server by itself switching;And judging standby server Switch when failing for main Dynamic Host Configuration Protocol server, continued by the standby server in standby server list in addition to the standby server In the corresponding standby server of IP address of standby server list lookup minimum, until the standby server successful switch found Be in main Dynamic Host Configuration Protocol server or standby server list without for lookup standby server;
    The main Dynamic Host Configuration Protocol server is additionally operable to after work provide generation DHCP leases letter in service process for dhcp client Breath, DHCP history lease cache files;And it is gone through in standby server list, DHCP leases information and the DHCP for judging to obtain After at least one in history lease cache file three changes, by updated content synchronization to newest standby server Spare Dynamic Host Configuration Protocol server in list;
    Spare Dynamic Host Configuration Protocol server in the standby server list is additionally operable to switching as after main Dynamic Host Configuration Protocol server, based on DHCP Lease file and the work of DHCP history leases cache file.
  6. 6. system as claimed in claim 5, which is characterized in that main Dynamic Host Configuration Protocol server cooperates with acquisition standby with spare Dynamic Host Configuration Protocol server With server list, including:
    Main Dynamic Host Configuration Protocol server, for fixed time broadcast heartbeat packet;Receive the unicast heartbeat packet returned from spare Dynamic Host Configuration Protocol server Afterwards, which is stored into standby server list;If it is not received by preset time from spare clothes Be engaged in the unicast heartbeat packet that existing spare Dynamic Host Configuration Protocol server returns in device list, then by for spare Dynamic Host Configuration Protocol server from described It is deleted in standby server list;
    Spare Dynamic Host Configuration Protocol server after receiving the heartbeat packet of main Dynamic Host Configuration Protocol server broadcast, returns single to main Dynamic Host Configuration Protocol server Broadcast heartbeat packet.
  7. 7. system as claimed in claim 5, which is characterized in that
    The standby server is additionally operable to itself switching after main Dynamic Host Configuration Protocol server, to bind the main Dynamic Host Configuration Protocol server before switching The virtual ip address used.
  8. 8. system as claimed in claim 6, which is characterized in that
    The spare Dynamic Host Configuration Protocol server is additionally operable to after judging that main Dynamic Host Configuration Protocol server does not work, and is established comprising own IP address Available server list, and broadcast heartbeat packet;It receives after the heartbeat packet that other standby servers are broadcasted, it should to broadcast The standby server of heartbeat packet returns to unicast heartbeat packet;If receive the unicast heartbeat returned from other spare Dynamic Host Configuration Protocol server Packet, then store other spare Dynamic Host Configuration Protocol server into the available server list;In available server list lookup minimum The corresponding spare Dynamic Host Configuration Protocol server of IP address, judges whether itself is the spare Dynamic Host Configuration Protocol server, if it is, itself is switched For main Dynamic Host Configuration Protocol server;And after judging standby server switching for the failure of main Dynamic Host Configuration Protocol server, then by available server Standby server in list in addition to the standby server is corresponding standby in the IP address of available server list lookup minimum With server, until the standby server successful switch found is main Dynamic Host Configuration Protocol server;It is wide to receive main Dynamic Host Configuration Protocol server timing After the heartbeat packet broadcast, spare Dynamic Host Configuration Protocol server is gone off the air heartbeat packet, and unicast heartbeat packet is returned to the main Dynamic Host Configuration Protocol server.
CN201410145280.5A 2014-04-11 2014-04-11 A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy Active CN103945016B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410145280.5A CN103945016B (en) 2014-04-11 2014-04-11 A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410145280.5A CN103945016B (en) 2014-04-11 2014-04-11 A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy

Publications (2)

Publication Number Publication Date
CN103945016A CN103945016A (en) 2014-07-23
CN103945016B true CN103945016B (en) 2018-07-06

Family

ID=51192496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410145280.5A Active CN103945016B (en) 2014-04-11 2014-04-11 A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy

Country Status (1)

Country Link
CN (1) CN103945016B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105791251B (en) * 2014-12-26 2019-02-05 中国移动通信集团公司 A kind of network service moving method, device and router
CN104506654B (en) * 2015-01-08 2019-04-19 中国联合网络通信集团有限公司 Cloud computing system and Dynamic Host Configuration Protocol server backup method
CN105007233B (en) * 2015-07-13 2018-02-27 互联网域名系统北京市工程研究中心有限公司 A kind of method that distribution address is loaded based on Dynamic Host Configuration Protocol server cluster
CN107291580A (en) * 2017-05-04 2017-10-24 复旦大学 MATLAB software system and method
CN107995327B (en) * 2017-12-22 2020-07-28 盛科网络(苏州)有限公司 Method for sharing information between DHCP servers in real time based on DHCP message
CN110365930B (en) * 2018-04-11 2021-07-30 视联动力信息技术股份有限公司 Data processing method and device
CN109507866A (en) * 2018-12-07 2019-03-22 天津津航计算技术研究所 A kind of double-machine redundancy system and method based on network address drift technology
CN112769600B (en) * 2020-12-29 2022-08-30 新华三技术有限公司 DHCP escape method, device, equipment and machine readable storage medium

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060391A (en) * 2007-05-16 2007-10-24 华为技术有限公司 Master and spare server switching method and system and master server and spare server
CN101090309A (en) * 2007-07-18 2007-12-19 杭州华三通信技术有限公司 Method for implementing DHCP service redundant and DHCP server
CN101309167B (en) * 2008-06-27 2011-04-20 华中科技大学 Disaster allowable system and method based on cluster backup
CN101330531B (en) * 2008-07-31 2011-01-19 杭州华三通信技术有限公司 Method for processing DHCP address allocation and DHCP relay
CN101465862A (en) * 2009-01-09 2009-06-24 北京星网锐捷网络技术有限公司 Method and device for processing switch of authentication business, network appliance and communication system
CN101695049A (en) * 2009-11-10 2010-04-14 杭州华三通信技术有限公司 Method and device for processing businesses in monitoring system
CN102064951A (en) * 2009-11-18 2011-05-18 中兴通讯股份有限公司 Method for implementing master and standby DHCP servers
CN102098354B (en) * 2011-02-28 2014-09-10 北京星网锐捷网络技术有限公司 Method and server for allocating dynamic host configuration protocol (DHCP) addresses
CN102404146B (en) * 2011-11-17 2014-10-29 福建星网锐捷网络有限公司 Master-slave switching method, network device and DHCP server
CN102572014B (en) * 2012-03-07 2015-12-02 华为终端有限公司 Message treatment method, device and system
US20140006568A1 (en) * 2012-06-28 2014-01-02 Alcatel-Lucent Canada, Inc. Prioritization based on ip pool and subnet by dhcp
CN103067206B (en) * 2012-12-28 2016-07-06 无锡博欧节能科技有限公司 Internet of Things is across the distributed full-automatic heat standby server switched system of machine room
CN103248724A (en) * 2013-04-19 2013-08-14 中国(南京)未来网络产业创新中心 SDN (Software-Defined Networking) controller-based DHCP (Dynamic Host Configuration Protocol) broadcast processing method
CN103560922A (en) * 2013-11-18 2014-02-05 北京特立信电子技术股份有限公司 Disaster recovery method and system

Also Published As

Publication number Publication date
CN103945016A (en) 2014-07-23

Similar Documents

Publication Publication Date Title
CN103945016B (en) A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy
CN101330531B (en) Method for processing DHCP address allocation and DHCP relay
EP2654268B1 (en) Address allocation processing method and apparatus
EP2648114B1 (en) Method, system, token conreoller and memory database for implementing distribute-type main memory database system
CN105471995B (en) Extensive Web service group of planes high availability implementation method based on SOA
CN101090309A (en) Method for implementing DHCP service redundant and DHCP server
CN102244690B (en) Address allocation method and system of dynamic host configuration protocol (DHCP) as well as client side and servers of same
EP2843910A1 (en) Address allocation method, device, and system
CN101471898B (en) Protection method, system and virtual access edge node for access network
CN104601959A (en) Video monitoring system and method for rapidly accessing web camera
CA2560625A1 (en) Highly-available blade-based distributed computing system
CN109005045A (en) Active and standby service system and host node fault recovery method
EP2888863B1 (en) Method and apparatus for configuring dhcp client
CN110620694B (en) Client online recovery method and device, electronic equipment and storage medium
CN113169895A (en) N +1 redundancy for virtualization services with low latency failover
CN106612339A (en) Domain name updating method, system and main DNS (Domain Name System) server
CN104506372A (en) Method and system for realizing host-backup server switching
CN101217477B (en) A method, device and router to realize DHCP lease smoothing switching in VRRP backup group
CN101577723B (en) Method for preventing neighbor discovery protocol message attack and device
JP2003348136A (en) Router setting method
CN101079800B (en) A method and system for improving P2P network stability
CN111404978B (en) Data storage method and cloud storage system
CN104158694B (en) The hot spare method and device of DHCPv6 servers
CN115499414A (en) Address allocation method and device
CN115460160A (en) Network communication method, system, storage medium and switch based on Full-Mesh networking

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: INST OF MICROELECTRONICS, C. A. S

Free format text: FORMER OWNER: JIANGSU INTERNET OF THINGS RESEARCH + DEVELOMENT CO., LTD.

Effective date: 20150624

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20150624

Address after: 100029 Beijing city Chaoyang District Beitucheng West Road No. 3

Applicant after: Institute of Microelectronics, Chinese Academy of Sciences

Address before: 214135 Jiangsu province Wuxi city Wuxi District Road No. 200 China Linghu Sensor Network International Innovation Park building C

Applicant before: JIANGSU R & D CENTER FOR INTERNET OF THINGS

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20160113

Address after: 214135 Jiangsu Wuxi District Road No. 200 China Linghu Sensor Network International Innovation Park C building 10 floor

Applicant after: JIANGSU ZHONGKE YILIAN COMMUNICATION TECHNOLOGY Co.,Ltd.

Address before: 100029 Beijing city Chaoyang District Beitucheng West Road No. 3

Applicant before: Institute of Microelectronics, Chinese Academy of Sciences

GR01 Patent grant
GR01 Patent grant
PP01 Preservation of patent right

Effective date of registration: 20230905

Granted publication date: 20180706

PP01 Preservation of patent right
PD01 Discharge of preservation of patent

Date of cancellation: 20240119

Granted publication date: 20180706

PD01 Discharge of preservation of patent