CN106375210A - Method for realizing VRRP (Virtual Router Redundancy Protocol) downlink load balancing and route devices - Google Patents

Method for realizing VRRP (Virtual Router Redundancy Protocol) downlink load balancing and route devices Download PDF

Info

Publication number
CN106375210A
CN106375210A CN201610797266.2A CN201610797266A CN106375210A CN 106375210 A CN106375210 A CN 106375210A CN 201610797266 A CN201610797266 A CN 201610797266A CN 106375210 A CN106375210 A CN 106375210A
Authority
CN
China
Prior art keywords
client
routing device
equipment
mac address
routing
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.)
Pending
Application number
CN201610797266.2A
Other languages
Chinese (zh)
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.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu 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 Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201610797266.2A priority Critical patent/CN106375210A/en
Publication of CN106375210A publication Critical patent/CN106375210A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/586Association of routers of virtual routers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a method for realizing VRRP (Virtual Router Redundancy Protocol) downlink load balancing and route devices, so as to avoid the problem due to a fact that one route is selected out from equivalent routes randomly by an uplink device to forward downlink traffic in the prior art. The method comprises the steps of selecting out a master route device in virtual routers, wherein other route devices are backup route devices; distributing different forwarding MAC addresses to the master route device and at least one backup route device of the virtual routers by the master route device, and broadcasting a distributing result via a notification message; generating a host route with a client IP address as a prefix by the route device associated with a client, and releasing the host route to the uplink device of the route device, so that the uplink device generates the route which has the same prefix with the host route and takes the route device as a next hop.

Description

Realize vrrp down load method and routing device in a balanced way
Technical field
The present invention relates to the network communications technology, more particularly, to one kind realize Virtual Router Redundacy Protocol (vrrp, virtual Router redundancy protocol) down load method and routing device in a balanced way.
Background technology
When realizing client with external network communication, usually all clients setting in the same network segment is same default Gateway, that is, configure the default route with same gateway as next-hop, and the message that client is sent to other network segments will be default by this Route is sent to the gateway of next-hop, then is forwarded by gateway, but when gateway breaks down, in this network segment all with this net Close the client for default route to will be unable to be communicated with external network.Although default route provides for the configuration operation of user Convenience, but gateway is proposed with very high stability requirement, and gateway of increasing export is the common side improving system reliability Method, now, how to carry out routing between multiple outlets just becomes the problem needing to solve.
The vrrp gradually growing up is that it is carrying for solving how to carry out the protocol for error tolerance of routing between multiple outlets While high reliability, simplify the configuration of client.The vrrp of standard is by multiple group of router devices with gateway function Cheng Yitai virtual router, the multiple routing devices in this virtual router elect a conduct according to the election mechanism of vrrp Primary (master) routing device is responsible for flow and is forwarded, and other are responsible for master is route as standby (backup) routing device Equipment is monitored, and when listening to master routing device and breaking down, re-elects master routing device.Although it is this Mode improves system reliability, but, the only main routing device of the multiple routing devices in virtual router is responsible for flow and is turned Send out it is clear that waste is all existed on routing device resource and the network bandwidth.
In order to solve the problems, such as above-mentioned resource and bandwidth waste, prior art provides a kind of vrrp load balancing realized Method.The method includes: virtual router comprises multiple routing devices, and the default gateway ip address of each client of the same network segment is joined It is set to the empty ip address of this virtual router;The primary route equipment electing in virtual router is itself distribution empty mac ground Location, and after the empty mac distribution request message receiving the transmission of other routing devices, distribute different for other routing devices described Empty mac address, and other routing devices described are sent to by address response message;Described primary route equipment receives and arrives From after the address resolution request of client, according to load balancing, each routing device in described virtual router will be distributed to Empty mac address carry and reply to described client in address resolution response, so that described client is using the void receiving Mac address carries out the transmission of message.
Prior art additionally provides a kind of method realizing vrrp load balancing, that is, utilize multiple vrrp routing devices to create Multiple virtual routers, have a master routing device in each virtual router and at least one backup route sets Standby.Wherein, vrrp routing device may do master routing device it is also possible at another in a virtual router Backup routing device is done in virtual router.Can be that each client is different virtual according to load balancing configuration in advance The empty ip address of router sends address resolution association as default gateway ip address, each client according to the virtual ip address of configuration View (arp) request, the mac address of itself is carried by the master routing device in virtual router corresponding with this client This client is replied to, this client is using the mac address creation arp list item carrying in arp response, and utilizes in arp response This arp list item sends uplink traffic, that is, be derived from the uplink traffic of each client by being allocated to the virtual router of this client In master routing device forwarded, this achieves load balancing between multiple vrrp routing devices for the uplink traffic.
The uplink traffic of client can be directed to different first line of a couplet equipment using the strategy of various loads by these agreements On, realize the load balancing of uplink traffic.And it is directed to downlink traffic, in prior art, no matter which kind of realizes vrrp load balancing Method, require that multiple vrrp routing devices of same virtual router are sent out to the first line of a couplet equipment being connected to this virtual router Cloth identical interface IP address network segment route is that is to say, that the route issued of the multiple vrrp routing devices of same virtual router It is equal-cost route for first line of a couplet equipment, based on this, first line of a couplet equipment is sending downlink traffic to the corresponding visitor of virtual router During the end of family, it is selected a route at random from equal-cost route and carrys out converting downlink flow.That is, under first line of a couplet device forwards The route of row flow to client is to randomly choose, and can not uniquely determine, and, is same client for destination address Downlink traffic, the route of converting downlink flow to this client is also likely to be different.So cause service message Loop footpath is inconsistent, and because of routeing preferred relation, downlink traffic is undertaken by a part of equipment, as shown in figure 1, setting Standby r2 assume responsibility for whole downlink traffics of client, if flow is more than the downstream interface bandwidth of r2, will cause network congestion Problem.
Content of the invention
Embodiments of the invention provide one kind to realize Virtual Router Redundacy Protocol (vrrp, virtual router Redundancy protocol) down load method and routing device in a balanced way, to avoid first line of a couplet equipment in prior art random Select one of route and carry out the problem that converting downlink flow is brought from equal-cost route.
For reaching above-mentioned purpose, embodiments of the invention adopt the following technical scheme that
In a first aspect, embodiments providing one kind to realize Virtual Router Redundacy Protocol vrrp down load in a balanced way Method, is applied to comprise the virtual router of multiple routing devices, and described virtual router has an empty ip address, same net The default gateway ip address configuration of each client of section is described void ip address, and the method includes:
In described virtual router, elect a primary route equipment, other routing devices are alternate routing equipment;
Described primary route equipment is that at least one of itself and described virtual router alternate routing equipment distributes Different forwarding mac addresses, and the result of described distribution is broadcasted by notification packet;
Described primary route equipment receives after the address resolution request message of client, according to load balancing plan Slightly, it is that described client associate has the routing device forwarding mac address, and the result of described association is entered by notification packet Row broadcast;
Generate the Host routes with described client ip address as prefix with the routing device of described client associate, and will Described Host routes are distributed to the first line of a couplet equipment of this routing device, so that described first line of a couplet equipment generates and described Host routes tool There are same prefix and the route with this routing device as next-hop.
Optionally, the described routing device having forwarding mac address for described client associate includes: described primary route Equipment sets up the association list item of described client in contingency table, and the association list item of described client includes: described client The forwarding mac address of the routing device of mark and described client associate;
The described result by described association carries out broadcast by notification packet and includes: the information in described contingency table is passed through Notification packet is broadcasted.
Optionally, described according to load balancing, be that described client associate has the routing device forwarding mac address Including:
According to described contingency table, one that chooses associated client end minimum number has forwarding to described primary route equipment The routing device of mac address, to associate described client;
Or, if described client belongs to the client in static association strategy, described static association strategy be used for be to A few client is static to specify routing device, then described primary route equipment is described client according to described static association strategy End static association routing device;Otherwise, described primary route equipment, according to described contingency table, chooses association dynamic client quantity Minimum one has the routing device forwarding mac address, and described dynamic client is to be not belonging in described static association strategy Client.
Optionally, the method also includes: described primary route device statistics each have forward mac address routing device Load flow;
Described according to load balancing, be that described client associate has and forwards the routing device of mac address to include: institute State primary route equipment and choose a minimum routing device with forwarding mac address of load flow, to associate described client End.
Optionally, receive after the address resolution request message of client in described primary route equipment, described side Method also includes:
Described primary route equipment sets up the entry of described client, the entry of described client in client records table For recording the mark of described client, and time-out time is set for described client;
In described time-out time, if described primary route equipment receives the address resolution that described client sends again Request message, then reset to the time-out time of described client;If described time-out time arrives, described primary route equipment Do not receive the address resolution request message that described client sends again, then delete the entry of described client or by described visitor It is invalid that the entry at family end is set to.
Optionally, methods described also includes: when the described entry deleting described client or the entry by described client Be set to invalid after, described primary route equipment, according to load balancing, re-establishes each visitor in described client records table Family end and associating that there is the routing device forwarding mac address.
Optionally, described primary route equipment is the different forwarding mac address bag of at least one alternate routing equipment distribution Include: described alternate routing equipment sends to described primary route equipment consults request, and described negotiation request is used for indicating described standby The forwarding mac address being assigned to routing device expectation, the forwarding mac address that described expectation is assigned to includes: described standby road Real mac address and/or at least one empty mac address by equipment;
Described primary route equipment after receiving the negotiation request that described alternate routing equipment sends, according to described negotiation Request distribution one in the empty mac address realm pre-setting not yet distributes and meets the described empty mac address consulting request To described alternate routing equipment, or, consult request using the real mac address of described alternate routing equipment as described according to described The forwarding mac address of alternate routing equipment.
Optionally, described notification packet includes: description information data content, and described description information comprises serial number;
Methods described also includes: described primary route equipment receive alternate routing equipment transmission comprise First ray number Description information after, judge described First ray number second serial number locally stored with described primary route equipment whether Cause, if inconsistent, by comprise locally stored data content and comprise the 3rd serial number description information notification packet Send to described alternate routing equipment, described 3rd serial number is more than described First ray number;Or,
After described alternate routing equipment receives the notification packet comprising the 4th serial number, by described 4th serial number and institute State the 5th locally stored serial number of alternate routing equipment to be compared, if the 4th serial number is more than described 5th serial number, Store the notification packet of described 4th serial number.
Second aspect, embodiments provides a kind of routing device, and multiple described routing devices are used for constituting one Virtual router, described virtual router has an empty ip address, and the default gateway ip address of each client of the same network segment is joined It is set to described void ip address, this routing device includes: role's election unit, allocation unit, receiving unit, associative cell, transmission Unit;
Described role elects unit, in described virtual router, electing a primary route equipment, other roads It is alternate routing equipment by equipment;
Described allocation unit, when the primary route equipment for electing in role's election unit is described routing device, For the different forwarding mac addresses of other routing devices of at least one of itself and described virtual router distribution, and by institute The result stating distribution is broadcasted by notification packet;
Described receiving unit, for when role elects the alternate routing equipment that elects of unit to be described routing device, Receive the result of described distribution, the result of described distribution is used for after described routing device is assigned forwarding mac address, configuration Described forwarding mac address;
Described receiving unit, is additionally operable to receive the address resolution request message from client;
Described associative cell, when the primary route equipment for electing in role's election unit is described routing device, Described receiving unit receives after the address resolution request message of client, according to load balancing, is described client End association has the routing device forwarding mac address, and the result of described association is broadcasted by notification packet;
Described receiving unit, being additionally operable to when role elects the alternate routing equipment that unit elects is described routing device When, receive the result of described association;
Described transmitting element, described transmitting element, for generating in the routing device with described client associate with described Client ip address is the Host routes of prefix, and described Host routes is distributed to the first line of a couplet equipment of this routing device, so that Obtain described first line of a couplet equipment and generate, with described Host routes, there is same prefix and the route with this routing device as next-hop.
Optionally, described routing device also includes: sets up and maintenance unit, for the master electing in role's election unit During with routing device for described routing device, receiving after the address resolution request message of client, in client note The entry of described client is set up, the entry of described client is used for recording the mark of described client, and is described in record table Client arranges time-out time;
In described time-out time, if receiving unit receives the address resolution request report that described client sends again Literary composition, then reset to the time-out time of described client;If described time-out time arrives, described receiving unit does not receive institute State the address resolution request message that client sends again, then delete entry or the entry by described client of described client It is invalid to be set to.
Optionally, described notification packet includes: description information data content, and described description information comprises serial number;Institute State routing device also to include: lock unit, for electing the primary route equipment that unit elects to set for described route in role When standby, after receiving the description information comprising First ray number of alternate routing equipment transmission, judge described First ray with described Whether the second locally stored serial number of primary route equipment consistent, if inconsistent, comprise locally stored data content with And the notification packet of the description information comprising the 3rd serial number sends to described alternate routing equipment, described 3rd serial number is more than Described First ray number;Or,
Described lock unit is additionally operable to when role elects the alternate routing equipment that unit elects to be described routing device, After receiving the notification packet comprising the 4th serial number, by locally stored with described alternate routing equipment for described 4th serial number Five serial numbers are compared, if the 4th serial number is more than described 5th serial number, store the notice report of described 4th serial number Literary composition.
Embodiments provide one kind and realize Virtual Router Redundacy Protocol vrrp down load method and in a balanced way Plant routing device.It is applied to comprise the virtual router of multiple routing devices, in virtual router, elect a master Routing device, other routing devices are backup routing device;Master routing device is in itself and virtual router The different forwarding mac address of at least one backup routing device distribution, and the result of distribution is carried out extensively by notification packet Broadcast;Master routing device receives after the address resolution request message of client, according to load balancing, is client End association has the routing device forwarding mac address, and the result of association is broadcasted by notification packet.I.e. virtual flow-line In device multiple routers all have forwarding mac address, can be carried out the forwarding of message.Set with the route of client associate For the Host routes generating with client ip address as prefix, and the first line of a couplet that this Host routes is distributed to this routing device sets Standby, so that described first line of a couplet equipment generates has same prefix and the road with this routing device as next-hop with this Host routes By.Understand that the embodiment of the present invention to be realized accurately routeing by the way of above-mentioned Host routes are noticed, guiding downlink traffic is to this Equipment, thus avoid upstream plant in prior art to select one of route at random from equal-cost route carry out converting downlink stream Measure brought problem.
Brief description
In order to be illustrated more clearly that the technical scheme of the embodiment of the present invention, below will be in embodiment or description of the prior art The accompanying drawing of required use be briefly described it should be apparent that, drawings in the following description be only the present invention some are real Apply example, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to these accompanying drawings Obtain other accompanying drawings.
The down load congestion schematic diagram that Fig. 1 provides for prior art;
Fig. 2 is the flow chart realizing vrrp load-balancing method provided in an embodiment of the present invention;
Fig. 3 is the schematic diagram of neighbours provided in an embodiment of the present invention and role's election contest;
Fig. 4 is the schematic diagram consulting forwarding mac address provided in an embodiment of the present invention;
Fig. 5 sets up client-entry schematic diagram for master provided in an embodiment of the present invention;
Fig. 6 is the related information schematic diagram that master provided in an embodiment of the present invention issues routing device and client;
Fig. 7 is that association routing device provided in an embodiment of the present invention sends client host route;
Fig. 8 is that down load provided in an embodiment of the present invention equalizes schematic diagram;
Fig. 9 is the block diagram of routing device provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.Based on this Embodiment in invention, the every other reality that those of ordinary skill in the art are obtained under the premise of not making creative work Apply example, broadly fall into the scope of protection of the invention.
Term "and/or" in the embodiment of the present invention, a kind of only incidence relation of description affiliated partner, expression can be deposited In three kinds of relations, for example, a and/or b, can represent: individualism a, there are a and b, these three situations of individualism b simultaneously. In addition, character "/" in the embodiment of the present invention, typically represent forward-backward correlation to as if a kind of relation of "or".
For the ease of clearly describing the technical scheme of the embodiment of the present invention, in an embodiment of the present invention, employ " the One ", the printed words such as " second " identical entry essentially identical to function and effect or similar item make a distinction, and those skilled in the art can To understand that the printed words such as " first ", " second " are not defined to quantity and execution order.In describing the invention, unless separately It is described, " multiple " are meant that two or more.
The method realizing vrrp load balancing provided in an embodiment of the present invention is applied to comprise the virtual of multiple routing devices Router, in virtual router, elects a master routing device, and other routing devices are backup routing device; Master routing device is the different forwarding mac of at least one of itself and virtual router backup routing device distribution Address, and the result of distribution is broadcasted by notification packet;Master routing device receives the address from client After analysis request message, according to load balancing, it is that client associate has the routing device forwarding mac address, and will close The result of connection is broadcasted by notification packet;Generate with client ip address as prefix with the routing device of client associate Host routes, and state the first line of a couplet equipment that Host routes are distributed to this routing device, so that first line of a couplet equipment generates and Host routes There is same prefix and the route with this routing device as next-hop.The embodiment of the present invention is passed through to lead to using above-mentioned Host routes The mode accused realizing accurately routeing, guiding downlink traffic to this equipment, thus avoid in prior art first line of a couplet equipment at random from Select one of route in equal-cost route and carry out the problem that converting downlink flow is brought.
The several the nouns first embodiment of the present invention mentioned illustrate:
1st, empty ip address: virtual router has an empty ip address, the default gateway ip ground of each client of the same network segment Location is configured to described void ip address, and empty ip address need to use phase same network segment with the major-minor address of interface, when routing device has been in After (master is assigned with forwarding mac address for it) after effect forwarding state, empty ip address all should be added in secondary address.
2nd, address resolution request message and address resolution back message: wherein, address resolution request message can in ipv4 To be arp (address resolution protocol) request message, address resolution back message can be that arp responds report Literary composition, client is built after arp list item using the forwarding mac address receiving, and carries out the transmission of message using this arp list item;? In ipv6, address resolution request message can be neighbor request (ns, neighbor solicaitations) message, address resolution Back message can be neighbor advertisement (na, neighbor advertisements) message, and client is using the forwarding receiving After mac address builds nd list item, carry out the transmission of message using this nd list item.In the following description taking ipv4 as a example.
3rd, the message that hello packet and notification packet are that any two kinds of forms are different, can distinguish mutually, and be the present invention The new protocol massages that embodiment redefines according to actual needs.
Embodiment one
With reference to specific embodiment, said method is described in detail.Taking the network architecture shown in Fig. 1 as a example, client Pc1 and two clients that client pc2 is the same network segment, routing device r1, routing device r2 and routing device r3 are conducts Three routers of network egress, are connected using two layers of switch between routing device and client.Real in the present invention Apply in example, routing device r1, routing device r2 and routing device r3 are merely compriseed a virtual router, for this virtual router The empty ip address of configuration one, and, all clients of the same network segment can will this virtual ip address using identical configuration It is configured to the default gateway ip address of all clients that is to say, that client pc1 and client pc2 are all to same virtual Router sends arp request.It should be noted that client can have multiple in real network, comprise in virtual router Routing device can also have multiple, in embodiments of the present invention, only to comprise two clients, a switch and by three As a example the network of a virtual router composition that individual routing device is constituted.
With reference to shown in Fig. 2, the concrete steps of the method include:
S101 (optional), neighbours set up and safeguard.
Hello packet is mutual with each routing device safeguarded in this virtual router for setting up in embodiments of the present invention Between neighborhood, if a routing device can be set up after receiving the hello packet that adjacent routing device sends or update Neighbours.Particularly as follows: setting up neighbours can be when virtual router just builds, routing device therein can send mutually hello Message, sets up neighborhood each other or a routing device first time receives the hello of a certain adjacent device Message, then can set up the neighborhood with this adjacent device.After neighborhood is set up, routing device can start active (active) hello packet that intervalometer periodically sends to its neighbour is monitored, when interval sets duration (more than this neighbour Send the cycle of hello packet) it is not received by the hello packet of this neighbour transmission it is determined that this neighbour was lost efficacy, delete this neighbour Occupy.The setting duration of the active intervalometer that different routing device starts can identical it is also possible to different.
S102, routing device role election.
This virtual router needs elect a master routing device, then other routing devices route for backup Equipment.
Specifically, carry its priority attribute in the hello packet that routing device sends and, being stated, these can to master For role's election contest.The priority attribute of wherein routing device is that the vrrp of this routing device defined in vrrp agreement is excellent First level.Master statement is when a certain routing device thinks that it can be master routing device, can send master statement.
Election optimum principle be priority attribute big as master routing device, if priority attribute is identical, source As master routing device, election is carried out by the way of non-preemptive the big equipment in address (the main address of interface), be as Really certain routing device is it is stated that oneself be master routing device, then as long as event in master routing device Barrier, the routing device in this virtual router remains active or standby state, the backup route in this virtual router Even if equipment is subsequently configured for higher priority also will not become master routing device.That is, this election occurs Situation only have two kinds, when one kind is that virtual router just builds, when another kind is that master routing device breaks down, other Need as backup routing device the routing device re-electing out a normal operation as master routing device, take over The work of original master routing device.The equipment being elected as master routing device can send notification packet, notifies this void Other routing devices oneself intended in router are working properly.
That elects concretely comprises the following steps: preferential from the neighbours that statement oneself is master routing device, (execution is elected in inclusion Person) campaign for out the elected master routing device of the superior.If failing to campaign for out master routing device, then from without proper notice oneself it is Master routing device and priority be not 0 neighbours in (include election executor) and campaign for out the superior being elected to master route Equipment.
Example, as shown in figure 3, after mutually setting up neighborhood between running the equipment of this agreement, elect Master/backup routing device.Wherein r1 priority be 40, r2 be 20, r3 be 10, according to the principle of priority, r1 becomes Master routing device, r2, r3 become backup routing device.
S103, distribution forward mac address.
Primary route equipment is different the turning of at least one of itself and virtual router alternate routing equipment distribution Send out mac address, and the result of distribution is broadcasted by notification packet.
Specifically, each routing device, in order to realize the forwarding to client message, needs configuration to forward mac ground thereon Location.Forward the mac address that mac address is virtual gateway, it is corresponding with empty ip address.
It should be understood that every routing device on the premise of not considering back mechanism, in each virtual router Only using unique one forwarding mac address.If it is considered that back mechanism (now generally empty mac address), then Mei Tailu Multiple forwarding mac addresses can be configured by equipment, including primary mac address and backup mac address.In embodiments of the present invention with As a example not considering back mechanism.
Forward mac address can also use real mac address using empty mac address.Real mac address is routing device True mac address, can only give the routing device having this real mac address;Empty mac address is dynamically distributes, can distribute Can use the routing device of this empty mac address to any one.Empty mac address is defined as 00:01:7a:00 in embodiments of the present invention: Group id:mid, wherein group id span is 1~255 (0x01~0xff), mid span be 1~255 (0x01~0xff, 0 is invalid).Which kind of, no matter scene, need to ensure to produce with the real mac address of existing equipment in empty mac address field to conflict.If When routing device is assigned to the real mac address of the empty mac address that mid is 0 or full 0, show that this routing device is not required to undertake and turn The task of sending out.
Distribution about forward mac address is explained below.
The rule of first introduction distribution forwarding mac address is: 1) is executed by master routing device and forwards dividing of mac address Join;2) the only equipment distribution for unallocated forwarding mac;3) preferentially meet the negotiation request of higher priority devices;4) from low address Interval to high address sequential processing request address;5) equipment forwarding mac address cannot be distributed, not undertake forwarding task;6) no Change the owner of allocated forwarding mac address.Wherein it is impossible to distribution forwards mac address to refer to be not allocated to forward mac Address, or this equipment fault can not distribute.Do not change allocated forwarding mac address owner refer to master route set After the standby distribution carrying out forwarding mac address, the forwarding mac address of distribution and the corresponding relation of backup routing device can be recorded, When repeatedly receiving when carrying the hello packet consulting request of this backup routing device, same void mac address can be divided This backup routing device of dispensing, if but master routing device detects this backup failure of routing equipment, and can be according to negative Carry balance policy and in time other routing devices are distributed in this forwarding mac address, so that being currently in use the visitor of this forwarding mac address Family end can normally E-Packet as early as possible.
Master routing device is responsible for distributing the forwarding mac address of all routing devices in this virtual router.Route sets For once being converted into master routing device, if itself being still not previously allocated forwarding mac address, in turning of pre-setting Send out and distribute a still untapped forwarding mac address in mac address realm to itself.If in addition, backup routing device does not have There is allocated forwarding mac address, backup routing device sends to master routing device consults request, consults request and is used for referring to Show that backup routing device expects the forwarding mac address being assigned to it is desirable to the forwarding mac address being assigned to includes: backup road Real mac address and/or at least one empty mac address by equipment;Master routing device sets receiving described alternate routing After negotiation that preparation is sent request, according to consult request distribution one in the empty mac address realm pre-setting not yet distribute and Meet the empty mac address consulting request to alternate routing equipment, or, asked the reality of backup routing device according to negotiation Mac address is as the forwarding mac address of this backup routing device.Master routing device completes to forward the distribution of mac address Afterwards, the result of distribution can be broadcasted by notification packet.Preferably master routing device can be set up one and forward mac ground Location table, every sub-distribution can update this forwarding mac address table after forwarding mac end of address (EOA), and be stored in notification packet and send out See off.Other backup routers receive advertised information, carry out forwarding mac address configuration, and bearing purpose mac address is should Forward the forwarding of the message of mac address.
Example, as shown in figure 4, backup routing device (r2) sends to master routing device (r1) consults request, Expect for 00:01:7a:00:01:01 or 00:01:7a:00:01:02 to forward mac address as it, backup (r3) route sets Standby transmission to master routing device (r1) consults request it is desirable to by 00:01:7a:00:01:02 or 00:01:7a:00:01:03 Forward mac address as it, r1 itself expects to be used 00:01:7a:00:01:01 to forward mac address as it.So according to association Consult and request and ask distribution, and first distribute with reference to the equipment of high priority, the principle that low request address is first processed, the forwarding after finally consulting As shown in table 1, table one is broadcasted mac table by r1 by notification packet.
Table 1
Forward mac address (forward mac) State (state) Owner (owner)
00:01:7a:00:01:01 (setting up) established Routing device r1
00:01:7a:00:01:02 (setting up) established Routing device r2
00:01:7a:00:01:03 (setting up) established Routing device r3
It should be noted that notification packet is lost or is had little time to process this notification packet all may make some backup roads The forwarding mac address being its distribution less than master routing device is obtained by equipment, in order to ensure that backup routing device can Get this forwarding mac address, in embodiments of the present invention, taken by comparing the hello packet of backup routing device transmission The description information of the notification packet of the description information of notification packet of band and the transmission of master routing device forwards to realize distributing The synchronization of mac address result, thereby may be ensured that each backup routing device can get master routing device is its point The forwarding mac address joined.Concrete synchronizing process may be referred to the description of step s106.
S104 (optional), the foundation of client-entry and maintenance.
Compared to poll load balancing of the prior art, if many times the routing device of certain normal work is dashed forward So fault or client all can not be truly realized load balancing situations such as offline.In order to be able to improve above-mentioned the asking of prior art presence Topic, embodiments provides the thinner load balancing of granularity, and master routing device passes through to record client state And count flow information etc. of each routing device and to realize more preferable load balancing.
In embodiments of the present invention, master routing device sets up the Weak link with client, and Weak link is to work as After master routing device receives the arp request message of client, client is recorded by the entry setting up client State, and the entry of client set up after master routing device also can be maintained.In the embodiment of the present invention In, Weak link is not really to make to form annexation between master routing device and pc, but only in master routing device One end is set up and is safeguarded the status information of client.
Specifically, set up the entry of client: master routing device receives the address resolution request from client In client records table, after message, set up the entry of client, the entry of client is used for recording the mark of client, and is Client arranges time-out time.The mark of wherein client can be the title of client;It can also be the address letter of client Breath, such as ip address, mac address, group id (gateway void ip address) etc..Time-out time is used for indicating the request whether mistake of client When.The entry of client can be used for the follow-up distribution executing forwarding mac address according to load balancing.
Example, as shown in figure 5, working as client pc1, when pc2 needs data is activation, the local arp table of client is simultaneously Do not set up, it will send the arp request of broadcast, after master receives this request, in client records table, set up client The entry at end, as shown in table 2, and arranges time-out time:
Table 2
Interface name (interface name) State (state) Client (host) Time-out time (timer)
portx valid pc1 xx:xx:xx
portx valid pc2 xx:xx:xx
It should be noted that the timing of the entry of client is greater than the ageing time of client local arp table.
Safeguard client records table: after list item is set up, need the arp according to client to ask to carry out the entry of client The replacement of retention time refreshes.Specifically in time-out time, if master routing device receives what client sent again Arp request message, then reset to the time-out time of client, and replacement will refresh as maximum time-out time.List item is old After change, readjusting of client associate load will be carried out according to load balancing.If specific time-out time arrives, Master routing device does not receive the arp request message that client sends again, then illustrate that the entry of this client is aging, Delete the entry of client or the entry of client is set to invalid.Master routing device does not receive client and sends again Arp request message it may be possible to because the reasonable cause such as offline, fault of client.
After when the entry deleting described client or the entry of client being set to invalid, master routing device is according to negative Carry balance policy, re-establish each client in client records table and associating that there is the routing device forwarding mac address. After the entry of a client is aging, the load that may result in network no longer equalizes, and now master routing device can be by According to according to load balancing, the active client of record in client records table is carried out with the incidence relation of routing device Adjustment.It should be noted that the principle of adjustment herein is to try to few change associating of existing client and routing device Relation.If master routing device goes out load imbalance according to the entry of client and client associate idea's analysis, will close One associated client end of the most routing device of connection client terminal quantity adjusts to the routing device of associated client end minimum number, Until each has client (the client terminal quantity difference that effective routing device forwarding mac address distributes equal number as far as possible 1 can not be more than).
Example it is assumed that present master routing device establishes the entry of 4 client's sections in the log of family end, respectively It is entry, the entry of the entry of client b, the entry of client c and client d of client a, client a and client simultaneously End b association routing device a, client c association routing device b, client d association routing device c.But the entry in client c In the time-out time setting, master routing device does not receive the arp request of client c transmission, then the entry of client c is old Change, master routing device deletes this entry from the log of family end, simultaneously the incidence relation of client c and routing device b Do not exist.Now load imbalance, then master routing device will adjust client associate relation, so that client b is again closed Connection routing device b, other incidence relations are constant.Namely new incidence relation closes for client a association routing device a, client b Connection routing device b, client d association routing device c, reach load balancing.
S105, according to load balancing, to client associate routing device.
Master routing device receives after the address resolution request message of client, according to load balancing, For client associate, there is the routing device forwarding mac address, and the result of association is broadcasted by notification packet.
Preferably, in order to the incidence relation of good record client and routing device, master routing device exists The association list item of client is set up, the association list item of client includes: the mark of client (can be client in contingency table Title, address information etc.) and client associate routing device forwarding mac address (or routing device title) it is also possible to bag Include other information, such as status information etc., it is not limited herein.After master routing device builds up association list item, by contingency table In information broadcasted by notification packet, notified its associated client client information of backup routing device.
Example, r1 carries out client associate according to simple balance policy, and contingency table is as shown in table 3:
Table 3
As shown in fig. 6, the related information notice in contingency table is sent to backup equipment by r1 in messages, including oneself Apply the association list item in this contingency table in interior all devices.
Wherein, load balancing includes:
Optionally, can be simple equally loaded strategy, that is, master routing device, according to contingency table, chooses associated client One of end minimum number has the routing device forwarding mac address, with associated client end.
Specifically, the method for salary distribution of simple equally loaded strategy, is to have, for each, the gateway device forwarding mac address The client of association equal number.
The principle of simple equally loaded strategy is: is executed as client associate gateway device by master routing device, makes Each has the client effectively forwarding the routing device of mac address to try one's best association equal number, and (client terminal quantity difference can not More than 1).The forwarding mac address of the routing device of client associate necessarily be in effective status, if the route of client associate sets Standby forwarding mac address is in disarmed state, then must make client reassociation routing device.If for example there being 4 clients, 3 have effective equipment forwarding mac, then each equipment at least distributes a client, and the client having more is randomly assigned To arbitrary equipment.
Optionally, can be mixed equilibrium load strategy, be static association strategy and the side of simple equally loaded strategy Formula mixes.If client belongs to the client in static association strategy, static association strategy is used for quiet at least one client State specifies routing device, then primary route equipment is client static association routing device according to static association strategy;Otherwise, main With routing device according to contingency table, a route with forwarding mac address choosing association dynamic client minimum number sets Standby, dynamic client is the client being not belonging in described static association strategy.
The principle of specific mixed equilibrium load strategy is: the incidence relation that preferential distribution static state is specified;Disregard using quiet The client of state associating policy, the client having effective equipment distribution equal number forwarding mac address for each (has visitor Family end number differences can not be more than 1);The forwarding mac of client associate equipment must be in effective status, the client otherwise relying on Must be redistributed.
If for example having 4 clients, respectively client a, client b, client c and client d, 3 have effective turning Send out the equipment of mac, respectively master routing device 1, routing device 2 and routing device 3, wherein client a be static specify by Routing device 2 associates.So now to take mixed equilibrium load strategy, master routing device 1 preferentially distributes client a and closes Connection routing device 2;Disregard client a, also 3 clients, then master routing device 1 is according to simple equally loaded plan Slightly, 3 clients are averagely allocated to routing device 1, routing device 2 and routing device 3.When again having new non-static specified pass When client e of system needs to associate routing device, any one of 3 each routing devices routing device can be given.
Optionally, can be the flow equalization load strategy extending.Primary route device statistics each have forwarding mac ground The load flow of the routing device of location, primary route equipment chooses a minimum road with forwarding mac address of load flow By equipment, with associated client end.
Specifically, flow equalization strategy purpose is, so that the load flow of every gateway device is kept in balance, to belong to grain Spend thinner load to control.After master routing device completes to distribute client associate, routing device is responsible for associated client end Flow forwards and carries out traffic statistics, would know that each client by flow for bandwidth consumption, by this statistical information Master routing device will be fed back in write hello packet, after master routing device receives traffic statistics, equal using flow The mode of weighing apparatus distributes client, and allocation strategy is as follows: is to have effective equipment forwarding mac address to try one's best in units of client The flow of distribution is identical.Can be that master routing device is chosen when a new client needs to associate routing device A minimum routing device with forwarding mac address of load flow, to associate this client;Can also be when master road Load flow is obtained after the traffic statistics to each routing device and analysis by equipment unbalanced, according to load flow strategy simultaneously After after calculating being adjusted the incidence relation of client and routing device, Adjustment principle is also to try to the existing pass of few change Connection relation.
In embodiments of the present invention, master routing device is according to load balancing, by client associate routing device Mainly there are following three kinds of situations: the first, the arp that master routing device receives new client asks and sets up this client After the entry at end, the specific foregoing description with reference to s105;In second, such as step s104, master routing device is to visitor In the maintenance process of the log at family end, after when the entry deleting a certain client or the entry of client being set to invalid, tool The description with reference to s104 of body;The third, is when the failure of routing equipment with client associate, specific retouching with reference to s106 State.There may also be other situations and lead to load imbalance it is also possible to according to side provided in an embodiment of the present invention in real network Method, will not be described here.
The routing device of s106 and client associate generates and sends Host routes.
Generate the Host routes with client ip address as prefix with the routing device of client associate, and by Host routes It is distributed to the first line of a couplet equipment of this routing device, so that first line of a couplet equipment generates has same prefix, Qie Yigai road with Host routes By equipment for next-hop route.
Specifically, when master routing device in step s105 will be wide by notification packet for the contingency table having association list item After broadcasting, all routing devices including master routing device apply this incidence relation.Once incidence relation determines, Master/backup routing device generates the Host routes of with its associated client end ip address as prefix 32, and by main frame Route is distributed to the first line of a couplet equipment of this routing device, and route next jump points to agreement runnable interface.Routing device is by configuring road By the redistribution of agreement, Host routes are published in whole network, so that first line of a couplet equipment generates has phase with Host routes Same prefix and the route with master/backup routing device as next-hop.According to the longest match principle of route, descending report After literary composition reaches gateway device, find accurate route, be forwarded to the first line of a couplet equipment of client, complete down load equilibrium.
It should be noted that the Host routes mentioned in embodiments of the present invention and Host routes form of the prior art Unanimously.Due to being exactly its associated client end according to the next-hop of vrrp equally loaded agreement routing device, so above-mentioned route sets Can only be comprised before the ip address of associated client end with its associated client end ip address Host routes as prefix for generate Sew, save next-hop;The prefix of associated client end ip address can also both be comprised, by comprising next-hop.
Example, as shown in fig. 7, master (r1) is associated with pc1, and generate the ip address adding pc1 main frame road By pc1/32;Backup (r2) is associated with pc2, and generate respectively the ip address adding pc2 Host routes pc2/32.Pass through Routing Protocol is published in whole routed domain so that r1 first line of a couplet equipment generate with Host routes have same prefix and with R1 is route pc1/32nexthop (next-hop) of next-hop: r1;The generation of first line of a couplet equipment and the Host routes of r2 have mutually the same Sew and route pc2/32nexthop:r2 with r2 as next-hop.
As shown in figure 8, being to exist according to the lower happiness that vrrp down load equalization methods provided in an embodiment of the present invention are set up Business, is sent to the first line of a couplet equipment via r1 for the message of pc1, r1, switch issue pc1;The message being sent to pc2 is via r2's First line of a couplet equipment, r2, switch issue pc2.
In embodiments of the present invention, master routing device and backup routing device multipass notification packet and Hello packet carries out information exchange, then may occur in this process could not receive the feelings of the message of other side in time Condition, thus lead to complete corresponding work.In order to solve this problem, because hello packet is periodically to send, because This increased the description information of the notification packet receiving, description information in the hello packet that backup routing device sends In comprise serial number and verification and (checksum).Thus comparing whether this description information unanimously realizes master routing device The synchronization of interactive information and backup routing device between, is further ensured that corresponding work can complete in time.
Specifically, if according to the hello packet receiving, master routing device judges that backup routing device does not have The synchronous notification packet that it sends, then resend notification packet;If backup routing device is according to the master road receiving Judge that it is not synchronous by the notification packet that equipment sends, then the information in synchronous notification packet.
Receive the hello of the description information comprising First ray number of alternate routing equipment transmission in master routing device After message, judge the second serial number in the First ray number notification packet locally stored with described master routing device whether Unanimously, if inconsistent, by comprise locally stored data content and comprise the 3rd serial number description information notice report Literary composition sends to backup routing device, and the 3rd serial number is more than described First ray number.Specifically, if First ray number is less than the Two serial numbers, then the 3rd Serial No. the second serial number, master routing device sends locally stored notification packet;If first Serial number is more than the second serial number, then the second serial number in local notification packet is increased to the 3rd serial number, master road Send the notification packet of renewal sequence number by equipment;If serial number is identical, does not process and (prove that this backup routing device connects Have received up-to-date notification packet).
After receiving, in backup routing device, the notification packet comprising the 4th serial number, if this notification packet is master road Sent by equipment, then the 5th locally stored with backup routing device for the 4th serial number serial number is compared, specifically If the 4th serial number be more than the 5th serial number, the notification packet of storage the 4th serial number, and according to the phase in notification packet Close instruction work (subsequent design related content);Otherwise do not process.If this notification packet is backup routing device sending, Then directly abandon this message.
Embodiments provide a kind of method realizing vrrp load balancing, be applied to comprise multiple routing devices Virtual router, in virtual router, elects a master routing device, and master routing device is itself and void Intend the different forwarding mac address of at least one of router backup routing device distribution, master routing device receives After the address resolution request message of client, according to load balancing, it is that client associate has forwarding mac address Routing device, generates the Host routes with client ip address as prefix with the routing device of client associate, and by main frame road By the first line of a couplet equipment being distributed to this routing device, so that first line of a couplet equipment generates has same prefix and with this with Host routes Routing device is the route of next-hop.The embodiment of the present invention to realize accurate road by way of using the notice of above-mentioned Host routes By, guiding downlink traffic to this equipment, thus avoiding first line of a couplet equipment in prior art to select wherein from equal-cost route at random One route carrys out the problem that converting downlink flow is brought.
Embodiment two
Embodiments provide a kind of routing device, multiple described routing devices are used for constituting a virtual flow-line Device, described virtual router has an empty ip address, and the default gateway ip address configuration of each client of the same network segment is described Empty ip address, as shown in figure 9, this routing device includes: role's election unit 91, allocation unit 92, receiving unit 93, association table Unit 94, transmitting element 95;In this routing device, the realization of each functional module may be referred to above-described embodiment one, and here is no longer superfluous State.
Role elects unit 91, in described virtual router, electing a primary route equipment, other routes Equipment is alternate routing equipment;
Allocation unit 92, for when role elects the primary route equipment that unit elects to be described routing device, being The different forwarding mac address of other routing devices of at least one of itself and described virtual router distribution, and will be described The result of distribution is broadcasted by notification packet;
Receiving unit 93, for when role elects the alternate routing equipment that unit elects to be described routing device, connecing Receive the result of described distribution, the result of described distribution is used for, after described routing device is assigned forwarding mac address, configuring institute State forwarding mac address;
Receiving unit 93, is additionally operable to receive the address resolution request message from client;
Associative cell 94, when the primary route equipment for electing in role's election unit is described routing device, institute State receiving unit and receive after the address resolution request message of client, according to load balancing, be described client Association has the routing device forwarding mac address, and the result of described association is broadcasted by notification packet;
Receiving unit 93, is additionally operable to when role elects the alternate routing equipment that unit elects to be described routing device, Receive the result of described association;
Transmitting element 95, for generating Host routes with described associated client end ip address as prefix, and by described master Machine route is distributed to the first line of a couplet equipment of this routing device so that described first line of a couplet equipment generate with described Host routes have identical Prefix and the route with this routing device as next-hop.
Optionally, associative cell 94, specifically for setting up the association list item of described client, described client in contingency table The association list item at end includes: the forwarding mac address of the routing device of the mark of described client and described client associate;Institute State and the result of described association is carried out broadcast inclusion by notification packet: the information in described contingency table is entered by notification packet Row broadcast.
Optionally, associative cell 94, specifically for according to described contingency table, choose associated client end minimum number one There is the routing device forwarding mac address, to associate described client;
Or, if described client belongs to the client in static association strategy, described static association strategy be used for be to A few client is static to specify routing device, then set for described client static association route according to described static association strategy Standby;Otherwise, according to described contingency table, one that chooses association dynamic client minimum number has the route forwarding mac address Equipment, described dynamic client is the client being not belonging in described static association strategy.
Optionally, this routing device also includes: statistic unit 96, for the primary route electing in role's election unit Equipment be described routing device when, count each have forward mac address routing device load flow;Associative cell 94, A routing device with forwarding mac address minimum specifically for choosing load flow, to associate described client.
Optionally, this routing device also includes: sets up and maintenance unit 97, for the master electing in role's election unit During with routing device for described routing device, after receiving unit receives the address resolution request of client, in client note The entry of described client is set up, the entry of described client is used for recording the mark of described client, and is described in record table Client arranges time-out time;In described time-out time, if receiving the address resolution request that described client sends again Message, then reset to the time-out time of described client;If described time-out time arrives, do not receive described client again The address resolution request message of secondary transmission, then delete the entry of described client or the entry of described client is set to invalid.
Optionally, described associative cell 94 is additionally operable to described to set up unit 97 and deletes the entry of described client or by institute State client entry be set to invalid after, according to load balancing, re-establish each client in described client records table End and associating that there is the routing device forwarding mac address.
Optionally, transmitting element 95 is additionally operable to elect the alternate routing equipment that unit elects to set for described route as role When standby, send to described primary route equipment and consult request, described negotiation request is used for indicating described alternate routing equipment expectation The forwarding mac address being assigned to, the forwarding mac address that described expectation is assigned to includes: the real mac ground of described alternate routing equipment Location and/or at least one empty mac address;
Allocation unit 92 is additionally operable to after receiving the negotiation request that described alternate routing equipment sends, according to described negotiation Request distribution one in the empty mac address realm pre-setting not yet distributes and meets the described empty mac address consulting request To described alternate routing equipment, or, consult request using the real mac address of described alternate routing equipment as described according to described The forwarding mac address of alternate routing equipment.
Optionally, described notification packet includes: description information data content, and described description information comprises serial number;Should Routing device also includes lock unit 98, for being described routing device when role elects the primary route equipment that unit elects When receive alternate routing equipment transmission the description information comprising First ray number after, judge described First ray number with described Whether the second locally stored serial number of primary route equipment is consistent, if inconsistent, will comprise locally stored data content And the notification packet of the description information comprising the 3rd serial number sends to described alternate routing equipment, described 3rd serial number is big In described First ray number;Or, when role elects the alternate routing equipment that unit elects to be described routing device, receiving To comprising after the notification packet of the 4th serial number, by the locally stored with described alternate routing equipment for described 4th serial number the 5th Serial number is compared, if the 4th serial number is more than described 5th serial number, stores the notification packet of described 4th serial number.
It should be noted that receiving unit 93 in the present embodiment can for possess on routing device receive capabilities or connect Mouth circuit, such as receiver or information receiving interface;Transmitting element 95 can be for possessing the interface electricity of sending function on routing device Road, such as transmitter or information transmission interface.Other units can be the processor individually set up it is also possible to be integrated in routing device Some processor in realize, in addition it is also possible in the memorizer being stored in routing device in the form of the program code, by road Called by some processor of equipment and execute the function of above unit.Processor described here can be in one Central processor (English full name: central processing unit, English abbreviation: cpu), or specific integrated circuit (English Civilian full name: application specific integrated circuit, English abbreviation: asic), or be arranged to Implement one or more integrated circuits of the embodiment of the present invention.
Embodiments provide a kind of routing device, in the virtual router that multiple routing devices are constituted, By the master routing device electing by the message interaction between each routing device be virtual router in each route Equipment distribution forwards mac address, and according to load balancing, client associate is had the routing device forwarding mac address, Then the Host routes with described client ip address as prefix are generated with the routing device of described client associate, and will be described Host routes are distributed to the first line of a couplet equipment of this routing device, so that described first line of a couplet equipment generates has phase with described Host routes Same prefix and the route with this routing device as next-hop.To realize accurately by way of using the notice of above-mentioned Host routes Route, guides downlink traffic to this equipment, thus avoiding first line of a couplet equipment in prior art to select it from equal-cost route at random In a route carry out the problem that converting downlink flow is brought.
It should be understood that disclosed system in several embodiments provided herein, apparatus and method are permissible Realize by another way.For example, device embodiment described above is only schematically, for example, described unit Divide, only a kind of division of logic function, actual can have other dividing mode when realizing, for example multiple units or assembly Can in conjunction with or be desirably integrated into another system, or some features can be ignored, or does not execute.Another, shown or The coupling each other discussing or direct-coupling or communication connection can be by some interfaces, the indirect coupling of device or unit Close or communicate to connect, can be electrical, mechanical or other forms.
The described unit illustrating as separating component can be or may not be physically separate, show as unit The part showing can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.The mesh to realize this embodiment scheme for some or all of unit therein can be selected according to the actual needs 's.
In addition, can be integrated in a processing unit in each functional unit in each embodiment of the present invention it is also possible to It is that the independent physics of unit is included it is also possible to two or more units are integrated in a unit.Above-mentioned integrated list Unit both can be to be realized in the form of hardware, it would however also be possible to employ the form that hardware adds SFU software functional unit is realized.
The above-mentioned integrated unit realized in the form of SFU software functional unit, can be stored in an embodied on computer readable and deposit In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions with so that a computer Equipment (can be personal computer, server, or network equipment etc.) executes the portion of each embodiment methods described of the present invention Step by step.And aforesaid storage medium includes: u disk, portable hard drive, read only memory (read-only memory, referred to as Rom), random access memory (random access memory, abbreviation ram), magnetic disc or CD etc. are various can store The medium of program code.
Finally it is noted that above example, only in order to technical scheme to be described, is not intended to limit;Although With reference to the foregoing embodiments the present invention is described in detail, it will be understood by those within the art that: it still may be used To modify to the technical scheme described in foregoing embodiments, or equivalent is carried out to wherein some technical characteristics; And these modification or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit and Scope.

Claims (11)

1. one kind realize Virtual Router Redundacy Protocol vrrp down load in a balanced way method it is characterised in that be applied to comprise many The virtual router of individual routing device, described virtual router has an empty ip address, each client of the same network segment default Gateway ip address configuration is described void ip address, and the method includes:
In described virtual router, elect a primary route equipment, other routing devices are alternate routing equipment;
Described primary route equipment is that the distribution of at least one of itself and described virtual router alternate routing equipment is different Forwarding mac address, and the result of described distribution is broadcasted by notification packet;
Described primary route equipment receives after the address resolution request message of client, according to load balancing, is Described client associate has the routing device forwarding mac address, and the result of described association is carried out extensively by notification packet Broadcast;
Generate the Host routes with described client ip address as prefix with the routing device of described client associate, and will be described Host routes are distributed to the first line of a couplet equipment of this routing device, so that described first line of a couplet equipment generates has phase with described Host routes Same prefix and the route with this routing device as next-hop.
2. method according to claim 1 is it is characterised in that described have forwarding mac address for described client associate Routing device include: described primary route equipment sets up the association list item of described client, described client in contingency table Association list item include: the forwarding mac address of the routing device of the mark of described client and described client associate;
The described result by described association carries out broadcast by notification packet and includes: the information in described contingency table is passed through notice Message is broadcasted.
3. method according to claim 2 it is characterised in that described according to load balancing, be that described client is closed The routing device that connection has forwarding mac address includes:
According to described contingency table, one that chooses associated client end minimum number has forwarding mac ground to described primary route equipment The routing device of location, to associate described client;
Or, if described client belongs to the client in static association strategy, it is at least one that described static association strategy is used for Individual client is static to specify routing device, then described primary route equipment is that described client is quiet according to described static association strategy State associates routing device;Otherwise, described primary route equipment, according to described contingency table, chooses association dynamic client minimum number One have forward mac address routing device, described dynamic client is the visitor being not belonging in described static association strategy Family end.
4. method according to claim 1 is it is characterised in that also include: described primary route device statistics each have Forward the load flow of the routing device of mac address;
Described according to load balancing, be that described client associate has and forwards the routing device of mac address to include: described master Choose a minimum routing device with forwarding mac address of load flow with routing device, to associate described client.
5. method according to claim 1 is it is characterised in that receive from client in described primary route equipment After address resolution request message, methods described also includes:
Described primary route equipment sets up the entry of described client in client records table, and the entry of described client is used for Record the mark of described client, and time-out time is set for described client;
In described time-out time, if described primary route equipment receives the address resolution request that described client sends again Message, then reset to the time-out time of described client;If described time-out time arrives, described primary route equipment does not connect Receive the address resolution request message that described client sends again, then delete the entry of described client or by described client Entry be set to invalid.
6. method according to claim 5 is it is characterised in that methods described also includes:
When described delete the entry of described client or the entry of described client be set to invalid after, described primary route equipment According to load balancing, re-establish each client in described client records table and the route with forwarding mac address The association of equipment.
7. method according to claim 1 is it is characterised in that described primary route equipment sets at least one alternate routing Back-up is joined different forwarding mac addresses and is included:
Described alternate routing equipment sends to described primary route equipment consults request, and described negotiation request is used for indicating described standby The forwarding mac address being assigned to routing device expectation, the forwarding mac address that described expectation is assigned to includes: described standby road Real mac address and/or at least one empty mac address by equipment;
Described primary route equipment, after receiving the negotiation request that described alternate routing equipment sends, consults request according to described In the empty mac address realm pre-setting, distribution one not yet distributes and meets the described empty mac address consulting request to institute State alternate routing equipment, or, consult request using the real mac address of described alternate routing equipment as described standby according to described The forwarding mac address of routing device.
8. the method according to any one of claim 1-7 is it is characterised in that described notification packet includes: description information and Data content, described description information comprises serial number;
Methods described also includes: described primary route equipment receive alternate routing equipment transmission comprise retouching of First ray number After stating information, judge whether described First ray second serial number locally stored with described primary route equipment be consistent, if not Unanimously, then the notification packet comprising locally stored data content and the description information comprising the 3rd serial number sends to described Alternate routing equipment, described 3rd serial number is more than described First ray number;Or,
After described alternate routing equipment receives the notification packet comprising the 4th serial number, will be standby with described for described 4th serial number It is compared with the 5th locally stored serial number of routing device, if the 4th serial number is more than described 5th serial number, store The notification packet of described 4th serial number.
9. a kind of routing device is it is characterised in that multiple described routing device is used for constituting a virtual router, described virtual Router has an empty ip address, and the default gateway ip address configuration of each client of the same network segment is described void ip address, should Routing device includes: role's election unit, allocation unit, receiving unit, associative cell, transmitting element;
Described role elects unit, and in described virtual router, electing a primary route equipment, other routes set Standby for alternate routing equipment;
Described allocation unit, for when role elects the primary route equipment that unit elects to be described routing device, being certainly The different forwarding mac address of other routing devices of at least one of body and described virtual router distribution, and by described point The result joined is broadcasted by notification packet;
Described receiving unit, for when role elects the alternate routing equipment that unit elects to be described routing device, receiving The result of described distribution, the result of described distribution is used for after described routing device is assigned forwarding mac address, and configuration is described Forward mac address;
Described receiving unit, is additionally operable to receive the address resolution request message from client;
Described associative cell, for when role elects the primary route equipment that unit elects to be described routing device, described Receiving unit receives after the address resolution request message of client, according to load balancing, is that described client is closed Connection has the routing device forwarding mac address, and the result of described association is broadcasted by notification packet;
Described receiving unit, is additionally operable to, when role elects the alternate routing equipment that unit elects to be described routing device, connect Receive the result of described association;
Described transmitting element, for generating Host routes with described associated client end ip address as prefix, and by described main frame Route is distributed to the first line of a couplet equipment of this routing device so that described first line of a couplet equipment generate and described Host routes have mutually the same Sew and the route with this routing device as next-hop.
10. routing device according to claim 9 is it is characterised in that receive from visitor in described primary route equipment After the address resolution request message at family end, described routing device also includes:
Set up and maintenance unit, when the primary route equipment for electing in role's election unit is described routing device, The entry of described client is set up, the entry of described client is used for recording the mark of described client in client records table, And time-out time is set for described client;
In described time-out time, if receiving unit receives the address resolution request message that described client sends again, The time-out time of described client is reset;If described time-out time arrives, described receiving unit does not receive described visitor The address resolution request message that family end sends again, then delete the entry of described client or be set to the entry of described client Invalid.
11. routing devices according to any one of claim 9-10 are it is characterised in that described notification packet includes: description Information data content, described description information comprises serial number;
Described routing device also includes: lock unit, is described for electing, in role, the primary route equipment that unit elects During routing device, after receiving the description information comprising First ray number of alternate routing equipment transmission, judge described First ray Whether second serial number locally stored with described primary route equipment be consistent, if inconsistent, comprises locally stored data The notification packet of content and the description information comprising the 3rd serial number sends to described alternate routing equipment, described 3rd sequence Number be more than described First ray number;Or,
Described lock unit is additionally operable to, when role elects the alternate routing equipment that unit elects to be described routing device, receive After comprising the notification packet of the 4th serial number, by the 5th locally stored with described alternate routing equipment for described 4th serial number sequence Row number is compared, if the 4th serial number is more than described 5th serial number, stores the notification packet of described 4th serial number.
CN201610797266.2A 2016-08-31 2016-08-31 Method for realizing VRRP (Virtual Router Redundancy Protocol) downlink load balancing and route devices Pending CN106375210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610797266.2A CN106375210A (en) 2016-08-31 2016-08-31 Method for realizing VRRP (Virtual Router Redundancy Protocol) downlink load balancing and route devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610797266.2A CN106375210A (en) 2016-08-31 2016-08-31 Method for realizing VRRP (Virtual Router Redundancy Protocol) downlink load balancing and route devices

Publications (1)

Publication Number Publication Date
CN106375210A true CN106375210A (en) 2017-02-01

Family

ID=57900473

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610797266.2A Pending CN106375210A (en) 2016-08-31 2016-08-31 Method for realizing VRRP (Virtual Router Redundancy Protocol) downlink load balancing and route devices

Country Status (1)

Country Link
CN (1) CN106375210A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888492A (en) * 2017-10-16 2018-04-06 闽南师范大学 A kind of method and apparatus of VRRP load balancing
CN112653620A (en) * 2020-12-21 2021-04-13 杭州迪普科技股份有限公司 Route processing method, device, equipment and computer readable storage medium
CN113098788A (en) * 2021-03-08 2021-07-09 杭州迪普科技股份有限公司 Method and device for releasing route
CN115801555A (en) * 2023-01-06 2023-03-14 北京中科网威信息技术有限公司 Main/standby switching method and device based on preemption delay and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244606A (en) * 2010-05-12 2011-11-16 杭州华三通信技术有限公司 Method for realizing virtual router redundancy protocol extended (VRRPE) flow transmission, system and equipment thereof
CN103354567A (en) * 2013-07-10 2013-10-16 杭州华三通信技术有限公司 Method for synchronizing media access control (MAC) addresses and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244606A (en) * 2010-05-12 2011-11-16 杭州华三通信技术有限公司 Method for realizing virtual router redundancy protocol extended (VRRPE) flow transmission, system and equipment thereof
CN103354567A (en) * 2013-07-10 2013-10-16 杭州华三通信技术有限公司 Method for synchronizing media access control (MAC) addresses and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888492A (en) * 2017-10-16 2018-04-06 闽南师范大学 A kind of method and apparatus of VRRP load balancing
CN107888492B (en) * 2017-10-16 2020-07-24 闽南师范大学 VRRP load balancing method and device
CN112653620A (en) * 2020-12-21 2021-04-13 杭州迪普科技股份有限公司 Route processing method, device, equipment and computer readable storage medium
CN113098788A (en) * 2021-03-08 2021-07-09 杭州迪普科技股份有限公司 Method and device for releasing route
CN115801555A (en) * 2023-01-06 2023-03-14 北京中科网威信息技术有限公司 Main/standby switching method and device based on preemption delay and electronic equipment

Similar Documents

Publication Publication Date Title
CN106161272B (en) Realize the method and routing device of VRRP load balancing
CN109120418B (en) Distributed multicast of endpoints
WO2017117339A1 (en) Network redundancy and failure detection
WO2018077238A1 (en) Switch-based load balancing system and method
CN1826773B (en) Distributing and balancing traffic flow in a virtual gateway
CN101404621B (en) Method and routing device for implementing VRRP load balance
US20040034702A1 (en) Method and apparatus for exchanging intra-domain routing information between VPN sites
CN101160909B (en) Method and system for implementing virtual router redundancy protocol on a resilient packet ring
CN103428306B (en) Network element device loading method, equipment and system
CN101005452A (en) Method and system for communication between IP devices
CN106375210A (en) Method for realizing VRRP (Virtual Router Redundancy Protocol) downlink load balancing and route devices
CN102215158A (en) Method for realizing VRRP (Virtual Router Redundancy Protocol) flow transmission and routing equipment
JP5107339B2 (en) System and method for active geographic redundancy
CN103259740B (en) A kind of load balance process method and device
CN102769556B (en) Dynamic regulation method and device for active VLAN
CN106936943A (en) The distribution method and system of virtual machine address
WO2021185043A1 (en) Forwarding path establishment method and apparatus, and computer-readable storage medium
US11546267B2 (en) Method for determining designated forwarder (DF) of multicast flow, device, and system
CN107888492A (en) A kind of method and apparatus of VRRP load balancing
CN103746881A (en) Neighbor state detection method and neighbor state detection device in EVI (Ethernet Virtualization Interconnection) network
CN103873336A (en) Distributed resilient network interconnection-based service bearing method and device
CN101562576B (en) Route distribution method and equipment thereof
CN106375211A (en) Switch data processing method in VRRP load balanced scene and switch
CN105721328A (en) VRRP load balancing method, VRRP load balancing device and router
CN107294845A (en) VRRP load-balancing methods and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170201