[go: up one dir, main page]

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
routing
equipment
mac address
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

Method and routing equipment for realizing VRRP downlink load balance
Technical Field
The present invention relates to network communication technologies, and in particular, to a method and a routing device for implementing Virtual Router Redundancy Protocol (VRRP) downlink load balancing.
Background
When the communication between the client and the external network is realized, the same default gateway is usually set for all the clients in the same network segment, that is, the default route with the same gateway as the next hop is configured, and the messages sent by the client to other network segments are sent to the gateway of the next hop through the default route and then forwarded by the gateway, however, when the gateway fails, all the clients in the network segment using the gateway as the default route cannot communicate with the external network. Although the default route provides convenience for the configuration operation of the user, a high stability requirement is provided for the gateway, and adding an egress gateway is a common method for improving the reliability of the system.
VRRP, which is being developed, is a fault tolerant protocol for solving how to route between multiple outlets, which simplifies the configuration of clients while improving reliability. The standard VRRP is a virtual router formed by a plurality of router devices with gateway functions, wherein one of the router devices in the virtual router is selected as a master router device to be responsible for flow forwarding according to an election mechanism of the VRRP, and the other router devices are selected as backup router devices to be responsible for monitoring the master router device, and when the master router device is monitored to have a fault, the master router device is reselected. Although the system reliability is improved in this way, only the main routing device of the plurality of routing devices in the virtual router is responsible for traffic forwarding, and obviously, there is waste in both routing device resources and network bandwidth.
In order to solve the problem of resource and bandwidth waste, the prior art provides a method for implementing VRRP load balancing. The method comprises the following steps: the virtual router comprises a plurality of routing devices, and the default gateway IP address of each client in the same network segment is configured as the virtual IP address of the virtual router; the method comprises the steps that a main routing device selected from a virtual router allocates a virtual MAC address to the main routing device, and after receiving a virtual MAC allocation request message sent by other routing devices, allocates different virtual MAC addresses to the other routing devices, and sends the virtual MAC addresses to the other routing devices through address response messages; after receiving an address resolution request from a client, the primary routing device replies a virtual MAC address assigned to each routing device in the virtual router to the client by carrying the virtual MAC address in an address resolution response according to a load balancing strategy, so that the client can send a message by using the received virtual MAC address.
The prior art also provides a method for implementing VRRP load balancing, that is, multiple VRRP routing devices are used to create multiple virtual routers, and each virtual router has a master routing device and at least one backup routing device. One VRRP routing device may be used as a master routing device in one virtual router, and may also be used as a backup routing device in another virtual router. The virtual IP addresses of different virtual routers can be configured for each client in advance according to a load balancing strategy as default gateway IP addresses, each client sends an Address Resolution Protocol (ARP) request according to the configured virtual IP addresses, the master routing equipment in the virtual router corresponding to the client carries the MAC address of the client in an ARP response and replies the ARP response to the client, the client establishes an ARP table item by using the MAC address carried in the ARP response and sends uplink flow by using the ARP table item, namely the uplink flow from each client is forwarded through the master routing equipment in the virtual router configured to the client, and the load balancing of the uplink flow among a plurality of VRRP routing equipment is realized.
The protocols can guide the uplink flow of the client to different uplink devices by using various load strategies, so as to realize the load sharing of the uplink flow. For the downlink traffic, in the prior art, no matter which method for implementing the VRRP load balancing is used, multiple VRRP routing devices of the same virtual router are required to issue the same interface address network segment route to the uplink device connected to the virtual router, that is, the routes issued by the multiple VRRP routing devices of the same virtual router are equivalent routes for the uplink device, and based on this, when the uplink device sends the downlink traffic to the client corresponding to the virtual router, the uplink device randomly selects one route from the equivalent routes to forward the downlink traffic. That is to say, the route for forwarding the downlink traffic to the client by the uplink device is randomly selected and cannot be uniquely determined, and the route for forwarding the downlink traffic to the client may also be different for the downlink traffic whose destination address is the same client. This causes inconsistency of the back-and-forth paths of the service packets, and the downlink traffic is borne by a part of the devices possibly due to the preferred relationship of the route, as shown in fig. 1, the device R2 bears all the downlink traffic of the client, and if the traffic is greater than the bandwidth of the downlink interface of R2, the problem of network congestion is caused.
Disclosure of Invention
Embodiments of the present invention provide a method and a routing device for implementing Virtual Router Redundancy Protocol (VRRP) downlink load balancing, so as to avoid a problem in the prior art that an uplink device randomly selects one of equivalent routes to forward downlink traffic.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method for implementing VRRP downlink load balancing, which is applied to a virtual router including multiple routing devices, where the virtual router has a virtual IP address, and a default gateway IP address of each client in the same network segment is configured as the virtual IP address, and the method includes:
in the virtual router, a main routing device is selected, and other routing devices are standby routing devices;
the main routing equipment distributes different forwarding MAC addresses for the main routing equipment and at least one standby routing equipment in the virtual router, and broadcasts the distribution result through an announcement message;
after receiving an address resolution request message from a client, the main routing equipment associates the routing equipment with a forwarding MAC address for the client according to a load balancing strategy, and broadcasts the associated result through an announcement message;
and the routing equipment associated with the client generates a host route with the IP address of the client as a prefix, and distributes the host route to the uplink equipment of the routing equipment, so that the uplink equipment generates a route which has the same prefix as the host route and takes the routing equipment as a next hop.
Optionally, associating the routing device with the forwarding MAC address for the client includes: the primary routing device establishes an association table entry of the client in an association table, where the association table entry of the client includes: an identifier of the client, a forwarding MAC address of a routing device associated with the client;
the broadcasting the associated result through an announcement message includes: and broadcasting the information in the association table through an announcement message.
Optionally, associating, according to the load balancing policy, the routing device having the forwarding MAC address for the client includes:
the master routing equipment selects one routing equipment with a forwarding MAC address with the least number of associated clients according to the association table so as to associate the clients;
or, if the client belongs to a client in a static association policy, where the static association policy is used to statically assign a routing device to at least one client, the primary routing device is the client static association routing device according to the static association policy; otherwise, the master routing device selects a routing device with a forwarding MAC address with the least number of associated dynamic clients according to the association table, wherein the dynamic clients are clients not belonging to the static association policy.
Optionally, the method further includes: the main routing equipment counts the load flow of each routing equipment with the forwarding MAC address;
the associating the routing device with the forwarding MAC address for the client according to the load balancing strategy comprises: and the main routing equipment selects one routing equipment with the least load flow and the forwarding MAC address to associate the client.
Optionally, after the active routing device receives an address resolution request packet from a client, the method further includes:
the main routing equipment establishes an entry of the client in a client record table, wherein the entry of the client is used for recording the identification of the client and setting timeout time for the client;
if the primary routing equipment receives an address resolution request message sent again by the client within the timeout time, resetting the timeout time of the client; and if the timeout time is up, the active routing equipment does not receive the address resolution request message sent again by the client, deleting the entry of the client or setting the entry of the client as invalid.
Optionally, the method further includes: and when the entry of the client is deleted or set as invalid, the main routing equipment reestablishes the association between each client in the client record table and the routing equipment with the forwarding MAC address according to a load balancing strategy.
Optionally, the allocating, by the active routing device, different forwarding MAC addresses to at least one standby routing device includes: the standby routing equipment sends a negotiation request to the active routing equipment, where the negotiation request is used to indicate a forwarding MAC address that the standby routing equipment desires to allocate, and the forwarding MAC address that the standby routing equipment desires to allocate includes: a real MAC address and/or at least one virtual MAC address of the standby routing device;
after receiving the negotiation request sent by the standby routing equipment, the main routing equipment allocates a virtual MAC address which is not allocated yet and meets the negotiation request from a preset virtual MAC address range to the standby routing equipment according to the negotiation request, or takes the real MAC address of the standby routing equipment as the forwarding MAC address of the standby routing equipment according to the negotiation request.
Optionally, the notification packet includes: description information and data content, the description information including a serial number;
the method further comprises the following steps: after receiving description information which is sent by a standby routing device and contains a first serial number, the main routing device judges whether the first serial number is consistent with a second serial number locally stored by the main routing device, if not, an announcement message which contains locally stored data content and description information containing a third serial number is sent to the standby routing device, and the third serial number is larger than the first serial number; or,
after the standby routing equipment receives the notification message containing the fourth serial number, comparing the fourth serial number with a fifth serial number locally stored by the standby routing equipment, and if the fourth serial number is greater than the fifth serial number, storing the notification message of the fourth serial number.
In a second aspect, an embodiment of the present invention provides a routing device, where multiple routing devices are used to form a virtual router, where the virtual router has a virtual IP address, and a default gateway IP address of each client in a same network segment is configured as the virtual IP address, and the routing device includes: the system comprises a role election unit, a distribution unit, a receiving unit, an association unit and a sending unit;
the role election unit is used for electing a main routing device in the virtual router, and other routing devices are standby routing devices;
the distribution unit is configured to distribute different forwarding MAC addresses to the master routing device and at least one other routing device in the virtual router when the master routing device elected by the role election unit is the routing device, and broadcast a distribution result through an advertisement message;
the receiving unit is configured to receive the allocation result when the standby routing device elected by the role election unit is the routing device, where the allocation result is used to configure a forwarding MAC address after the routing device is allocated with the forwarding MAC address;
the receiving unit is also used for receiving an address resolution request message from a client;
the association unit is configured to, when the master routing device elected by the role election unit is the routing device, associate, according to a load balancing policy, the routing device having a forwarding MAC address with the client, after the receiving unit receives an address resolution request packet from the client, and broadcast an association result through an advertisement packet;
the receiving unit is further configured to receive the result of the association when the backup routing device elected by the role election unit is the routing device;
the sending unit is configured to generate, at a routing device associated with the client, a host route with the client IP address as a prefix, and issue the host route to an uplink device of the routing device, so that the uplink device generates a route with the same prefix as the host route and with the routing device as a next hop.
Optionally, the routing device further includes: the establishment and maintenance unit is used for establishing an entry of the client in a client record table after receiving an address resolution request message from the client when the main routing equipment elected by the role election unit is the routing equipment, wherein the entry of the client is used for recording the identification of the client and setting timeout time for the client;
within the timeout time, if the receiving unit receives an address resolution request message sent again by the client, resetting the timeout time of the client; and if the overtime time is up, the receiving unit does not receive the address resolution request message sent again by the client, deleting the entry of the client or setting the entry of the client as invalid.
Optionally, the notification packet includes: description information and data content, the description information including a serial number; the routing device further comprises: a synchronization unit, configured to, when the primary routing device elected by the role election unit is the routing device, after receiving description information that includes a first sequence number and is sent by a standby routing device, determine whether the first sequence is consistent with a second sequence number locally stored in the primary routing device, and if not, send an advertisement packet that includes locally stored data content and description information that includes a third sequence number to the standby routing device, where the third sequence number is greater than the first sequence number; or,
the synchronization unit is further configured to, after receiving an advertisement packet including a fourth sequence number when the standby routing device elected by the role election unit is the routing device, compare the fourth sequence number with a fifth sequence number locally stored in the standby routing device, and if the fourth sequence number is greater than the fifth sequence number, store the advertisement packet of the fourth sequence number.
The embodiment of the invention provides a method for realizing Virtual Router Redundancy Protocol (VRRP) downlink load balancing and routing equipment. The method is applied to a virtual router comprising a plurality of routing devices, wherein one master routing device is elected from the virtual router, and other routing devices are backup routing devices; the master routing equipment distributes different forwarding MAC addresses for the master routing equipment and at least one backup routing equipment in the virtual router, and broadcasts the distribution result through the notification message; after receiving the address analysis request message from the client, the master routing device associates the routing device with the forwarding MAC address for the client according to the load balancing strategy, and broadcasts the associated result through the notification message. That is, all the routers in the virtual router have forwarding MAC addresses, and all the routers can forward the packet. And the routing equipment associated with the client generates a host route with the IP address of the client as a prefix, and distributes the host route to the uplink equipment of the routing equipment, so that the uplink equipment generates a route which has the same prefix as the host route and takes the routing equipment as a next hop. It can be seen that the embodiment of the present invention implements accurate routing by using the host route advertisement, and directs the downlink traffic to the device, thereby avoiding the problem in the prior art that the uplink device randomly selects one of the routes from the equivalent routes to forward the downlink traffic.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of downlink load congestion provided in the prior art;
fig. 2 is a flowchart of a method for implementing VRRP load balancing according to an embodiment of the present invention;
fig. 3 is a schematic diagram of neighbor and role election provided in an embodiment of the present invention;
fig. 4 is a schematic diagram of negotiating and forwarding a MAC address according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a master creating client entry according to an embodiment of the present invention;
fig. 6 is a schematic diagram of associated information between a master distribution routing device and a client according to an embodiment of the present invention;
fig. 7 is a diagram illustrating an associated routing device sending a client host route according to an embodiment of the present invention;
fig. 8 is a schematic diagram of downlink load balancing according to an embodiment of the present invention;
fig. 9 is a block diagram of a routing device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The term "and/or" in the embodiment of the present invention is only one kind of association relationship describing an associated object, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the embodiment of the present invention generally indicates that the preceding and following related objects are in an "or" relationship.
For the convenience of clearly describing the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", and the like are used to distinguish the same items or similar items with basically the same functions and actions, and those skilled in the art can understand that the words "first", "second", and the like do not limit the quantity and execution order. In the description of the present invention, "a plurality" means two or more unless otherwise specified.
The method for realizing VRRP load balancing provided by the embodiment of the invention is applied to a virtual router comprising a plurality of routing devices, wherein one master routing device is elected from the virtual router, and other routing devices are backup routing devices; the master routing equipment distributes different forwarding MAC addresses for the master routing equipment and at least one backup routing equipment in the virtual router, and broadcasts the distribution result through the notification message; after receiving an address analysis request message from a client, the master routing equipment associates the routing equipment with a forwarding MAC address for the client according to a load balancing strategy, and broadcasts an associated result through an announcement message; and the routing equipment associated with the client generates a host route with the IP address of the client as a prefix, and the host route is issued to the uplink equipment of the routing equipment, so that the uplink equipment generates a route which has the same prefix as the host route and takes the routing equipment as a next hop. The embodiment of the invention realizes accurate routing by adopting the host routing notification mode and guides the downlink flow to the equipment, thereby avoiding the problem brought by the prior art that the uplink equipment randomly selects one route from equivalent routes to forward the downlink flow.
First, some terms mentioned in the embodiments of the present invention will be explained:
1. virtual IP address: the virtual router is provided with a virtual IP address, the default gateway IP address of each client in the same network segment is configured to be the virtual IP address, the virtual IP address needs to use the same network segment with the main address and the auxiliary address of the interface, and after the routing equipment is in an effective forwarding state (the Master allocates a forwarding MAC address to the routing equipment), the virtual IP address is added into the auxiliary address.
2. An address analysis request message and an address analysis response message: in IPv4, the address Resolution request message may be an ARP (address Resolution protocol) request message, the address Resolution response message may be an ARP response message, and the client uses the received forwarding MAC address to construct an ARP entry and then uses the ARP entry to send the message; in IPv6, the address resolution request message may be a Neighbor Solicitation (NS) message, the address resolution response message may be a Neighbor Advertisement (NA) message, and the client constructs an ND entry using the received forwarding MAC address and then sends the message using the ND entry. IPv4 is taken as an example in the following description.
3. The hello message and the notification message are messages with different formats and can be distinguished from each other, and are new protocol messages redefined according to actual needs in the embodiment of the invention.
Example one
The above method is described in detail with reference to specific examples. Taking the network architecture shown in fig. 1 as an example, the client PC1 and the client PC2 are two clients in the same network segment, the routing device R1, the routing device R2, and the routing device R3 are three routers serving as network outlets, and the routing device and the clients are communicated by using a two-layer switch. In the embodiment of the present invention, the routing device R1, the routing device R2, and the routing device R3 only form one virtual router, a virtual IP address is configured for the virtual router, and all clients in the same network segment may adopt the same configuration, that is, the virtual IP address is configured as a default gateway IP address of all clients, that is, both the client PC1 and the client PC2 send ARP requests to the same virtual router. It should be noted that there may be a plurality of clients in the actual network, and there may also be a plurality of routing devices included in the virtual router.
Referring to fig. 2, the method includes the following specific steps:
s101 (optional), neighbor establishment and maintenance.
In the embodiment of the invention, the Hello message is used for establishing and maintaining the neighbor relation among the routing devices in the virtual router, and if the routing device receives the Hello message sent by the adjacent routing device, the neighbor is established or updated. The method specifically comprises the following steps: the neighbor establishment may be that when the virtual router is just established, the routing devices in the virtual router send Hello messages to each other to establish a neighbor relationship with each other, or that when a routing device receives a Hello message of a certain neighboring device for the first time, a neighbor relationship with the neighboring device is established. After the neighbor relation is established, the routing equipment starts an Active (Active) timer to monitor hello messages periodically sent by the neighbor, and when the interval set time (which is longer than the period of sending the hello messages by the neighbor) does not receive the hello messages sent by the neighbor, the neighbor is determined to be invalid, and the neighbor is deleted. The set duration of the Active timers started by different routing devices can be the same or different.
And S102, selecting the role of the routing equipment.
And selecting a master routing device in the virtual router, wherein other routing devices are backup routing devices.
Specifically, the Hello message sent by the routing device carries the priority attribute and the master declaration thereof, and these can be used for role election. Wherein the priority attribute of the routing device is the VRRP priority of the routing device as defined in the VRRP protocol. The master declaration is that when a certain routing device considers that it can be a master routing device, it is sent.
The preferred principle of election is that the device with large priority attribute is used as a master routing device, if the priority attributes are the same, the device with large source address (interface main address) is used as the master routing device, and election is performed in a non-preemptive mode, that is, if a certain routing device declares itself to be the master routing device, as long as the master routing device does not have a fault, the routing device in the virtual router always keeps a primary or standby state, and even if the backup routing device in the virtual router is configured with higher priority later, the routing device cannot become the master routing device. That is, the election occurs in only two situations, one is when the virtual router is just built, and the other is when the master routing device fails, and the other routing devices serving as backup routing devices need to re-elect a routing device which normally operates as the master routing device to take over the work of the original master routing device. The device elected as the master router device sends an announcement message to inform other router devices in the virtual router that the devices work normally.
The selection comprises the following specific steps: the master routing device is elected by the best election person preferentially from the neighbors (including election executors) that declare themselves as master routing devices. If the master routing equipment cannot be selected in a competitive mode, the most superior person is selected from the neighbors (including election executors) which never declare the master routing equipment as the master routing equipment and have the priority different from 0.
For example, as shown in fig. 3, after the devices running the present protocol establish a neighbor relationship with each other, a master/backup routing device is elected. Wherein the priority of R1 is 40, R2 is 20, R3 is 10, according to the priority principle, R1 becomes master routing equipment, and R2 and R3 become backup routing equipment.
S103, distributing and forwarding MAC addresses.
The main route device distributes different forwarding MAC addresses for the main route device and at least one standby route device in the virtual router, and broadcasts the distribution result through the notice message.
Specifically, each routing device needs to configure a forwarding MAC address in order to forward a client packet. The forwarding MAC address is the MAC address of the virtual gateway, which corresponds to the virtual IP address.
It should be noted that: each routing device in each virtual router uses only a unique one of the forwarding MAC addresses without regard to the backup mechanism. If a backup mechanism is considered (typically a virtual MAC address at this time), each routing device may configure multiple forwarding MAC addresses, including a primary MAC address and a backup MAC address. In the embodiment of the present invention, the backup mechanism is not considered as an example.
The forwarding MAC address may use either a virtual MAC address or a real MAC address. The real MAC address is the real MAC address of the routing equipment and can only be distributed to the routing equipment with the real MAC address; the virtual MAC address is dynamically assigned and can be assigned to any routing device that can use the virtual MAC address. In the embodiment of the invention, the virtual MAC address is defined as 00:01:7a:00: group ID: MID, wherein the group ID ranges from 1 to 255(0x01 to 0xff), and the MID ranges from 1 to 255(0x01 to 0xff, 0 invalid). Regardless of the scenario, it is necessary to ensure that no conflict occurs with the real MAC address of the existing device within the virtual MAC address segment. If the routing device is assigned to a virtual MAC address with MID of 0 or a real MAC address with all 0, it indicates that the routing device does not need to undertake forwarding tasks.
The following will describe the assignment of forwarding MAC addresses.
Firstly, the rule for distributing the forwarding MAC address is introduced as follows: 1) the master routing device performs the assignment of forwarding MAC addresses; 2) only distributing for the devices which are not distributed with the forwarding MAC; 3) the negotiation request of the high-priority equipment is met preferentially; 4) processing request address intervals sequentially from a low address to a high address; 5) the equipment for forwarding the MAC address cannot be allocated, and the forwarding task is not undertaken; 6) the owner of the assigned forwarding MAC address is not changed. The fact that the forwarding MAC address cannot be allocated means that the forwarding MAC address is not allocated or the device fails to allocate. After the owner of the allocated forwarding MAC address indicates that the master routing equipment allocates the forwarding MAC address, the corresponding relation between the allocated forwarding MAC address and the backup routing equipment is recorded, when the hello message carrying the negotiation request of the backup routing equipment is received for multiple times, the same virtual MAC address is allocated to the backup routing equipment, but if the master routing equipment detects that the backup routing equipment is in failure, the forwarding MAC address is allocated to other routing equipment in time according to a load balancing strategy, so that a client using the forwarding MAC address can normally forward the message as soon as possible.
The master routing device is responsible for assigning the forwarding MAC addresses of all the routing devices in the virtual router. Once the routing device is converted into a master routing device, if the routing device is not allocated with a forwarding MAC address, an unused forwarding MAC address is allocated to the routing device within a preset forwarding MAC address range. In addition, if the back-up routing device is not allocated with a forwarding MAC address, the back-up routing device sends a negotiation request to the master routing device, where the negotiation request is used to indicate a forwarding MAC address that the back-up routing device desires to allocate to, and the forwarding MAC address that the back-up routing device desires to allocate to includes: a real MAC address and/or at least one virtual MAC address of the backup routing device; after receiving the negotiation request sent by the standby routing device, the master routing device allocates a virtual MAC address which is not allocated yet and satisfies the negotiation request to the standby routing device from a preset virtual MAC address range according to the negotiation request, or takes the real MAC address of the backup routing device as the forwarding MAC address of the backup routing device according to the negotiation request. After the master routing equipment completes the distribution of the forwarding MAC address, the distributed result is broadcasted through the announcement message. The preferred master routing equipment establishes a forwarding MAC address table, updates the forwarding MAC address table after the completion of the allocation of the forwarding MAC address each time, stores the forwarding MAC address table in the notification message and sends the notification message. And other backup routers receive the notification information, configure the forwarding MAC address and carry out the forwarding of the message with the destination MAC address as the forwarding MAC address.
Illustratively, as shown in FIG. 4, the backup routing device (R2) sends a negotiation request to the master routing device (R1) desiring 00:01:7a:00:01:01 or 00:01:7a:00:01:02 as its forwarding MAC address, the backup (R3) routing device sends a negotiation request to the master routing device (R1) desiring 00:01:7a:00:01:02 or 00:01:7a:00:01:03 as its forwarding MAC address, and R1 itself expects 00:01:7a:00:01:01 as its forwarding MAC address. Then according to the negotiation request allocation, and combining the principle that the device with high priority is allocated first and the low request address is processed first, the last negotiated forwarding MAC table is shown in table 1, and R1 broadcasts the table one through the notification message.
TABLE 1
Forwarding MAC Address (forward MAC) State (state) Owner (Owner)
00:01:7a:00:01:01 (Established) Established Established Routing device R1
00:01:7a:00:01:02 (Established) Established Established Routing device R2
00:01:7a:00:01:03 (Established) Established Established Routing device R3
It should be noted that, if the notification message is lost or cannot be processed in time, some backup routing devices may not obtain the forwarding MAC address allocated to the backup routing device by the master routing device, and in order to ensure that the backup routing device can obtain the forwarding MAC address, in the embodiment of the present invention, synchronization of the result of allocating the forwarding MAC address is implemented by comparing the description information of the notification message carried in the hello message sent by the backup routing device with the description information of the notification message sent by the master routing device, so that each backup routing device can obtain the forwarding MAC address allocated to the master routing device by the master routing device. The description of step S106 may be referred to for a specific synchronization procedure.
S104 (optional), establishment and maintenance of client entries.
Compared with a polling load balancing strategy in the prior art, the load balancing can not be really realized in many cases if certain normally-working routing equipment suddenly fails or a client end is offline and the like. In order to solve the above problems in the prior art, embodiments of the present invention provide a load balancing policy with finer granularity, where a master routing device implements a better load balancing policy by recording a client state and counting traffic information of each routing device.
In the embodiment of the invention, the master routing equipment establishes the weak connection with the client, the weak connection means that after the master routing equipment receives the ARP request message of the client, the state of the client is recorded by establishing the entry of the client, and the master routing equipment also maintains the entry of the client after the entry of the client is established. In the embodiment of the invention, the weak connection does not really form the connection relation between the master routing equipment and the PC, but only establishes and maintains the state information of the client at one end of the master routing equipment.
Specifically, the entry of the client is established: after receiving an address resolution request message from a client, the master routing device establishes an entry of the client in a client record table, wherein the entry of the client is used for recording the identification of the client and setting timeout time for the client. Wherein the identification of the client may be the name of the client; or address information of the client such as IP address, MAC address, group ID (gateway virtual IP address), etc. The timeout time is used to indicate whether the client's request is out of date. The client's entry may be used to subsequently perform the assignment of forwarding MAC addresses in accordance with a load balancing policy.
For example, as shown in fig. 5, when the client PC1, PC2 needs to have data to send, the local ARP table of the client is not established, and a broadcast ARP request is sent, and after the Master receives the request, an entry of the client is established in the client record table, as shown in table 2, and a timeout is set:
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 time of the entry of the client is greater than the aging time of the local ARP table of the client.
Maintaining a client record table: after the entry is established, the reset and refresh of the retention time of the entry of the client needs to be performed according to the ARP request of the client. Specifically, within the timeout period, if the master routing device receives the ARP request message sent again by the client, the timeout period of the client is reset, and the reset is to refresh the timeout period to the maximum value. And after the table entry is aged, readjusting the client-side associated load according to the load balancing strategy. Specifically, if the timeout time is up, the master routing device does not receive the ARP request message sent again by the client, it indicates that the entry of the client is aged, and deletes the entry of the client or sets the entry of the client as invalid. The reason why the master routing device does not receive the ARP request message sent again by the client may be that the client is offline and fails.
And after deleting the entries of the client or setting the entries of the client as invalid, the master routing equipment reestablishes the association between each client in the client record list and the routing equipment with the forwarding MAC address according to a load balancing strategy. When an entry of a client is aged, load in the network may not be balanced any more, and at this time, the master routing device may adjust the association relationship between the active clients and the routing device recorded in the client record table according to the load balancing policy. It should be noted that the principle of the adjustment here is to change the existing association relationship between the client and the routing device as little as possible. If the master routing device analyzes load imbalance according to the entry of the client and the client association representation, one associated client of the routing device with the largest number of associated clients is adjusted to the routing device with the smallest number of associated clients until each routing device with the effective forwarding MAC address distributes the same number of clients as much as possible (the difference value of the number of the clients cannot be larger than 1).
For example, assume that now the master routing device establishes 4 entries of client segments in the client record table, which are the entry of client a, the entry of client B, the entry of client C, and the entry of client D, and meanwhile, the client a and the client B are associated with the routing device a, the client C is associated with the routing device B, and the client D is associated with the routing device C. However, within the timeout time set by the entry of the client C, the master routing device does not receive the ARP request sent by the client C, the entry of the client C is aged, the master routing device deletes the entry from the client record table, and meanwhile, the association relationship between the client C and the routing device B does not exist. At this time, if the load is unbalanced, the master routing device will adjust the association relationship of the client, so that the client B re-associates with the routing device B, and the other association relationships are not changed. Namely, the new association relationship is that the client A is associated with the routing device A, the client B is associated with the routing device B, and the client D is associated with the routing device C, so that load balancing is achieved.
And S105, associating the routing equipment to the client according to the load balancing strategy.
After receiving the address analysis request message from the client, the master routing device associates the routing device with the forwarding MAC address for the client according to the load balancing strategy, and broadcasts the associated result through the notification message.
Preferably, in order to record the association relationship between the client and the routing device well, the master routing device establishes an association table entry of the client in the association table, where the association table entry of the client includes: the identifier of the client (may be a name, address information, etc. of the client), the forwarding MAC address of the routing device associated with the client (or a name of the routing device), and may also include other information, such as status information, etc., without limitation. After the master routing device establishes the association table entry, the information in the association table is broadcasted through the notification message, and the backup routing device is notified of the information of the association client.
For example, R1 performs client association according to a simple balancing policy, and the association table is shown in table 3:
TABLE 3
As shown in fig. 6, R1 sends the association information notification in the association table to the Backup device in a message, and all devices including itself apply the association table entry in the association table.
Wherein, the load balancing strategy comprises:
optionally, the method may be a simple load balancing policy, that is, the master routing device selects, according to the association table, one routing device with a forwarding MAC address, which has the least number of associated clients, to associate the clients.
Specifically, the distribution manner of the simple balanced load policy is to associate the same number of clients to each gateway device having a forwarding MAC address.
The principle of the simple load balancing strategy is as follows: and executing the master routing equipment as client-associated gateway equipment, so that each routing equipment with the effective forwarding MAC address is associated with the same number of clients as much as possible (the difference of the number of the clients cannot be larger than 1). The forwarding MAC address of the routing device associated with the client must be in a valid state, and if the forwarding MAC address of the routing device associated with the client is in an invalid state, the client must be re-associated with the routing device. For example, if there are 4 clients and 3 devices with valid forwarding MACs, each device is assigned at least one client, and the excess clients are randomly assigned to any device.
Alternatively, a hybrid load balancing policy may be used, that is, a hybrid of a static association policy and a simple load balancing policy. If the client belongs to the client in the static association strategy, and the static association strategy is used for statically assigning routing equipment for at least one client, the main routing equipment is used as the client static association routing equipment according to the static association strategy; otherwise, the main routing device selects a routing device with a forwarding MAC address with the least number of associated dynamic clients according to the association table, wherein the dynamic client is a client not belonging to the static association policy.
The principle of the specific hybrid balanced load strategy is as follows: preferentially distributing statically specified association relation; the client side adopting the static association strategy is not counted, and the same number of client sides (the difference value of the number of the client sides is not larger than 1) are distributed to each device with the effective forwarding MAC address; the forwarding MAC of the client associated device must be in a valid state, otherwise dependent clients must be redistributed.
For example, if there are 4 clients, client a, client B, client C, and client D, 3 devices with valid forwarding MAC are respectively master routing device 1, routing device 2, and routing device 3, where client a statically specifies that routing device 2 is associated. Then, at this time, a hybrid balanced load strategy is adopted, and the master routing device 1 preferentially distributes the client A and the associated routing device 2; counting no client A, and 3 clients, then the master routing device 1 distributes 3 clients to the routing device 1, the routing device 2 and the routing device 3 according to a simple balanced load strategy. When a new client E with a non-static designated relationship needs to associate with a routing device, the client E can be distributed to any one of 3 routing devices.
Optionally, an extended traffic balancing load policy may be used. The main routing equipment counts the load flow of each routing equipment with the forwarding MAC address, and selects the routing equipment with the forwarding MAC address with the least load flow to associate the client.
Specifically, the traffic balancing policy aims to keep the load traffic of each gateway device balanced, and belongs to load control with finer granularity. After the Master routing equipment completes the association of the distributed clients, the routing equipment is responsible for the flow forwarding of the associated clients and carrying out flow statistics, the consumption of the passing flow of each client to the bandwidth can be obtained, the statistical information is written into a Hello message and fed back to the Master routing equipment, after the Master routing equipment receives the flow statistics, the clients are distributed in a flow balancing mode, and the distribution strategy is as follows: the traffic allocated to the device with the effective forwarding MAC address is the same as much as possible by taking the client as a unit. That is, when a new client needs to associate with the routing device, the master routing device selects a routing device with a forwarding MAC address with the least load flow to associate with the client; or when the master routing device obtains the load traffic imbalance through traffic statistics and analysis of each routing device, the adjustment principle also changes the existing association as little as possible after adjusting the association between the client and the routing device according to the load traffic strategy and calculation.
In the embodiment of the invention, the master routing device associates the client with the routing device mainly under the following three conditions according to the load balancing strategy: first, after the master routing device receives an ARP request of a new client and establishes an entry of the client, refer to the above description of S105 specifically; secondly, in the step S104, when deleting an entry of a certain client or setting an entry of the client as invalid in the process of maintaining the record table of the client by the master routing device, the description of S104 is referred to specifically; thirdly, when the routing device associated with the client fails, reference is specifically made to the description of S106. In an actual network, there may be other situations that cause load imbalance, and the method provided by the embodiment of the present invention may also be used, which is not described herein again.
S106, the routing device associated with the client generates and sends the host routing.
And the routing equipment associated with the client generates a host route with the IP address of the client as a prefix, and distributes the host route to the uplink equipment of the routing equipment, so that the uplink equipment generates a route which has the same prefix as the host route and takes the routing equipment as a next hop.
Specifically, after the master routing device broadcasts the association table in which the association table entry is stored through the advertisement packet in step S105, all the routing devices including the master routing device apply the association relationship. Once the association relationship is determined, the master/backup routing device generates a 32-bit host route with the IP address of the associated client as the prefix, and issues the host route to the uplink device of the routing device, and the next hop of the route points to the protocol operation interface. The routing equipment distributes the host routing to the whole network through redistribution configured with a routing protocol, so that the uplink equipment generates a routing which has the same prefix with the host routing and takes the master/backup routing equipment as the next hop. According to the longest matching principle of the route, after the downlink message reaches the gateway equipment, the accurate route is found and forwarded to the uplink equipment of the client, and the downlink load balancing is completed.
It should be noted that the host routing mentioned in the embodiment of the present invention is consistent with the host routing format in the prior art. Because the next hop of the routing equipment is the associated client according to the VRRP balanced load protocol, the host route generated by the routing equipment and taking the IP address of the associated client as the prefix can only contain the prefix of the IP address of the associated client, and the next hop is saved; or may include a prefix that associates the client IP address with the next hop.
For example, as shown in fig. 7, a Master (R1) associates PC1 and generates host routing PC1/32 that joins the IP address of PC 1; backup (R2) associates PCs 2 and generates host routing PCs 2/32, respectively, that join the IP address of PC 2. And (3) issuing to the whole routing domain through a routing protocol so that the upstream device of R1 generates a routing PC1/32NExthop (next hop) having the same prefix as the host route and with R1 as the next hop: r1; the upstream device of R2 generates a route PC2/32NExthop with the same prefix as the host route and with R2 as the next hop: and R2.
As shown in fig. 8, for the lower happy business established by the VRRP downlink load balancing method according to the embodiment of the present invention, the message sent to the PC1 is sent to the PC1 through the uplink device of R1, R1, and the switch; the message sent to the PC2 is sent to the PC2 via the uplink device of R2, R2 and the switch.
In the embodiment of the invention, the master routing equipment and the backup routing equipment perform information interaction through the announcement message and the hello message for multiple times, so that the situation that the messages of the opposite sides cannot be received in time can occur in the process, and the corresponding work cannot be finished. In order to solve the problem, because the hello packet is sent periodically, the description information of the received notification packet is added to the hello packet sent by the backup routing device, and the description information includes a sequence number and a Checksum (Checksum). Therefore, the synchronization of the mutual information between the master routing equipment and the backup routing equipment is realized by comparing whether the description information is consistent, and the corresponding work can be further ensured to be completed in time.
Specifically, if the master routing device judges that the backup routing device does not synchronize the notification message sent by the backup routing device according to the received hello message, the master routing device resends the notification message; and if the backup routing equipment judges that the backup routing equipment is not synchronous according to the received notification message sent by the master routing equipment, synchronizing the information in the notification message.
After receiving a Hello message which is sent by a standby router and contains description information of a first serial number, a master router judges whether the first serial number is consistent with a second serial number in an announcement message which is locally stored by the master router, if not, the master router sends the announcement message which contains locally stored data content and description information of a third serial number to a backup router, and the third serial number is larger than the first serial number. Specifically, if the first sequence number is smaller than the second sequence number, the third sequence number is the second sequence number, and the master routing device sends a locally stored notification message; if the first serial number is larger than the second serial number, the second serial number in the local notification message is increased to a third serial number, and the master routing equipment sends a notification message for updating the serial number; if the serial numbers are the same, no processing is performed (the backup routing equipment is proved to receive the latest notification message).
After the backup routing equipment receives the notification message containing the fourth serial number, if the notification message is sent by the master routing equipment, comparing the fourth serial number with a fifth serial number locally stored by the backup routing equipment, and specifically, if the fourth serial number is greater than the fifth serial number, storing the notification message of the fourth serial number and working according to related instructions in the notification message (subsequently designing related contents); otherwise, no processing is performed. If the notification message is sent by the backup routing device, the message is directly discarded.
The embodiment of the invention provides a method for realizing VRRP load balancing, which is applied to a virtual router comprising a plurality of routing devices, wherein a master routing device is selected from the virtual router, the master routing device distributes different forwarding MAC addresses for the master routing device and at least one backup routing device in the virtual router, after receiving an address resolution request message from a client, the master routing device associates the routing device with the forwarding MAC address for the client according to a load balancing strategy, the routing device associated with the client generates a host route with the IP address of the client as a prefix, and distributes the host route to an uplink device of the routing device, so that the uplink device generates a route which has the same prefix as the host route and takes the routing device as a next hop. The embodiment of the invention realizes accurate routing by adopting the host routing notification mode and guides the downlink flow to the equipment, thereby avoiding the problem brought by the prior art that the uplink equipment randomly selects one route from equivalent routes to forward the downlink flow.
Example two
An embodiment of the present invention provides a routing device, where a plurality of routing devices are used to form a virtual router, where the virtual router has a virtual IP address, and a default gateway IP address of each client in the same network segment is configured as the virtual IP address, as shown in fig. 9, the routing device includes: a role election unit 91, an assignment unit 92, a receiving unit 93, an association unit 94, and a transmitting unit 95; for implementation of each functional module in the routing device, reference may be made to the first embodiment, which is not described herein again.
A role election unit 91, configured to elect a primary routing device from the virtual router, where the other routing devices are standby routing devices;
an allocating unit 92, configured to allocate, when the master routing device elected by the role election unit is the routing device, different forwarding MAC addresses to the master routing device and at least one other routing device in the virtual router, and broadcast the allocation result through an advertisement packet;
a receiving unit 93, configured to receive, when the standby routing device elected by the role election unit is the routing device, the assignment result, where the assignment result is used to configure a forwarding MAC address after the routing device is assigned with the forwarding MAC address;
the receiving unit 93 is further configured to receive an address resolution request message from the client;
an association unit 94, configured to, when the master routing device elected by the role election unit is the routing device, after receiving an address resolution request packet from a client, associate, according to a load balancing policy, a routing device having a forwarding MAC address for the client, and broadcast a result of the association through an advertisement packet;
a receiving unit 93, configured to receive the result of the association when the backup routing device elected by the role election unit is the routing device;
a sending unit 95, configured to generate a host route using the associated client IP address as a prefix, and issue the host route to an uplink device of the routing device, so that the uplink device generates a route that has the same prefix as the host route and uses the routing device as a next hop.
Optionally, the association unit 94 is specifically configured to establish an association table entry of the client in an association table, where the association table entry of the client includes: an identifier of the client, a forwarding MAC address of a routing device associated with the client; the broadcasting the associated result through an announcement message includes: and broadcasting the information in the association table through an announcement message.
Optionally, the associating unit 94 is specifically configured to select, according to the association table, one routing device with a forwarding MAC address, which has a minimum number of associated clients, to associate the clients;
or, if the client belongs to a client in a static association policy, the static association policy is used for statically assigning a routing device to at least one client, and the client is statically associated with the routing device according to the static association policy; otherwise, selecting a routing device with a forwarding MAC address and the least number of associated dynamic clients according to the association table, wherein the dynamic clients are clients not in the static association policy.
Optionally, the routing device further includes: a counting unit 96, configured to count load flows of the routing devices having forwarding MAC addresses when the primary routing device elected by the role election unit is the routing device; the associating unit 94 is specifically configured to select a routing device with a forwarding MAC address with the least load traffic to associate the client.
Optionally, the routing device further includes: the establishing and maintaining unit 97 is configured to, when the master routing device elected by the role election unit is the routing device, after the receiving unit receives an address resolution request of a client, establish an entry of the client in a client record table, where the entry of the client is used to record an identifier of the client and set timeout time for the client; if an address resolution request message sent again by the client is received within the overtime, resetting the overtime of the client; and if the overtime time is up and the address resolution request message sent again by the client is not received, deleting the entry of the client or setting the entry of the client as invalid.
Optionally, the associating unit 94 is further configured to, after the establishing unit 97 deletes the entry of the client or sets the entry of the client as invalid, reestablish association between each client in the client record table and the routing device having the forwarding MAC address according to a load balancing policy.
Optionally, the sending unit 95 is further configured to send, when the standby routing device elected by the role election unit is the routing device, a negotiation request to the active routing device, where the negotiation request is used to indicate a forwarding MAC address that the standby routing device desires to allocate, where the forwarding MAC address that the standby routing device desires to allocate includes: a real MAC address and/or at least one virtual MAC address of the standby routing device;
the allocating unit 92 is further configured to, after receiving the negotiation request sent by the standby routing device, allocate, according to the negotiation request, an unallocated virtual MAC address that meets the negotiation request from a preset virtual MAC address range to the standby routing device, or use the real MAC address of the standby routing device as the forwarding MAC address of the standby routing device according to the negotiation request.
Optionally, the notification packet includes: description information and data content, the description information including a serial number; the routing device further includes a synchronization unit 98, configured to, when the master routing device elected by the role election unit is the routing device, after receiving description information that includes a first serial number and is sent by a standby routing device, determine whether the first serial number is consistent with a second serial number locally stored by the master routing device, and if not, send an advertisement packet that includes locally stored data content and description information that includes a third serial number to the standby routing device, where the third serial number is greater than the first serial number; or, when the backup routing device elected by the role election unit is the routing device, after receiving an advertisement message containing a fourth sequence number, comparing the fourth sequence number with a fifth sequence number locally stored in the backup routing device, and if the fourth sequence number is greater than the fifth sequence number, storing the advertisement message of the fourth sequence number.
It should be noted that the receiving unit 93 in this embodiment may be an interface circuit, such as a receiver or an information receiving interface, which has a receiving function or is provided on the routing device; the transmitting unit 95 may be an interface circuit with a transmitting function on the routing device, such as a transmitter or an information transmitting interface. The other units may be processors separately set up, or may be implemented by being integrated in a certain processor of the routing device, or may be stored in a memory of the routing device in the form of program codes, and the certain processor of the routing device calls and executes the functions of the above units. The processor may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
The embodiment of the invention provides a routing device, in a virtual router formed by a plurality of routing devices, a selected master routing device distributes forwarding MAC addresses to each routing device in the virtual router through message interaction between the selected master routing device and each routing device, a client is associated with the routing device with the forwarding MAC addresses according to a load balancing strategy, then the routing device associated with the client generates a host route with the IP address of the client as a prefix, and the host route is issued to an uplink device of the routing device, so that the uplink device generates a route which has the same prefix as the host route and takes the routing device as a next hop. The accurate routing is realized by adopting the host routing notification mode, and the downlink traffic is guided to the device, so that the problem caused by the fact that the uplink device randomly selects one of the routes from equivalent routes to forward the downlink traffic in the prior art is solved.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be physically included alone, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (11)

1. A method for realizing Virtual Router Redundancy Protocol (VRRP) downlink load balancing is characterized in that the method is applied to a virtual router comprising a plurality of routing devices, the virtual router is provided with a virtual IP address, and the default gateway IP address of each client in the same network segment is configured as the virtual IP address, and the method comprises the following steps:
in the virtual router, a main routing device is selected, and other routing devices are standby routing devices;
the main routing equipment distributes different forwarding MAC addresses for the main routing equipment and at least one standby routing equipment in the virtual router, and broadcasts the distribution result through an announcement message;
after receiving an address resolution request message from a client, the main routing equipment associates the routing equipment with a forwarding MAC address for the client according to a load balancing strategy, and broadcasts the associated result through an announcement message;
and the routing equipment associated with the client generates a host route with the IP address of the client as a prefix, and distributes the host route to the uplink equipment of the routing equipment, so that the uplink equipment generates a route which has the same prefix as the host route and takes the routing equipment as a next hop.
2. The method of claim 1, wherein associating the routing device with the forwarded MAC address for the client comprises: the primary routing device establishes an association table entry of the client in an association table, where the association table entry of the client includes: an identifier of the client, a forwarding MAC address of a routing device associated with the client;
the broadcasting the associated result through an announcement message includes: and broadcasting the information in the association table through an announcement message.
3. The method of claim 2, wherein associating a routing device having a forwarding MAC address for the client according to a load balancing policy comprises:
the master routing equipment selects one routing equipment with a forwarding MAC address with the least number of associated clients according to the association table so as to associate the clients;
or, if the client belongs to a client in a static association policy, where the static association policy is used to statically assign a routing device to at least one client, the primary routing device is the client static association routing device according to the static association policy; otherwise, the master routing device selects a routing device with a forwarding MAC address with the least number of associated dynamic clients according to the association table, wherein the dynamic clients are clients not belonging to the static association policy.
4. The method of claim 1, further comprising: the main routing equipment counts the load flow of each routing equipment with the forwarding MAC address;
the associating the routing device with the forwarding MAC address for the client according to the load balancing strategy comprises: and the main routing equipment selects one routing equipment with the least load flow and the forwarding MAC address to associate the client.
5. The method of claim 1, wherein after the active routing device receives an address resolution request packet from a client, the method further comprises:
the main routing equipment establishes an entry of the client in a client record table, wherein the entry of the client is used for recording the identification of the client and setting timeout time for the client;
if the primary routing equipment receives an address resolution request message sent again by the client within the timeout time, resetting the timeout time of the client; and if the timeout time is up, the active routing equipment does not receive the address resolution request message sent again by the client, deleting the entry of the client or setting the entry of the client as invalid.
6. The method of claim 5, further comprising:
and when the entry of the client is deleted or set as invalid, the main routing equipment reestablishes the association between each client in the client record table and the routing equipment with the forwarding MAC address according to a load balancing strategy.
7. The method of claim 1, wherein the allocating, by the active routing device, different forwarding MAC addresses for at least one standby routing device comprises:
the standby routing equipment sends a negotiation request to the active routing equipment, where the negotiation request is used to indicate a forwarding MAC address that the standby routing equipment desires to allocate, and the forwarding MAC address that the standby routing equipment desires to allocate includes: a real MAC address and/or at least one virtual MAC address of the standby routing device;
after receiving the negotiation request sent by the standby routing equipment, the main routing equipment allocates a virtual MAC address which is not allocated yet and meets the negotiation request from a preset virtual MAC address range to the standby routing equipment according to the negotiation request, or takes the real MAC address of the standby routing equipment as the forwarding MAC address of the standby routing equipment according to the negotiation request.
8. The method according to any of claims 1-7, wherein the announcement message comprises: description information and data content, the description information including a serial number;
the method further comprises the following steps: after receiving description information which is sent by a standby routing device and contains a first serial number, the main routing device judges whether the first serial number is consistent with a second serial number which is locally stored by the main routing device, if not, an announcement message which contains locally stored data content and description information which contains a third serial number is sent to the standby routing device, and the third serial number is larger than the first serial number; or,
after the standby routing equipment receives the notification message containing the fourth serial number, comparing the fourth serial number with a fifth serial number locally stored by the standby routing equipment, and if the fourth serial number is greater than the fifth serial number, storing the notification message of the fourth serial number.
9. A routing device, wherein a plurality of said routing devices are configured to form a virtual router, said virtual router having a virtual IP address, and a default gateway IP address of each client in the same network segment is configured as said virtual IP address, the routing device comprising: the system comprises a role election unit, a distribution unit, a receiving unit, an association unit and a sending unit;
the role election unit is used for electing a main routing device in the virtual router, and other routing devices are standby routing devices;
the distribution unit is configured to distribute different forwarding MAC addresses to the master routing device and at least one other routing device in the virtual router when the master routing device elected by the role election unit is the routing device, and broadcast a distribution result through an advertisement message;
the receiving unit is configured to receive the allocation result when the standby routing device elected by the role election unit is the routing device, where the allocation result is used to configure a forwarding MAC address after the routing device is allocated with the forwarding MAC address;
the receiving unit is also used for receiving an address resolution request message from a client;
the association unit is configured to, when the master routing device elected by the role election unit is the routing device, associate, according to a load balancing policy, the routing device having a forwarding MAC address with the client, after the receiving unit receives an address resolution request packet from the client, and broadcast an association result through an advertisement packet;
the receiving unit is further configured to receive the result of the association when the backup routing device elected by the role election unit is the routing device;
the sending unit is configured to generate a host route using the associated client IP address as a prefix, and issue the host route to an uplink device of the routing device, so that the uplink device generates a route having the same prefix as the host route and using the routing device as a next hop.
10. The routing device according to claim 9, wherein after the active routing device receives an address resolution request packet from a client, the routing device further comprises:
the establishment and maintenance unit is used for establishing an entry of the client in a client record table when the main routing device elected by the role election unit is the routing device, wherein the entry of the client is used for recording the identifier of the client and setting timeout time for the client;
within the timeout time, if the receiving unit receives an address resolution request message sent again by the client, resetting the timeout time of the client; and if the overtime time is up, the receiving unit does not receive the address resolution request message sent again by the client, deleting the entry of the client or setting the entry of the client as invalid.
11. The routing device according to any of claims 9-10, wherein the advertisement packet comprises: description information and data content, the description information including a serial number;
the routing device further comprises: a synchronization unit, configured to, when the primary routing device elected by the role election unit is the routing device, after receiving description information that includes a first sequence number and is sent by a standby routing device, determine whether the first sequence is consistent with a second sequence number locally stored in the primary routing device, and if not, send an advertisement packet that includes locally stored data content and description information that includes a third sequence number to the standby routing device, where the third sequence number is greater than the first sequence number; or,
the synchronization unit is further configured to, after receiving an advertisement packet including a fourth sequence number when the standby routing device elected by the role election unit is the routing device, compare the fourth sequence number with a fifth sequence number locally stored in the standby routing device, and if the fourth sequence number is greater than the fifth sequence number, store the advertisement packet of the fourth sequence 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
CN100334866C (en) Method for realizing dynamic gateway load sharing and backup
CN102202104B (en) Managing distributed address pools within network devices
CN101404621B (en) Method and routing device for realizing VRRP load balancing
CN101316236B (en) Vrrp backup group load sharing method and router
US7929420B2 (en) Method and apparatus for learning VRRP backup routers
JP4587446B2 (en) NETWORK SYSTEM, SWITCH DEVICE, ROUTE MANAGEMENT SERVER, ITS CONTROL METHOD, COMPUTER PROGRAM, AND COMPUTER-READABLE STORAGE MEDIUM
US20050027778A1 (en) Automatic configuration of an address allocation mechanism in a computer network
CN102215158A (en) Method for realizing VRRP (Virtual Router Redundancy Protocol) flow transmission and routing equipment
KR20060057503A (en) System and method for distributed server for P2P network
US20210218688A1 (en) Method and Apparatus for Load Balancing and Packet Re-Sequencing on Network
WO2021093465A1 (en) Method, device, and system for transmitting packet and receiving packet for performing oam
US20190238949A1 (en) Multicast service providing method and software defined networking controller
CN106506724B (en) Method and device for distributing port blocks
CN102333027A (en) Traffic load sharing realization method based on virtual router redundancy protocol extend (VRRPE) backup group and realization apparatus thereof
CN106375210A (en) Method for realizing VRRP (Virtual Router Redundancy Protocol) downlink load balancing and route devices
CN109495593B (en) Address allocation method and system
CN101159670A (en) Service transmission method and device thereof
CA2510053C (en) Power saving in wireless packet based networks
CN105743781B (en) A kind of VRRP load-balancing method and device
WO2018161795A1 (en) Routing priority configuration method, device, and controller
CN105721328A (en) VRRP load balancing method, VRRP load balancing device and router
US20250063017A1 (en) 5g user terminal ip address confirmation method, apparatus and system
CN106375211B (en) Exchange data processing method and interchanger in VRRP load-balancing scenario
US20190036793A1 (en) Network service implementation method, service controller, and communications system

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