WO2017117908A1 - 负荷分担的方法及装置 - Google Patents

负荷分担的方法及装置 Download PDF

Info

Publication number
WO2017117908A1
WO2017117908A1 PCT/CN2016/083932 CN2016083932W WO2017117908A1 WO 2017117908 A1 WO2017117908 A1 WO 2017117908A1 CN 2016083932 W CN2016083932 W CN 2016083932W WO 2017117908 A1 WO2017117908 A1 WO 2017117908A1
Authority
WO
WIPO (PCT)
Prior art keywords
load sharing
load
links
group
link
Prior art date
Application number
PCT/CN2016/083932
Other languages
English (en)
French (fr)
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 WO2017117908A1 publication Critical patent/WO2017117908A1/zh

Links

Images

Classifications

    • 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

Definitions

  • the present application relates to, but is not limited to, the field of communications, and in particular, to a method and apparatus for load sharing.
  • Load sharing refers to load balancing on multiple links existing on network equipment nodes such as switches and routers through corresponding policies and methods.
  • Load sharing needs to solve the problem: when these network nodes have multiple paths to forward packet messages, how to properly select a forwarding path, so that the forwarding performance of the node is optimal or meets certain forwarding requirements and how Traffic is distributed to each link in a reasonably balanced manner.
  • the two modes are flow-by-flow mode and packet-by-packet mode.
  • the so-called flow-by-flow mode is a method in which all packets forwarded by the router select a link according to a destination IP or a quintuple (including a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol) for forwarding.
  • the so-called packet-by-packet mode is to randomly select a link forwarding mode in the load sharing member table by all the packets forwarded by the router.
  • the load sharing is performed in the flow-by-flow mode, for example, packet packet out-of-order, jitter, and the like can be avoided to the greatest extent, because the content of the message and the result of the routing are related, so that the packet addressed to the same destination IP is obtained.
  • the result of the routing is the same, but since the routing of the mode is related to the content of the packet, the bandwidth of the forwarding link of the forwarding node does not necessarily match the payload of the packet carried by the forwarding node, which may cause some paths to be congested. Some paths are idle, so bandwidth cannot be used effectively.
  • the bandwidth of the forwarding link can be matched with the packet load carried by the load.
  • the packet content is independent of the mode selection result, the packet is sent to Packets of the same destination IP address may be assigned to different forwarding paths, causing the packets to be out of order and jittered. If a node in the link of a forwarding path fails and loses packets, the packet is discarded. incomplete.
  • the present invention provides a method and an apparatus for load sharing, which at least solves the problem that the packet-by-packet policy mode in the related art causes the packet to be out of order and jitter, and the traffic-by-flow policy mode causes some paths to be congested.
  • the path is idle, so the bandwidth utilization problem cannot be guaranteed.
  • a method for load sharing including: determining a load ratio between links having mutually different types of interfaces;
  • the load sharing of the packets shared by the links is performed according to the load sharing member table and the load sharing policy table.
  • the step of determining a load ratio between links having mutually different types of interfaces includes: determining a number of packets of the link sharing having mutually different types of interfaces; The ratio between the number of link-shared packets having mutually different types of interfaces as the load ratio, wherein the load ratio is greater than the interface bandwidth between the links having the interfaces of different types respectively The ratio corresponds.
  • the step of grouping the links for load sharing according to the load ratio includes: performing a remainder operation on each value of the interface bandwidth and each value in the load ratio; If the remainder of the remainder operation is zero, the link is divided into packets corresponding to the value in the load ratio of the remainder of the bandwidth of the interface of the link.
  • the step of grouping links for load sharing according to the load ratio further includes: sorting a load sharing member table corresponding to the group in which the links are located; assigning a segment address to the sorted load sharing member table, where the first load is allocated to the first load
  • the segment address of the shared member table is a basic shared index, and the basic shared index is derived from the prefix table.
  • the segment address assigned to one of the plurality of load sharing member tables is the load sharing member table.
  • the segment address of the previous load sharing member table of the sort is incremented by one.
  • the application further provides a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • a load sharing apparatus comprising: a first processing module configured to determine a load ratio between links having mutually different types of interfaces; and a second processing module configured to Generating a link for load sharing according to the load ratio to generate a load sharing member table corresponding to each packet; wherein the links are all assigned with the load sharing member corresponding to the group in which the group is located An offset address in the table; the writing module is configured to calculate a boundary value of the group in which the links are located according to a preset rule to generate a load sharing policy table; and an execution module configured to share the member table according to the load And the load sharing policy table performs load sharing on the packets that are shared by each link.
  • the first processing module includes: a first acquiring unit, configured to determine a number of the packets that are respectively shared by the links having different types of interfaces; and the comparing unit is configured to have different types respectively
  • the ratio between the number of link-shared messages of the interface corresponds to the load ratio, wherein the load corresponds to a ratio of bandwidths of interfaces between the links having mutually different types of interfaces.
  • the second processing module includes: a remnant unit, configured to perform a remainder operation on the value of the interface bandwidth and each value in the load ratio; and the dividing unit is configured to perform a remainder operation If the remainder is zero, the link is divided into packets corresponding to the value in the load ratio of the remainder of the bandwidth of the interface of the link.
  • the device further includes a segment address allocation module, where the second processing module is After the load ratio is grouped, the segment address allocation module is configured to sort the load sharing member table corresponding to the group in which the links are located, and is the sorted load sharing member table.
  • An allocation segment address wherein the segment address assigned to the first load balancing member table that is sorted is a basic sharing index, and the basic sharing index is from a prefix table; wherein, one of the plurality of load sharing member tables is allocated
  • the segment address of the person is one of the segment addresses of the sorted previous load sharing member table of the load sharing member table.
  • determining a load ratio between links having mutually different types of interfaces grouping links for load sharing according to a load ratio to generate a load sharing member table corresponding to each group; And calculating a boundary value of the group in which each link is located according to a preset rule to generate a load sharing policy table; and load-sharing the packets shared by each link according to the load sharing member table and the load sharing policy table;
  • the links are grouped. Therefore, the load of the transmitted packets can be load-balanced according to the interface bandwidth of the links, which solves the problem of packet out-of-order and jitter caused by the packet-by-packet policy mode in the related art. It is more serious, and the use of the traffic-by-flow policy mode for transmission causes the packets allocated between the links to be unbalanced, thereby reducing the bandwidth utilization problem.
  • FIG. 1 is a flow chart of a method of load sharing according to an embodiment of the present invention
  • FIG. 2 is a structural block diagram of an apparatus for load sharing according to an embodiment of the present invention.
  • FIG. 3 is a step of dividing a link for load sharing into three groups in accordance with an alternative embodiment of the present invention.
  • FIG. 4 is a schematic diagram of grouping of groups of links for load sharing in accordance with an alternative embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a boundary value of a load sharing policy table according to an alternative embodiment of the present invention.
  • FIG. 6 is a flow chart of a method of load sharing in accordance with an alternate embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for load sharing according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps:
  • Step S102 determining a load ratio between links having interfaces of different types from each other;
  • Step S104 Group the links for load sharing according to the load ratio to generate a load sharing member table corresponding to each group; wherein the links are all assigned with load sharing member tables corresponding to the group in which they are located. Offset address in ;
  • Step S106 Calculate a boundary value of a packet where each link is located according to a preset rule, to generate a load sharing policy table.
  • Step S108 Perform load sharing on the packets shared by the links according to the load sharing member table and the load sharing policy table.
  • the member table is configured to calculate the boundary value of the packet in which each link is located according to the preset rule to generate a load sharing policy table.
  • the load sharing member table and the load sharing policy table are used to load-load the packets shared by each link.
  • the load ratio of the packets used for load sharing can be load-balanced according to the interface bandwidth of these links, so as to fully utilize the bandwidth of each forwarding link and balance the purpose of sharing, and then solve the problem.
  • the use of the packet-by-packet policy mode causes the packets to be out of order, and the jitter is severe, and the use of the traffic-by-flow policy mode causes the packets allocated between the links to be unbalanced, thereby reducing the bandwidth utilization problem. .
  • the load ratio between the links having the different types of interfaces respectively determined in the foregoing step S102 can be implemented as follows:
  • Step S102-1 determining the number of packets of link sharing having interfaces of different types respectively;
  • Step S102-2 using, as a load ratio, a ratio between the number of packets shared by links having mutually different types of interfaces, wherein the load ratio is an interface bandwidth between links having interfaces of different types respectively The ratio corresponds to.
  • the number of distributed packets of 10G LAN, 10G WAN, and 10G POS192 is represented by L, W, and P, respectively, for 40G and
  • the 100G LAN is a ratio of 4x and 10x, according to the following formula:
  • 64/66 indicates the 64/66 encoding when transmitting on the PHY, that is, the data with a transmission length of 64 bits requires 66 bits of space; 26/27 indicates the utilization after the management frame is removed for SDH encapsulation; 10.3125 and 9.95328 are respectively LAN and SDH line rate constant.
  • the ratio of L to W is independent of the length of the IP address.
  • the ratio of L to W is related to the length of the IP address.
  • the length of the IP address is 128 bytes in binary, and the length of the link with three different interfaces is the length of the IP address.
  • grouping the links used for load sharing according to the load ratio in step S104 in this embodiment may be implemented as follows:
  • Step S102-4 performing a remainder operation on the values of the interface bandwidth and the respective values in the load ratio
  • Step S102-5 If the remainder of the remainder operation is zero, the link is divided into packets corresponding to the value in the load ratio of the remainder of the bandwidth of the interface of the link.
  • each link used for load balancing may be divided into three groups according to the bandwidth of the interface, namely, A, B, and C, and each chain in the group A.
  • the value of the interface bandwidth of the road is a multiple of 116.
  • the value of the interface bandwidth of each link in the B group is a multiple of 100.
  • the value of the interface bandwidth of each link in the C group is a multiple of 93.
  • the method further includes:
  • Step S105-1 Sort the load sharing member table corresponding to the group in which each link is located;
  • Step S105-2 assigning a segment address to the sorted load sharing member table, wherein the segment address assigned to the first load sharing member table that is sorted is a basic sharing index, and the basic sharing index is from a prefix table; The segment address of one of the plurality of load sharing member tables is incremented by one of the segment addresses of the sorted previous load sharing member table of the load sharing member table.
  • step S105-1 to step S105-2 in a specific application scenario, after determining that each link for load sharing belongs to groups A, B, and C, it is determined that each of the three groups belongs to each other.
  • the segment address of the load sharing member table of group A is the load sharing index (the index is obtained from the prefix table such as routing table and label table), and the B group
  • the segment address of the load-sharing member table is the segment address of the load-sharing member table of group A plus one
  • the segment address of the load-sharing member table of group C is the segment address of the load-sharing member table of group A plus two.
  • the content of each load sharing member table is a hash of each link in the group at intervals of 255 (8 bits in binary).
  • the K-1th packet is in the boundary value of the 16-bit binary interval, and 1_W is the sum of the interface bandwidths of all the links in the first packet, and K and N are positive integers.
  • the specific application scenario may be: after the respective links are determined to belong to the A, B, and C groups, the hash value Boundary_A of the A group in the interval of 16 bits according to the binary is obtained by the following calculation, and the B group is 16 bits according to the binary.
  • the hash value Boundary_B on the interval is written to the load sharing strategy table.
  • A_W represents the sum of the interface bandwidths of all links in group A
  • B_W represents group B.
  • the C_W represents the sum of the interface bandwidths of all the links in the C group.
  • Boundary_A (A_W*65535)/(A_W+B_W+C_W);
  • Boundary_B ((A_W+B_W)*65535)/(A_W+B_W+C_W).
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present application which is essential or contributes to the related art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, CD-ROM).
  • the instructions include a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present application.
  • Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • a device for load sharing is further provided, and the device implements the foregoing embodiment, and details have been omitted for description.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • the apparatus includes: a first processing module 22 configured to determine loads between links having mutually different types of interfaces, respectively.
  • the second processing module 24 is coupled to the first processing module 22 and configured to group the links for load sharing according to the load ratio to generate a load sharing member table corresponding to each group;
  • the link is assigned an offset address in the load sharing member table corresponding to the group in which the packet is located;
  • the writing module 26 is coupled to the second processing module 24, and is configured to calculate the group of each link according to a preset rule.
  • the boundary value is used to generate a load sharing policy table.
  • the executing module 28 is coupled to the writing module 26 and configured to perform load sharing on the packets shared by the links according to the load sharing member table and the load sharing policy table.
  • the first processing module 22 includes: a first acquiring unit, configured to determine a number of link-sharing packets respectively having interfaces of different types; and comparing units configured to have different types of interfaces respectively Ratio of the number of packets shared by the link as a load ratio,
  • the load ratio corresponds to a ratio of bandwidths of interfaces between links having mutually different types of interfaces.
  • the second processing module 24 includes: a remnant unit configured to perform a remainder operation on the values of the interface bandwidth and the respective values in the load ratio; and the dividing unit is configured to set the remainder of the remainder operation to be zero, And dividing the link into a packet corresponding to a value in the load ratio of the remainder operation of the bandwidth of the interface of the link.
  • the apparatus further includes a segment address assignment module 23, and after the second processing module 24 groups the links for load sharing according to the load ratio, the segment address assignment module 23 sets the links to each link.
  • the load sharing member table corresponding to the group is sorted; the segment address is allocated to the sorted load sharing member table, wherein the segment address assigned to the first load sharing member table that is sorted is a basic sharing index, and the basic sharing index is from
  • the prefix table may be a routing table, a label table, or the like; wherein, the segment address allocated to one of the plurality of load sharing member tables is the sorted previous load of the load sharing member table. Add the segment address of the member table to one.
  • the K-1th packet is in the boundary value of the 16-bit binary interval
  • 1_W is the sum of the interface bandwidths of all the links in the first packet
  • K and N are positive integers.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
  • the present invention provides a method for load sharing, which is summarized as: determining a load ratio between links having mutually different types of interfaces; according to the load ratio, each piece for load sharing The link is grouped to generate a load sharing member table corresponding to each group, and a boundary value of each group is calculated to generate a load sharing policy table; load sharing is performed on the packet.
  • FIG. 3 is used in accordance with an alternative embodiment of the present invention.
  • L, W, and P respectively represent 10G LAN
  • the number of shared packets of 10G WAN and 10G POS192 is 4 times and 10 times for 40G and 100G LANs, according to the following formula:
  • 64/66 represents 64/66 encoding when transmitting on the physical layer PHY, that is, data with a transmission length of 64 bits requires 66 bits of bearer space; 26/27 represents a synchronous digital system (Synchronous) Digital Hierarchy (referred to as SDH) encapsulation, the utilization rate after the management frame is removed; 10.3125, 9.95328 are the line rate constants of the LAN and SDH respectively; wherein the ratio of L to W is independent of the length of the IP address, L and W The ratio is related to the length of the IP address.
  • FIG. 4 is a schematic diagram of groups of groups for load sharing according to an optional embodiment of the present invention. As shown in FIG. 4, the length of the IP address is 128 bytes in binary.
  • the respective links for load sharing are divided into three groups according to the load ratio according to the load ratio.
  • the value of the interface bandwidth of each link in group A is a multiple of 116.
  • the value of the interface bandwidth of each link in group B is a multiple of 100.
  • the value of the interface bandwidth of each link in group C is 93. Multiples.
  • the step of assigning the segment address to the sorted load sharing member table may be implemented as follows: After each link of the load sharing belongs to the three groups A, B, and C, the offset addresses in the generated load sharing member tables of each of the three groups can be determined.
  • the segment address of the member table is the load sharing index (the index is obtained from the prefix table such as the routing table and the label table).
  • the segment address of the load sharing member table corresponding to group B is the segment address of the load sharing member table corresponding to group A plus one.
  • the segment address of the load sharing member table corresponding to the C group is the segment address of the load sharing member table corresponding to the A group plus 2.
  • the content of each load sharing member table is a hash of each link in the group at intervals of 255 (8 bits in binary).
  • FIG. 5 is An alternative embodiment of the invention is a structural diagram of the boundary value of the load sharing strategy table. As shown in FIG. 5, after the groups A, B, and C have been determined, the group A can be obtained by the following equations (4) and (5). In the hash value Boundary_A on the interval of 16 bits in binary, the B group is in the hash value Boundary_B on the interval of 16 bits in binary, and generates a load sharing strategy table by it;
  • Boundary_A (A_W*65535)/(A_W+B_W+C_W) (4)
  • Boundary_B ((A_W+B_W)*65535)/(A_W+B_W+C_W) (5)
  • A_W represents the sum of the interface bandwidths of all the links in the group A
  • B_W represents the sum of the interface bandwidths of all the links in the group B
  • C_W represents the sum of the interface bandwidths of all the links in the group C.
  • FIG. 6 is a flowchart of a method for load sharing according to an alternative embodiment of the present invention. As shown in FIG. 6, the steps of the method include:
  • Step S602 Parsing outbound interface information of each link used for load sharing, and calculating a total interface bandwidth of each link;
  • the information communication mechanism determined by the protocol and the support supports the load-sharing index and the information of each link of the packet used for the load-sharing forwarding according to the receiving protocol, and determines each link used for packet forwarding.
  • Step S604 load sharing the bandwidth of each link interface according to each group of load coefficient ratios, and grouping the grouped flags;
  • the value of the interface bandwidth of each link parsed in step S602 is respectively compared with the coefficients 116, 100, and 93 of the weight proportions of the links having interfaces of different types, according to the remainder operation.
  • the packet to which the link belongs is determined. If the value of the interface bandwidth of the link and the remainder of the remainder operation of 116 are 0, if the link is assigned to the A group, the load sharing flag of the A group is set. If the bit is 1, the same reason is that if the remainder of the link interface bandwidth and the remainder of the remainder operation is 0, the link is divided into the B group, and the load sharing flag of the B group is set to 1.
  • step S608 If the outgoing interface bandwidth is divisible by the factor 116, 100 or 93 of the payload weight, the value of the interface bandwidth of the link is a mixed value, and the flow proceeds to step S606.
  • Step S606 dividing the interface bandwidth of the link into each packet
  • M is the value of the interface bandwidth of the link
  • X is the value of the interface bandwidth allocated by the link to the group A
  • Y is the value of the interface bandwidth allocated by the link to the group B
  • Z represents the value of the interface bandwidth allocated by the link to the C group; proceeding to step S608.
  • Step S608 calculating the number of logical links of each link in the group A, group B, and group C, and the boundary value of each group in the policy table, and storing link information for forwarding in each group;
  • the value of the bandwidth of each physical link interface belonging to the group is divided with the greatest common divisor of the group, and it is determined whether the sum of the interface bandwidths of all the links in the group is greater than 255 (8 bits according to the binary).
  • the interface bandwidth of each link in the group can be summed to determine the number of logical links in the packet, when all links in the packet
  • it can be hashed at 255 according to the following equation (6).
  • Wi represents the interface bandwidth of the i-th link in the group
  • L_Wi represents the value of the interface bandwidth after the hash of the i-th link in the group
  • the values of the interface bandwidths of the hashed links are summed.
  • Step S610 generating a load sharing member table
  • the group corresponding to the load sharing member table to be generated is determined according to the grouping flag in step S604, and then the segment address of the corresponding load sharing member table of the group and the links are negative.
  • the offset address in the load member table When generating the load sharing member table, the following situations occur: A, B, and C respectively represent the three groups of load sharing that are divided, for example, divided into group A, group B, and group C; divided into group A and group B. Group, Group A and Group C, Group B and Group C; only Group A or Group B or Group C.
  • the processing for these cases is as follows: If the group A, group B, and group C are divided, the segment addresses of the load sharing member table corresponding to group B and group C need only be segmented backwards based on the segment address of group A. It can be offset by 1 unit. If it is divided into Group A and Group B, refer to the above, the load sharing member table corresponding to Group A is used as the base address, and the segment address of the load sharing member table corresponding to Group B is offset by 1 unit. If it is divided into Group A and Group C. The information of the load balancing member table of the C group is only required to be offset by the segment address of the load sharing member table of the A group. unit.
  • the segment address of the load sharing member table corresponding to the B group and the C group needs to be increased by one and two units, respectively, and then the load sharing member table is generated. If only the link load balancing in the A group is used, the load sharing index is used as the segment address of the load sharing member table. If only the link load sharing in the B group is used, the segment address of the load sharing member table corresponding to the B group is the corresponding group A. The segment address of the load sharing member table is increased by one unit. If only the link load sharing in the C group is used, the segment address of the load sharing member table corresponding to the C group is increased by two segments of the load sharing member table corresponding to the A group. unit.
  • Step S612 generating a load sharing strategy table
  • step S608 the boundary value of each group in the case of dividing into any number of groups can be calculated, and the calculated boundary is calculated. The value is written to the corresponding field in the load sharing policy table.
  • the interface bandwidth of all the forwarding links in the load sharing is re-grouped according to the interface bandwidth of the link to ensure that the bandwidth value of the link is multiplied by a group, and then respectively grouped.
  • the sum of the interface bandwidths of the respective links in each packet is hashed in a range of 8 bits in binary, and finally the sum of the interface bandwidths of the links in each packet is calculated as a ratio in the range of 16 bits in binary.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • Step S1 determining load ratios between links having interfaces of different types from each other;
  • Step S2 grouping the links for load sharing according to the load ratio to generate a load sharing member table corresponding to each group; wherein the links are all assigned load sharing members corresponding to the group in which they are located The offset address in the table;
  • Step S3 Calculate a boundary value of a packet where each link is located according to a preset rule, to generate a load sharing policy table.
  • Step S4 Perform load sharing on the packets shared by the links according to the load sharing member table and the load sharing policy table.
  • modules or steps of the present application can be implemented by a general computing device, which can be concentrated on a single computing device or distributed in 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 thereof are fabricated as a single integrated circuit module.
  • the application is not limited to any particular combination of hardware and software.
  • each module/unit in the above embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program stored in the memory by a processor. / instruction to achieve its corresponding function.
  • Embodiments of the invention are not limited to any particular form of hardware and The combination of software.
  • determining a load ratio between links having mutually different types of interfaces grouping links for load sharing according to a load ratio to generate a load sharing member table corresponding to each group; And calculating a boundary value of the group in which each link is located according to a preset rule to generate a load sharing policy table; and load-sharing the packets shared by each link according to the load sharing member table and the load sharing policy table;
  • the load ratio the packets used for the load sharing are grouped. Therefore, the load of the transmitted packets can be load-balanced according to the interface bandwidth of the links.
  • the jitter situation is more serious, and the use of the traffic-by-flow policy mode for transmission causes the packets allocated between the links to be unbalanced, thereby reducing the bandwidth utilization problem.

Landscapes

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

Abstract

公开了一种负荷分担的方法及装置,其中,该方法包括:确定分别具有相互不同类型的接口的链路之间的载荷比;根据载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;其中,所述链路均分配有其所在的分组对应的负荷分担成员表中的偏移地址;根据预设规则计算出各链路所在的分组的边界值,以生成负荷分担策略表;依据负荷分担成员表和负荷分担策略表对各个链路分担的报文进行负荷分担。通过上述方案,解决了相关技术中的采用逐包策略模式进行传输导致报文乱序、抖动的情况比较严重,以及采用逐流策略模式进行传输导致在各个链路之间分配的报文不均衡,从而降低带宽利用率的问题。

Description

负荷分担的方法及装置 技术领域
本申请涉及但不限于通信领域,特别是一种负荷分担的方法及装置。
背景技术
负荷分担指的是通过相应策略和方法在在交换机、路由器等网络设备节点上存在的多条链路上进行负载均衡。
负荷分担需要解决这样一个问题:当这些网络节点有多条路径可以转发分组报文时,怎样恰当地选择一条转发路径,从而使该节点的转发性能到达最优或满足一定的转发要求以及怎样将流量合理均衡地分配到各链路上。
相关技术中主要有两种策略模式对网络设备节点进行负荷分担。这两种模式分别为逐流模式和逐包模式。所谓逐流模式,就是通过该路由器转发的所有报文按照目的IP或者五元组(包括源IP地址,源端口,目的IP地址,目的端口和传输层协议)选择链路以进行转发的方式;所谓逐包模式,就是通过该路由器转发的所有报文随机选择负荷分担成员表中的一条链路转发的方式。
如果负荷分担按照逐流模式进行选路,可以最大程度地避免例如分组报文乱序、抖动等,这是因为报文的内容和选路的结果是相关的,使得发往同一目的IP的报文,其选路的结果是相同的,但由于该模式的选路跟报文内容相关,转发节点的转发链路的带宽和其承载的报文负荷不一定匹配,这样会导致有些路径拥塞,而有些路径空闲,从而不能有效使用带宽。
而如果负荷分担按照逐包模式进行选路,虽然可以比较好的使转发链路的带宽和其承载的报文负荷匹配,但由于报文内容与该模式选路结果无关,这样会导致发往同一目的IP的报文可能会被分配到不同的转发路径上,使得该组报文乱序、抖动比较严重,如果某一条转发路径的链路中的节点出现故障而丢包,该报文就不完整。
针对相关技术中的采用逐包模式导致报文乱序、抖动比较严重,以及采 用逐流模式导致有些路径拥塞,而有些路径空闲,从而不能有效使用带宽的问题,目前尚未存在有效的解决方案。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本申请提供了一种负荷分担的方法及装置,以至少解决相关技术中的采用逐包策略模式导致报文乱序、抖动的情况比较严重,以及采用逐流策略模式导致有些路径拥塞,而有些路径空闲,从而不能保证带宽利用率问题。
根据本申请的一个方面,提供了一种负荷分担的方法,包括:确定分别具有相互不同类型的接口的链路之间的载荷比;
根据所述载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;其中,所述链路均分配有其所在的分组对应的所述负荷分担成员表中的偏移地址;
根据预设规则计算出所述各链路所在的分组的边界值,以生成负荷分担策略表;
依据所述负荷分担成员表和所述负荷分担策略表对各个链路分担的报文进行负荷分担。
可选地,其中,所述确定分别具有相互不同类型的接口的链路之间的载荷比的步骤包括:确定所述分别具有相互不同类型的接口的链路分担的报文的数量;将分别具有相互不同类型的接口的链路分担的报文的数量之间的比值作为所述载荷比,其中,所述载荷比与所述分别具有相互不同类型的接口的链路之间的接口带宽的比值对应。
可选地,所述根据所述载荷比,对用于负荷分担的链路进行分组的步骤包括:将所述接口带宽的值分别与所述载荷比中的各个值进行取余运算;若进行取余运算的余数为零,则将所述链路分到与该链路的所述接口的带宽的值进行取余运算的所述载荷比中的值对应的分组。
可选地,在所述根据所述载荷比,对用于负荷分担的链路进行分组的步 骤之后,所述方法还包括:对所述各链路所在的分组对应的负荷分担成员表进行排序;为所排序的负荷分担成员表分配段地址,其中,分配给所排序的第一个负荷分担成员表的段地址为基础分担索引,所述基础分担索引来自于前缀表;其中,分配给所述多个负荷分担成员表之一者的段地址,是将该所述负荷分担成员表的所排序的前一个的负荷分担成员表的段地址加一。
可选地,所述预设规则为:Boundary_K-1=((1_W+…+K-1_W)*65535)/(1_W+……+N_W);其中,N为所述分组的数量,Boundary_K-1为所述分组中第K-1个分组在按照二进制为16bit的区间上的边界值,1_W为第一个分组中所有链路的接口带宽之和,K、N均为正整数。
本申请另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。
根据本申请的另一个方面,提供了一种负荷分担的装置,包括:第一处理模块,设置成确定分别具有相互不同类型的接口的链路之间的载荷比;第二处理模块,设置成根据所述载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;其中,所述链路均分配有其所在的分组对应的所述负荷分担成员表中的偏移地址;写入模块,设置成根据预设规则计算出所述各链路所在的分组的边界值,以生成负荷分担策略表;执行模块,设置成依据所述负荷分担成员表和所述负荷分担策略表对各个链路分担的报文进行负荷分担。
可选地,所述第一处理模块包括:第一获取单元,设置成确定所述分别具有相互不同类型的接口的链路分担的报文的数量;比较单元,设置成将分别具有相互不同类型的接口的链路分担的报文的数量之间的比值作为所述载荷比,其中,所述载荷比与所述分别具有相互不同类型的接口的链路之间的接口的带宽的比值对应。
可选地,所述第二处理模块包括:取余单元,设置成将所述接口带宽的值分别与所述载荷比中的各个值进行取余运算;划分单元,设置成若进行取余运算的余数为零,则将所述链路分到与该链路的所述接口的带宽的值进行取余运算的所述载荷比中的值对应的分组。
可选地,所述装置还包括段地址分配模块,在所述第二处理模块根据所 述载荷比,对用于负荷分担的链路进行分组之后,所述段地址分配模块设置成对所述各链路所在的分组对应的负荷分担成员表进行排序;为所排序的负荷分担成员表分配段地址,其中,分配给所排序的第一个负荷分担成员表的段地址为基础分担索引,所述基础分担索引来自于前缀表;其中,分配给所述多个负荷分担成员表之一者的段地址,是将该所述负荷分担成员表的所排序的前一个负荷分担成员表的段地址加一。
可选地,所述预设规则为:Boundary_K-1=((1_W+…+K-1_W)*65535)/(1_W+……+N_W);其中,N为所述分组的数量,Boundary_K-1为所述分组中第K-1个分组在按照二进制为16bit的区间上的边界值,1_W为第一个分组中所有链路的接口带宽之和,K、N均为正整数。
在本申请中,确定分别具有相互不同类型的接口的链路之间的载荷比;根据载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;并根据预设规则计算出各链路所在的分组的边界值,以生成负荷分担策略表;依据所述负荷分担成员表和负荷分担策略表对各个链路分担的报文进行负荷分担;由于是根据载荷比,对链路进行分组,因此可以根据这些链路的接口带宽对传输的报文进行负荷分担,解决了相关技术中的采用逐包策略模式进行传输导致报文乱序、抖动的情况比较严重,以及采用逐流策略模式进行传输导致在各个链路之间分配的报文不均衡,从而降低带宽利用率的问题。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1是根据本发明实施例的负荷分担的方法的流程图;
图2是根据本发明实施例的负荷分担的装置的结构框图;
图3是根据本发明可选实施例的将用于负荷分担的链路分成三组的步骤 的示意图;
图4是根据本发明可选实施例的各组用于负荷分担的链路的分组的示意图;
图5是根据本发明可选实施例的为负荷分担策略表的边界值的结构示意图;
图6是根据本发明可选实施例的负荷分担的方法的流程图。
本发明的较佳实施方式
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
在本实施例中提供了一种负荷分担的方法,图1是根据本发明实施例的负荷分担的方法的流程图,如图1所示,该方法包括如下步骤:
步骤S102:确定分别具有相互不同类型的接口的链路之间的载荷比;
步骤S104:根据载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;其中,所述链路均分配有其所在的分组对应的负荷分担成员表中的偏移地址;
步骤S106:根据预设规则计算出各链路所在的分组的边界值,以生成负荷分担策略表;
步骤S108:依据所述负荷分担成员表和负荷分担策略表对各个链路分担的报文进行负荷分担。
通过上述步骤S102至步骤S108,确定分别具有相互不同类型的接口的链路之间的载荷比;根据载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;并根据预设规则计算出各链路所在的分组的边界值,以生成负荷分担策略表;依据所述负荷分担成员表和负荷分担策略表对各个链路分担的报文进行负荷分担;在本实施例中,由于是根据载 荷比,对用于负荷分担的链路进行分组,可以根据这些链路的接口带宽来对传输的报文进行负荷分担,达到充分利用各转发链路的带宽,均衡地分担的目的,进而解决了相关技术中的采用逐包策略模式导致报文乱序、抖动的情况比较严重,以及采用逐流策略模式进行传输导致各个链路之间分配的报文不均衡,从而降低带宽利用率的问题。
可选地,对于上述步骤S102中的确定分别具有相互不同类型的接口的链路之间的载荷比,可以通过如下方式来实现:
步骤S102-1:确定分别具有相互不同类型的接口的链路分担的报文的数量;
步骤S102-2:将分别具有相互不同类型的接口的链路分担的报文的数量之间的比值作为载荷比,其中,载荷比与分别具有相互不同类型的接口的链路之间的接口带宽的比值对应。
对于上述步骤S102-1和步骤S102-2,在本实施例的应用场景中可以是:例如,以L、W、P分别表示10G LAN、10G WAN、10G POS192的分担报文数,对于40G和100G的LAN,就是4倍和10倍的比例,根据以下公式:
L=(10.3125*(64/66))/(IP长度+38)
W=(9.95328*(64/66)*(26/27))/(IP长度+38)
P=(9.95328*(26/27))/(IP长度+9)
其中64/66表示PHY上传输时的64/66编码,即传输长度为64bit的数据需要66bit的空间;26/27表示SDH封装时,除去管理帧后的利用率;10.3125、9.95328分别是LAN和SDH的线路速率常数。其中L与W的比值与IP地址的长度无关,L与W的比值与IP地址的长度有关,取IP地址的长度为二进制的128Byte,则分别具有三种不同接口的链路在IP地址的长度为128Byte的分担比值(即载荷比)大约为:L:W:P=100:93:116。
可选地,对于本实施例步骤S104中的根据载荷比,对用于负荷分担的链路进行分组,可以通过如下方式来实现:
步骤S102-4:将接口带宽的值分别与载荷比中的各个值进行取余运算;
步骤S102-5:若进行取余运算的余数为零,则将所述链路分到与该链路的接口的带宽的值进行取余运算的所述载荷比中的值对应的分组。
基于上述具体应用场景,对于步骤S102-3至步骤S102-5,可以是:将用于负荷分担的各个链路根据接口的带宽划分为A、B、C三组,其中A组中的各链路的接口带宽的值为116的倍数,B组中的各链路的接口带宽的值为100的倍数,C组中的各链路的接口带宽的值为93的倍数。
可选地,本实施例步骤S104中的在述根据所述载荷比,对用于负荷分担的链路进行分组的步骤之后,所述方法还包括:
步骤S105-1:对各链路所在的分组对应的负荷分担成员表进行排序;
步骤S105-2:为所排序的负荷分担成员表分配段地址,其中,分配给所排序的第一个负荷分担成员表的段地址为基础分担索引,基础分担索引来自于前缀表;其中,分配给多个负荷分担成员表之一者的段地址,是将该所述负荷分担成员表的所排序的前一个负荷分担成员表的段地址加一。
对于步骤S105-1至步骤S105-2,在具体应用场景可以是:在确定了用于负荷分担的各个链路分属A、B、C三组后,即可确定分属这三组的各个链路在生成的负荷分担成员表中的偏移地址,其中,A组的负荷分担成员表的段地址为负荷分担索引(该索引从路由表、标签表等前缀表中获取),B组的负荷分担成员表的段地址为A组的负荷分担成员表的段地址加1,C组的负荷分担成员表的段地址为A组的负荷分担成员表的段地址加2。每个负荷分担成员表的内容为该组中各个链路在255(按照二进制为8bit)的区间上的散列。
可选地,该预设规则为:Boundary_K-1=((1_W+…+K-1_W)*65535)/(1_W+……+N_W);其中,N为所述分组的数量,Boundary_K-1为分组中第K-1个分组在按照二进制为16bit的区间上的边界值,1_W为第一个分组中所有链路的接口带宽之和,K、N均为正整数。
具体应用场景可以是:在已确定各个链路分属A、B、C组后,通过如下计算可以得到A组在按照二进制为16bit的区间上的散列值Boundary_A,B组在按照二进制为16bit的区间上的散列值Boundary_B,将其写入负荷分担策略表。其中A_W表示A组中的所有链路的接口带宽之和,B_W表示B组 中的所有链路的接口带宽之和,C_W表示C组中的所有链路的接口带宽之和。
Boundary_A=(A_W*65535)/(A_W+B_W+C_W);
Boundary_B=((A_W+B_W)*65535)/(A_W+B_W+C_W)。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
本发明实施例另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。
在本实施例中还提供了一种负荷分担的装置,该装置实现上述实施例,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图2是根据本发明实施例的负荷分担的装置的结构框图,如图2所示,该装置包括:第一处理模块22,设置成确定分别具有相互不同类型的接口的链路之间的载荷比;第二处理模块24,与第一处理模块22耦合连接,设置成根据载荷比,对用于负荷分担的链路进行分组以生成与每个分组对应的负荷分担成员表;其中,所述链路均分配有其所在的分组对应的负荷分担成员表中的偏移地址;写入模块26,与第二处理模块24耦合连接,设置成根据预设规则计算出各链路所在的分组的边界值,以生成负荷分担策略表;执行模块28,与写入模块26耦合连接,设置成依据所述负荷分担成员表和负荷分担策略表对各个链路分担的报文进行负荷分担。
可选地,该第一处理模块22包括:第一获取单元,设置成确定分别具有相互不同类型的接口的链路分担的报文的数量;比较单元,设置成将分别具有相互不同类型的接口的链路分担的报文的数量之间的比值作为载荷比,其 中,载荷比与分别具有相互不同类型的接口的链路之间的接口的带宽的比值对应。
可选地,第二处理模块24包括:取余单元,设置成将接口带宽的值分别与载荷比中的各个值进行取余运算;划分单元,设置成若进行取余运算的余数为零,则将所述链路分到与该链路的接口的带宽的值进行取余运算的所述载荷比中的值对应的分组。
可选地,所述装置还包括段地址分配模块23,在第二处理模块24根据所述载荷比,对用于负荷分担的链路进行分组之后,段地址分配模块23设置成对各链路所在的分组对应的负荷分担成员表进行排序;为所排序的负荷分担成员表分配段地址,其中,分配给所排序的第一个负荷分担成员表的段地址为基础分担索引,基础分担索引来自于前缀表,所述前缀表可以是路由表、标签表等;其中,分配给多个负荷分担成员表之一者的段地址,是将该所述负荷分担成员表的所排序的前一个负荷分担成员表的段地址加一。
可选地,预设规则为:Boundary_K-1=((1_W+…+K-1_W)*65535)/(1_W+……+K_W);其中,N为所述分组的数量,Boundary_K-1为分组中第K-1个分组在按照二进制为16bit的区间上的边界值,1_W为第一个分组中所有链路的接口带宽之和,K、N均为正整数。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。
下面结合本申请的可选实施例对本申请进行举例说明;
本可选实施例提供了一种负荷分担的方法,该方法的概述为:确定分别具有相互不同类型的接口的链路之间的载荷比;根据该载荷比,对用于负荷分担的各条链路的进行分组,以生成与每个分组对应的负荷分担成员表,计算出各分组的边界值,以生成负荷分担策略表;对报文进行负荷分担。
对于本可选实施例中的确定分别具有相互不同类型的接口的链路之间的载荷比的步骤,在本可选实施例中实现为:图3是根据本发明可选实施例的将用于负荷分担的链路分成三组的步骤的示意图,如图3所示,根据载荷比对用于负荷分担的各条链路进行分组,例如,以L、W、P分别表示10G LAN、 10G WAN、10G POS192的分担报文数,对于40G和100G的LAN,就是4倍和10倍的比例,根据以下公式:
L=(10.3125*(64/66))/(IP长度+38)        (1)
W=(9.95328*(64/66)*(26/27))/(IP长度+38)     (2)
P=(9.95328*(26/27))/(IP长度+9)          (3)
在上述(1)(2)(3)中64/66表示物理层PHY上传输时的64/66编码,即传输长度为64bit的数据需要66bit的承载空间;26/27表示同步数字体系(Synchronous Digital Hierarchy,简称为SDH)封装时,除去管理帧后的利用率;10.3125、9.95328分别是局域网LAN和SDH的线路速率常数;其中,L与W的比值与IP地址的长度无关,L与W的比值与IP地址的长度有关,图4是根据本发明可选实施例的各组用于负荷分担的链路的分组的示意图,如图4所示,取IP地址的长度为二进制的128Byte,则分别具有三种不同接口的链路在IP地址的长度为二进制的128Byte的分担比值大约为:L:W:P=100:93:116。根据前述已求得的用于负荷分担的、分别具有相互不同类型的接口的各个链路之间的载荷比,将用于负荷分担的各个链路根据载荷比划分为A、B、C三组,其中A组中的各链路的接口带宽的值为116的倍数,B组中的各链路的接口带宽的值为100的倍数,C组中的各链路的接口带宽的值为93的倍数。
而对于本可选实施例中的对各链路所在的分组对应的负荷分担成员表进行排序,为所排序的负荷分担成员表分配段地址的步骤,可以通过如下来实现:在确定了用于负荷分担的各个链路分属A、B、C三组后,即可确定分属这三组的各个链路在生成的负荷分担成员表中的偏移地址,其中,A组对应的负荷分担成员表的段地址为负荷分担索引(该索引从路由表、标签表等前缀表中获取),B组对应的负荷分担成员表的段地址为A组对应的负荷分担成员表的段地址加1,C组对应的负荷分担成员表的段地址为A组对应的负荷分担成员表的段地址加2。每个负荷分担成员表的内容为该组中各个链路在255(按照二进制为8bit)的区间上的散列。
可选地,对于本可选实施例中的根据预设规则计算出各链路所在的分组的边界值,以生成负荷分担策略表的步骤,可以如下来实现:图5是根据本 发明可选实施例的为负荷分担策略表的边界值的结构示意图,如图5所示,在已确定A、B、C组后,通过如下(4)和(5)方程式计算可以得到A组在按照二进制为16bit的区间上的散列值Boundary_A,B组在按照二进制为16bit的区间上的散列值Boundary_B,并以其生成负荷分担策略表;
Boundary_A=(A_W*65535)/(A_W+B_W+C_W)        (4)
Boundary_B=((A_W+B_W)*65535)/(A_W+B_W+C_W)      (5)
其中,A_W表示A组中的所有链路的接口带宽之和,B_W表示B组中的所有链路的接口带宽之和,C_W表示C组中的所有链路的接口带宽之和。
下面通过附图及具体实施例对本发明可选实施例再做进一步的详细说明;
图6是根据本发明可选实施例的负荷分担的方法的流程图,如图6所示,该方法的步骤包括:
步骤S602:解析用于负荷分担的各个链路的出接口信息,计算各个链路的接口带宽总和;
其中,通过协议与支撑所确定的消息通讯机制,支撑根据接收协议所下发的负荷分担索引以及用于负荷分担转发的报文的各个链路的信息,确定用于报文转发的各个链路的接口带宽的值并计算各链路的接口的带宽的值总和。
步骤S604,负荷分担各链路接口带宽根据各组载荷系数比进行分组计算,并将所分组标记置位;
其中,首先将根据步骤S602中解析出的各链路的接口带宽的值分别与具有相互不同类型的接口的链路的载荷比重的系数116、100、93进行取余运算,根据取余运算的余数,判定该链路所属的分组,如果该链路的接口带宽的值与116进行取余运算的余数为0,则如果将该链路分到A组,并将A组的负荷分担标记置位为1,同理如果将该链路接口带宽的值与100进行取余运算的余数为0,则将该链路分到B组,并将B组的负荷分担标记位置1。如果将该链路接口带宽的值与93进行取余运算的余数为0,则将该链路分到C组,并将C组的负荷分担标记位置1;然后,进行到步骤S608;如果解析出来的接口带宽既不能被载荷比重的系数116、100或93整除,则该链路的接口带宽的值是混合值,进行到步骤S606。
步骤S606,将链路的接口带宽分至各个分组;
其中,针对于这种链路,则通过计算混合带宽模型的函数M=116X+100Y+93Z,将链路的接口带宽的值分解到A、B、C三组中的某一组或某两组或三组中;其中,M表示链路的接口带宽的值,X表示该链路分配到A组中的接口带宽的值,Y表示该链路分配到B组中的接口带宽的值,Z表示该链路分配到C组中的接口带宽的值;进行到步骤S608。
步骤S608,分别计算A组、B组、C组中各个链路的逻辑链路数以及各个分组在策略表中的边界值,存储各分组中用于转发的链路信息;
其中,首先,根据分别在A组、B组、C组中的链路的接口带宽的总和,通过上述方程式(4)、(5)计算出A组和B组的边界值,如果只分成一个分组,则Boundary_A=Boundary_B=65535,如果分成两个分组,通过方程式(4)计算出其中一组的边界值Boundary_A,则Boundary_B=65535,如果分成了三个分组,则根据方程式(4)、(5)计算各个分组的边界值。对于每个分组,在其分组中提取各个负荷分担链路的接口带宽的值的最大公约数;
然后,将属于该组的每个物理链路接口带宽的值与该组的最大公约数进行除法运算,判断该组中所有链路的接口带宽之和是否大于255(按照二进制为8bit),当该分组中所有链路的接口带宽之和小于或等于255时,可以通过对该组中各个链路的接口带宽求和,以确定该分组中的逻辑链路数,当该分组中所有链路的接口带宽之和大于255时,可以按照如下方程式(6)在255上散列,
L_Wi=(Wi*255)/(W1+…+Wn)         (6)
其中,Wi表示该组中第i条链路的接口带宽,L_Wi表示该组中第i条链路散列后的接口带宽的值,将散列后的各链路的接口带宽的值求和,以确定该分组的的逻辑链路的数量。并存储该分组中的实际用于转发报文的链路的数目和转发信息。
步骤S610,生成负荷分担成员表;
其中,根据步骤S604中的分组标记来判断所要生成的负荷分担成员表所对应的分组,进而确定该组对应负荷分担成员表的段地址以及各链路在负 荷分担成员表中的偏移地址。在生成负荷分担成员表时,会出现以下情况,以A、B、C分别表示所分出的三组负荷分担为例,如分成了A组、B组和C组;分成了A组和B组、A组和C组、B组和C组;仅有A组或B组或C组。
针对这几种情况的处理如下:如果分成了A组、B组和C组,那么B组和C组对应的负荷分担成员表的段地址只需以A组的段地址为基址依次向后偏移1个单位即可。如果分成了A组和B组,参照前述,以A组对应的负荷分担成员表为基址,B组对应的负荷分担成员表的段地址偏移1个单位,如果分成了A组和C组,将C组的所有用于转发报文的信息填充到B组的所在的位置,C组的负荷分担成员表的段地址只需在A组对应的负荷分担成员表的段地址偏移1个单位。如果分成了B组和C组,按照上述方式,需要将B组和C组对应的负荷分担成员表的段地址分别增加1个和2个单位,然后生成负荷分担成员表。如果只有A组中的链路负荷分担,利用负荷分担索引作为负荷分担成员表的段地址,如果只有B组中的链路负荷分担,B组对应的负荷分担成员表的段地址为A组对应的负荷分担成员表的段地址增加1个单位,如果只有C组中的链路负荷分担,C组对应的负荷分担成员表的段地址为A组对应的负荷分担成员表的段地址增加2个单位。
步骤S612,生成负荷分担策略表;
其中,根据用于负荷分担的链路所在的分组的数量,按照步骤S608所述的计算方法,可以计算出在分成任何数量的分组的情况下,各组的边界值,并将计算后的边界值写入负荷分担策略表中的相应字段。
通过本可选实施例,按照链路的接口带宽对负荷分担中的所有转发链路的接口带宽进行重新分组以保证链路的带宽值成倍数关系的为一组,然后再分别对已经分组的各个分组中各个链路的接口带宽总和进行按照二进制为8bit的范围中的散列,最后再计算出各个分组中各个链路的接口带宽的总和在按照二进制为16bit的范围中所占的比例,通过两次计算,可以充分利用各用于转发报文的链路的带宽,保证在各个链路之间分配的报文均衡。
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:
步骤S1:确定分别具有相互不同类型的接口的链路之间的载荷比;
步骤S2:并根据载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;其中,所述链路均分配有其所在的分组对应的负荷分担成员表中的偏移地址;
步骤S3:根据预设规则计算处各链路所在的分组的边界值,以生成负荷分担策略表;
步骤S4:依据所述负荷分担成员表和负荷分担策略表对各个链路分担的报文进行负荷分担。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的可选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本发明实施例不限制于任何特定形式的硬件和 软件的结合。
工业实用性
在本申请中,确定分别具有相互不同类型的接口的链路之间的载荷比;根据载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;并根据预设规则计算出各链路所在的分组的边界值,以生成负荷分担策略表;依据所述负荷分担成员表和负荷分担策略表对各个链路分担的报文进行负荷分担;由于是根据载荷比,对用于负荷分担的链路进行分组,因此可以根据这些链路的接口带宽对传输的报文进行负荷分担,解决了相关技术中的采用逐包策略模式导致报文乱序、抖动的情况比较严重,以及采用逐流策略模式进行传输导致在各个链路之间分配的报文不均衡,从而降低带宽利用率的问题。

Claims (10)

  1. 一种负荷分担的方法,包括:
    确定分别具有相互不同类型的接口的链路之间的载荷比;
    根据所述载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;其中,所述链路均分配有其所在的分组对应的所述负荷分担成员表中的偏移地址;
    根据预设规则计算出所述各链路所在的分组的边界值,以生成负荷分担策略表;
    依据所述负荷分担成员表和所述负荷分担策略表对各个链路分担的报文进行负荷分担。
  2. 根据权利要求1所述的方法,其中,所述确定分别具有相互不同类型的接口的链路之间的载荷比的步骤包括:
    确定所述分别具有相互不同类型的接口的链路分担的报文的数量;
    将分别具有相互不同类型的接口的链路分担的报文的数量之间的比值作为所述载荷比,其中,所述载荷比与所述分别具有相互不同类型的接口的链路之间的接口带宽的比值对应。
  3. 根据权利要求2所述的方法,其中,所述根据所述载荷比,对用于负荷分担的链路进行分组的步骤包括:
    将所述接口带宽的值分别与所述载荷比中的各个值进行取余运算;
    若进行取余运算的余数为零,则将所述链路分到与该链路的所述接口的带宽的值进行取余运算的所述载荷比中的值对应的分组。
  4. 根据权利要求1所述的方法,其中,在所述根据所述载荷比,对用于负荷分担的链路进行分组的步骤之后,所述方法还包括:
    对各链路所在的分组对应的负荷分担成员表进行排序;
    为所排序的负荷分担成员表分配段地址,其中,分配给所排序的第一个负荷分担成员表的段地址为基础分担索引,所述基础分担索引来自于前缀表;
    其中,分配给所述多个负荷分担成员表之一者的段地址,是将该所述负 荷分担成员表的所排序的前一个负荷分担成员表的段地址加一。
  5. 根据权利要求1所述的方法,其中,所述预设规则为:
    Boundary_K-1=((1_W+…+K-1_W)*65535)/(1_W+……+N_W);其中,N为所述分组的数量,Boundary_K-1为所述分组中第K-1个分组在按照二进制为16bit的区间上的边界值,1_W为第一个分组中所有链路的接口带宽之和,K、N均为正整数。
  6. 一种负荷分担的装置,包括:
    第一处理模块,设置成确定分别具有相互不同类型的接口的链路之间的载荷比;
    第二处理模块,设置成根据所述载荷比,对用于负荷分担的链路进行分组,以生成与每个分组对应的负荷分担成员表;其中,所述链路均分配有其所在的分组对应的所述负荷分担成员表中的偏移地址;
    写入模块,设置成根据预设规则计算出所述各链路所在的分组的边界值,以生成负荷分担策略表;
    执行模块,设置成依据所述负荷分担成员表和所述负荷分担策略表对各个链路分担的报文进行负荷分担。
  7. 根据权利要求6所述的装置,其中,所述第一处理模块包括:
    第一获取单元,设置成确定所述分别具有相互不同类型的接口的链路分担的报文的数量;
    比较单元,设置成将分别具有相互不同类型的接口的链路分担的报文的数量之间的比值作为所述载荷比,其中,所述载荷比与所述分别具有相互不同类型的接口的链路之间的接口的带宽的比值对应。
  8. 根据权利要求7所述的装置,其中,所述第二处理模块包括:
    取余单元,设置成将所述接口带宽的值分别与所述载荷比中的各个值进行取余运算;
    划分单元,设置成若进行取余运算的余数为零,则将所述链路分到与该链路的所述接口的带宽的值进行取余运算的所述载荷比中的值对应的分组。
  9. 根据权利要求6所述的装置,所述装置还包括段地址分配模块,在所述第二处理模块根据所述载荷比,对用于负荷分担的链路进行分组之后,所述段地址分配模块设置成对所述各链路所在的分组对应的负荷分担成员表进行排序;
    为所排序的负荷分担成员表分配段地址,其中,分配给所排序的第一个负荷分担成员表的段地址为基础分担索引,所述基础分担索引来自于前缀表;
    其中,分配给所述多个负荷分担成员表之一者的段地址,是将该所述负荷分担成员表的所排序的前一个负荷分担成员表的段地址加上一。
  10. 根据权利要求6所述的装置,其中,所述预设规则为:
    Boundary_K-1=((1_W+…+K-1_W)*65535)/(1_W+……+K_W);
    其中,N为所述分组的数量,Boundary_K-1为所述分组中第K-1个分组在按照二进制为16bit的区间上的边界值,1_W为第一个分组中所有链路的接口带宽之和,K、N均为正整数。
PCT/CN2016/083932 2016-01-04 2016-05-30 负荷分担的方法及装置 WO2017117908A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610006432.2A CN106941455A (zh) 2016-01-04 2016-01-04 均衡负荷分担的方法及装置
CN201610006432.2 2016-01-04

Publications (1)

Publication Number Publication Date
WO2017117908A1 true WO2017117908A1 (zh) 2017-07-13

Family

ID=59273142

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/083932 WO2017117908A1 (zh) 2016-01-04 2016-05-30 负荷分担的方法及装置

Country Status (2)

Country Link
CN (1) CN106941455A (zh)
WO (1) WO2017117908A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110138675A (zh) * 2019-05-30 2019-08-16 新华三信息安全技术有限公司 一种数据流量转发方法、装置、网板及分布式设备
CN113660160A (zh) * 2021-08-20 2021-11-16 烽火通信科技股份有限公司 一种ucmp负载分担的方法和装置
CN114039979A (zh) * 2021-11-22 2022-02-11 华平智慧信息技术(深圳)有限公司 一种链路聚合中负载均衡的方法、装置、设备及存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109600321B (zh) * 2017-09-30 2022-06-21 迈普通信技术股份有限公司 报文转发方法及装置
CN109450807B (zh) * 2018-11-28 2022-02-22 迈普通信技术股份有限公司 一种接口选择方法及通信设备
CN110798400B (zh) * 2019-10-23 2022-02-11 新华三信息安全技术有限公司 报文转发方法及装置
CN113316192B (zh) * 2021-05-18 2022-12-02 西安电子科技大学 基于链路设置的多链路调度策略
CN113630319B (zh) * 2021-06-28 2022-08-19 济南浪潮数据技术有限公司 一种数据分流方法、装置及相关设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094185A (zh) * 2007-07-27 2007-12-26 杭州华三通信技术有限公司 基于多链路的报文转发方法和装置
CN101119313A (zh) * 2007-09-14 2008-02-06 杭州华三通信技术有限公司 一种负载分担方法和设备
US20100149979A1 (en) * 2008-12-11 2010-06-17 International Business Machines Corporation System and method for implementing adaptive load sharing to balance network traffic
CN102447636A (zh) * 2012-01-06 2012-05-09 中兴通讯股份有限公司 一种数据中心通讯设备的负载分担方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094185A (zh) * 2007-07-27 2007-12-26 杭州华三通信技术有限公司 基于多链路的报文转发方法和装置
CN101119313A (zh) * 2007-09-14 2008-02-06 杭州华三通信技术有限公司 一种负载分担方法和设备
US20100149979A1 (en) * 2008-12-11 2010-06-17 International Business Machines Corporation System and method for implementing adaptive load sharing to balance network traffic
CN102447636A (zh) * 2012-01-06 2012-05-09 中兴通讯股份有限公司 一种数据中心通讯设备的负载分担方法和装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110138675A (zh) * 2019-05-30 2019-08-16 新华三信息安全技术有限公司 一种数据流量转发方法、装置、网板及分布式设备
CN110138675B (zh) * 2019-05-30 2022-04-22 新华三信息安全技术有限公司 一种数据流量转发方法、装置、网板及分布式设备
CN113660160A (zh) * 2021-08-20 2021-11-16 烽火通信科技股份有限公司 一种ucmp负载分担的方法和装置
CN113660160B (zh) * 2021-08-20 2023-04-28 烽火通信科技股份有限公司 一种ucmp负载分担的方法和装置
CN114039979A (zh) * 2021-11-22 2022-02-11 华平智慧信息技术(深圳)有限公司 一种链路聚合中负载均衡的方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN106941455A (zh) 2017-07-11

Similar Documents

Publication Publication Date Title
WO2017117908A1 (zh) 负荷分担的方法及装置
US10735323B2 (en) Service traffic allocation method and apparatus
US9166805B1 (en) Scalable IP-services enabled multicast forwarding with efficient resource utilization
CN102763380B (zh) 用于路由分组的系统和方法
US20160197812A1 (en) Network status mapping
CN103155500A (zh) 用于网络业务流的无状态负载平衡的方法、系统和计算机可读介质
US20090190580A1 (en) Method and apparatus for Link aggregation using links having different link speeds
WO2017190559A1 (zh) 路由查找方法、装置、分配节点、查找节点及入口节点
WO2011095017A1 (zh) 一种实现负荷分担的方法和路由设备
WO2021027434A1 (zh) 一种业务传输的方法、装置和系统
WO2023011153A1 (zh) 负载均衡的哈希算法信息的确定方法、装置及存储介质
CN111464443A (zh) 基于服务功能链的报文转发方法、装置、设备及存储介质
WO2015039616A1 (zh) 一种报文处理方法及设备
CN113890855A (zh) 一种报文转发方法、系统、设备以及介质
US11240164B2 (en) Method for obtaining path information of data packet and device
US10243838B1 (en) Interleaving members for proportionate network traffic distribution
Bwalya et al. Performance evaluation of buffer size for access networks in first generation optical networks
CN113595919A (zh) 一种负载分担的方法及装置
US11444875B2 (en) Per-packet load-balancing over multiple network paths
US8660127B2 (en) Cascaded load balancing
CN111224884A (zh) 拥塞控制的处理方法、报文转发装置及报文接收装置
Chung et al. A fast and updatable IP address lookup scheme
WO2022127154A1 (zh) 一种路由通告的方法及设备
WO2022242661A1 (zh) 通信处理方法及相关设备
CN113824781A (zh) 一种数据中心网络源路由方法与装置

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: 16883049

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: 16883049

Country of ref document: EP

Kind code of ref document: A1