WO2012065440A1 - Implementation method and apparatus for priority of device in virtual router redundancy protocol backup group - Google Patents

Implementation method and apparatus for priority of device in virtual router redundancy protocol backup group Download PDF

Info

Publication number
WO2012065440A1
WO2012065440A1 PCT/CN2011/076076 CN2011076076W WO2012065440A1 WO 2012065440 A1 WO2012065440 A1 WO 2012065440A1 CN 2011076076 W CN2011076076 W CN 2011076076W WO 2012065440 A1 WO2012065440 A1 WO 2012065440A1
Authority
WO
WIPO (PCT)
Prior art keywords
priority
backup group
current
vrrp backup
vrrp
Prior art date
Application number
PCT/CN2011/076076
Other languages
French (fr)
Chinese (zh)
Inventor
翟洪军
龚协丰
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012065440A1 publication Critical patent/WO2012065440A1/en

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

Definitions

  • the present invention relates to the field of communications, and in particular, to a device in a virtual router redundancy protocol (VRRP) backup group.
  • VRRP virtual router redundancy protocol
  • a virtual router redundancy protocol (VRRP) is a device redundancy technology.
  • VRRP two or more physical devices (generally devices with routing functions, such as routers) are grouped together to form a virtual device (or VRRP backup group), and provide consistent virtual IP and virtual MAC. address.
  • a host in the local area network accesses the external network by designating the virtual IP as the default next hop.
  • the physical device In the same VRRP backup group, only one physical device is responsible for forwarding packets between the internal and external networks.
  • the physical device is called the primary device (the master device).
  • the other devices are responsible for listening to the status of the master device.
  • Device that is, the backup device.
  • the packet forwarding operation is replaced by the original master device, but the virtual IP is unchanged. Host access to the external network.
  • Normally, in a VRRP backup group only the master is responsible for forwarding packets. The backup is not responsible for forwarding. Therefore, the forwarding capability of devices in the VRRP backup group cannot be fully utilized.
  • VRRP backup groups are usually assigned and the forwarding devices are added to these backup groups at the same time. Then, the priority of each device in different backup groups is properly planned, so that different devices assume the role of the master device in different groups, and the load sharing of the forwarding load is implemented.
  • FIG 1 there are six hosts and three routers in the LAN. Among them, three routers Router A, ... and Router C are added to VRRP backup groups 1, 2 and 3, and Router A is the backup group 1.
  • Router B is the master device in VRRP group 2
  • Router C is the master device in VRRP group 3; H1/H2 is connected to Router B through Router C through Router B and H3/H6 through Router C.
  • Router B and Router C will select the master device in VRRP group 1, because Router B has priority in Backup Group 1.
  • the priority is 90, which is greater than the priority of Router C.
  • Router B is the master of backup group 1.
  • the master device can be replaced by one of the backup devices.
  • the load of each device in the VRRP backup group may be unbalanced.
  • the traffic of the host HI,..., H6 access network (Internet) is 15M/s
  • the forwarding capabilities of Router A, Router B, and Router C are 90M/sec and 80M/sec respectively. And 100M/sec.
  • Router A Before Router A fails, the load on Router A, Router B, and Router C is 30 M/s, and the remaining bandwidth is 60 M/s, 50 M/s, and 70 M/s. The load of each router is not much different. Load balancing is achieved. After Router A is disabled, Router B is the new master of backup group 1 because it has a higher priority than that of Router C. The load on Router A is transferred to Router B. Therefore, the load on Router B and Router C is 60 M/s and 30 M/s, respectively. The remaining bandwidth is 20 M/s and 70 M/s respectively. As shown in Table 1, Router B and The load on Router C is 4 ⁇ , and the load between Router B and Router C is very uneven. Table 1.
  • the main object of the present invention is to provide a method and a device for implementing a device priority in a VRRP backup group, so as to solve at least the problem that the load imbalance occurs after the primary device of the VRRP backup group fails.
  • a device priority implementation method in a virtual router redundancy protocol backup group including: scheduling at a predetermined time, obtaining current forwarding capability of each device and current bearer traffic; The priority of each device in each VRRP backup group, the remaining bandwidth of the device, the current forwarding capability of the device, and the current traffic. The priority of each device recorded in each VRRP backup group is updated.
  • the priority of the VRRP group where N1 is the remaining bandwidth of the recorded device, M1 is the forwarding capability of the recorded device, M is the current forwarding capability of the device, and P is the current priority.
  • the priority of each device in the VRRP backup group is as follows: After calculating the current priority of the device in each VRRP backup group, determine the current priority and record of the calculated device in each VRRP backup group. Whether the absolute value of the difference between the priority of the device in each VRRP backup group exceeds the threshold. If yes, the current priority of the device in each VRRP backup group is calculated. Each device in the update record is in each VRRP backup group. Priority.
  • Obtaining the current forwarding capability of each device and the currently carried traffic includes: obtaining the current forwarding capability of each device according to the current state of the port of each device; periodically collecting the size and frequency of the packets sent and received by each device, and obtaining the current The traffic carried.
  • the scheduled arrival time includes: When the scheduled period arrives or receives a request from the VRRP backup group.
  • the method further includes: the standby device in each VRRP backup group listening for keep-alive packets sent by the primary device in the VRRP backup group, if If the active device fails, the new primary device is elected.
  • the device with the highest priority in the VRRP backup group is migrated to the active device.
  • the new primary device is the VRRP backup group.
  • a device for implementing a priority of a device in a VRRP backup group comprising: an obtaining module, configured to acquire a current forwarding capability of each device and a currently carried traffic; and a computing module, configured to respectively Calculate the priority of each device in each VRRP backup group, the remaining bandwidth of the device, and the current forwarding capability of the device and the currently carried traffic. Calculate the current status of each device in each VRRP backup group.
  • the update module is set to use the current priority of the calculated device in each VRRP backup group to update the priority of each device recorded in each VRRP backup group.
  • the obtaining module includes: a port management module, configured to acquire a current forwarding capability of each device according to a state of each device; and a traffic monitoring module configured to periodically collect statistics on the size and frequency of packets received and received by each device, and obtain current The traffic carried.
  • the priority of each device in each VRRP backup group is dynamically updated according to the current forwarding capability of each device and the currently carried traffic, so that when the primary device of a VRRP backup group fails, the current priority can be selected.
  • the VRRP device can implement the balanced load balancing of the network in the VRRP backup group environment.
  • FIG. 1 is a schematic structural diagram of a VRRP backup group configuration according to the related art
  • FIG. 2 is a schematic structural diagram of a device priority implementation device in a VRRP backup group according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a device priority implementation device in a VRRP backup group according to another preferred embodiment of the present invention
  • FIG. 4 is a schematic diagram of a device priority implementation device in a VRRP backup group according to another preferred embodiment of the present invention
  • FIG. 6 is a flow chart of dynamically adjusting device priorities in a VRRP backup group according to a preferred embodiment of the present invention.
  • the VRRP device performs load balancing between backup groups and maintains good interoperability with standard VRRP devices.
  • 2 is a schematic structural diagram of an apparatus for implementing a device priority in a VRRP backup group according to an embodiment of the present invention.
  • the apparatus mainly includes: an obtaining module 10, a calculating module 20, and an updating module 30.
  • the obtaining module 10 is configured to obtain the current forwarding capability of each device and the currently carried traffic.
  • the computing module 20 is configured to record the priority of each device in each VRRP backup group according to the recorded priority. Calculating the current priority of each of the devices in each of the VRRP backup groups; and updating the module 30, setting the calculation to the remaining bandwidth, and the current forwarding capability of the device and the currently carried traffic.
  • the current priority of the device in each VRRP backup group is updated, and the priority of each of the devices recorded in each VRRP backup group is updated.
  • the obtaining module 10 can obtain the current forwarding capability and the currently carried traffic of each device periodically, and obtain the current forwarding capability and current traffic of each device when receiving a request sent by a VRRP backup group.
  • the calculation module 20 and the update module 30 may be composed of multiple modules, which are respectively set in each VRRP backup group, and are calculated by the calculation module and the update module set in each VRRP backup group. The priority of each device and the priority of each device in the VRRP backup group.
  • the remaining bandwidth of the devices belonging to the VRRP backup group is shared between the backup groups, and the bandwidth is dynamically quantized to the VRRP priority of the device and distributed to each VRRP.
  • the calculation module 20 can calculate the priority of each device in each VRRP backup group according to the following manner (for convenience of description, the priority update of a device in a VRRP backup group is taken as an example): Assume that the device The current forwarding capability is M, and the current bearer traffic is L. The recorded device has a priority of P1 in a VRRP backup group, a forwarding capability of M1, and a remaining bandwidth of N1.
  • the obtaining module 10 may include: a port management module 100, configured to acquire a current forwarding capability of each device according to a state of each device; and a traffic monitoring module 102, It is set to periodically collect statistics on the size and frequency of packets sent and received by each device to obtain the traffic currently carried by each device.
  • the port management module 100 can detect the Up/Down state of each device port, and calculate the device forwarding capability according to the detected state.
  • the port of the VRRP device can be divided into the downlink port and the uplink port according to whether the port is connected to the internal network or the external network.
  • the forwarding capability of the device can be defined as the sum of the bandwidths of the uplink ports in the Up state.
  • the traffic monitoring module 102 can calculate the length of the packet received and sent by the device on the uplink port and the number of packets of various lengths, and calculate the traffic currently carried by each device according to the statistics of a certain period.
  • the VRRP protocol RRC3768
  • the backup with the highest priority in the VRRP backup group is elected as the new master and takes over the forwarding task of the original master.
  • the device with the highest priority in the VRRP backup group is the device with the largest remaining bandwidth. Therefore, after the master fails, the load balancing between the VRRP backup groups is ensured.
  • the initial VRRP priority is specified for each device according to the forwarding capability of the device. level. For example, the priority of the device with the strongest forwarding capability (the forwarding capability is M) can be defined as P, and the priority of the device with the forwarding capability of M1 is: P*M1/M.
  • the information of the quaternion state, priority, forwarding capability, and remaining bandwidth
  • FIG. 4 is a schematic structural diagram of a device for implementing priority of a device in a VRRP backup group according to a preferred embodiment of the present invention, as shown in FIG.
  • the device mainly includes: a port management module 401 (corresponding to the port management module 100 in FIG.
  • the port management module 401 notifies the packet sending and receiving module 402 of the port status in real time, and periodically forwards the forwarding capability of the device to the traffic calculating module 404.
  • the packet sending and receiving module 402 mainly completes the receiving of the data packet and the protocol packet.
  • the traffic monitoring module 403 the length of the packet received and sent by the statistics packet transceiver module 402 on the uplink port of each device, and the number of packets of various lengths, and periodically reporting the statistics to the traffic calculation and distribution module 404.
  • the traffic calculation and distribution module 404, the statistics data and the statistics period sent by the traffic monitoring module 403, calculate the data traffic forwarded by each device in the internal and external networks in a unit time, and obtain the forwarding traffic carried by each device.
  • the VRRP priority management module 405 is distributed to the VRRP priority management module 405 in each backup group periodically or according to the VRRP backup group request; the port management module 401, the port management module 401, the text transceiver module 402, and the traffic
  • the monitoring module 403 and the flow calculation and distribution module 404 are used to perform the functions of the acquisition module 10 in FIG.
  • the VRRP priority management module 405 is configured in each VRRP backup group to calculate the priority of each device in the VRRP backup group.
  • the information related to the calculation includes: 1 the forwarding capability of each device distributed by the traffic calculation module 404, and the traffic carried by the device; 2 the quaternion (state, priority, forwarding capability, and remaining bandwidth) of each device stored in the VRRP backup group.
  • the master switchover causes a momentary interruption of the packet forwarding of the inner network. Therefore, for the sake of stability, when calculating the priority of the master, you can consider the bearer before the transition to the master.
  • a threshold ⁇ can be defined for the change of priority, and the priority of the device is updated only when the change amount of the device priority ⁇ is greater than ⁇ , and the quaternary group stored in the backup group is updated ( Status, priority, forwarding capability, remaining bandwidth) information.
  • the VRRP state management module 406 is configured in each VRRP backup group to complete the management of the device state transition in the VRRP backup group, and write the state change to the quaternion structure in the VRRP backup group.
  • the ratio is: The timer expires, the master election is initiated; ) After the Administer Down event, the device is set to the Init state.
  • it is also responsible for advertising the status of the device to the packet transceiver module 402, controlling the sending and receiving of the data packet, and notifying the device status to the packet transceiver module 402, and controlling the transmission and reception of the VRRP protocol.
  • the VRRP packet sending and receiving module 407 is configured in each VRRP backup group to receive and send VRRP packets and detect the status of other devices according to the status of each device. For example, for the master device, periodically send the keep-alive message, that is, the Advertisement 4 message; for the backup device, receive the keep-alive message of the master, and check the status of the master, if at a certain time (such as three guarantees) If the keep-alive message is not received within the live period, the master is considered invalid and the VRRP state management module 406 is notified to initiate the master election.
  • the fault can be quickly detected by the master and the backup, and the Bidirectional Forwarding Detection (BFD) session is performed. Switching speed between standby devices.
  • BFD Bidirectional Forwarding Detection
  • Step S502 The scheduled time arrives, and obtains the current forwarding capability and the currently carried traffic of each device. For example, the current forwarding capability and the currently carried traffic of each device may be obtained when the predetermined period arrives, or Upon receiving a request for a VRRP device group, step S502 is triggered.
  • Step S504 Update each record according to the priority of each device in each VRRP backup group, the remaining bandwidth of the device, and the obtained current forwarding capability of the device and the currently carried traffic.
  • the priority of each device in each VRRP backup group can be updated as follows: According to the recorded priority of each device in each VRRP backup group, the remaining bandwidth of the device, the current forwarding capability of the acquired device, and the current The current priority of the device in each VRRP backup group is calculated. The priority of each device in each VRRP backup group is updated.
  • the specific step 4 is as follows: Step 1. Specify the initial VRRP priority for each device according to the forwarding capabilities of each device. For example, the priority of the device with the strongest forwarding capability (the forwarding capability of which is M) can be defined as P, and the priority of the device with the forwarding capability of M1 is: P*M1/M.
  • the master switchover may cause a momentary interruption of the internal and external network packet forwarding. Therefore, for the sake of stability, the priority of the master of a VRRP backup group should be considered in the calculation.
  • Step 3 The priority of each device in each VRRP backup group is calculated by using the priority of each device in each VRRP backup group.
  • a threshold ⁇ may be defined for the change of the priority, and the priority of the device is updated only when the variation ⁇ of the device priority is greater than ⁇ , and the quaternary saved in the backup group is updated. (status, priority, forwarding capability, remaining bandwidth) information.
  • each device may also be calculated according to other methods in each VRRP.
  • the priority of the backup group For example, you can calculate the remaining bandwidth of each device based on the current forwarding capability of each device and the current traffic. Then compare the current remaining bandwidth of each device in a VRRP backup group.
  • the priority of each device in the VRRP backup group is reset.
  • the device with the largest remaining bandwidth has the highest priority.
  • the following describes the dynamic adjustment method of the device priority in the VRRP backup group according to the preferred embodiment of the present invention.
  • one of the VRRP backup groups is used.
  • the process is the same for the other devices in the VRRP backup group and the other devices in the VRRP backup group, and is not described in the embodiment of the present invention.
  • FIG. 6 is a flowchart of a preferred embodiment. As shown in FIG. 6, the method includes the following steps: Step S601: Receive forwarding capability and traffic advertisement of each device, and the priority management module 405 in the VRRP backup group periodically receives traffic calculation.
  • Step S602 acquiring the quaternary group saved by the device, for example, the storage device or the memory reading device may be saved in the backup group.
  • Information in the quad (state, priority P1, forwarding capability M1, remaining bandwidth N1).
  • a quaternary group information is stored in the VRRP backup group to record the status, priority, forwarding capability, and remaining bandwidth of the device in the VRRP backup group.
  • the priority of the master device is: P1/N1*(M-M1+N1), and the priority of the backup device is: P1/N1*(ML);
  • Step S608 Compare with the priority in the quad. By comparing the priority value calculated in step S607 with the current priority of the device, the difference between the two is calculated. Step S609: The priority change amount is greater than the threshold, and the absolute difference value of the priority is compared with the previously configured threshold.
  • Step S610 The priority of the device is updated, and the priority of the device in the backup group is set to the priority calculated in step S607.
  • Step S611 Update the quaternary information saved by the device, and set the state of the device in the backup group. The priority, forwarding capability, and remaining bandwidth information are written to the backup group to overwrite the information in the original quad. The process ends; Step S612: Discard the received forwarding capability and the traffic advertisement, discard the notification information received in step S601, and the process ends.
  • the embodiment of the present invention allocates the priority of each device in the VRRP backup group according to the forwarding capability of the device, and performs traffic monitoring, traffic calculation, and VRRP on each device in the VRRP backup group.
  • the priority is dynamically adjusted so that the priorities of the devices in the VRRP backup group can proportionally reflect the remaining bandwidth of each device at that time.
  • the backup device with the highest priority is selected as the backup device with the highest priority.
  • the backup device functions as the new master. Master's forwarding work. Therefore, the load is preferentially allocated to the VRRP device with the largest remaining bandwidth.
  • the VRRP device can implement balanced load balancing of the network in multiple VRRP backup groups.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module.

Abstract

An implementation method and apparatus for priority of devices in a Virtual Router Redundancy Protocol (VRRP) backup group are disclosed by the present invention, wherein, the method includes: when a predetermined time arrives, obtaining the current forwarding ability of each device and the traffic currently borne by each device (S502); updating the recorded priority of each device in each VRRP backup group, respectively according to the recorded priority of each device in each VRRP backup group, the recorded residual bandwidth of the device and the obtained the current forwarding ability of the device and the traffic currently borne by the device (S504). With the present invention, the VRRP device can implement balanced bearing of the forwarding load of a network in the environment of the multiple VRRP backup groups.

Description

虚拟路由器冗余协议备份组中设备优先级实现方法^置 技术领域 本发明涉及通信领域, 具体而言, 涉及一种虚拟路由器冗余协议 ( Virtual Router Redundancy Protocol, 简称为 VRRP )备份组中设备优先级实现方法及 装置。 背景技术 虚拟路由器冗余协议 ( Virtual Router Redundancy Protocol , 简称为 VRRP ) 是一种设备冗余技术, 用于解决局域网环境中, 静态配置的默认网关出现单点 故障后, 局域网内主机无法访问外部网络的问题。 在 VRRP中, 两个或多个物 理设备(一般是具有路由功能的设备, 比如路由器) 聚集在一起组成一个虚拟 的设备(或称为 VRRP备份组), 并对外提供一致的虚拟 IP和虚拟 MAC地址。 局域网内的主机通过将该虚拟 IP 指定为默认的下一跳来实现对外部网络的访 问。在同一个 VRRP备份组中,只有一个物理设备负责内外网之间报文的转发, 该物理设备称为主用设备(即 Master设备), 其他的设备负责侦听 Master设备 的状态, 称为备用设备(即 Backup设备)。 当发现 Master设备失效后, 将根据 设备的优先级标识, 从 Backup 设备中竟选出一个新的 Master设备, 接替原 Master设备的报文转发工作, 但虚拟 IP 不变, 因此不会影响局域网内主机对 外部网络的访问。 正常情况下, 在一个 VRRP备份组中, 只有 Master负责 4艮文转发, Backup 不负责转发工作, 因此 VRRP备份组中设备的转发能力得不到充分利用。 为了 提高设备利用率, 通常会划分多个 VRRP备份组, 并将转发设备同时加入这些 备份组。 然后通过合理规划各设备在不同备份组中的优先级, 使不同的设备分 别在不同的组中承担 Master设备角色, 实现转发载荷的负荷分担。 如图 1所示,局域网中有六台主机和三台路由器,其中:三台路由器 Router A, ... ,Router C都加入了 VRRP备份组 1 , 2和 3 , 并且 Router A是备份组 1中 的 Master设备, Router B是备份组 2中的 Master设备, Router C是备份组 3 中的 Master设备; H1/H2通过 Router A、 H3/H4通过 Router B、 H5/H6通过 Router C访问 Internet, 从而实现了载荷分担。 当 Router A失效后, Router B和 Router C会竟选备份组 1中的 Master设备, 由于备份组 1中, Router B的优先 级为 90, 大于 Router C的优先级 80, 因 jtb, 最终由 Router B作为备份组 1的 Master设备。 但是, 在某个 VRRP备份组的 Master设备失效后, 虽然可以由其中的一 个备用设备接替 Master设备, 但却可能导致 VRRP备份组中的各个设备的负 载不均衡。 例如,在图 1中, £设主机 HI,... , H6访问网络(Internet )的流量为均 15M/ 秒, Router A、 Router B和 Router C的转发能力分别为 90M/秒、 80M/秒和 100M/ 秒、。 在 Router A失效前, Router A、 Router B和 Router C的负载啫为 30M/秒、, 剩余带宽分别为 60M/秒、 50M/秒和 70M/秒, 各个路由器的负载相差不大, 较 好地实现了负载均衡。 在 Router A失效后, 由于在备份组 1中, Router B的优 先级比 Router C高, 因此, Router B作为备份组 1的新的 Master设备。 Router A的负载转移到 Router B上, 因此, Router B和 Router C的负载分别为 60M/ 秒和 30M/秒, 剩余带宽分别为 20M/秒和 70M/秒, 如表 1所示, Router B 和 Router C的负载相差 4艮大, Router B和 Router C间的负载非常不均衡。 表 1. The present invention relates to the field of communications, and in particular, to a device in a virtual router redundancy protocol (VRRP) backup group. Level implementation method and device. A virtual router redundancy protocol (VRRP) is a device redundancy technology. In a LAN environment, after a single point of failure occurs in a statically configured default gateway, hosts in the LAN cannot access the external network. The problem. In VRRP, two or more physical devices (generally devices with routing functions, such as routers) are grouped together to form a virtual device (or VRRP backup group), and provide consistent virtual IP and virtual MAC. address. A host in the local area network accesses the external network by designating the virtual IP as the default next hop. In the same VRRP backup group, only one physical device is responsible for forwarding packets between the internal and external networks. The physical device is called the primary device (the master device). The other devices are responsible for listening to the status of the master device. Device (that is, the backup device). After the master device is found to be invalid, a new master device is selected from the backup device based on the priority of the device. The packet forwarding operation is replaced by the original master device, but the virtual IP is unchanged. Host access to the external network. Normally, in a VRRP backup group, only the master is responsible for forwarding packets. The backup is not responsible for forwarding. Therefore, the forwarding capability of devices in the VRRP backup group cannot be fully utilized. To improve device utilization, multiple VRRP backup groups are usually assigned and the forwarding devices are added to these backup groups at the same time. Then, the priority of each device in different backup groups is properly planned, so that different devices assume the role of the master device in different groups, and the load sharing of the forwarding load is implemented. As shown in Figure 1, there are six hosts and three routers in the LAN. Among them, three routers Router A, ... and Router C are added to VRRP backup groups 1, 2 and 3, and Router A is the backup group 1. On the master device, Router B is the master device in VRRP group 2, and Router C is the master device in VRRP group 3; H1/H2 is connected to Router B through Router C through Router B and H3/H6 through Router C. Thereby load sharing is achieved. After Router A fails, Router B and Router C will select the master device in VRRP group 1, because Router B has priority in Backup Group 1. The priority is 90, which is greater than the priority of Router C. Because of jtb, Router B is the master of backup group 1. However, after the master device of a VRRP backup group fails, the master device can be replaced by one of the backup devices. However, the load of each device in the VRRP backup group may be unbalanced. For example, in Figure 1, the traffic of the host HI,..., H6 access network (Internet) is 15M/s, and the forwarding capabilities of Router A, Router B, and Router C are 90M/sec and 80M/sec respectively. And 100M/sec. Before Router A fails, the load on Router A, Router B, and Router C is 30 M/s, and the remaining bandwidth is 60 M/s, 50 M/s, and 70 M/s. The load of each router is not much different. Load balancing is achieved. After Router A is disabled, Router B is the new master of backup group 1 because it has a higher priority than that of Router C. The load on Router A is transferred to Router B. Therefore, the load on Router B and Router C is 60 M/s and 30 M/s, respectively. The remaining bandwidth is 20 M/s and 70 M/s respectively. As shown in Table 1, Router B and The load on Router C is 4 相, and the load between Router B and Router C is very uneven. Table 1.
Figure imgf000004_0001
发明内容 本发明的主要目的在于提供一种 VRRP备份组中设备优先级实现方法及装 置, 以至少解决上述的在 VRRP备份组的主用设备失效后出现负载不均衡的问 题。 根据本发明的一个方面, 提供了一种虚拟路由器冗余协议备份组中设备优 先级实现方法, 包括: 预定时刻到达, 获取各个设备当前的转发能力和当前承 载的流量; 分别根据记录的每个设备在各个 VRRP备份组中的优先级、 该设备 的剩余带宽、 获取的该设备的当前的转发能力和当前承载的流量, 更新记录的 每个设备在各个 VRRP备份组中的优先级。 根据记录的每个设备在各个 VRRP备份组中的优先级、 设备的剩余带宽、 获取的设备的当前的转发能力和当前承载的流量, 计算出设备在各个 VRRP备 份组中的当前优先级, 更新记录的每个设备在各个 VRRP备份组中的优先级。 按照下式分别计算设备在各个 VRRP 备份组中的当前优先级:
Figure imgf000004_0001
SUMMARY OF THE INVENTION The main object of the present invention is to provide a method and a device for implementing a device priority in a VRRP backup group, so as to solve at least the problem that the load imbalance occurs after the primary device of the VRRP backup group fails. According to an aspect of the present invention, a device priority implementation method in a virtual router redundancy protocol backup group is provided, including: scheduling at a predetermined time, obtaining current forwarding capability of each device and current bearer traffic; The priority of each device in each VRRP backup group, the remaining bandwidth of the device, the current forwarding capability of the device, and the current traffic. The priority of each device recorded in each VRRP backup group is updated. Calculate the current priority of the device in each VRRP backup group based on the priority of each device in the VRRP backup group, the remaining bandwidth of the device, the current forwarding capability of the device, and the current traffic. The priority of each device recorded in each VRRP backup group. Calculate the current priority of the device in each VRRP backup group according to the following formula:
N1 , 其中, P1为记录的设备在当前 VRRP备份组中的优先级, N1 为记录的设备的剩余带宽, M为设备的当前的转发能力, L为设备的当前承载 的流量, P为当前优先级。 在计算设备在各个 VRRP备份组中的当前优先级时, 该方法还包括: 判断 设备为当前 VRRP备份组的主用设备;按照下式计算设备在当前 VRRP备份组 的当前优先级: Ρ=Ρ1 * Μ~ (Μ1 ~Ν1 ) , 其中, Pi为记录的设备在当前 VRRP N1, where P1 is the priority of the recorded device in the current VRRP backup group, N1 is the remaining bandwidth of the recorded device, M is the current forwarding capability of the device, L is the current bearer traffic of the device, and P is the current priority. level. When the current priority of the device in the VRRP backup group is calculated, the method further includes: determining that the device is the primary device of the current VRRP backup group; and calculating the current priority of the device in the current VRRP backup group according to the following formula: Ρ=Ρ1 * Μ ~ (Μ1 ~ Ν1) , where Pi is the recorded device in the current VRRP
N1  N1
备份组中的优先级, N1为记录的设备的剩余带宽, Ml为记录的设备的转发能 力, M为设备的当前的转发能力, P为当前优先级。 更新记录的每个设备在各个 VRRP备份组中的优先级包括: 计算出设备在 各个 VRRP备份组中的当前优先级后,判断计算出的设备在各个 VRRP备份组 中的当前优先级与记录的设备在各个 VRRP备份组中的优先级之差的绝对值是 否超过阈值, 如果是, 则将计算出设备在各个 VRRP备份组中的当前优先级, 更新记录的每个设备在各个 VRRP备份组中的优先级。 获取各个设备当前的转发能力和当前承载的流量包括: 根据各个设备的端 口的当前状态, 获取各个设备当前的转发能力; 周期性地统计各个设备收发报 文的大小和频度, 获取各个设备当前承载的流量。 预定时刻到达包括: 预定周期到达或接收 VRRP备份组的请求时。 在更新记录的每个设备在各个 VRRP备份组中的优先级之后, 该方法还包 括:每个 VRRP备份组中的备用设备侦听 VRRP备份组中的主用设备发送的保 活报文, 如果主用设备失效, 则发起新的主用设备选举, VRRP备份组中优先 级最高的备用设备迁移到主用设备状态, 作为 VRRP备份组的新的主用设备。 在更新记录的每个设备在各个 VRRP备份组中的优先级之后, 该方法还包 括: 根据获取的各个设备的当前转发能力和当前承载的流量, 更新记录的各个 设备的剩余带宽。 根据本发明的另一方面,提供了一种 VRRP备份组中设备的优先级实现装 置, 包括: 获取模块, 设置为获取各个设备当前的转发能力和当前承载的流量; 计算模块, 设置为分别根据记录的每个设备在各个 VRRP备份组中的优先级、 该设备的剩余带宽、 及获取的该设备的当前的转发能力和当前承载的流量, 计 算每个设备在每个 VRRP备份组中的当前优先级; 更新模块, 设置为用计算出 的设备在各个 VRRP 备份组中的当前优先级, 更新记录的每个设备在各个 VRRP备份组中的优先级。 上述获取模块包括: 端口管理模块, 设置为根据各个设备的状态, 获取各 个设备当前的转发能力; 流量监控模块, 设置为周期性地统计各个设备收发报 文的大小和频度, 获取各个设备当前承载的流量。 通过本发明, 根据各个设备当前的转发能力和当前承载的流量, 动态更新 各个设备在各个 VRRP备份组中的优先级,从而使得在某个 VRRP备份组的主 用设备失效时, 可以选择当前优先级最高的备用设备作为主用设备, 解决了主 用设备失效后负载不均衡的问题, 进而实现了在多个 VRRP备份组的环境下, VRRP设备可以实现网络的转发载荷的均衡分担。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不 当限定。 在附图中: 图 1是根据相关技术的一种 VRRP备份组配置结构示意图; 图 2是根据本发明实施例的 VRRP备份组中设备优先级实现装置的结构示 意图; 图 3是根据本发明优选实施例的 VRRP备份组中设备优先级实现装置的结 构示意图; 图 4是才艮据本发明另一优选实施例的 VRRP备份组中设备优先级实现装置 的结构示意图; 图 5 是才艮据本发明实施例的 VRRP备份组中设备优先级实现方法的流程 图; 图 6是本发明优选实施例的 VRRP备份组中设备优先级的动态调整流程 图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不 冲突的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 下面结合附图对本发明在 VRRP备份组之间提高路由器负载均衡能力的方 法进行说明。 针对多个 VRRP备份组的环境中, 某个设备失效后, 传统的 VRRP设备的 在备份组之间载荷分担恶化的问题,发明人发现,出现上述问题的原因是 VRRP 备份组中各个设备的优先级在配置后是固定的, 但是在实际使用过程中, 由于 各个设备分担的负载不同, 各个设备当前剩余带宽也不同, 因此, 优先级高的 设备的当前剩余带宽可能不是最大, 从而导致负载不均衡恶化。 因此, 本发明 实施例提供一种动态调整 VRRP备份组中各个设备的优先级的方案, 解决了传 统 VRRP设备在备份组之间进行负荷均衡的问题, 同时还能与标准 VRRP设备 保持了较好互通性。 图 2为根据本发明实施例的 VRRP备份组中设备优先级实现装置的结构示 意图, 如图 2所示, 该装置主要包括: 获取模块 10、 计算模块 20和更新模块 30。 其中, 获取模块 10, 设置为获取各个设备当前的转发能力和当前承载的流 量; 计算模块 20 ,设置为分别根据记录的每个所述设备在各个 VRRP备份组中 的优先级、 记录的该设备的剩余带宽、 以及获取的该设备的所述当前的转发能 力和当前承载的流量, 计算每个所述设备在每个所述 VRRP备份组中的当前优 先级; 更新模块 30 ,设置为用计算出的所述设备在各个 VRRP备份组中的所述 当前优先级,更新记录的每个所述设备在各个 VRRP备份组中的优先级。其中, 获取模块 10 可以周期性的获取各个设备当前的转发能力和当前承载的流量, 也可以在接收到某个 VRRP备份组发送的请求时获取各个设备当前的转发能力 和当前 载的流量。 在实际应用中, 计算模块 20和更新模块 30可以有多个模块组成, 分别设 置在每个 VRRP备份组中, 由设置在各个 VRRP备份组中的计算模块和更新模 块计算其所在 VRRP备份组中各个设备的优先级,以及更新其所在 VRRP备份 组中各个设备的优先级。 在本发明实施例中, 对属于多个 VRRP备份组的设备, 其剩余带宽在备份 组之间共享,可以将这种带宽按照一定比例动态地量化为设备的 VRRP优先级, 并分发到各 VRRP备份组中。 因此, 计算模块 20可以按照以下方式计算各个 设备在各个 VRRP备份组中的优先级(为了便于描述,以一个设备在某个 VRRP 备份组中的优先级更新为例进行说明): 假设, 该设备的当前的转发能力为 M, 当前承载的流量为 L; 而记录的该 设备在某个 VRRP备份组中的优先级为 P1 , 转发能力为 Ml , 剩余带宽为 Nl。 则该设备的剩余带宽 N=M-L, 优先级为: P/N1*N= P/N1*(M-L)。 在 VRRP中, Master的切换会引起内夕卜网报文转发的瞬时中断,因此,优选地,在计算 Master 的优先级时, 应该考虑其转变成 Master之前的 7 载情况, 因此, 如果该设备为 该 VRRP 备份组的 Master, 则该设备的剩余带宽也可以为: N=M-(M1-N1)= M-M1+N1 , 即等于转发能力与转变成 Master之前所 载的流量之差。 所以, 作为该 VRRP 备份组的 Master 的该设备的优先级 P 为: P1/N1*N= P1/N1*(M-M1+N1)。 优选地, 为了避免优先级更新过于频繁, 影响备份组的效率, 可以为优先 级的变化设定义一个阈值 δ, 只有当设备优先级的变化量 Ρ大于 δ时, 才更 新设备的优先级。 在本发明实施例的一个优选实施方式中, 如图 3所示, 获取模块 10可以 包括: 端口管理模块 100 , 设置为根据各个设备的状态, 获取各个设备当前的 转发能力; 流量监控模块 102 , 设置为周期性地统计各个设备收发报文的大小 和频度, 获取各个设备当前承载的流量。 例如, 端口管理模块 100可以对各个设备端口进行 Up/Down状态的检测, 并根据检测到的状态计算设备转发能力。 根据端口连接的是内网还是外网, 可 以将 VRRP设备的端口分为下行口和上行口。 比如, 可以将设备的转发能力定 义为 Up状态的各个上行口的带宽总和。 流量监控模块 102 , 可以统计各个设 备在其上行端口接收和发送的报文的长度及各种长度报文的数量, 根据某一周 期统计的结果计算各个设备当前承载的流量。 按照 VRRP协议 ( RFC3768 ), 某个 VRRP备份组中的 Master失效后, 该 VRRP备份组中优先级最高的 Backup会被选举为新的 Master ,并接替原 Master 的转发任务, 按照本发明实施例提供的上述装置, VRRP备份组中优先级最高 的备用设备即是当前剩余带宽最大的设备, 因此, 可以保证在 Master失效后, 各个设备在 VRRP备份组之间的负载均衡。 在本发明实施例中, 为了能使设备的 VRRP优先级能按比例动态地反映设 备的剩余带宽, 并在备份组之间分发, 首先需要按照设备的转发能力, 为各个 设备指定初始的 VRRP 优先级。 比如, 可以将转发能力最强的设备 (其转发能 力为 M)的优先级定义为 P, 则转发能力为 Ml的设备的优先级为: P*M1/M。 同时, 将四元组 (状态, 优先级, 转发能力, 剩余带宽)信息存储到设备的各 个备份组中, 初始情况下, 设备的剩余带宽就是其转发能力。 在各个 VRRP备 份组工作后, 利用上述装置对各个设备在各个 VRRP备份组中的优先级进行更 新, 并根据各个设备当前承载的流量和当前转发能力, 更新各个 VRRP备份组 中的各个设备的上述四元组中的其余变量(包括状态、转发能力和剩余带宽等。 图 4是根据本发明优选实施例的 VRRP备份组中设备的优先级实现装置的 结构示意图, 如图 4所示, 在该优选实施例中, 该装置主要包括: 端口管理模块 401 (相当于图 3中的端口管理模块 100 ), 主要完成设备端 口 Up/Down 状态的检测和设备转发能力的计算两部分功能。 根据端口连接的 是内网还是外网, 可以将 VRRP设备的端口分为下行口和上行口。 比如, 可以 将设备的转发能力定义为 Up状态的各个上行口的带宽总和。端口管理模块 401 实时地向报文收发模块 402通告端口状态, 并将设备的转发能力周期性的通告 给流量计算模块 404; 报文收发模块 402 , 主要完成数据报文和协议报文的接收与发送; 流量监控模块 403 , 统计报文收发模块 402在各个设备的上行端口接收和 发送的报文的长度和各种长度报文的数量, 并将统计结果周期性通告给流量计 算及分发模块 404; 流量计算及分发模块 404 , 居流量监控模块 403发送来的统计数据和统 计周期, 计算单位时间内各个设备在内外网之间转发的数据流量, 得到各个设 备承载的转发流量。 然后周期性或根据 VRRP备份组请求, 将设备的转发能力 和承载的转发流量分发到各个备份组中的 VRRP优先级管理模块 405; 上述端口管理模块 401端口管理模块 401、 文收发模块 402、 流量监控 模块 403和流量计算及分发模块 404用于完成图 2中的获取模块 10的功能。 VRRP优先级管理模块 405 , 每个 VRRP备份组中设置一个, 用于完成各 个设备在本 VRRP备份组中的优先级的计算。 与计算相关的信息包括: ①流量 计算模块 404分发来的各个设备转发能力、 承载的流量; ②保存在该 VRRP备 份组内的各个设备的四元组 (状态, 优先级, 转发能力, 剩余带宽) 信息; 例如, 假设, 设备当前的转发能力为 M, 流量为 L; 该设备的四元组中的 优先级为 Pl、 转发能力为 Ml、 剩余带宽为 Nl。 如果四元组中的状态指示该 设备是 Backup设备, 剩余带宽 N=M-L, 优先级为: P1/N1*N= P1/N1*(M-L)。 在 VRRP备份组中, Master的切换会引起内夕卜网报文转发的瞬时中断, 所以为 了稳定起见, 在计算 Master的优先级时, 可以考虑其转变成 Master之前的承 载情况, 因此, 对于四元组中的状态指示该设备为 Master 的剩余带宽为: N=M-(M1-N1)= M-M1+N1 , 即等于转发能力与转变成 Master之前所 载的流 量之差。 所以, Master的优先级为: P1/N1*N= P1/N1*(M-M1+N1)。 同样, 为了稳定起见, 可以为优先级的变化设定义一个阈值 δ , 只有当设 备优先级的变化量 Ρ大于 δ时, 才更新设备的优先级, 并更新保存在备份组 中的四元组 (状态, 优先级, 转发能力, 剩余带宽) 信息。 VRRP 状态管理模块 406 , 各个 VRRP 备份组中设置一个, 用于完成本 VRRP备份组中设备状态跃迁的管理, 以及将状态变化写入本 VRRP备份组中 的四元组结构中。 比^口: 定时器超时, 发起 Master选举; ) 到 Administer Down 事件后, 将设备置为 Init状态等。 此外, 还负责将设备的状态通告给报文收发 模块 402 , 控制数据报文的收发, 将设备状态通告给报文收发模块 402 , 控制 VRRP协议 4艮文的收发。 The priority of the VRRP group, where N1 is the remaining bandwidth of the recorded device, M1 is the forwarding capability of the recorded device, M is the current forwarding capability of the device, and P is the current priority. The priority of each device in the VRRP backup group is as follows: After calculating the current priority of the device in each VRRP backup group, determine the current priority and record of the calculated device in each VRRP backup group. Whether the absolute value of the difference between the priority of the device in each VRRP backup group exceeds the threshold. If yes, the current priority of the device in each VRRP backup group is calculated. Each device in the update record is in each VRRP backup group. Priority. Obtaining the current forwarding capability of each device and the currently carried traffic includes: obtaining the current forwarding capability of each device according to the current state of the port of each device; periodically collecting the size and frequency of the packets sent and received by each device, and obtaining the current The traffic carried. The scheduled arrival time includes: When the scheduled period arrives or receives a request from the VRRP backup group. After updating the priority of each device in each VRRP backup group, the method further includes: the standby device in each VRRP backup group listening for keep-alive packets sent by the primary device in the VRRP backup group, if If the active device fails, the new primary device is elected. The device with the highest priority in the VRRP backup group is migrated to the active device. The new primary device is the VRRP backup group. After updating the priority of each device in each VRRP backup group, the method further includes: updating the remaining bandwidth of each recorded device according to the obtained current forwarding capability of each device and the currently carried traffic. According to another aspect of the present invention, a device for implementing a priority of a device in a VRRP backup group, comprising: an obtaining module, configured to acquire a current forwarding capability of each device and a currently carried traffic; and a computing module, configured to respectively Calculate the priority of each device in each VRRP backup group, the remaining bandwidth of the device, and the current forwarding capability of the device and the currently carried traffic. Calculate the current status of each device in each VRRP backup group. Priority; The update module is set to use the current priority of the calculated device in each VRRP backup group to update the priority of each device recorded in each VRRP backup group. The obtaining module includes: a port management module, configured to acquire a current forwarding capability of each device according to a state of each device; and a traffic monitoring module configured to periodically collect statistics on the size and frequency of packets received and received by each device, and obtain current The traffic carried. According to the present invention, the priority of each device in each VRRP backup group is dynamically updated according to the current forwarding capability of each device and the currently carried traffic, so that when the primary device of a VRRP backup group fails, the current priority can be selected. The VRRP device can implement the balanced load balancing of the network in the VRRP backup group environment. The VRRP device can implement the balanced load balancing of the network. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are set to illustrate,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, In the drawings: FIG. 1 is a schematic structural diagram of a VRRP backup group configuration according to the related art; FIG. 2 is a schematic structural diagram of a device priority implementation device in a VRRP backup group according to an embodiment of the present invention; FIG. 4 is a schematic structural diagram of a device priority implementation device in a VRRP backup group according to another preferred embodiment of the present invention; FIG. 4 is a schematic diagram of a device priority implementation device in a VRRP backup group according to another preferred embodiment of the present invention; A flowchart of a device priority implementation method in a VRRP backup group in the embodiment of the present invention; FIG. 6 is a flow chart of dynamically adjusting device priorities in a VRRP backup group according to a preferred embodiment of the present invention. BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. The method for improving router load balancing capability between VRRP backup groups according to the present invention will be described below with reference to the accompanying drawings. In the environment of multiple VRRP backup groups, the load balancing of the traditional VRRP devices is deteriorating between the backup groups. The inventor found that the above problems occur because the devices in the VRRP backup group take precedence. The level is fixed after the configuration. However, in actual use, the current remaining bandwidth of each device is different because the load shared by each device is different. Therefore, the current remaining bandwidth of the device with the highest priority may not be the largest, resulting in no load. The equilibrium deteriorates. Therefore, the embodiment of the present invention provides a scheme for dynamically adjusting priorities of devices in a VRRP backup group, and solves the problem. The VRRP device performs load balancing between backup groups and maintains good interoperability with standard VRRP devices. 2 is a schematic structural diagram of an apparatus for implementing a device priority in a VRRP backup group according to an embodiment of the present invention. As shown in FIG. 2, the apparatus mainly includes: an obtaining module 10, a calculating module 20, and an updating module 30. The obtaining module 10 is configured to obtain the current forwarding capability of each device and the currently carried traffic. The computing module 20 is configured to record the priority of each device in each VRRP backup group according to the recorded priority. Calculating the current priority of each of the devices in each of the VRRP backup groups; and updating the module 30, setting the calculation to the remaining bandwidth, and the current forwarding capability of the device and the currently carried traffic. The current priority of the device in each VRRP backup group is updated, and the priority of each of the devices recorded in each VRRP backup group is updated. The obtaining module 10 can obtain the current forwarding capability and the currently carried traffic of each device periodically, and obtain the current forwarding capability and current traffic of each device when receiving a request sent by a VRRP backup group. In a practical application, the calculation module 20 and the update module 30 may be composed of multiple modules, which are respectively set in each VRRP backup group, and are calculated by the calculation module and the update module set in each VRRP backup group. The priority of each device and the priority of each device in the VRRP backup group. In the embodiment of the present invention, the remaining bandwidth of the devices belonging to the VRRP backup group is shared between the backup groups, and the bandwidth is dynamically quantized to the VRRP priority of the device and distributed to each VRRP. In the backup group. Therefore, the calculation module 20 can calculate the priority of each device in each VRRP backup group according to the following manner (for convenience of description, the priority update of a device in a VRRP backup group is taken as an example): Assume that the device The current forwarding capability is M, and the current bearer traffic is L. The recorded device has a priority of P1 in a VRRP backup group, a forwarding capability of M1, and a remaining bandwidth of N1. Then the remaining bandwidth of the device is N=ML, and the priority is: P/N1*N=P/N1*(ML). In VRRP, the master switch causes a momentary interruption of the message forwarding of the Eclipse network. Therefore, preferably, when calculating the priority of the Master, the 7-load situation before the transition to the Master should be considered. Therefore, if the device For the master of the VRRP backup group, the remaining bandwidth of the device can also be: N=M-(M1-N1)= M-M1+N1, which is equal to the difference between the forwarding capability and the traffic carried before the transition to the Master. Therefore, the priority P of the device that is the master of the VRRP backup group is: P1/N1*N= P1/N1*(M-M1+N1). Preferably, in order to prevent the priority update from being too frequent and affecting the efficiency of the backup group, a threshold δ may be defined for the change of the priority, and the priority of the device is updated only when the change amount of the device priority is greater than δ. In a preferred embodiment of the present invention, as shown in FIG. 3, the obtaining module 10 may include: a port management module 100, configured to acquire a current forwarding capability of each device according to a state of each device; and a traffic monitoring module 102, It is set to periodically collect statistics on the size and frequency of packets sent and received by each device to obtain the traffic currently carried by each device. For example, the port management module 100 can detect the Up/Down state of each device port, and calculate the device forwarding capability according to the detected state. The port of the VRRP device can be divided into the downlink port and the uplink port according to whether the port is connected to the internal network or the external network. For example, the forwarding capability of the device can be defined as the sum of the bandwidths of the uplink ports in the Up state. The traffic monitoring module 102 can calculate the length of the packet received and sent by the device on the uplink port and the number of packets of various lengths, and calculate the traffic currently carried by each device according to the statistics of a certain period. According to the VRRP protocol (RFC3768), after the master in a VRRP backup group fails, the backup with the highest priority in the VRRP backup group is elected as the new master and takes over the forwarding task of the original master. The device with the highest priority in the VRRP backup group is the device with the largest remaining bandwidth. Therefore, after the master fails, the load balancing between the VRRP backup groups is ensured. In the embodiment of the present invention, in order to enable the VRRP priority of the device to dynamically reflect the remaining bandwidth of the device and distribute it among the backup groups, firstly, the initial VRRP priority is specified for each device according to the forwarding capability of the device. level. For example, the priority of the device with the strongest forwarding capability (the forwarding capability is M) can be defined as P, and the priority of the device with the forwarding capability of M1 is: P*M1/M. At the same time, the information of the quaternion (state, priority, forwarding capability, and remaining bandwidth) is stored in each backup group of the device. In the initial case, the remaining bandwidth of the device is its forwarding capability. After the VRRP backup group is working, the device is used to update the priority of each device in each VRRP backup group, and the devices in each VRRP backup group are updated according to the current traffic and the current forwarding capability of each device. The remaining variables in the quaternary group include state, forwarding capability, and remaining bandwidth, etc. FIG. 4 is a schematic structural diagram of a device for implementing priority of a device in a VRRP backup group according to a preferred embodiment of the present invention, as shown in FIG. In a preferred embodiment, the device mainly includes: a port management module 401 (corresponding to the port management module 100 in FIG. 3), which mainly performs the functions of detecting the Up/Down state of the device port and calculating the forwarding capability of the device. of Whether it is an internal network or an external network, you can divide the ports of the VRRP device into downlink ports and uplink ports. For example, the forwarding capability of the device can be defined as the sum of the bandwidths of the uplink ports in the Up state. The port management module 401 notifies the packet sending and receiving module 402 of the port status in real time, and periodically forwards the forwarding capability of the device to the traffic calculating module 404. The packet sending and receiving module 402 mainly completes the receiving of the data packet and the protocol packet. The traffic monitoring module 403, the length of the packet received and sent by the statistics packet transceiver module 402 on the uplink port of each device, and the number of packets of various lengths, and periodically reporting the statistics to the traffic calculation and distribution module 404. The traffic calculation and distribution module 404, the statistics data and the statistics period sent by the traffic monitoring module 403, calculate the data traffic forwarded by each device in the internal and external networks in a unit time, and obtain the forwarding traffic carried by each device. Then, the VRRP priority management module 405 is distributed to the VRRP priority management module 405 in each backup group periodically or according to the VRRP backup group request; the port management module 401, the port management module 401, the text transceiver module 402, and the traffic The monitoring module 403 and the flow calculation and distribution module 404 are used to perform the functions of the acquisition module 10 in FIG. The VRRP priority management module 405 is configured in each VRRP backup group to calculate the priority of each device in the VRRP backup group. The information related to the calculation includes: 1 the forwarding capability of each device distributed by the traffic calculation module 404, and the traffic carried by the device; 2 the quaternion (state, priority, forwarding capability, and remaining bandwidth) of each device stored in the VRRP backup group. For example, assume that the current forwarding capability of the device is M and the traffic is L; the priority of the quaternion of the device is P1, the forwarding capability is M1, and the remaining bandwidth is N1. If the status in the quad indicates that the device is a backup device, the remaining bandwidth is N=ML, and the priority is: P1/N1*N= P1/N1*(ML). In a VRRP backup group, the master switchover causes a momentary interruption of the packet forwarding of the inner network. Therefore, for the sake of stability, when calculating the priority of the master, you can consider the bearer before the transition to the master. Therefore, for the fourth The status in the tuple indicates that the remaining bandwidth of the device is Master: N=M-(M1-N1)= M-M1+N1, which is equal to the difference between the forwarding capability and the traffic carried before the transition to the Master. Therefore, the priority of the Master is: P1/N1*N= P1/N1*(M-M1+N1). Similarly, for the sake of stability, a threshold δ can be defined for the change of priority, and the priority of the device is updated only when the change amount of the device priority Ρ is greater than δ, and the quaternary group stored in the backup group is updated ( Status, priority, forwarding capability, remaining bandwidth) information. The VRRP state management module 406 is configured in each VRRP backup group to complete the management of the device state transition in the VRRP backup group, and write the state change to the quaternion structure in the VRRP backup group. The ratio is: The timer expires, the master election is initiated; ) After the Administer Down event, the device is set to the Init state. In addition, it is also responsible for advertising the status of the device to the packet transceiver module 402, controlling the sending and receiving of the data packet, and notifying the device status to the packet transceiver module 402, and controlling the transmission and reception of the VRRP protocol.
VRRP报文收发模块 407, 各个 VRRP备份组中分别设置一个, 用于根据 各个设备的状态, 接收和发送 VRRP协议报文并检测其他设备的状态。 例如, 对于 Master 设备, 定期的对外发送保活 4艮文, 即 Advertisement 4艮文; 对于 Backup设备, 接收 Master的保活 4艮文, 并检测 Master的状态, 如果在一定时 间(比如三个保活周期)内收不到保活报文,就认为 Master失效,并通知 VRRP 状态管理模块 406发起 Master选举。 此夕卜, 在本优选实施例中, 还可以通过主、备之间建立故障快速检测会话, 比^口 BFD ( Bidirectional Forwarding Detection, 双向转发检测)会话, 来力口快 Master失效后, 主、 备设备之间的切换速度。 图 5 是才艮据本发明实施例的 VRRP备份组中设备优先级实现方法的流程 图, 该方法可以通过图 2-图 4所示的装置实现, 如图 5所示, 该方法主要包括 以下步 4聚: 步骤 S502, 预定时刻到达, 获取各个设备当前的转发能力和当前承载的流 量; 例如, 可以在预定周期到达时, 获取各个设备当前的转发能力和当前承载 的流量, 或者, 也可以在接收到某个 VRRP设备组的请求时, 触发步骤 S502。 步骤 S504, 分别根据记录的每个所述设备在各个 VRRP备份组中的优先 级、 该设备的剩余带宽、 以及获取的该设备的当前的转发能力和当前承载的流 量, 更新记录的每个所述设备在各个 VRRP备份组中的优先级。 例如, 可以按照以下方式更新各个设备在各个 VRRP备份组中的优先级: 根据记录的每个设备在各个 VRRP备份组中的优先级、 设备的剩余带宽、 获取 的设备的当前的转发能力和当前承载的流量, 计算出设备在各个 VRRP备份组 中的当前优先级, 更新记录的每个设备在各个 VRRP备份组中的优先级。 具体 步 4聚如下: 步骤 1 ,按照各个设备的转发能力, 为各个设备指定初始的 VRRP优先级。 例如, 可以将转发能力最强的设备 (其转发能力为 M)的优先级定义为 P, 则转 发能力为 Ml的设备的优先级为: P*M1/M。 同时, 将四元组 (状态, 优先级, 转发能力, 剩余带宽)信息存储到设备的各个备份组中, 初始情况下, 设备的 剩余带宽就是其转发能力。 步骤 2 , 根据各个设备当前承载的流量及当前转发能力, 计算各个设备在 各个 VRRP备份组中的当前优先级。 例如, 假设, 某个设备的当前转发能力为 M, 当前承载流量为 L; 记录的 其在某个 VRRP备份组中四元组中的优先级为 P1 , 剩余带宽为 Nl。 则该设备 当前的剩余带宽 N=M-L, 其当前优先级 P可以为: P1/N1*N= P1/N1*(M-L)。 优选地, 由于在 VRRP备份组中, Master的切换会引起内外网报文转发的 瞬时中断, 因此, 为了稳定起见, 对于某个 VRRP备份组的 Master的优先级, 在计算时, 应该考虑其转变成 Master之前的 载情况, 因 对于某个 VRRP 备份组的 Master剩余带宽为: N=M-(M1-N1)= M-M1+N1 , 即等于转发能力与 转变成 Master之前所 载的流量之差。 作为某个 VRRP备份组的 Master在该 VRRP备份组中的优先级 P为: P1/N1*N= P1/N1*(M-M1+N1)。 步骤 3 ,利用步骤 2计算得到的各个设备在各个 VRRP备份组中的优先级, 更新各个设备在各个 VRRP备份组中的优先级。 优选地, 为了稳定起见, 可以为优先级的变化设定义一个阈值 δ, 只有当 设备优先级的变化量 Ρ大于 δ时, 才更新设备的优先级, 并更新保存在备份 组中的四元组 (状态, 优先级, 转发能力, 剩余带宽) 信息。 需要说明的是, 虽然上述列举了一种计算某个设备在某个 VRRP备份组中 的优先级的方法, 但并不限于此, 在实际应用中, 也可以按照其它方法计算各 个设备在各个 VRRP备份组中的优先级, 例如, 可以根据各个设备当前的转发 能力和当前承载的流量, 计算各个设备的剩余带宽, 然后比较某个 VRRP备份 组中各个设备的当前剩余带宽, 按照各个设备当前剩余带宽量的大小, 重新设 置各个设备在该 VRRP备份组中的优先级, 其中, 当前剩余带宽量最大的设备 的优先级最高。 下面结合图 4 , 对本发明优选实施例的 VRRP备份组中设备优先级的动态 调整方法进行描述, 在该优选实施例中, 以某个 VRRP备份组中的某一个设备 为例进行说明, 对于该 VRRP备份组中的其它设备, 以及其它 VRRP备份组中 各个设备, 其流程相同, 在本发明实施例中不再赘述。 图 6为本优选实施例的 流程图, 如图 6所示, 主要包括以下步骤: 步骤 S601: 接收各个设备转发能力和流量通告, VRRP备份组中的优先级 管理模块 405定期的接收到流量计算和分发模块 404分发的本 VRRP备份组中 各个设备转发能力 Ml和流量 L1通告信息; 步骤 S602: 获取设备保存的四元组, 例如, 可以从存储单元或内存中读取 设备保存在该备份组中的四元组 (状态, 优先级 P1 , 转发能力 Ml , 剩余带宽 N1 ) 信息。 当某个设备同时属于多个 VRRP备份组时, 每个 VRRP备份组中 都会存储一个四元组信息, 用于记录在该设备在本 VRRP备份组中的状态、 优 先级、 转发能力和剩余带宽信息; 步骤 S603: 判断设备是否 Master, 可以根据四元组中的状态信息判断该设 备是否是当前备份组中的 Master。 如果是 Master, 继续步骤 S604; 否则, 转至 步骤 S605; 步骤 S604: 计算 Master的剩余带宽, Master的剩余带宽与设备在转变成 该备份组中的 Master之前所 载的流量有关, 其剩余带宽为: N = M-M1+N1 , 然后转至步 4聚 S607; 步骤 S605 : 判断设备是 Backup, 根据四元组中的状态信息判断该设备是 否是当前备份组中的 Backup。 如果是 Backup, 继续步骤 S606; 否则, 转至步 骤 S612; 步骤 S606: 计算 Backup的剩余带宽, 其剩余带宽为: N=M-L; 步骤 S607: 计算设备的优先级, 设备的优先级 P 为: P1/N1*N。 其中, Master 设备的优先级为: P1/N1*(M-M1+N1) , Backup 设备的优先级为: P1/N1*(M-L); 步骤 S608: 与四元组中的优先级进行比较, 通过比较步骤 S607算出的优 先级值与设备当前的优先级, 算出两者的差值; 步骤 S609: 优先级变化量大于阈值, 将优先级的绝对差值与事先配置的阈 值进行比较。 如果大于阈值, 继续步骤 S610; 否则, 转至步骤 S612; 步骤 S610: 更新设备的优先级, 将设备在该备份组内的优先级设置为步骤 S607计算出的优先级; 步骤 S611 : 更新设备保存的四元组信息, 将设备在该备份组中的状态、 优 先级、 转发能力和剩余带宽信息写入备份组, 覆盖原有四元组中的信息。 流程 结束; 步骤 S612: 丢弃收到的转发能力和流量通告, 丢弃步骤 S601中收到的通 告信息, 流程结束。 按照本发明实施例描述的上述方法, 对于图 1所示的局域网, 当路由器 A 失效后,备份组 1中各个设备的负载及剩余带宽如表 2所示,从表 2可以看出, 当路由器 A失效后, 路由器 C被选举为 Master, 路由器 B和路由器 C的剩余 带宽分别为 40M和 50M, 其负载较为均衡。 表 2.The VRRP packet sending and receiving module 407 is configured in each VRRP backup group to receive and send VRRP packets and detect the status of other devices according to the status of each device. For example, for the master device, periodically send the keep-alive message, that is, the Advertisement 4 message; for the backup device, receive the keep-alive message of the master, and check the status of the master, if at a certain time (such as three guarantees) If the keep-alive message is not received within the live period, the master is considered invalid and the VRRP state management module 406 is notified to initiate the master election. In addition, in the preferred embodiment, the fault can be quickly detected by the master and the backup, and the Bidirectional Forwarding Detection (BFD) session is performed. Switching speed between standby devices. FIG. 5 is a flowchart of a method for implementing device priority in a VRRP backup group according to an embodiment of the present invention. The method may be implemented by using the apparatus shown in FIG. 2 to FIG. 4. As shown in FIG. 5, the method mainly includes the following. Step 4: Step S502: The scheduled time arrives, and obtains the current forwarding capability and the currently carried traffic of each device. For example, the current forwarding capability and the currently carried traffic of each device may be obtained when the predetermined period arrives, or Upon receiving a request for a VRRP device group, step S502 is triggered. Step S504: Update each record according to the priority of each device in each VRRP backup group, the remaining bandwidth of the device, and the obtained current forwarding capability of the device and the currently carried traffic. Indicates the priority of the device in each VRRP backup group. For example, the priority of each device in each VRRP backup group can be updated as follows: According to the recorded priority of each device in each VRRP backup group, the remaining bandwidth of the device, the current forwarding capability of the acquired device, and the current The current priority of the device in each VRRP backup group is calculated. The priority of each device in each VRRP backup group is updated. The specific step 4 is as follows: Step 1. Specify the initial VRRP priority for each device according to the forwarding capabilities of each device. For example, the priority of the device with the strongest forwarding capability (the forwarding capability of which is M) can be defined as P, and the priority of the device with the forwarding capability of M1 is: P*M1/M. At the same time, the information of the quaternion (state, priority, forwarding capability, and remaining bandwidth) is stored in each backup group of the device. In the initial case, the remaining bandwidth of the device is its forwarding capability. Step 2: Calculate the current priority of each device in each VRRP backup group according to the current traffic and the current forwarding capability of each device. For example, if the current forwarding capability of a device is M and the current bearer traffic is L, the priority of the quaternary group in a VRRP backup group is P1 and the remaining bandwidth is N1. Then, the current remaining bandwidth of the device is N=ML, and its current priority P may be: P1/N1*N=P1/N1*(ML). Preferably, in the VRRP backup group, the master switchover may cause a momentary interruption of the internal and external network packet forwarding. Therefore, for the sake of stability, the priority of the master of a VRRP backup group should be considered in the calculation. Before the master becomes the master, the remaining bandwidth of the master for a VRRP backup group is: N=M-(M1-N1)= M-M1+N1, which is equal to the forwarding capability and the traffic before the transition to the Master. difference. The priority P of a master in a VRRP backup group is: P1/N1*N= P1/N1*(M-M1+N1). Step 3: The priority of each device in each VRRP backup group is calculated by using the priority of each device in each VRRP backup group. Preferably, for the sake of stability, a threshold δ may be defined for the change of the priority, and the priority of the device is updated only when the variation 设备 of the device priority is greater than δ, and the quaternary saved in the backup group is updated. (status, priority, forwarding capability, remaining bandwidth) information. It should be noted that although the above describes a method for calculating the priority of a certain device in a VRRP backup group, it is not limited thereto. In practical applications, each device may also be calculated according to other methods in each VRRP. The priority of the backup group. For example, you can calculate the remaining bandwidth of each device based on the current forwarding capability of each device and the current traffic. Then compare the current remaining bandwidth of each device in a VRRP backup group. The priority of each device in the VRRP backup group is reset. The device with the largest remaining bandwidth has the highest priority. The following describes the dynamic adjustment method of the device priority in the VRRP backup group according to the preferred embodiment of the present invention. In the preferred embodiment, one of the VRRP backup groups is used. For example, the process is the same for the other devices in the VRRP backup group and the other devices in the VRRP backup group, and is not described in the embodiment of the present invention. FIG. 6 is a flowchart of a preferred embodiment. As shown in FIG. 6, the method includes the following steps: Step S601: Receive forwarding capability and traffic advertisement of each device, and the priority management module 405 in the VRRP backup group periodically receives traffic calculation. And the device forwarding capability M1 and the traffic L1 advertisement information in the VRRP backup group distributed by the distribution module 404; Step S602: acquiring the quaternary group saved by the device, for example, the storage device or the memory reading device may be saved in the backup group. Information in the quad (state, priority P1, forwarding capability M1, remaining bandwidth N1). When a device belongs to multiple VRRP backup groups, a quaternary group information is stored in the VRRP backup group to record the status, priority, forwarding capability, and remaining bandwidth of the device in the VRRP backup group. Information: Step S603: Determine whether the device is a master, and determine whether the device is a master in the current backup group according to the status information in the quad. If it is the master, proceed to step S604; otherwise, go to step S605; Step S604: calculate the remaining bandwidth of the master, and the remaining bandwidth of the master is related to the traffic carried by the device before being converted into the master in the backup group, and the remaining bandwidth is : N = M - M1 + N1 , then go to step 4 to gather S607; Step S605 : Determine that the device is a Backup, and determine whether the device is a Backup in the current backup group according to the status information in the quad group. If it is Backup, go to step S606; otherwise, go to step S612; Step S606: Calculate the remaining bandwidth of the Backup, and the remaining bandwidth is: N=ML; Step S607: Calculate the priority of the device, and the priority P of the device is: P1 /N1*N. The priority of the master device is: P1/N1*(M-M1+N1), and the priority of the backup device is: P1/N1*(ML); Step S608: Compare with the priority in the quad. By comparing the priority value calculated in step S607 with the current priority of the device, the difference between the two is calculated. Step S609: The priority change amount is greater than the threshold, and the absolute difference value of the priority is compared with the previously configured threshold. If it is greater than the threshold, proceed to step S610; otherwise, go to step S612; Step S610: The priority of the device is updated, and the priority of the device in the backup group is set to the priority calculated in step S607. Step S611: Update the quaternary information saved by the device, and set the state of the device in the backup group. The priority, forwarding capability, and remaining bandwidth information are written to the backup group to overwrite the information in the original quad. The process ends; Step S612: Discard the received forwarding capability and the traffic advertisement, discard the notification information received in step S601, and the process ends. According to the foregoing method described in the embodiment of the present invention, for the local area network shown in FIG. 1, when the router A fails, the load and remaining bandwidth of each device in the backup group 1 are as shown in Table 2. As can be seen from Table 2, when the router After A fails, Router C is elected as the Master, and the remaining bandwidths of Router B and Router C are 40M and 50M, respectively, and the load is relatively balanced. Table 2.
Figure imgf000014_0001
Figure imgf000014_0001
从以上的描述中, 可以看出, 本发明实施例按照设备的转发能力, 按比例 分配 VRRP备份组内各设备的优先级,通过对 VRRP备份组中的各个设备进行 流量监控、 流量计算以及 VRRP优先级动态调整, 使得 VRRP备份组内各设备 的优先级能按比例地反映出各设备当时的剩余带宽。 当某个备份组内的 Master 失效后, 使得组内的 Backup通过竟选方式优先选出的优先级最高的备用设备 为剩余带宽最大的 Backup设备, 由该 Backup设备作为新的 Master , 担原有 Master的转发工作。从而保证了载荷会优先分配到剩余带宽最大的 VRRP设备 上, 进而较好地实现了在多个 VRRP备份组的环境下, VRRP设备可以实现网 络的转发载荷的均衡分担。 另外, 本发明实施例在实现负载均衡时, 仅动态调 整了 VRRP设备的优先级, 未对 VRRP协议进行改动。 因此, 本发明实施例可 以与标准 VRRP协议完全兼容。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以 用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多 个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码 来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 并且在某些 情况下, 可以以不同于此处的顺序执行所示出或描述的步骤, 或者将它们分别 制作成各个集成电路模块, 或者将它们中的多个模块或步骤制作成单个集成电 路模块来实现。 这样, 本发明不限制于任何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领 域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的 ^"神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之 内。 From the above description, it can be seen that the embodiment of the present invention allocates the priority of each device in the VRRP backup group according to the forwarding capability of the device, and performs traffic monitoring, traffic calculation, and VRRP on each device in the VRRP backup group. The priority is dynamically adjusted so that the priorities of the devices in the VRRP backup group can proportionally reflect the remaining bandwidth of each device at that time. After the master in a VRRP group fails, the backup device with the highest priority is selected as the backup device with the highest priority. The backup device functions as the new master. Master's forwarding work. Therefore, the load is preferentially allocated to the VRRP device with the largest remaining bandwidth. The VRRP device can implement balanced load balancing of the network in multiple VRRP backup groups. In addition, when the load balancing is implemented, the priority of the VRRP device is dynamically adjusted, and the VRRP protocol is not modified. Therefore, embodiments of the present invention can be fully compatible with the standard VRRP protocol. Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the scope of the present invention are intended to be included within the scope of the present invention.

Claims

权 利 要 求 书 Claims
1. 一种虚拟路由器冗余协议 VRRP备份组中设备优先级实现方法, 包括: 预定时刻到达, 获取各个设备当前的转发能力和当前承载的流量; 分别根据记录的每个所述设备在各个 VRRP备份组中的优先级、 所 述设备的剩余带宽、 获取的所述设备的当前的转发能力和当前承载的流 量, 更新记录的每个所述设备在各个 VRRP备份组中的优先级。 A method for implementing a device priority in a VRRP backup group of a virtual router redundancy protocol, including: scheduling a predetermined time to obtain the current forwarding capability of each device and the currently carried traffic; respectively, according to each of the recorded devices in each VRRP The priority of the backup group, the remaining bandwidth of the device, the current forwarding capability of the device, and the currently carried traffic, and the priority of each of the devices recorded in each VRRP backup group.
2. 根据权利要求 1 所述的方法, 其中, 根据记录的每个所述设备在各个 VRRP 备份组中的优先级、 所述设备的剩余带宽、 获取的所述设备的当 前的转发能力和当前承载的流量, 计算出所述设备在各个 VRRP备份组 中的所述当前优先级, 更新记录的每个所述设备在各个 VRRP备份组中 的优先级。 2. The method according to claim 1, wherein: according to the recorded priority of each device in each VRRP backup group, the remaining bandwidth of the device, the obtained current forwarding capability of the device, and the current The current priority of the device in each VRRP backup group is calculated, and the priority of each device in the VRRP backup group is updated.
3. 根据权利要求 2所述的方法, 其中, 按照下式分别计算所述设备在各个 VRRP备份组中的当前优先级: The method according to claim 2, wherein the current priority of the device in each VRRP backup group is calculated according to the following formula:
N1 , 其中, P1为记录的所述设备在当前 VRRP备份组中 的优先级, N1 为记录的所述设备的剩余带宽, M 为所述设备的当前的 转发能力, L为所述设备的当前承载的流量, P为所述当前优先级。 根据权利要求 2所述的方法, 其中, 在计算所述设备在各个 VRRP备份 组中的所述当前优先级时, 所述方法还包括: N1, where P1 is the priority of the recorded device in the current VRRP backup group, N1 is the remaining bandwidth of the recorded device, M is the current forwarding capability of the device, and L is the current device The traffic carried, P is the current priority. The method according to claim 2, wherein, when calculating the current priority of the device in each VRRP backup group, the method further includes:
判断所述设备为所述当前 VRRP备份组的主用设备;  Determining that the device is a primary device of the current VRRP backup group;
按照下式计算所述设备在所述当前 VRRP备份组的当前优先级:  Calculate the current priority of the device in the current VRRP backup group according to the following formula:
P=P1 * M(M1 ~N1 ) , 其中, Pi为记录的所述设备在当前 VRRP P=P1 * M(M1 ~ N1 ) , where Pi is the recorded device at the current VRRP
N1  N1
备份组中的优先级, N1为记录的所述设备的剩余带宽, Ml为记录的所 述设备的转发能力, M为所述设备的当前的转发能力, P为所述当前优 先级。 根据权利要求 2-4任一项所述的方法, 其中, 所述更新记录的每个所述 设备在各个 VRRP备份组中的优先级包括: 计算出所述设备在各个 VRRP备份组中的所述当前优先级后, 判断 所述计算出的所述设备在各个 VRRP备份组中的所述当前优先级与记录 的所述设备在各个 VRRP 备份组中的优先级之差的绝对值是否超过阈 值, 如果是, 则将计算出所述设备在各个 VRRP备份组中的所述当前优 先级, 更新记录的每个所述设备在各个 VRRP备份组中的优先级。 The priority of the backup group, N1 is the remaining bandwidth of the recorded device, M1 is the recorded forwarding capability of the device, M is the current forwarding capability of the device, and P is the current priority. The method according to any one of claims 2-4, wherein the priority of each of the devices in the update record in each VRRP backup group includes: After the current priority of the device in each VRRP backup group is calculated, it is determined that the calculated current priority of the device in each VRRP backup group and the recorded device are in each VRRP backup. Whether the absolute value of the difference in the priority of the group exceeds the threshold, and if so, the current priority of the device in each VRRP backup group is calculated, and each device of the update record is in each VRRP backup group. Priority in .
6. 根据权利要求 1所述的方法, 其中, 获取各个设备当前的转发能力和当 前承载的流量包括: The method according to claim 1, wherein obtaining the current forwarding capability of each device and the currently carried traffic includes:
根据各个所述设备的端口的当前状态, 获取各个所述设备当前的转 发能力;  Obtaining a current forwarding capability of each of the devices according to a current state of a port of each of the devices;
周期性地统计各个所述设备收发报文的大小和频度, 获取各个所述 设备当前承载的流量。  Periodically, the size and frequency of the packets sent and received by the devices are periodically collected, and the traffic currently carried by each device is obtained.
7. 根据权利要求 1所述的方法, 其中, 所述预定时刻到达包括: 预定周期 到达或接收 VRRP备份组的请求时。 7. The method according to claim 1, wherein the predetermined time arrival comprises: a predetermined period when a request to arrive or receive a VRRP backup group is received.
8. 根据权利要求 1至 4、 6至 7中任一项所述的方法, 其中, 在更新记录的 每个所述设备在各个 VRRP备份组中的优先级之后, 所述方法还包括: 每个 VRRP备份组中的备用设备侦听所述 VRRP备份组中的主用设 备发送的保活报文, 如果所述主用设备失效, 则发起新的主用设备选举, 所述 VRRP备份组中优先级最高的备用设备迁移到主用设备状态, 作为 所述 VRRP备份组的新的主用设备。 The method according to any one of claims 1 to 4, 6 to 7, wherein after updating the priority of each of the recorded devices in each VRRP backup group, the method further comprises: The standby device in the VRRP backup group listens to the keep-alive packets sent by the active device in the VRRP backup group. If the active device fails, the device initiates a new active device election. The VRRP backup group is in the VRRP backup group. The backup device with the highest priority is migrated to the active device state as the new primary device of the VRRP backup group.
9. 根据权利要求 1至 4、 6至 7中任一项所述的方法, 其中, 在更新记录的 每个所述设备在各个 VRRP备份组中的优先级之后, 所述方法还包括: 根据获取的各个所述设备的当前转发能力和当前承载的流量, 更新 记录的各个所述设备的剩余带宽。 The method according to any one of claims 1 to 4, 6 to 7, wherein after updating the priority of each of the recorded devices in each VRRP backup group, the method further comprises: Obtaining the current forwarding capability of each of the devices and the currently carried traffic, and updating the remaining bandwidth of each of the recorded devices.
10. —种 VRRP备份组中设备优先级实现装置, 包括: 10. Device priority implementation device in a VRRP backup group, including:
获取模块,设置为获取各个设备当前的转发能力和当前承载的流量; 计算模块, 设置为分别根据记录的每个所述设备在各个 VRRP备份 组中的优先级、 所述设备的剩余带宽、 及获取的所述设备的所述当前的 转发能力和当前承载的流量, 计算每个所述设备在每个所述 VRRP备份 组中的当前优先级; 更新模块, 设置为用计算出的所述设备在各个 VRRP备份组中的所 述当前优先级, 更新记录的每个所述设备在各个 VRRP备份组中的优先 级。 The obtaining module is configured to obtain the current forwarding capability of each device and the currently carried traffic; the computing module is configured to respectively set the priority of each device in each VRRP backup group, the remaining bandwidth of the device, and Calculating the current forwarding capability of the device and the currently carried traffic, and calculating a current priority of each of the devices in each of the VRRP backup groups; The update module is configured to update the priority of each of the recorded devices in each VRRP backup group by using the calculated current priority of the device in each VRRP backup group.
11. 根据权利要求 10所述的装置, 其中, 所述获取模块包括: The device according to claim 10, wherein the acquiring module comprises:
端口管理模块, 设置为根据各个设备的状态, 获取各个设备当前的 转发能力;  The port management module is configured to obtain the current forwarding capability of each device according to the status of each device.
流量监控模块, 设置为周期性地统计各个所述设备收发报文的大小 和频度, 获取各个所述设备当前承载的流量。  The traffic monitoring module is configured to periodically collect statistics on the size and frequency of the packets sent and received by the devices, and obtain the traffic currently carried by each device.
PCT/CN2011/076076 2010-11-18 2011-06-21 Implementation method and apparatus for priority of device in virtual router redundancy protocol backup group WO2012065440A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010549810.4 2010-11-18
CN201010549810.4A CN102469018B (en) 2010-11-18 2010-11-18 Priority facility implementation method and device in Virtual Router Redundancy Protocol backup group

Publications (1)

Publication Number Publication Date
WO2012065440A1 true WO2012065440A1 (en) 2012-05-24

Family

ID=46072215

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076076 WO2012065440A1 (en) 2010-11-18 2011-06-21 Implementation method and apparatus for priority of device in virtual router redundancy protocol backup group

Country Status (2)

Country Link
CN (1) CN102469018B (en)
WO (1) WO2012065440A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108429675A (en) * 2018-03-30 2018-08-21 新华三技术有限公司 VRRP linkage switching methods, device and electronic equipment

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103581014B (en) * 2012-07-20 2018-02-06 中兴通讯股份有限公司 VRRP routers dynamic adjusting method and device
CN111464438B (en) * 2020-03-04 2023-02-28 邦彦技术股份有限公司 Method and device for managing state of VRRP node, and method and device for improving equipment
CN111698158B (en) * 2020-04-17 2023-03-31 新华三技术有限公司成都分公司 Method and device for electing master equipment and machine-readable storage medium
CN111698173B (en) * 2020-06-29 2022-09-13 迈普通信技术股份有限公司 Traffic scheduling method and device and electronic equipment
CN114095442B (en) * 2021-11-17 2024-03-15 迈普通信技术股份有限公司 Load balancing method, load balancing device, electronic equipment and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1723664A (en) * 2003-02-19 2006-01-18 松下电器产业株式会社 Inter-router adjustment method, router priority calculation device, and router device
CN1968260A (en) * 2005-11-17 2007-05-23 华为技术有限公司 Method for implementing virtual router redundancy protocol switching between primary/standby devices

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6556547B1 (en) * 1998-12-15 2003-04-29 Nortel Networks Limited Method and apparatus providing for router redundancy of non internet protocols using the virtual router redundancy protocol
CN1208929C (en) * 2002-06-23 2005-06-29 华为技术有限公司 Method for realfizing router interface backup utilizing virtual router redundancy procotol
CN101883380B (en) * 2009-05-04 2012-11-28 中兴通讯股份有限公司 Method and device for selecting terminal during congestion processing
CN101562576B (en) * 2009-05-27 2011-11-16 杭州华三通信技术有限公司 Route distribution method and equipment thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1723664A (en) * 2003-02-19 2006-01-18 松下电器产业株式会社 Inter-router adjustment method, router priority calculation device, and router device
CN1968260A (en) * 2005-11-17 2007-05-23 华为技术有限公司 Method for implementing virtual router redundancy protocol switching between primary/standby devices

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108429675A (en) * 2018-03-30 2018-08-21 新华三技术有限公司 VRRP linkage switching methods, device and electronic equipment

Also Published As

Publication number Publication date
CN102469018B (en) 2016-01-20
CN102469018A (en) 2012-05-23

Similar Documents

Publication Publication Date Title
WO2018077238A1 (en) Switch-based load balancing system and method
US10911398B2 (en) Packet generation method based on server cluster and load balancer
US10257265B2 (en) Redundancy network protocol system
EP3122004B1 (en) Traffic switching method, device, and system
US11734138B2 (en) Hot standby method, apparatus, and system
US10148756B2 (en) Latency virtualization in a transport network using a storage area network
JP5944537B2 (en) Communication path management method
EP2993838B1 (en) Methods for setting a member identity of gateway device and corresponding management gateway devices
CN101316236B (en) Vrrp backup group load sharing method and router
US8243594B1 (en) Coordinated control of multiple parallel links or link aggregations
EP2108224B1 (en) Multipath virtual router redundancy
US20170013508A1 (en) Stateless load-balancing across multiple tunnels
WO2011140951A1 (en) Method, device and system for load balancing
WO2012065440A1 (en) Implementation method and apparatus for priority of device in virtual router redundancy protocol backup group
TW201541262A (en) Method for virtual machine migration using software defined networking (SDN)
US11546267B2 (en) Method for determining designated forwarder (DF) of multicast flow, device, and system
CN111901236B (en) Method and system for optimizing openstack cloud network by using dynamic routing
WO2011147312A1 (en) Method, device and system for port backup of service access router
US20160205033A1 (en) Pool element status information synchronization method, pool register, and pool element
CN105721328B (en) VRRP load balancing method, device and router
WO2014075527A1 (en) Method, device and system for performing redundancy backup among network virtualization edge devices
WO2014157512A1 (en) System for providing virtual machines, device for determining paths, method for controlling paths, and program
US9548887B2 (en) Proactive creation of multicast state in an overlay transport network to achieve fast convergence on failover
US9615307B2 (en) System and method for managing prefixes
Zhang et al. Scalability and Bandwidth Optimization for Data Center Networks

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11842371

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11842371

Country of ref document: EP

Kind code of ref document: A1