Background technology
In telecommunication service IPization, under the development trend of IP network telecommunications, demand for service accesses such as NGN/3G to IP bearer network, at NGN (Next Generation Network, next generation network) in bearer network, the general dual homed of NGN operation system equipment is connected to two couple in router equipment, to ensure the reliability of telecommunication service, couple in router is as PE (Provider Edge, Provider Edge) equipment, between two equipment, run VRRP (Virtual Router RedundancyProtocol, Virtual Router Redundancy Protocol), realize master-slave redundancy backup.But basic VRRP agreement exists the long defect of convergence time, can not meet and support the carrier class of 50ms to switch demand.On basic VRRP protocol basis, strengthen agreement by the VRRP of associated BFD (Bidirectional Forwarding Detection, two-way converting detects), improved convergence rate, but these technology exist defect more or less.
At present industry has VRRP characteristic to strengthen agreement, and VRRP binding BFD also increases the operation that promotes priority, is better to have expanded backup functionality on original VRRP monitors the basis of function of interface.By increasing a new order, make the variation that track order in VRRP not only can docking port, can also change to the state of the BFD of binding time, raise, reduce or recover priority in the past, the unit that in default situation, priority changes is 10.Like this in the time of Master router down, router in Backup state is by monitoring the state of specified interface or BFD Session, cannot quick sensing in the situation that, can judge whether that the state that carries out VRRP switches fast according to the state of BFD, Slave initiatively escalates into Master fast, takes over uplink traffic.
But there is defect in the method, in the time running into BFD down, the method directly reduces priority, for be associated with more than one group BFD time, if a Peer (router) of this VRRP runs into one group of BFD down, and another Peer runs into two groups of BFD down, and the value that two Peer reduce after priority equates, by the problem that occurs that VRRP cannot switch.
Existing two-node cluster hot backup method can be evaded above problem, in two-node cluster hot backup method, does not adopt priority to reduce in the time running into BFD down, but direct down host apparatus.Concrete structure as shown in Figure 1, comprise primary BRAS (Broadband Remote Access Server, Broadband Remote Access Server), with direct-connected switch SW1, the BRAS for subsequent use of primary BRAS, with the direct-connected switch SW2 of BRAS for subsequent use.Link between primary BRAS and BRAS for subsequent use, is associated with respectively one group of BFD on the link between the link between primary BRAS and switch SW1 and BRAS for subsequent use and switch SW2.
In two-node cluster hot backup method, following two principle is followed in the switching of active and standby machine,
1, when guest machine is found and the direct-connected BFD state of switch SW2 is UP, when the direct-connected BFD state of BRAS DOWN, guest machine is switched to primary;
2, when main computer is found and the direct-connected BFD of switch SW1, and the direct-connected BFD state of BRAS is while being all DOWN, and primary BRAS is switched to for subsequent use.
The reason of so doing is, if VRRP only when the BFD between associated BRAS, in the time there is this situation, can cause active and standby BRAS to think the linkdown between primary BRAS and switch by mistake, and the VRRP making the mistake switches.
But in two-node cluster hot backup method, there is following problem: when the heartbeat that connects main computer on guest machine has disconnected, according to Article 1 principle, just there will be two primary situations.
Summary of the invention
Main purpose of the present invention is to provide a kind of primary access server for dual-machine redundancy backup to determine method and device, at least to solve two main frame problems that may cause in the hollow networking of two-node cluster hot backup.
According to an aspect of the present invention, provide a kind of primary access server for dual-machine redundancy backup to determine method, comprised the following steps: the first access server and with it the down link between direct-connected switch, the second access server and with it the down link between direct-connected switch, the link of the first access server between down link to the second access server respectively associated one group of two-way converting detect BFD; In the time that the first access server and/or one group of associated BFD of the second access server disconnect, the priority of this access server is reduced to a progression from current configuration preference level; In the time that the first access server and/or two groups of associated BFD of the second access server disconnect, the priority of this access server is reduced to two progression from predetermined benchmark priority, and wherein benchmark priority is less than or equal to the configuration preference level of the access server that in the first access server and the second access server, configuration preference level is little; The relatively current priority of the first access server and the second access server, using the high access server of current priority as primary access server.
Further, the method also comprises: in the time that the first access server and/or one group of associated BFD of the second access server recover to connect, the current priority of this access server is improved to a progression; In the time that the first access server and/or two groups of associated BFD of the second access server recover to connect, the current priority of this access server is returned to its configuration preference level; The relatively current priority of the first access server and the second access server, using the high access server of current priority as primary access server.
Further, the scope of priority is 0-255, and wherein, a progression size of priority is 10.
Further, the first access server and the second access server are determined primary access server by contention mode.
Further, the first access server and the second access server form logic interfacing by link aggregation, adopt bridged protocol to connect between logic interfacing.
According to a further aspect in the invention, a kind of primary access server determining device for dual-machine redundancy backup is provided, this device comprises: relating module, the first access server and with it the down link between direct-connected switch, the second access server and with it the down link between direct-connected switch, the link of the first access server between down link to the second access server respectively associated one group of two-way converting detect BFD; Priority adjusting module, in the time that the first access server and/or one group of associated BFD of the second access server disconnect, reduces a progression by the priority of this access server from current configuration preference level; In the time that the first access server and/or two groups of associated BFD of the second access server disconnect, the priority of this access server is reduced to two progression from predetermined benchmark priority, and wherein benchmark priority is less than or equal to the configuration preference level of the access server that in the first access server and the second access server, configuration preference level is little; Primary access server determination module, for the current priority of the first access server and the second access server relatively, using the high access server of current priority as primary access server.
Further, priority adjusting module is also in the time that the first access server and/or one group of associated BFD of the second access server recover to connect, the current priority of this access server is improved to a progression, and in the time that the first access server and/or two groups of associated BFD of the second access server recover to connect, the current priority of this access server is returned to its configuration preference level.
In the present invention, by being the associated two BFD of primary and backup access server, and benchmark priority is set, in the time that the associated two BFD of access server disconnect, the priority of this access server reduces by two progression from benchmark priority, thereby can avoid the two primary problem in two-node cluster hot backup.
Embodiment
Hereinafter also describe the present invention in detail with reference to accompanying drawing in conjunction with the embodiments.It should be noted that, in the situation that not conflicting, the feature in embodiment and embodiment in the application can combine mutually.
Fig. 2 determines the applied schematic network structure of method according to the primary access server of the embodiment of the present invention, as shown in Figure 2, this network is by the first access server, the first switch, a hollow structure of the second switch and the second access server composition, the first access server and the second access server are respectively associated with two groups of BFD, in working order, one in the first access server and the second access server is primary access server, another is as access server for subsequent use, according to the state of associated BFD, the state that the first access server and the second access server can carry out standby usage switches.VRRP is by adopting bridged protocol between the first access server and the second access server, ensure that by SMARTGROUP technology (logic interfacing that link aggregation forms is called SMARTGROUP to reliability, SMARTGROUP can be used as common port, ensure the reliability of link), bridged protocol makes physically the not two-server on a channel, links together by logic interfacing or vlan (VLAN) etc.
Certainly, in the dual-machine redundancy backup of actual application, network configuration is more complicated, but substantially can be abstracted into above-mentioned network structure model.
Fig. 3 determines method flow diagram according to the primary access server of the embodiment of the present invention, and the method is applied in the network configuration environment shown in Fig. 2, as shown in Figure 3, comprises the following steps:
Step S302, the link at the link between the link between the first access server and the first switch, the second access server and the second switch, the first access server between the first switch and the second switch to the second access server respectively associated one group of two-way converting detects BFD.
Step S304, in the time that the first access server and/or one group of associated BFD of the second access server disconnect, reduces a progression by the priority of this access server from current configuration preference level; In the time that the first access server and/or two groups of associated BFD of the second access server disconnect, the priority of this access server is reduced to two progression from predetermined benchmark priority, and wherein benchmark priority is less than or equal to the configuration preference level of the access server that in the first access server and the second access server, configuration preference level is little.
Step S306, the relatively current priority of the first access server and the second access server, using the high access server of current priority as primary access server.
In said method, by being the associated two BFD of primary and backup access server, and benchmark priority is set, in the time that the associated two BFD of access server disconnect, the priority of this access server reduces by two progression from benchmark priority, thereby can avoid the two primary problem in two-node cluster hot backup.
After step S306, also comprise: in the time that the first access server and/or one group of associated BFD of the second access server recover to connect, the current priority of this access server is improved to a progression; In the time that the first access server and/or two groups of associated BFD of the second access server recover to connect, the current priority of this access server is returned to its configuration preference level; The relatively current priority of the first access server and the second access server, using the high access server of current priority as primary access server, a progression size of priority can be set to 10, definite employing contention mode of primary access server.The agreement that goes along a bridge between the first access server and the second access server, ensures link reliability by SMARTGROUP.
Wherein, in said method, a VRRP group of two access server compositions, each access server is a PEER of VRRP group, carries out priority negotiation by VRRP agreement.Benchmark priority refers to, in the time that some Peer of VRRP need to reduce priority, taking this benchmark priority as basis, reduces the priority of Peer below benchmark priority.In the time of the BFD state down of a certain Peer association of VRRP, the peer priority of this VRRP must be reduced to than the low a certain amplitude of benchmark priority, and in the time of the whole UP of the BFD of this Peer association state, the Peer priority of this VRRP must return to the priority of configuration.Choosing of this benchmark priority can configure as required, also can adopt less priority in two Peer of VRRP group, but must be less than in VRRP group less one of 2 Peer priority.
Adopt benchmark priority to be because: suppose that a peer priority is 60, another is 40.Priority is 60 the bras linkdown to direct-connected switch, suppose priorities is in original priority basis, bfd of down reduces priority 10, that peer that so original priority was 60 because down 2 bfd, so priority is 60-20=40, that peer priority that priority is 40 is 40-10=30, and can cause like this that peer priority of down is 40, that priority that there is not down is that 30, vrrp cannot switch.So when using priority mode vrrp to switch and supporting two BFD, must have one can reference priority, and this priority must be less than or equal to the minimum value of two priority of the peer of VRRP.
Fig. 4 is the primary access server determining device structured flowchart according to the embodiment of the present invention, and as shown in Figure 4, this determining device comprises: the relating module 10, priority adjusting module 20 and the primary access server determination module 30 that connect successively.
Wherein, relating module 10, the link for the link between the link between the first access server and the first switch, the second access server and the second switch, the first access server between the first switch and the second switch to the second access server respectively associated one group of two-way converting detects BFD; Priority adjusting module 20, in the time that the first access server and/or one group of associated BFD of the second access server disconnect, reduces a progression by the priority of this access server from current configuration preference level; In the time that the first access server and/or two groups of associated BFD of the second access server disconnect, the priority of this access server is reduced to two progression from predetermined benchmark priority, and wherein benchmark priority is less than or equal to the configuration preference level of the access server that in the first access server and the second access server, configuration preference level is little; Primary access server determination module 30, for the current priority of the first access server and the second access server relatively, using the high access server of current priority as primary access server.
In said apparatus, by being the associated two BFD of primary and backup access server, and benchmark priority is set, in the time that the associated two BFD of access server disconnect, the priority of this access server reduces by two progression from benchmark priority, thereby can avoid the two primary problem in two-node cluster hot backup.
In above-mentioned primary access server determining device, priority adjusting module is also in the time that the first access server and/or one group of associated BFD of the second access server recover to connect, the current priority of this access server is improved to a progression, and in the time that the first access server and/or two groups of associated BFD of the second access server recover to connect, the current priority of this access server is returned to its configuration preference level.
Embodiment mono-
In this example, adopt the hollow network configuration shown in Fig. 2, in the case of the associated two groups of BFD of each Peer of VRRP, cause the Peer priority transition of VRRP for BFD state, have following 4 kinds of situations:
In the time of 1 associated BFD state down, the VRRP priority ratio " priority own " of this Peer reduces a quantity, and for example 10.
In the time of 2 BFD state down, the VRRP priority ratio " benchmark priority " of this Peer reduces by two quantity.
In the time of 1 BFD state UP, a quantity of VRRP priority ratio benchmark priority rising of this Peer.
In the time of 2 BFD state UP, the VRRP priority of this Peer is recovered original configuration preference level.
In above-mentioned process, in the time that the Peer of VRRP priority changes, initiatively change side gets started re-electing of primary PEER.
Fig. 5 is the flow chart while disconnecting according to the BFD state of the embodiment of the present invention one, in the present embodiment, supposes that the VRRP priority of original bras1 is 50, bras2 is 40, benchmark priority is 40, and the situation in the time that related BFD state disconnects as shown in Figure 5, comprises the following steps so:
Step S502, link or node break down, BFD state down.For example, linkdown between bras1 and sw1.
Step S504, this peer starts to reduce VRRP priority according to the link number of down.The BFD1 of the vrrp association of bras1 and the full down of BFD3, priority is reduced to 40-20=10; And bras2 down bfd3, priority is reduced to 40-10=30.
Step S506, restarts the active and standby election of VRRP, wherein immediately, active and standby election adopts contention mode, and contention mode, is a kind of pattern of VRRP agreement, receive after VRRP notification packet when Backup router, the priority in the priority of oneself and notification packet can be compared; If be greater than the priority in notification packet, become host apparatus, otherwise will keep stand-by state.In the present embodiment, the current priority of bras2 is higher than the current priority of bras1, and bras1 is as host apparatus.
Step S508, judges whether the active and standby switching of VRRP, is to go to step S510, otherwise goes to step S512.Bras1 is elected as host apparatus, need to carry out active and standby switching.
Step S510, triggers active and standby switching and route processing, and bras1 switches to primary server, and bras2 switches to standby server.
Step S512, does not process.
In above-mentioned step, also there are following two kinds of situations:
When between sw1 and sw2 when linkdown: bras1 and bras2 only have the state down of a bfd, and therefore bras1 priority is reduced to 50-10=40; Bras2 is reduced to 40-10=30, according to vrrp is regular or bras1 is main.
When between bras2 and sw2 when linkdown: bras1 down bfd3, priority is reduced to 50-10=40, the full down of bfd of 2 vrrp associations of bras2, priority is reduced to 40-20=10 according to vrrp switching law, bras1 is main.
In above-mentioned two situations, by the reduction of priority, two primary problems are avoided equally.
Fig. 6 is the flow chart while connecting according to the BFD recovering state of the embodiment of the present invention one, as shown in Figure 6, comprises the following steps:
Step S602, the BFD state up of Peer.
Step S604, judges whether the whole up of BFD, if so, goes to step S606, otherwise goes to step S608
Step S606, the VRRP priority of this Peer reverts to configuration preference level.
Step S608, improves 1 quantity by the current VRRP priority of this Peer.
Step S610, restarts the active and standby election of VRRP immediately, and wherein active and standby election adopts contention mode.
Step S612, the whether active and standby switching of VRRP, if so, goes to step S614, otherwise goes to step S616
Step S614, triggers active and standby switching and route processing.
Step S616, does not process.
In the above embodiment of the present invention, by being the associated suitable two BFD of primary and backup access server, and be provided as the benchmark priority of reference, in the time that the associated two BFD of access server disconnect, the priority of this access server reduces by two progression from benchmark priority, make the priority of active and standby access server there will not be identical situation, thereby avoided the two primary problem in two-node cluster hot backup.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on the network that multiple calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in storage device and be carried out by calculation element, and in some cases, can carry out shown or described step with the order being different from herein, or they are made into respectively to each integrated circuit modules, or the multiple modules in them or step are made into single integrated circuit module to be realized.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.