CN102404146B - Master-slave switching method, network device and DHCP server - Google Patents
Master-slave switching method, network device and DHCP server Download PDFInfo
- Publication number
- CN102404146B CN102404146B CN201110366414.2A CN201110366414A CN102404146B CN 102404146 B CN102404146 B CN 102404146B CN 201110366414 A CN201110366414 A CN 201110366414A CN 102404146 B CN102404146 B CN 102404146B
- Authority
- CN
- China
- Prior art keywords
- dhcp
- server
- master
- configuration protocol
- dynamic host
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 230000004044 response Effects 0.000 claims abstract description 81
- 230000002159 abnormal effect Effects 0.000 claims description 23
- 238000001514 detection method Methods 0.000 claims description 23
- 230000005540 biological transmission Effects 0.000 claims description 12
- 230000008569 process Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 4
- 230000011664 signaling Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 230000001052 transient effect Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention provides a master-slave switching method, a network device and a DHCP server. The method comprises the following steps that a DHCP repeater transmits the DHCP request message to a DHCP master server and receives the DHCP response message returned by the DHCP master server; if the DHCP repeater parses the DHCP response message to obtain the IP address and master-slave switching identifier of a DHCP slave server, the DHCP repeater executes the master-slave switching between the DHCP master server and the DHCP slave server according to the switching strategy corresponding to the master-slave switching identifier. According to the master-slave switching method, the network device and the DHCP server, the problem that the master server and slave server work at the same time, caused by that the state of the master serve and slave server is judged improperly can be solved.
Description
Technical field
The present invention relates to master-slave equipment coordination technique, relate in particular to a kind of master-slave switching method, the network equipment and Dynamic Host Configuration Protocol server, belong to wireless communication technology field.
Background technology
DHCP (Dynamic Host Configuration Protocol, DHCP) adopts the operating mechanism of client and server, is a kind of TCP/IP standard of simplifying host IP address configuration management.This standard allows Dynamic Host Configuration Protocol server to provide IP address and other relevant configuration information to client.Dhcp client obtains IP address by sending broadcasting packet application, and when Dynamic Host Configuration Protocol server is with dhcp client during a local area network (LAN) inside, Dynamic Host Configuration Protocol server can be directly dhcp client distributing IP address.When dhcp client and Dynamic Host Configuration Protocol server, when a local area network (LAN) is inner, need in the local area network (LAN) at dhcp client place, not dispose DHCP relay device, by DHCP relay device, forward DHCP request message.DHCP relay device, in the process E-Packeting, carries local gateway address and in DHCP message, sends in the lump Dynamic Host Configuration Protocol server.Dynamic Host Configuration Protocol server is the IP address of user assignment and gateway same network segment according to the gateway address in DHCP message.Fig. 1 is a kind of topology diagram of DHCP application.As shown in Figure 1, Dynamic Host Configuration Protocol server and dhcp client be not in a local area network (LAN), and during dhcp client application IP address, DHCP relay device carries out the forwarding of DHCP message between dhcp client and Dynamic Host Configuration Protocol server.
Conventionally, in order to prevent Dynamic Host Configuration Protocol server Single Point of Faliure problem, in DHCP application, can dispose two Dynamic Host Configuration Protocol server, one is DHCP master server, and another is that DHCP is from server.When master server is hung up, by certain technology, activate role that DHCP bears rapidly master server from server and continue as user in network and provide application IP addresses to serve.Fig. 2 is the topology diagram with the DHCP application of hot standby structure.As shown in Figure 2, Dynamic Host Configuration Protocol server is divided into DHCP master server and DHCP from server.DHCP master server can be synchronized to data from server in the process of address assignment, at master server duration of work, from server, does not work, and only completes the backup functionality of data.DHCP master server and from the backup relation between server conventionally by one independently backup path carry out, can be direct-connected between passage also can be interconnected by intermediate equipment.Between principal and subordinate's server by sending out mutually keep-alive message to determine the other side's operating state; from server, not receiving keep-alive message certain hour, confirm master server operation irregularity and take over master server to complete DHCP and share out the work; and after resuming work, DHCP master server by from the synchronization of data content of server to master server, by master server, proceeds work.
When adopting aforesaid way to coordinate DHCP master server and DHCP from switching between server, if in the completely normal situation of master server work, the communication link disconnection between principal and subordinate's server, the situation that can cause principal and subordinate's server simultaneously to work.Due to principal and subordinate's server, configuration is identical conventionally, therefore in the situation that principal and subordinate's server is worked simultaneously, will cause the address conflict of whole net distribution.
Summary of the invention
For above-mentioned defect, the invention provides a kind of master-slave switching method, the network equipment and Dynamic Host Configuration Protocol server, in order to solve the problem because the improper principal and subordinate's of the causing server of state judgement is worked between principal and subordinate's server simultaneously.
According to an aspect of the present invention, provide a kind of master-slave switching method, comprising:
DHCP relay device forwards DHCP request message to DHCP master server, and receives the dhcp response message that described DHCP master server returns;
If described DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify corresponding switchover policy and carry out described DHCP master server and described DHCP from the master-slave swap between server.
According to a further aspect in the invention, also provide a kind of network equipment, comprising:
Transceiver module, for forwarding DHCP request message to DHCP master server, and receives the dhcp response message that described DHCP master server returns;
Master-slave swap module, if for passing through to resolve described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify corresponding switchover policy and carry out described DHCP master server and described DHCP from the master-slave swap between server.。
According to another aspect of the invention, also provide a kind of master-slave switching method, comprising:
Dynamic Host Configuration Protocol server receives the DHCP request message that DHCP relay device forwards;
Described Dynamic Host Configuration Protocol server is according to described DHCP request message, to described DHCP relay device, return to dhcp response message, wherein said dhcp response message carries IP address and the master-slave swap sign of backup Dynamic Host Configuration Protocol server, master-slave swap sign, identifies corresponding switchover policy according to described master-slave swap and carries out described DHCP master server and described DHCP from the master-slave swap between server.
In accordance with a further aspect of the present invention, also provide a kind of Dynamic Host Configuration Protocol server, comprising:
Receiver module, the DHCP request message forwarding for receiving DHCP relay device;
Respond module, be used for according to described DHCP request message, to described DHCP relay device, return to dhcp response message, wherein said dhcp response message carries the backup IP address of Dynamic Host Configuration Protocol server and master-slave swap sign, so that described DHCP relay device identifies corresponding switchover policy according to described master-slave swap, carries out described DHCP master server and described DHCP from the master-slave swap between server.
According to master-slave switching method of the present invention, the network equipment and Dynamic Host Configuration Protocol server, by IP address and the switchover policy from dhcp response message learning DHCP from server by DHCP relay device, according to switchover policy, carry out master-slave swap, because this master-slave swap operation is judged and carried out by DHCP relay device, DHCP relay device sends DHCP request message to which server, which server is workspace server, so situation that there will not be DHCP master server and DHCP simultaneously to work from server, thereby avoided because of DHCP master server and DHCP from server, be the problem that dhcp client duplicate allocation IP causes IP confusion.
Accompanying drawing explanation
Fig. 1 is a kind of topology diagram of DHCP application.
Fig. 2 is the topology diagram with the DHCP application of hot standby structure.
Fig. 3 is the schematic flow sheet of master-slave switching method of the present invention.
Fig. 4 is the first example signaling diagram of communicating by letter between DHCP relay device and the master and slave server of DHCP in master-slave switching method of the present invention.
Fig. 5 is the second example signaling diagram of communicating by letter between DHCP relay device and the master and slave server of DHCP in master-slave switching method of the present invention.
Fig. 6 is the structural representation of the network equipment of the present invention.
Fig. 7 is the schematic flow sheet of another master-slave switching method of the present invention.
Fig. 8 is the structural representation of Dynamic Host Configuration Protocol server of the present invention.
Embodiment
Fig. 3 is the schematic flow sheet of master-slave switching method of the present invention.As shown in Figure 3, this master-slave switching method comprises:
Step S301, DHCP relay device forwards DHCP request message to DHCP master server, and receives the dhcp response message that described DHCP master server returns;
Step S302, if DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify corresponding switchover policy and carry out described DHCP master server and described DHCP from the master-slave swap between server.
The master-slave switching method of above-described embodiment can be applicable to the topological structure shown in Fig. 2.
Particularly, in DHCP relay device, be provided with the IP address of DHCP master server in advance.Under initial condition, DHCP relay device and DHCP master server communicate, i.e. DHCP master server work for the treatment of state, is dhcp client distributing IP address.
When dhcp client access network, to DHCP relay device, send DHCP request message.DHCP relay device receives after DHCP request message, according to the IP address of pre-configured DHCP master server, to DHCP master server, forwards this DHCP request message.DHCP master server receives after DHCP request message, responds this DHCP request message, carries out IP distribution etc., and return to dhcp response message to DHCP relay device for this dhcp client.The field structure table that table 1 is dhcp response message.
Table 1
Wherein, DHCP master server carries following information in optional (option) of dhcp response message field:
The 1st byte (taking 0-7 bit) with for represent the entrained IP address of this field 2-5 byte be the IP address of DHCP master server or DHCP from the sign of the IP address of server, 0 represents that DHCP is from server, 1 represents DHCP master server;
2-5 byte (taking 8-39 bit) with the IP address of DHCP master server or DHCP from the IP address of server, when the 1st byte be designated 0 time, IP address with DHCP from server, when the 1st byte be designated 1 time, with the IP address of DHCP master server;
The 6th byte (taking 40-47 bit) identifies with master-slave swap, this master-slave swap sign is used to indicate DHCP relay device and whether immediately the indicated Server switching of the 1st byte is arrived to operating state, 1 represents to switch immediately, 0 represents not switch immediately, when the Dynamic Host Configuration Protocol server of work at present breaks down, carries out and switches.
According to the master-slave switching method of above-described embodiment, by IP address and the switchover policy from dhcp response message learning DHCP from server by DHCP relay device, according to switchover policy, carry out master-slave swap, because this master-slave swap operation is judged and carried out by DHCP relay device, DHCP relay device sends DHCP request message to which server, which server is workspace server, so situation that there will not be DHCP master server and DHCP simultaneously to work from server, thereby avoided because of DHCP master server and DHCP from server, be the problem that dhcp client duplicate allocation IP causes IP confusion.
Further, in the master-slave switching method of above-described embodiment, if described DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify that corresponding switchover policy is carried out described DHCP master server and described DHCP specifically comprises from the master-slave swap between server:
If described DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and be used to indicate and carry out the first master-slave swap sign of switching when abnormal, when detecting the link know between described DHCP master server or self and described DHCP master server, occur when abnormal, according to described DHCP, from the IP address of server, to described DHCP from server, to forward DHCP request message.
Particularly, in the dhcp response message sending at DHCP master server, option field is set to conventionally: the 1st byte is the IP address (be for example 1.1.1.1) of 0, the 2-5 byte with DHCP from server, and the 6th byte is 0.
DHCP relay device is resolved dhcp response message, if get DHCP from the IP address of server from the option field of dhcp response message and be the master-slave swap sign of " 0 ", record DHCP from the IP address of server, and continued the DHCP request message receiving from dhcp client to forward to DHCP master server before the link occurs fault not detecting between DHCP master server or self and described DHCP master server.
More specifically, Fig. 4 is the first example signaling diagram of communicating by letter between DHCP relay device and the master and slave server of DHCP in master-slave switching method of the present invention.As shown in Figure 4, comprise the following steps:
Step S401, DHCP relay device sends DHCP request message to DHCP master server;
Step S402, when sending DHCP request message, DHCP relay device is at local open detection timer;
Step S403, if after the detection timer expiry of opening, does not receive the dhcp response message that DHCP master server returns, and again to DHCP master server, sends DHCP request message;
Step S404, restarts detection timer;
Step S405, if after detecting timer expiry, do not receive yet the dhcp response message that DHCP master server returns, disconnect with DHCP master server communicate by letter and by DHCP from Server switching to operating state, that is: the IP address from server according to DHCP, forwards to DHCP the DHCP request message that does not receive response from server;
Step S406, DHCP processes this DHCP request message from server, and returns to dhcp response message to DHCP relay device.
So far, having completed the operating state of DHCP master server to DHCP from server switches.
According to the master-slave switching method of above-described embodiment, by the IP address from dhcp response message learning DHCP from server and the switchover policy of master-slave swap occurs to carry out when abnormal by DHCP relay device, in the process communicating with DHCP master server, the state of DHCP master server is detected, and when detect between DHCP master server or self and DHCP master server link occurs fault time, according to study to DHCP from the IP address switchover of server for to communicate from server with DHCP, so that DHCP is the dhcp client distributing IP address of request access network from server, the Dynamic Host Configuration Protocol server that is about to work in network is switched to from server by master server.This master-slave swap operation is judged and is carried out by DHCP relay device, DHCP relay device sends DHCP request message to which server, which server is workspace server, so the situation that there will not be DHCP master server and DHCP simultaneously to work from server, thus avoided because of DHCP master server and DHCP from server, be the problem that dhcp client duplicate allocation IP causes IP confusion.
Further, in the master-slave switching method of above-described embodiment, if DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify that corresponding switchover policy is carried out described DHCP master server and described DHCP specifically comprises from the master-slave swap between server:
If described DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and be used to indicate and carry out immediately the second master-slave swap sign of switching,, when again receiving the DHCP request message of dhcp client transmission, according to described DHCP, from the IP address of server, to described DHCP from server, forward DHCP request message.
Particularly, DHCP master server also as required the second master-slave swap sign in dhcp response message be set to 1.For example, when DHCP master server is communicated by letter with a plurality of DHCP relay devices, if the DHCP relay device quantity of communicating by letter has surpassed its load, for guaranteeing normal work, DHCP master server can be in returning to the dhcp response message of a part of DHCP relay device, the second master-slave swap sign is set to 1, so that these DHCP relay devices while again needing to forward DHCP request message, directly send from server to DHCP.
Further, in the master-slave switching method of above-described embodiment, according to described DHCP, after forwarding DHCP request message to described DHCP from server, the IP address of server also comprises:
If described DHCP relay device is by resolving described dhcp response message, obtain the IP address of DHCP master server and be used to indicate and carry out immediately the second master-slave swap sign of switching,, when again receiving the DHCP request message of dhcp client transmission, to described DHCP master server, forward DHCP request message.
Particularly, Fig. 5 is the second example signaling diagram of communicating by letter between DHCP relay device and the master and slave server of DHCP in master-slave switching method of the present invention.As shown in Figure 5, comprise the following steps:
Step S501, DHCP relay device switches to DHCP by the server of work at present from server by DHCP master server, and the DHCP request message that DHCP sends from server response DHCP relay device returns to dhcp response message;
Step S502, if the service ability that DHCP detects DHCP master server from server by the hot standby passage between itself and DHCP master server is normal, do not break down, DHCP, from server when returning to dhcp response message, starts the local switching timer arranging; Particularly, because detecting DHCP master server from server, DHCP do not break down, but between DHCP relay device and DHCP master server, cannot carry out proper communication, may be because being connected disconnection and causing cannot carrying out proper communication between DHCP relay device and DHCP master server between DHCP relay device and DHCP master server.Therefore DHCP is from switching timer of Servers installed, with when this switch overtime, indicates DHCP relay to think highly of newly DHCP request message to be issued to DHCP master server and processes;
Step S503, DHCP from server switching timer then before, continue that DHCP relay device is forwarded to the DHCP request message coming and process; When the switching timer time then, wish DHCP relay device make a try with DHCP master server between the no recovery linking, carry out principal and subordinate's information synchronous, the processed address allocation information in this locality is synchronized to DHCP master server, to guarantee DHCP master server, the information from server is consistent with DHCP, when follow-up all DHCP request messages are processed by DHCP master server, integrality that still can Guarantee Status machine;
Step S504, DHCP from server in first dhcp response message that switching timer is returned to DHCP relay device then, option field is set to: the 1st byte be 1, the 2-5 byte for example, with the IP address (being 1.1.1.2) of DHCP master server, the 6th byte is 1;
Step S505, DHCP relay device is resolved this dhcp response message, gets the IP address of DHCP master server and is the master-slave swap sign of " 1 ",, when carrying out the forwarding of next DHCP request message, again to DHCP master server, forwards.If linking between DHCP relay device and DHCP master server recovers, DHCP master server switches back operating state again, carries out follow-up IP address assignment; If not linking yet between DHCP relay device and DHCP master server recovers, DHCP relay device repeats flow process shown in Fig. 4.
According to the master-slave switching method of above-described embodiment, by DHCP relay device and DHCP from the information interaction between server, can between DHCP relay device and DHCP master server, owing to linking to disconnect, cause in the temporary transient disabled situation of DHCP master server, by DHCP, from server generation, for DHCP master server, carried out a period of time processing, DHCP relay device detect between current DHCP relay device and DHCP master server link whether available, and when available, the server of working in network system is returned to DHCP master server by DHCP from Server switching.
In addition,, in the flow process shown in above-mentioned Fig. 5, the DHCP of take detects DHCP master server normally as example describes from server by hot standby passage.But in actual applications, also may there are other situations, for example: DHCP detects DHCP master server from server by hot standby passage and breaks down, or due to hot standby channel failure, make DHCP state of DHCP master server etc. from server, cannot be detected.For these situations, DHCP from server without starting switching timer, but continue hot standby passage and DHCP master server to survey, and the DHCP request message that forwarding comes to DHCP relay device is processed, only, when detecting DHCP master server when normal, by dhcp response message indication DHCP relay device and DHCP master server, communicate.
Fig. 6 is the structural representation of the network equipment of the present invention.As shown in Figure 6, this network equipment comprises:
Transceiver module 61, for forwarding DHCP request message to DHCP master server, and receives the dhcp response message that described DHCP master server returns;
Master-slave swap module 62, if for passing through to resolve described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify corresponding switchover policy and carry out described DHCP master server and described DHCP from the master-slave swap between server.。
The network equipment of above-described embodiment is for example that it is specifically as follows router or switch in network for carrying out the DHCP relay device of the master-slave switching method of above-described embodiment.
It is identical with the master-slave switching method of above-described embodiment that the network equipment of above-described embodiment is carried out the flow process of master-slave swap, so locate to repeat no more.
According to the network equipment of above-described embodiment, by IP address and switchover policy from dhcp response message learning DHCP from server, according to switchover policy, carry out master-slave swap, because this master-slave swap operation is judged and carried out by DHCP relay device, the network equipment sends DHCP request message to which server, which server is workspace server, so situation that there will not be DHCP master server and DHCP simultaneously to work from server, thereby avoided because of DHCP master server and DHCP from server, be the problem that dhcp client duplicate allocation IP causes IP confusion.
Further, in the master-slave switching method of above-described embodiment, if master-slave swap module is also for passing through to resolve described dhcp response message, obtain DHCP from the IP address of server and be used to indicate and carry out the first master-slave swap sign of switching when abnormal, when detecting the link know between described DHCP master server or self and described DHCP master server, occur when abnormal, according to described DHCP, from the IP address of server, to described DHCP from server, to forward DHCP request message.
According to the network equipment of above-described embodiment, by the IP address from dhcp response message learning DHCP from server and the switchover policy of master-slave swap occurs to carry out when abnormal, in the process communicating with DHCP master server, the state of DHCP master server is detected, and when detect between DHCP master server or self and DHCP master server link occurs fault time, according to study to DHCP from the IP address switchover of server for to communicate from server with DHCP, so that DHCP is the dhcp client distributing IP address of request access network from server, the Dynamic Host Configuration Protocol server that is about to work in network is switched to from server by master server.This master-slave swap operation is judged and is carried out by the network equipment, the network equipment sends DHCP request message to which server, which server is workspace server, so the situation that there will not be DHCP master server and DHCP simultaneously to work from server, thus avoided because of DHCP master server and DHCP from server, be the problem that dhcp client duplicate allocation IP causes IP confusion.
Further, in the network equipment of above-described embodiment, if described master-slave swap module is also for passing through to resolve described dhcp response message, obtain DHCP from the IP address of server and be used to indicate and carry out immediately the second master-slave swap sign of switching,, when again receiving the DHCP request message of dhcp client transmission, according to described DHCP, from the IP address of server, to described DHCP from server, forward DHCP request message.
Further, in the network equipment of above-described embodiment, if described master-slave swap module is also for passing through to resolve described dhcp response message, obtain the IP address of DHCP master server and be used to indicate and carry out immediately the second master-slave swap sign of switching,, when again receiving the DHCP request message of dhcp client transmission, to described DHCP master server, forward DHCP request message.
According to the network equipment of above-described embodiment, by and DHCP from the information interaction between server, can between the network equipment and DHCP master server, owing to linking to disconnect, cause in the temporary transient disabled situation of DHCP master server, by DHCP, from server generation, for DHCP master server, carried out a period of time processing, informing network equipment (for example for DHCP relay device) again detect self with DHCP master server between link whether available, and when available, the server of working in network system is returned to DHCP master server by DHCP from Server switching.
Further, in the network equipment of above-described embodiment, described master-slave swap module is also for sending DHCP request message to described DHCP master server, and start detection timer; If do not receive the dhcp response message that described DHCP master server returns after described detection timer expiry, retransmit described DHCP request message, and restart described detection timer; If do not receive yet the dhcp response message that described DHCP master server returns after the detection timer expiry restarting, according to described DHCP, from the IP address of server, to described DHCP from server, forward described DHCP request message.
Fig. 7 is the schematic flow sheet of another master-slave switching method of the present invention.As shown in Figure 7, this master-slave switching method comprises:
Step S701, Dynamic Host Configuration Protocol server receives the DHCP request message that DHCP relay device forwards;
Step S702, Dynamic Host Configuration Protocol server is according to described DHCP request message, to described DHCP relay device, return to dhcp response message, wherein said dhcp response message carries the backup IP address of Dynamic Host Configuration Protocol server and master-slave swap sign, so that described DHCP relay device identifies corresponding switchover policy according to described master-slave swap, carries out described DHCP master server and described DHCP from the master-slave swap between server.
The master-slave switching method of above-described embodiment also can be applicable to the topological structure shown in Fig. 2.Wherein, Dynamic Host Configuration Protocol server can, for the DHCP master server in Fig. 2 or DHCP are from server, correspondingly, when the Dynamic Host Configuration Protocol server in above-described embodiment is DHCP master server, backs up Dynamic Host Configuration Protocol server and be DHCP from server; Dynamic Host Configuration Protocol server in above-described embodiment is DHCP during from server, backs up Dynamic Host Configuration Protocol server and is DHCP master server.
The specific implementation flow process of the master-slave switching method of above-described embodiment is identical with flow process shown in Fig. 4 and Fig. 5, so locate to repeat no more.
According to the master-slave switching method of above-described embodiment, because Dynamic Host Configuration Protocol server provides IP address and the switchover policy that backs up Dynamic Host Configuration Protocol server in the response message that returns to DHCP relay device, make DHCP relay device to identify to carry out corresponding master-slave swap according to master-slave swap.Because DHCP relay device sends DHCP request message to which server, which server is workspace server, so the situation that there will not be DHCP master server and DHCP simultaneously to work from server, thus avoided because of DHCP master server and DHCP from server, be the problem that dhcp client duplicate allocation IP causes IP confusion.
Further, in the master-slave switching method of above-described embodiment, described master-slave swap is designated to be used to indicate carries out the first master-slave swap sign of switching when abnormal, so that if described DHCP relay device is by resolving described dhcp response message, obtain the IP address of backup Dynamic Host Configuration Protocol server and be used to indicate and carry out the first master-slave swap sign of switching when abnormal, when detecting the link know between Dynamic Host Configuration Protocol server or self and described Dynamic Host Configuration Protocol server, occur when abnormal, according to the IP address of described backup Dynamic Host Configuration Protocol server, to described backup Dynamic Host Configuration Protocol server, forward DHCP request message.
Further, in the master-slave switching method of above-described embodiment, the DHCP request message that described Dynamic Host Configuration Protocol server receives the forwarding of DHCP relay device also comprises afterwards:
Described Dynamic Host Configuration Protocol server carries out state-detection to described backup Dynamic Host Configuration Protocol server;
If detect and know that described backup Dynamic Host Configuration Protocol server is normal, start preset switching timer, and when described switching timer then after, to described DHCP relay device, return and carry the IP address of backup Dynamic Host Configuration Protocol server and be used to indicate the dhcp response message of carrying out immediately the second master-slave swap sign of switching, so that described DHCP relay device is when again receiving the DHCP request message of dhcp client transmission, to described backup Dynamic Host Configuration Protocol server, forward DHCP request message.
According to the master-slave switching method of above-described embodiment, by the Dynamic Host Configuration Protocol server by work at present, backup Dynamic Host Configuration Protocol server is carried out to state-detection, can be on the one hand the availability of system after master-slave swap and provide safeguard; On the other hand, at current Dynamic Host Configuration Protocol server, be DHCP during from server, also can after work a period of time, again switch back by the execution work of DHCP master server at alternative DHCP master server.
Fig. 8 is the structural representation of Dynamic Host Configuration Protocol server of the present invention.As shown in Figure 8, this Dynamic Host Configuration Protocol server comprises:
Receiver module 81, the DHCP request message forwarding for receiving DHCP relay device;
Respond module 82, be used for according to described DHCP request message, to described DHCP relay device, return to dhcp response message, wherein said dhcp response message carries the backup IP address of Dynamic Host Configuration Protocol server and master-slave swap sign, so that described DHCP relay device identifies corresponding switchover policy according to described master-slave swap, carries out described DHCP master server and described DHCP from the master-slave swap between server.
It is identical with the master-slave switching method of above-described embodiment that the Dynamic Host Configuration Protocol server of above-described embodiment is carried out the flow process of master-slave swap, so locate to repeat no more.
According to the Dynamic Host Configuration Protocol server of above-described embodiment, due to IP address and the switchover policy of backup Dynamic Host Configuration Protocol server being provided in the response message returning to DHCP relay device, make DHCP relay device to identify to carry out corresponding master-slave swap according to master-slave swap.Because DHCP relay device sends DHCP request message to which server, which server is workspace server, so the situation that there will not be DHCP master server and DHCP simultaneously to work from server, thus avoided because of DHCP master server and DHCP from server, be the problem that dhcp client duplicate allocation IP causes IP confusion.
Further, in the Dynamic Host Configuration Protocol server of above-described embodiment, described master-slave swap sign is included as to be used to indicate carries out the first master-slave swap sign of switching when abnormal, so that if described DHCP relay device is by resolving described dhcp response message, obtain the IP address of backup Dynamic Host Configuration Protocol server and be used to indicate and carry out the first master-slave swap sign of switching when abnormal, when detecting the link know between Dynamic Host Configuration Protocol server or self and described Dynamic Host Configuration Protocol server, occur when abnormal, according to the IP address of described backup Dynamic Host Configuration Protocol server, to described backup Dynamic Host Configuration Protocol server, forward DHCP request message.
Further, in the Dynamic Host Configuration Protocol server of above-described embodiment, also comprise:
Backup Dynamic Host Configuration Protocol server state detection module, for carrying out state-detection to described backup Dynamic Host Configuration Protocol server; Correspondingly, if described respond module also knows that for detecting described backup Dynamic Host Configuration Protocol server is normal, start switching timer, and when described switching timer then after, to described DHCP relay device, return and carry the IP address of backup Dynamic Host Configuration Protocol server and the dhcp response message of described the second master-slave swap sign, so that described DHCP relay device is when again receiving the DHCP request message of dhcp client transmission, to described backup Dynamic Host Configuration Protocol server, forward DHCP request message.
According to the Dynamic Host Configuration Protocol server of above-described embodiment, by backup Dynamic Host Configuration Protocol server is carried out to state-detection, can be on the one hand the availability of system after master-slave swap and provide safeguard; On the other hand, at current Dynamic Host Configuration Protocol server, be DHCP during from server, also can after work a period of time, again switch back by the execution work of DHCP master server at alternative DHCP master server.
Finally it should be noted that: above embodiment only, in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to previous embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or part technical characterictic is wherein equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.
Claims (16)
1. a master-slave switching method, is characterized in that, comprising:
Dynamic host configuration protocol DHCP repeater forwards DHCP request message to DHCP master server, and receives the dhcp response message that described DHCP master server returns;
If described DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify corresponding switchover policy and carry out described DHCP master server and described DHCP from the master-slave swap between server.
2. master-slave switching method according to claim 1, it is characterized in that, if described DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify that corresponding switchover policy is carried out described DHCP master server and described DHCP specifically comprises from the master-slave swap between server:
If described DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and be used to indicate and carry out the first master-slave swap sign of switching when abnormal, when detecting the link know between described DHCP master server or self and described DHCP master server, occur when abnormal, according to described DHCP, from the IP address of server, to described DHCP from server, to forward DHCP request message.
3. master-slave switching method according to claim 1, it is characterized in that, if described DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify that corresponding switchover policy is carried out described DHCP master server and described DHCP specifically comprises from the master-slave swap between server:
If described DHCP relay device is by resolving described dhcp response message, obtain DHCP from the IP address of server and be used to indicate and carry out immediately the second master-slave swap sign of switching,, when again receiving the DHCP request message of dhcp client transmission, according to described DHCP, from the IP address of server, to described DHCP from server, forward DHCP request message.
4. according to the master-slave switching method described in claim 2 or 3, it is characterized in that, according to described DHCP, after the IP address of server forwards DHCP request message to described DHCP from server, also comprise:
If the dhcp response message that described DHCP relay device returns from server by resolving described DHCP, obtain the IP address of DHCP master server and be used to indicate and carry out immediately the second master-slave swap sign of switching,, when again receiving the DHCP request message of dhcp client transmission, to described DHCP master server, forward DHCP request message.
5. master-slave switching method according to claim 2, it is characterized in that, describedly when detecting the link know between described DHCP master server or self and described DHCP master server, occur when abnormal, according to described DHCP, from the IP address of server, to described DHCP from server, forward DHCP request message and specifically comprise:
Described DHCP relay device sends DHCP request message to described DHCP master server, and start detection timer;
If described DHCP relay device does not receive the dhcp response message that described DHCP master server returns before described detection timer expiry, retransmit described DHCP request message, and restart described detection timer;
If described DHCP relay device does not receive yet the dhcp response message that described DHCP master server returns before the detection timer expiry restarting, according to described DHCP, from the IP address of server, to described DHCP from server, forward described DHCP request message.
6. a network equipment, is characterized in that, comprising:
Transceiver module, for forwarding DHCP request message to DHCP master server, and receives the dhcp response message that described DHCP master server returns;
Master-slave swap module, if for passing through to resolve described dhcp response message, obtain DHCP from the IP address of server and master-slave swap sign, according to described master-slave swap, identify corresponding switchover policy and carry out described DHCP master server and described DHCP from the master-slave swap between server.
7. the network equipment according to claim 6, it is characterized in that, if described master-slave swap module is also for passing through to resolve described dhcp response message, obtain DHCP from the IP address of server and be used to indicate and carry out the first master-slave swap sign of switching when abnormal, when detecting the link know between described DHCP master server or self and described DHCP master server, occur when abnormal, according to described DHCP, from the IP address of server, to described DHCP from server, to forward DHCP request message.
8. the network equipment according to claim 6, it is characterized in that, if described master-slave swap module is also for passing through to resolve described dhcp response message, obtain DHCP from the IP address of server and be used to indicate and carry out immediately the second master-slave swap sign of switching,, when again receiving the DHCP request message of dhcp client transmission, according to described DHCP, from the IP address of server, to described DHCP from server, forward DHCP request message.
9. according to the network equipment described in claim 7 or 8, it is characterized in that, if described master-slave swap module is the dhcp response message for returning from server by resolving described DHCP also, obtain the IP address of DHCP master server and be used to indicate and carry out immediately the second master-slave swap sign of switching,, when again receiving the DHCP request message of dhcp client transmission, to described DHCP master server, forward DHCP request message.
10. according to the network equipment described in claim 7 or 8, it is characterized in that, described master-slave swap module is also for sending DHCP request message to described DHCP master server, and start detection timer; If do not receive the dhcp response message that described DHCP master server returns before described detection timer expiry, retransmit described DHCP request message, and restart described detection timer; If do not receive yet the dhcp response message that described DHCP master server returns before the detection timer expiry restarting, according to described DHCP, from the IP address of server, to described DHCP from server, forward described DHCP request message.
11. 1 kinds of master-slave switching methods, is characterized in that, comprising:
Dynamic Host Configuration Protocol server receives the DHCP request message that DHCP relay device forwards;
Described Dynamic Host Configuration Protocol server is according to described DHCP request message, to described DHCP relay device, return to dhcp response message, wherein said dhcp response message carries the backup IP address of Dynamic Host Configuration Protocol server and master-slave swap sign, so that described DHCP relay device identifies corresponding switchover policy according to described master-slave swap, carries out DHCP master server and DHCP from the master-slave swap between server;
Wherein, described Dynamic Host Configuration Protocol server be described DHCP master server or described DHCP from server, when described Dynamic Host Configuration Protocol server is described DHCP master server, described backup Dynamic Host Configuration Protocol server is that described DHCP is from server; When described Dynamic Host Configuration Protocol server is described DHCP during from server, described backup Dynamic Host Configuration Protocol server is described DHCP master server.
12. master-slave switching methods according to claim 11, it is characterized in that, described master-slave swap is designated to be used to indicate carries out the first master-slave swap sign of switching when abnormal, so that if described DHCP relay device is by resolving described dhcp response message, obtain the IP address of backup Dynamic Host Configuration Protocol server and be used to indicate and carry out the first master-slave swap sign of switching when abnormal, when detecting the link know between Dynamic Host Configuration Protocol server or self and described Dynamic Host Configuration Protocol server, occur when abnormal, according to the IP address of described backup Dynamic Host Configuration Protocol server, to described backup Dynamic Host Configuration Protocol server, forward DHCP request message.
13. master-slave switching methods according to claim 11, is characterized in that, the DHCP request message that described Dynamic Host Configuration Protocol server receives the forwarding of DHCP relay device also comprises afterwards:
Described Dynamic Host Configuration Protocol server carries out state-detection to described backup Dynamic Host Configuration Protocol server;
If detect and know that described backup Dynamic Host Configuration Protocol server is normal, start preset switching timer, and when described switching timer then after, to described DHCP relay device, return and carry the IP address of backup Dynamic Host Configuration Protocol server and be used to indicate the dhcp response message of carrying out immediately the second master-slave swap sign of switching, so that described DHCP relay device is when again receiving the DHCP request message of dhcp client transmission, to described backup Dynamic Host Configuration Protocol server, forward DHCP request message.
14. 1 kinds of Dynamic Host Configuration Protocol server, is characterized in that, comprising:
Receiver module, the DHCP request message forwarding for receiving DHCP relay device;
Respond module, be used for according to described DHCP request message, to described DHCP relay device, return to dhcp response message, wherein said dhcp response message carries the backup IP address of Dynamic Host Configuration Protocol server and master-slave swap sign, so that described DHCP relay device identifies corresponding switchover policy according to described master-slave swap, carries out DHCP master server and DHCP from the master-slave swap between server;
Wherein, described Dynamic Host Configuration Protocol server be described DHCP master server or described DHCP from server, when described Dynamic Host Configuration Protocol server is described DHCP master server, described backup Dynamic Host Configuration Protocol server is that described DHCP is from server; When described Dynamic Host Configuration Protocol server is described DHCP during from server, described backup Dynamic Host Configuration Protocol server is described DHCP master server.
15. Dynamic Host Configuration Protocol server according to claim 14, it is characterized in that, described master-slave swap sign is included as to be used to indicate carries out the first master-slave swap sign of switching when abnormal, so that if described DHCP relay device is by resolving described dhcp response message, obtain the IP address of backup Dynamic Host Configuration Protocol server and be used to indicate and carry out the first master-slave swap sign of switching when abnormal, when detecting the link know between Dynamic Host Configuration Protocol server or self and described Dynamic Host Configuration Protocol server, occur when abnormal, according to the IP address of described backup Dynamic Host Configuration Protocol server, to described backup Dynamic Host Configuration Protocol server, forward DHCP request message.
16. Dynamic Host Configuration Protocol server according to claim 14, is characterized in that, also comprise:
Backup Dynamic Host Configuration Protocol server state detection module, for carrying out state-detection to described backup Dynamic Host Configuration Protocol server; Correspondingly, if described respond module also knows that for detecting described backup Dynamic Host Configuration Protocol server is normal, start preset switching timer, and when described switching timer then after, to described DHCP relay device, return and carry the IP address of backup Dynamic Host Configuration Protocol server and be used to indicate the dhcp response message of carrying out immediately the second master-slave swap sign of switching, so that described DHCP relay device is when again receiving the DHCP request message of dhcp client transmission, to described backup Dynamic Host Configuration Protocol server, forward DHCP request message.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110366414.2A CN102404146B (en) | 2011-11-17 | 2011-11-17 | Master-slave switching method, network device and DHCP server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110366414.2A CN102404146B (en) | 2011-11-17 | 2011-11-17 | Master-slave switching method, network device and DHCP server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102404146A CN102404146A (en) | 2012-04-04 |
CN102404146B true CN102404146B (en) | 2014-10-29 |
Family
ID=45885961
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110366414.2A Expired - Fee Related CN102404146B (en) | 2011-11-17 | 2011-11-17 | Master-slave switching method, network device and DHCP server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102404146B (en) |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103795572B (en) * | 2014-01-24 | 2017-07-21 | 北京京东尚科信息技术有限公司 | The switching method and monitoring server of principal and subordinate's server |
CN103945016B (en) * | 2014-04-11 | 2018-07-06 | 江苏中科羿链通信技术有限公司 | A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy |
CN104639364B (en) * | 2014-12-02 | 2018-05-25 | 重庆尊贤科技有限公司 | The DHCP backup methods that main Dynamic Host Configuration Protocol server is supported and coordinated are not depended on |
CN104734880A (en) * | 2014-12-02 | 2015-06-24 | 重庆尊贤科技有限公司 | DHCP backup system independent of DHCP server supporting and cooperation |
CN106331202A (en) * | 2015-06-30 | 2017-01-11 | 中兴通讯股份有限公司 | Dynamic host configuration protocol (DHCP) server management method and device |
CN108337103B (en) * | 2017-01-20 | 2021-08-06 | 普天信息技术有限公司 | Backup method, standby recovery method and system of SIP server |
CN108259636B (en) * | 2017-09-29 | 2021-11-02 | 新华三技术有限公司 | Message processing method and device |
CN108040108B (en) * | 2017-12-11 | 2020-10-16 | 杭州电魂网络科技股份有限公司 | Communication switching method, device, coordination server and readable storage medium |
CN110855465B (en) * | 2018-08-21 | 2022-04-05 | 华为技术有限公司 | Message processing method and device |
CN111131445B (en) * | 2019-12-23 | 2022-08-12 | 互联网域名系统北京市工程研究中心有限公司 | DHCP cluster scheduling method and DHCP cluster system |
CN111158915A (en) * | 2019-12-31 | 2020-05-15 | 厦门快商通科技股份有限公司 | Master-slave relationship switching method, slave server, master server and system |
CN113949623B (en) * | 2021-10-18 | 2024-04-26 | 迈普通信技术股份有限公司 | MLAG double-master exception repairing method and device, electronic equipment and storage medium |
CN114124272B (en) * | 2021-11-16 | 2022-09-06 | 广州市保伦电子有限公司 | Hot backup switching method and system based on network card detection |
CN114338361B (en) * | 2022-03-15 | 2022-06-07 | 浙江中控技术股份有限公司 | Communication method of communication device, communication device and distributed control system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1567737A (en) * | 2003-07-01 | 2005-01-19 | 深圳市中兴通讯股份有限公司 | A method for warm back-up of broad band switch-in server |
CN101729559A (en) * | 2009-12-03 | 2010-06-09 | 中兴通讯股份有限公司 | Method and system for realizing backup of DHCP server |
CN102064951A (en) * | 2009-11-18 | 2011-05-18 | 中兴通讯股份有限公司 | Method for implementing master and standby DHCP servers |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102244690B (en) * | 2011-07-26 | 2014-03-12 | 福建星网锐捷网络有限公司 | Address allocation method and system of dynamic host configuration protocol (DHCP) as well as client side and servers of same |
-
2011
- 2011-11-17 CN CN201110366414.2A patent/CN102404146B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1567737A (en) * | 2003-07-01 | 2005-01-19 | 深圳市中兴通讯股份有限公司 | A method for warm back-up of broad band switch-in server |
CN102064951A (en) * | 2009-11-18 | 2011-05-18 | 中兴通讯股份有限公司 | Method for implementing master and standby DHCP servers |
CN101729559A (en) * | 2009-12-03 | 2010-06-09 | 中兴通讯股份有限公司 | Method and system for realizing backup of DHCP server |
Also Published As
Publication number | Publication date |
---|---|
CN102404146A (en) | 2012-04-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102404146B (en) | Master-slave switching method, network device and DHCP server | |
CN102904818B (en) | A kind of ARP information entry updating method and device | |
CN102439903B (en) | Method, device and system for realizing disaster-tolerant backup | |
CN101557317B (en) | Active dialogue backup system, equipment and method in dual-server hot-backup network | |
CN102098201B (en) | Method for realizing L2TP user access backup and network system | |
CN102137021B (en) | Remote redundancy back-up method of access controllers | |
CN104639367B (en) | A kind of method and system for realizing active/standby server switching | |
CN100454875C (en) | Method and system for realizing dual attachment or multiple attachment of user network boundary device | |
EP2482524B1 (en) | Address distribution method, device and system thereof | |
CN110324375B (en) | Information backup method and related equipment | |
CN104486128B (en) | A kind of system and method for realizing redundancy heartbeat between dual controller node | |
CN101431428B (en) | Security monitoring service recovery method and system | |
CN104506372B (en) | A kind of method and system for realizing active/standby server switching | |
CN105119822A (en) | Backup group management method and system based on VRRP (Virtual Router Redundancy Protocol) | |
CN102647304A (en) | Synchronizing method of address resolution protocols and device | |
CN105554175A (en) | ARP backup method in PW (Pseudo-wires) redundancy scene | |
CN102710520A (en) | Method and device for backing up lonworks network service (LNS) | |
CN101827035B (en) | Method for ensuring graceful restarting and dual master control network device | |
CN102761428A (en) | Server system and server switching method | |
JP5775473B2 (en) | Edge device redundancy system, switching control device, and edge device redundancy method | |
CN100484044C (en) | Method for detecting operating state of default gateway and apparatus thereof | |
CN104125079A (en) | Method and device for determining double-device hot-backup configuration information | |
JP2004032452A (en) | System changing method and system of cluster-configured machines | |
CN108270593A (en) | A kind of two-node cluster hot backup method and system | |
CN102932190A (en) | Method and device for solving single point of failure of equipment section |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C56 | Change in the name or address of the patentee | ||
CP01 | Change in the name or title of a patent holder |
Address after: Cangshan District of Fuzhou City, Fujian province 350002 Jinshan Road No. 618 Garden State Industrial Park building 19# Patentee after: RUIJIE NETWORKS Co.,Ltd. Address before: Cangshan District of Fuzhou City, Fujian province 350002 Jinshan Road No. 618 Garden State Industrial Park building 19# Patentee before: Fujian Star-net Ruijie Network Co.,Ltd. |
|
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20141029 |