WO2014023098A1 - 一种负载分担方法和流量转发设备 - Google Patents

一种负载分担方法和流量转发设备 Download PDF

Info

Publication number
WO2014023098A1
WO2014023098A1 PCT/CN2013/072378 CN2013072378W WO2014023098A1 WO 2014023098 A1 WO2014023098 A1 WO 2014023098A1 CN 2013072378 W CN2013072378 W CN 2013072378W WO 2014023098 A1 WO2014023098 A1 WO 2014023098A1
Authority
WO
WIPO (PCT)
Prior art keywords
outbound interface
load
traffic
state
threshold
Prior art date
Application number
PCT/CN2013/072378
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 WO2014023098A1 publication Critical patent/WO2014023098A1/zh

Links

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

  • a load sharing method and a traffic forwarding device A load sharing method and a traffic forwarding device.
  • the present application claims priority to a Chinese patent application filed on August 07, 2012 by the Chinese Patent Office, Application No. 201210278736.6, entitled “A Load Sharing Method and Traffic Forwarding Device” The entire contents of which are incorporated herein by reference.
  • the present invention relates to the field of communications, and in particular, to a load sharing method and a traffic forwarding device. Background technique
  • Load Balance also known as Load Balancing
  • Load Balancing can expand the bandwidth of the network, increase the throughput of the network, enhance the data processing capability, and improve the availability of the network without changing the existing network structure.
  • the current load sharing is usually based on the flow-by-flow load balancing. This ensures the order of receiving packets and ensures normal service functions.
  • the existing flow-by-flow load sharing scheme generally uses a fixed hash (HASH) algorithm for one load sharing calculation. For example, suppose that there are 7 traffic (M1 M7) packets to be forwarded.
  • the flow parameters of M1 M7 are: 101, 103, 105, 106, 108, 110, 111.
  • the traffic sizes of M1 to M7 are: 50M. 300M, 50M, 50M, 50M, 200M, 50M.
  • the flow parameter is a characteristic value of the traffic, and may be a quintuple according to a network protocol (Internet Protocol, IP) (source IP address, destination IP address, source port number, destination port number, and protocol number), or according to IP binary
  • IP Internet Protocol
  • the group source IP address, destination IP address
  • the forwarding device has five outbound interfaces (A ⁇ E).
  • the outbound interface list is shown in Table 1 below.
  • the HASH values corresponding to the outgoing interfaces A ⁇ E are: 0, 1, 2, 3, 4.
  • the module since there are 5 entries in the outbound interface list, the module takes 5, and the stream parameters of M1-M7 are sequentially divided by 5, and the remainder is the HASH value of the traffic, so the HSAH values of M1 ⁇ M7 are in turn For: 1, 3, 0, 1, 3, 0, 1.
  • the HASH value index is searched in the outbound interface list. You can determine that the outgoing interfaces of M1 ⁇ M7 are: B, D, A, B, D, A, B, as shown in Table 2:
  • the traffic on the outbound interface A is the sum of the traffic of M3 and M6, which is 250 M.
  • the traffic on the outbound interface B is the sum of the flows of M1, M4, and M7. 150M;
  • the traffic on the outbound interface C is 0;
  • the traffic on the outgoing interface D is the sum of the traffic of M2 and M5, which is 350M;
  • the traffic on the outgoing interface E is 0.
  • the forwarding device can make adjustments when it forwards the packets of traffic M1 ⁇ M7 for the next time. For example, although the number of outgoing interfaces of the forwarding device is fixed, the number of entries in the outgoing interface list of the forwarding device can be adjusted.
  • the outbound interfaces C and E are simulated as new outbound interface entries and added to the outbound interface list.
  • the adjusted outbound interface list is shown in Table 3 below:
  • the traffic of the outgoing interface A is M3, which is 50M
  • the traffic of the outgoing interface B is M4, which is 50M.
  • the traffic is the sum of the M2 and M6 traffic, which is 500 M.
  • the outbound interface D traffic is the sum of the M1 and M5 traffic, which is 100 M.
  • the outgoing interface E traffic is the M 7 traffic, which is 50 M.
  • the present invention provides a load sharing method and a traffic forwarding device, which can change the flow without changing
  • the problem of uneven load sharing is solved in the case of a hash model.
  • the present invention provides a load sharing method, including:
  • n is a natural number greater than or equal to 1;
  • the load state of the interface is determined, where the load state of the outbound interface may be a light load state, a heavy load state, or a normal state;
  • the n+1th load sharing calculation is performed by using the second algorithm on the traffic that is forwarded by the outbound interface in the reload state, where the first algorithm and the second algorithm are different; A new entry is added to the outbound interface list of the forwarding device when the n+1th load balancing calculation is performed, and the new entry corresponds to the outbound interface in the light load state.
  • determining, by the foregoing, a load status of each outbound interface includes:
  • the first threshold and the second threshold are set; wherein, the first threshold is greater than the second threshold; when the traffic of the outbound interface is greater than the first threshold, determining that the load state of the outbound interface is a heavy state; or
  • the outbound interface in the reload state is identified by a reload flag
  • the outbound interface in the light load state is identified by a light load tag
  • the outbound interface in the normal state is identified by a normal tag.
  • the second algorithm performs the n+1th load sharing calculation including:
  • the outbound interface in the reload state is enabled for load balancing again and is in a light load state. Or the outbound interface in the normal state is not enabled for load balancing again.
  • the traffic on the outbound interface that is determined to be incapable of performing load balancing is forwarded normally.
  • the traffic on the outbound interface that is determined to be enabled for load balancing again performs the n+1th load sharing calculation.
  • the second aspect provides a traffic forwarding device, including:
  • a first load sharing unit configured to perform an nth load sharing calculation by using a first algorithm; wherein n is a natural number greater than or equal to 1;
  • the state determining unit is configured to determine, after the first load sharing unit performs the nth load sharing calculation, the load status of the interface, where the load status of the outbound interface may be a light load state, a heavy load state, or a normal state.
  • the second load sharing unit if the state determining unit determines that the outbound interface is in the overload state, and is configured to perform the n+1th load sharing calculation by using the second algorithm for the traffic that is forwarded through the outbound interface of the heavy load state.
  • the first algorithm and the second algorithm are different; wherein, when the n+1th load sharing calculation is performed, a new entry is added to the outbound interface list of the forwarding device, where the new entry is in the light Outbound interface of the loaded state.
  • the state determining unit includes:
  • a threshold setting subunit configured to set a first threshold and a second threshold; wherein, the first threshold is greater than the second threshold;
  • the determining subunit is configured to determine that the load state of the outbound interface is a heavy load state when the traffic of the outbound interface is greater than the first threshold;
  • the determining subunit is further configured to: when the traffic of the outbound interface is less than the second threshold, determine that the load state of the outbound interface is a light load state;
  • the determining subunit is further configured to determine that the load state of the outbound interface is a normal state when the traffic of the outbound interface is greater than or equal to the second threshold being less than or equal to the first threshold.
  • the traffic forwarding device further includes:
  • a marking subunit configured to identify the outbound interface of the overloaded state with a reloading mark, and identify the outbound interface of the light load state with a light load mark, and mark the outbound interface in the normal state with a normal mark .
  • the embodiment of the present invention provides a load sharing method and a traffic forwarding device. After the load balancing calculation is performed, the load status of each interface is determined, and the traffic that is forwarded through the outbound interface in the heavy load state is again subjected to load sharing calculation, and twice. The algorithm used in load sharing calculation is different, which can effectively solve the problem of uneven load sharing.
  • FIG. 1 is a schematic flowchart of a load sharing method according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a load sharing method according to another embodiment of the present invention
  • FIG. 3 is a schematic flow chart of a load sharing method according to another embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a traffic forwarding device according to another embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a traffic forwarding device according to another embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a traffic forwarding device according to another embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a router according to another embodiment of the present invention. detailed description
  • the embodiment of the invention provides a load sharing method, as shown in FIG. 1 , including:
  • the traffic forwarding device performs the nth load sharing calculation by using the first algorithm; where n is a natural number greater than or equal to 1;
  • determining a load status of the interface where the load status of the outbound interface may be a light load state, a heavy load state, or a normal state.
  • the load status of the interface is determined by the size of the traffic forwarded by each outbound interface. For example, a first threshold may be set as the upper limit of the traffic, and a second threshold is set as the lower limit of the traffic. If the traffic forwarded through an outbound interface is greater than the first threshold, the load state of the outbound interface is determined to be a heavy load state. If the traffic forwarded by the outbound interface is less than the second threshold, the load state of the outbound interface is determined to be a light load state. If the traffic forwarded by the outbound interface is greater than or equal to the second threshold and less than or equal to the first threshold, The load status of the outbound interface is normal.
  • the traffic forwarding device performs a n+1th load sharing calculation on the traffic forwarded by the outbound interface in the reload state, where the first algorithm and the first algorithm The second algorithm is different.
  • the new entry is added to the outbound interface list of the forwarding device when the n+1th load balancing calculation is performed.
  • the new entry corresponds to the outbound interface in the light load state.
  • the load status in each outbound interface is judged, and if there is still an outbound interface in the overloaded state, the outgoing in the overloaded state is continued.
  • the traffic on the interface is load-balanced until there is no outbound interface in the heavy state.
  • the embodiment of the present invention provides a load sharing method, which determines the load state of each interface after one load sharing calculation, and performs load sharing calculation again on the traffic forwarded by the outbound interface in the heavy load state, and the two load sharing calculations are performed. Different algorithms are used, which can effectively solve the problem of uneven load sharing.
  • Another embodiment of the present invention provides another load sharing method, as shown in FIG. 2, including:
  • the traffic forwarding device performs the first load sharing by using the first HASH algorithm. Calculation.
  • the foregoing first HASH algorithm may be a Cyclic Redundancy Check (CRC) algorithm.
  • CRC Cyclic Redundancy Check
  • the forwarding device uses the CRC algorithm to calculate the stream parameters according to the IP quintuple of the traffic message, divides the stream parameter by the modulus value, and takes the remainder, which is the HASH value of the traffic.
  • the traffic forwarding device determines a load state of the interface, and the load state of the outbound interface may be a light load state, a heavy load state, or a normal state.
  • the first outbound interface when the traffic of the first outbound interface is greater than the first threshold, the first outbound interface is considered to be in a heavy state. When the traffic of the second outgoing interface is less than the second threshold, the second outgoing interface is considered to be in a light load state. When the traffic of the third interface is greater than or equal to the second threshold being less than or equal to the first threshold, the third outgoing interface is considered to be in a normal state.
  • the first threshold is greater than the second threshold.
  • first outbound interface the second outgoing interface
  • third outgoing interface are all referred to as an outgoing interface.
  • the overload interface may be marked with a reload flag
  • the outbound interface in the light load state may be marked with a light load flag
  • the normal interface may be marked with a normal flag.
  • the overloaded label, the light load label, and the normal label may be sent by the control plane of the traffic forwarding device to the forwarding plane of the traffic forwarding device, so that the forwarding plane can know the load status of each outgoing interface. In this way, the traffic forwarding device can monitor the load status of each outbound interface in real time, and maintain and update the outbound interface list in real time.
  • the traffic forwarding device determines whether the interface is enabled for load balancing again according to the load status of the outbound interface.
  • the outbound interface in the reload state needs to be enabled (Enable) to load again.
  • the outbound interface in the light load state or the normal state does not enable load balancing again.
  • the traffic forwarding device can update the outbound interface entry based on the outbound interface state calculated by the previous load balancing. For example, a new entry is added to the outbound interface. The new entry is light. The outbound interface of the load state, so that the traffic on the outbound interface in the heavy load state is shared by the outbound interface in the light load state during the second load sharing calculation.
  • the second HASH algorithm used in the second load sharing calculation may be a parity HASH algorithm.
  • the forwarding device uses the parity HASH algorithm to calculate the stream parameters based on the IP quintuple of the traffic packets forwarded through the outbound interface.
  • the stream parameter is divided by the modulus value, and the remainder is the HASH value of the traffic.
  • the outgoing interfaces A and B are overloaded. Status, outgoing interfaces C and D are in light load.
  • the second load sharing calculation is performed on the traffic forwarded through interfaces A and B.
  • the second load HASH algorithm is used for the load sharing calculation, and the second HASH is different from the first HASH algorithm.
  • the entries corresponding to the outbound interfaces C and D can be added to the outbound interface list of the forwarding device.
  • the interfaces C and D can be enhanced. Traffic sharing ratio.
  • the load status of each outbound interface can be determined again. If the outbound interface in the overloaded state exists in each outbound interface after performing the second load sharing calculation, The load sharing calculation is performed by using the method in the embodiment of the present invention until there is no outbound interface in the heavy load state in each outbound interface.
  • the embodiment of the present invention provides a load sharing method, which determines the load state of each interface after one load sharing calculation, and performs load sharing calculation again on the traffic forwarded by the outbound interface in the heavy load state, and the two load sharing calculations are performed. Different algorithms are used, which can effectively solve the problem of uneven load sharing.
  • a further embodiment of the present invention provides a traffic forwarding device 01, as shown in FIG. 4, including:
  • the first load sharing unit 011 is configured to perform the nth load sharing calculation by using the first algorithm; where n is a natural number greater than or equal to 1;
  • the state determining unit 012 is configured to determine a load state of the interface after performing the nth load sharing calculation, where the load state of the outbound interface may be a light load state, a heavy load state, or a normal state;
  • the second load sharing unit 013 if the state determining unit 012 determines that the outbound interface is in the reload state, and uses the second algorithm to perform the n+1th load sharing calculation on the traffic forwarded through the outbound interface of the reload state.
  • the first algorithm and the second algorithm are different; wherein, when the n+1th load sharing calculation is performed, a new entry is added to the outbound interface list of the forwarding device, where the new entry corresponds to Outlet interface in light load state.
  • the state determining unit 012 may include:
  • a threshold setting subunit 0121 configured to set a first threshold and a second threshold; wherein, the first threshold is greater than the second threshold;
  • the determining sub-unit 0122 is configured to determine that the outbound interface whose traffic is greater than the first threshold is the outbound interface in the heavy load state; the outbound interface whose traffic is less than the second threshold is the outbound interface in the light load state; the traffic is greater than or equal to the second threshold is less than or equal to The outbound interface of the first threshold is the outbound interface in the normal state;
  • the first threshold can be preset as the upper limit of the outgoing interface traffic
  • the second threshold is the lower limit of the outgoing interface traffic
  • the traffic forwarding device 01 may further include: a marking unit 014, configured to mark the outbound interface according to the load status of the outbound interface, where the label includes a reloaded label, and the light The label has been marked, or the label has been marked as normal.
  • a marking unit 014 configured to mark the outbound interface according to the load status of the outbound interface, where the label includes a reloaded label, and the light The label has been marked, or the label has been marked as normal.
  • the above traffic forwarding device 01 can be a router.
  • the embodiment of the present invention provides a traffic forwarding device, which determines the load state of each interface after a load balancing calculation, and performs load sharing calculation on the traffic forwarded by the outbound interface in the heavy load state, and the two load sharing calculations are performed. Different algorithms are used, which can effectively solve the problem of uneven load sharing.
  • a further embodiment of the present invention further provides a router 02, including a receiver 021, a transmitter 022, and a memory 023. As shown in FIG. 7, the method further includes:
  • the processor 024 is configured to perform the nth load sharing calculation by using the first algorithm; wherein ⁇ is a natural number greater than or equal to 1;
  • the processor 024 is further configured to determine, after performing the nth load sharing calculation, the interface a load state, where the load state of the outbound interface may be a light load state, a heavy load state, or a normal state.
  • the processor 024 if it is determined that the outbound interface is in the reload state, is also used to perform the n+1th load sharing calculation by using the second algorithm for the traffic that is forwarded through the outbound interface of the reload state, where the first algorithm and The second algorithm is different.
  • the n+1th load sharing calculation is performed, a new entry is added to the outbound interface list of the forwarding device, and the new entry corresponds to the outbound interface in the light load state. .
  • the processor 024 may be specifically configured to: set the first threshold and the second threshold when determining the load status of the interface; wherein, the first threshold is greater than the second threshold; and determining that the outbound interface with the traffic greater than the first threshold is The outbound interface of the overloaded state; the outbound interface whose traffic is less than the second threshold is the outbound interface in the light load state; the outbound interface whose traffic is greater than or equal to the second threshold and less than or equal to the first threshold is the outbound interface in the normal state;
  • the first threshold is preset as the upper limit of the outgoing interface traffic
  • the second threshold is the lower limit of the outgoing interface traffic
  • the processor 024 may further be configured to mark the outbound interface according to the load status of the outbound interface, where the identifier includes the overloaded label i, and the light load label Only, or normal standard has only i.
  • the embodiment of the present invention provides a router, which determines the load status of each interface after one load sharing calculation, and performs load sharing calculation on the traffic forwarded by the outbound interface in the heavy load state, and uses the load sharing calculation twice. Different algorithms can effectively solve the problem of uneven load sharing.
  • the functional units of the traffic forwarding device in various embodiments of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit.
  • the above units can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • All or part of the steps of implementing the above method embodiments may be performed by hardware related to the program instructions.
  • the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes the steps of the foregoing method embodiments;
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and the like, and the program code can be stored. Medium.

Landscapes

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

Abstract

本发明的实施例提供一种负载分担方法和流量转发设备,涉及通信领域,能够在不改变流量哈希模型的情况下改善负载分担不均的情况。其方法为:采用第一算法执行第n次负载分担计算;其中n为大于或等于1的自然数;在执行第n次负载分担计算后,判断出接口的负载状态,其中,所述出接口的负载状态可以为轻载状态、重载状态或正常状态;若有处于重载状态的出接口,对通过该重载状态的出接口转发的流量,采用第二算法执行第n+1次负载分担计算,其中,第一算法和第二算法不相同;其中,在执行第n+1次负载分担计算时,在转发设备的出接口列表中增加新的表项,所述新的表项对应处于轻载状态的出接口。本发明实施例用于进行负载分担。

Description

一种负载分担方法和流量转发设备 本申请要求于 2012年 08月 07日提交中国专利局、 申请号为 201210278736.6、 发明名称为 "一种负载分担方法和流量转发设备" 的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域 本发明涉及通信领域, 尤其涉及一种负载分担方法和流量转发设 备。 背景技术
负载分担( Load Balance ) 又称负载均衡( Load Balancing ) , 能 够在不改变现有网络结构情况下, 扩展网络的带宽、 增加网络的吞吐 量、 加强数据处理能力、 提高网络的可用性。
现有的负载分担分通常釆用逐流负载分担,这样可以保证报文的 接收顺序, 保证业务功能正常。
现有逐流负载分担的方案一般使用固定哈希 (HASH )算法进行 一次负载分担计算。 例如, 假设有 7 条流量 (M1 M7 ) 的报文待转 发, M1 M7的流参数依次为: 101、 103、 105、 106、 108、 110、 111 ; M1~M7的流量大小依次为: 50M, 300M, 50M, 50M, 50M, 200M, 50M。 其中, 流参数是流量的特征值, 可以是根据网络协议( Internet Protocol, IP ) 五元组 (源 IP地址、 目的 IP地址、 源端口号、 目的 端口号以及协议号) , 或者根据 IP二元组 (源 IP地址、 目的 IP地 址) , 釆用某种算法计算得到的。
转发设备有 5个出接口 (A~E ) , 出接口列表如下表 1所示, 出 接口 A~E对应的 HASH值依次为: 0 , 1 , 2 , 3 , 4。
表 1
出接口 HASH值
A 0 D 3
E 4
在这个例子中, 由于出接口列表中有 5 个表项, 故模取 5 , 将 M1-M7 的流参数依次除以 5 , 所得余数即为流量的 HASH 值, 故 M1~M7的 HSAH值依次为: 1、 3、 0、 1、 3、 0、 1。 以 HASH值为 索引在出接口列表中进行查找, 可以确定转发 M1~M7的出接口依次 为: B、 D、 A、 B、 D、 A、 B , 如表 2所示:
表 2
Figure imgf000003_0001
从上表可以看出, 进行一次负载分担计算之后, 出接口 A上的 流量为 M3和 M6的流量之和, 为 250M;出接口 B上的流量为 Ml、 M4和 M7的流量之和, 为 150M; 出接口 C上的流量为 0; 出接口 D上的流量为 M2和 M5的流量之和, 为 350M; 出接口 E上的流量 为 0。
由此可见, 经过了一次负载分担计算之后, 出接口 C和 E上是 没有流量的, 各出接口的负载仍然是不均的。
因此, 转发设备在下一次转发流量 M1~M7的报文时, 可以做出 调整。 例如, 虽然转发设备的出接口数量是固定的, 但是可以调整转 发设备出接口列表的表项个数。 这里可以理解为, 将出接口 C 和 E 模拟成新的出接口表项, 添加到出接口列表中。 调整后的出接口列表 如下表 3所示:
表 3
Figure imgf000003_0002
E 4
C 5
E 6
表 3中, 由于新增了两个表项, 因此, 当 HASH值为 2和 5时, 均能命中出接口 C, 当 HASH值为 4和 6时, 均能命中出接口 E。 因 此, 出接口 C和 E被命中的几率得到了提升。
调整后, 出接口列表中有 7个表项, 故模取 7。 仍然釆用调整之 前的算法计算流参数, 以流参数除以模值, 取余数, 得到调整后的负 载分担结果, 如表 4所示。
表 4
Figure imgf000004_0001
由表 4可以看出,调整出接口列表后 ,进行一次负载分担计算后 , 出接口 A的流量为 M3的流量, 为 50M; 出接口 B的流量为 M4的 流量, 为 50M; 出接口 C的流量为 M2与 M6流量之和, 为 500M; 出接口 D流量为 Ml与 M5流量之和, 为 100M; 出接口 E的流量为 M 7的流量, 为 50 M。
可见,对出接口列表的表项进行调整之后, 虽然在一定程度上緩 解了负载分担不均的情况, 但是仍有个别出接口的负载是过重的, 例 如, 出接口 C的负载情况就是严重超载的。
由此可见, 现有技术中固定哈希算法的一次负载分担计算方法, 由于算法固定, 难以彻底解决负载分担不均的问题。 发明内容
本发明提供一种负载分担方法和流量转发设备,能够在不改变流 量哈希模型的情况下解决负载分担不均的问题。
第一方面, 本发明提供一种负载分担方法, 包括:
釆用第一算法执行第 n次负载分担计算; 其中 n为大于或等于 1 的自然数;
在执行第 n次负载分担计算后, 判断出接口的负载状态, 其中, 所述出接口的负载状态可以为轻载状态、 重载状态或正常状态;
若有处于重载状态的出接口,对通过该重载状态的出接口转发的 流量, 釆用第二算法执行第 n+1次负载分担计算, 其中, 第一算法和 第二算法不相同; 其中, 在执行第 n+1次负载分担计算时, 在转发设 备的出接口列表中增加新的表项,所述新的表项对应处于轻载状态的 出接口。
在第一种可能的实现方式中, 结合第一方面, 所述判断出各个出 接口的负载状态包括:
设定第一门限和第二门限; 其中, 第一门限大于第二门限; 当出接口的流量大于第一门限时,确定该出接口的负载状态为重 载状态; 或
当出接口的流量小于第二门限时,确定该出接口的负载状态为轻 载状态; 或
当出接口的流量大于等于第二门限小于等于第一门限时,确定该 出接口的负载状态为正常状态。
在第二种可能的实现方式下,结合第一方面或第一方面的第一种 可能的实现方式, 所述判断出各个出接口的负载状态还包括:
将所述重载状态的出接口用重载标记标识,将所述轻载状态的出 接口用轻载标记标识, 将所述处于正常状态的出接口, 用正常标记标 识。
在第三种可能的实现方式中,结合第一方面或第一方面的第一种 可能的实现方式或第一方面的第二种可能的实现方式,若有处于重载 状态的出接口, 对通过该重载状态的出接口转发的流量, 釆用第二算 法执行第 n+1次负载分担计算包括:
判定处于重载状态的出接口为使能再次负载分担,处于轻载状态 或者正常状态的出接口为不使能再次负载分担;
将被判定为不使能再次负载分担的出接口上的流量正常转发; 将被判定为使能再次负载分担的出接口上的流量执行第 n+1 次 负载分担计算。
第二方面, 提供一种流量转发设备, 包括:
第一负载分担单元,用于釆用第一算法执行第 n次负载分担计算; 其中 n为大于或等于 1的自然数;
状态判断单元,用于在所述第一负载分担单元执行第 n次负载分 担计算后, 判断出接口的负载状态, 其中, 所述出接口的负载状态可 以为轻载状态、 重载状态或正常状态;
第二负载分担单元,若状态所述判断单元确定有出接口处于重载 状态, 用于对通过该重载状态的出接口转发的流量, 釆用第二算法执 行第 n+1次负载分担计算,其中,第一算法和第二算法不相同;其中, 在执行第 n+1次负载分担计算时,在转发设备的出接口列表中增加新 的表项, 所述新的表项对应处于轻载状态的出接口。
在第一种可能的实现方式中, 结合第二方面, 所述状态判断单元 包括:
门限设定子单元, 用于设定第一门限和第二门限; 其中, 第一门 限大于第二门限;
判断子单元, 用于当出接口的流量大于第一门限时, 确定该出接 口的负载状态为重载状态;
所述判断子单元还用于当出接口的流量小于第二门限时,确定该 出接口的负载状态为轻载状态;
所述判断子单元还用于当出接口的流量大于等于第二门限小于 等于第一门限时, 确定该出接口的负载状态为正常状态。
在第二种可能的实现方式中,结合第二方面或第二方面的第一种 可能的实现方式, 所述流量转发设备还包括:
标记子单元, 用于将所述重载状态的出接口用重载标记标识, 将 所述轻载状态的出接口用轻载标记标识,将所述处于正常状态的出接 口, 用正常标记标识。 本发明的实施例提供一种负载分担方法和流量转发设备, 通过一 次负载分担计算之后判断各个接口的负载状态, 并对通过重载状态的 出接口转发的流量再次进行负载分担计算, 且两次负载分担计算所釆 用的算法不同, 能够有效的解决负载分担不均的问题。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面 将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而 易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本领域 普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些 附图获得其他的附图。
图 1为本发明实施例提供的一种负载分担方法的流程示意图; 图 2 为本发明另一实施例提供的一种负载分担方法的流程示意 图一;
图 3 为本发明另一实施例提供的一种负载分担方法的流程示意 图二;
图 4 为本发明又一实施例提供的一种流量转发设备的结构示意 图一;
图 5 为本发明又一实施例提供的一种流量转发设备的结构示意 图二;
图 6 为本发明又一实施例提供的一种流量转发设备的结构示意 图三;
图 7为本发明又一实施例提供的一种路由器的结构示意图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方 案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部 分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普 通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
实施例一
本发明实施例提供一种负载分担方法, 如图 1所示, 包括:
5100、 流量转发设备釆用第一算法执行第 n次负载分担计算;其 中 n为大于或等于 1的自然数;
5101、在执行第 n次负载分担计算后,判断出接口的负载状态, 其中,所述出接口的负载状态可以为轻载状态、重载状态或正常状态。
示例性的, 可以根据第一次负载分担计算后, 通过各个出接口转 发的流量大小来判断出接口的负载状态。 例如, 可以设置一个第一门 限作为流量的上限, 设置一个第二门限作为流量的下限, 若通过某个 出接口转发的流量大于第一门限,则判定该出接口的负载状态为重载 状态; 若通过该出接口转发的流量小于第二门限, 则判定该出接口的 负载状态为轻载状态,若通过该出接口转发的流量大于等于第二门限 又小于等于第一门限, 则判定将该出接口的负载状态为正常状态。
5102、 若有处于重载状态的出接口, 对通过该重载状态的出接 口转发的流量,流量转发设备釆用第二算法执行第 n+1次负载分担计 算, 其中, 第一算法和第二算法是不相同的; 其中, 在执行第 n+1 次负载分担计算时, 在转发设备的出接口列表中增加新的表项, 所述 新的表项对应处于轻载状态的出接口。
在本发明的实施例中, 在执行完每一次的负载分担计算后, 对各 个出接口中的负载状态进行判断, 若仍有处于重载状态的出接口, 则 继续对处于重载状态的出接口上的流量进行负载分担计算,直至不存 在处于重载状态的出接口为止。
本发明的实施例提供一种负载分担方法,通过一次负载分担计算 之后判断各个接口的负载状态,并对通过重载状态的出接口转发的流 量再次进行负载分担计算, 且两次负载分担计算所釆用的算法不同, 能够有效的解决负载分担不均的问题。
本发明的另一实施例提供另一种负载分担方法, 如图 2所示, 包 括:
S201、 流量转发设备釆用第一 HASH算法进行第一次负载分担 计算。
可选的, 上述第一 HASH 算法可以是循环冗余码校验 (Cyclic Redundancy Check, CRC ) 算法。 转发设备釆用 CRC算法, 根据流 量报文的 IP五元组,计算得到流参数,用流参数除以模值,取余数, 即为流量的 HASH值。
而后根据各条流量的 HASH值, 在转发设备的出接口列表中查 找对应的出接口, 这样就完成了第一次负载分担计算。
S202、 流量转发设备判断出接口的负载状态, 所述出接口的负 载状态可以为轻载状态、 重载状态或正常状态。
例如, 当第一出接口的流量大于第一门限值时, 认为第一出接口 处于重载状态。 当第二出接口的流量小于第二门限值时, 认为第二出 接口处于轻载状态。当第三接口的流量大于等于第二门限小于等于第 一门限时, 认为该第三出接口处于正常状态。 其中, 第一门限大于所 述第二门限。
需要指出的是, 上述第一出接口、 第二出接口和第三出接口均为 代指, 可以为任意一个出接口。
可选的, 可以对处于重载状态的出接口打上重载标记, 还可以对 处于轻载状态的出接口打上轻载标记,对于处于正常状态的接口打上 正常标记。 其中, 在一种实现方式下, 上述的重载标记、 轻载标记以 及正常标记可以由流量转发设备的控制平面下发给流量转发设备的 转发平面, 以便转发平面能够知道各个出接口的负载状态, 这样就可 以使流量转发设备实时监控各个出接口的负载状态,并且实时维护更 新出接口列表。
S203、 流量转发设备根据出接口的负载状态判定出接口是否使 能再次负载分担。
可选的, 处于重载状态的出接口需要使能(Enable )再次负载分 担, 处于轻载状态或者正常状态的出接口不使能再次负载分担。
而后, 当出接口被判定为不使能再次负载分担时执行 S204 , 当 出接口被判定为使能再次负载分担时执行 S205。
5204、 按照第一次负载分担计算的结果, 转发流量。
5205、 执行第二次负载分担计算, 其中, 第二次负载分担计算 所釆用的第二 HASH 算法与上一次负载分担计算所釆用的第一 HASH算法不同。
在执行第二次负载分担计算之前,流量转发设备可以根据上一次 负载分担计算的出接口状态更新出接口表项, 例如, 在出接口中增加 新的表项, 该新的表项对应处于轻载状态的出接口, 以便在进行第二 次负载分担计算时,由轻载状态的出接口分担重载状态的出接口上流 量。
示例性的, 第二次负载分担计算所釆用的第二 HASH算法可以 是奇偶 HASH算法。 转发设备釆用奇偶 HASH算法, 根据通过重载 状态的出接口转发的流量报文的 IP五元组, 计算得到流参数, 用流 参数除以模值, 取余数, 即为流量的 HASH值。
示例性的,如图 3所示,假设一共有 N条流量,在釆用第一 HASH 算法进行第一次负载分担计算后, 根据各个出接口的流量判断出: 出 接口 A和 B处于重载状态, 出接口 C和 D处于轻载状态。 此时, 需 要对通过接口 A和 B转发的流量进行第二次负载分担计算, 此次负 载分担计算釆用第二 HASH算法, 且该第二 HASH与第一 HASH算 法不同。 在进行第二次负载分担计算时, 可以在转发设备的出接口列 表中增加对应于出接口 C和 D的表项, 这样, 在第二次负载分担计 算时, 可以提升出接口 C和 D的流量分担比例。
进一步的, 第二次负载分担计算后, 可以再次判断各个出接口的 负载状态, 若在执行第二次负载分担计算后, 各个出接口中还存在处 于重载状态的出接口,则可以再次釆用本发明实施例的方法进行负载 分担计算, 直至在各个出接口中不存在处于重载状态的出接口。
本发明的实施例提供一种负载分担方法,通过一次负载分担计算 之后判断各个接口的负载状态,并对通过重载状态的出接口转发的流 量再次进行负载分担计算, 且两次负载分担计算所釆用的算法不同, 能够有效的解决负载分担不均的问题。
本发明的又一实施例提供一种流量转发设备 01 , 如图 4所示, 包括:
第一负载分担单元 011 , 用于釆用第一算法执行第 n次负载分担 计算;其中 n为大于或等于 1的自然数; 状态判断单元 012 , 用于在执行第 n次负载分担计算后, 判断出 接口的负载状态, 其中, 所述出接口的负载状态可以为轻载状态、 重 载状态或正常状态;
第二负载分担单元 013 , 若状态判断单元 012确定有出接口处于 重载状态, 用于对通过该重载状态的出接口转发的流量, 釆用第二算 法执行第 n+1次负载分担计算, 其中, 第一算法和第二算法是不相同 的; 其中, 在执行第 n+1次负载分担计算时, 在转发设备的出接口列 表中增加新的表项, 所述新的表项对应处于轻载状态的出接口。
可选的, 如图 5所示, 状态判断单元 012可以包括:
门限设定子单元 0121 , 用于设定第一门限和第二门限; 其中, 第一门限大于第二门限;
判断子单元 0122 , 用于确定流量大于第一门限的出接口为处于 重载状态的出接口;流量小于第二门限的出接口为处于轻载状态的出 接口;流量大于等于第二门限小于等于第一门限的出接口为处于正常 状态的出接口;
例如, 可以预设第一门限为出接口流量的上限, 第二门限为出接 口流量的下限。
可选的, 如图 6所示, 所述流量转发设备 01还可以包括: 标记单元 014 , 用于根据出接口的负载状态对出接口进行标记, 所述标 己包括重载标 己标识, 轻载标 己标识, 或正常标己标识。
上述流量转发设备 01可以是路由器。
本发明的实施例提供一种流量转发设备,通过一次负载分担计算 之后判断各个接口的负载状态,并对通过重载状态的出接口转发的流 量再次进行负载分担计算, 且两次负载分担计算所釆用的算法不同, 能够有效的解决负载分担不均的问题。
本发明又一实施例还提供一种路由器 02 , 包括接收机 021、发射 机 022、 存储器 023 , 如图 7所示, 还包括:
处理器 024 , 用于釆用第一算法执行第 η次负载分担计算;其中 η 为大于或等于 1的自然数;
处理器 024还用于在执行第 η次负载分担计算后 ,判断出接口的 负载状态, 其中, 所述出接口的负载状态可以为轻载状态、 重载状态 或正常状态。
处理器 024若确定有出接口处于重载状态,还用于对通过该重载 状态的出接口转发的流量,釆用第二算法执行第 n+1次负载分担计算, 其中, 第一算法和第二算法是不相同的; 其中, 在执行第 n+1次负载 分担计算时, 在转发设备的出接口列表中增加新的表项, 所述新的表 项对应处于轻载状态的出接口。
进一步的,处理器 024在判断出接口的负载状态时可以具体用于: 设定第一门限和第二门限; 其中, 第一门限大于第二门限; 确定流量大于第一门限的出接口为处于重载状态的出接口;流量 小于第二门限的出接口为处于轻载状态的出接口;流量大于等于第二 门限小于等于第一门限的出接口为处于正常状态的出接口;
其中, 可以预设第一门限为出接口流量的上限, 第二门限为出接 口流量的下限。
可选的,处理器 024在判断出各个出接口的负载状态后还可以用 于根据出接口的负载状态对出接口进行标记,所述标记包括重载标记 标 i只 , 轻载标己标 i只 , 或正常标己标 i只。
本发明的实施例提供一种路由器,通过一次负载分担计算之后判 断各个接口的负载状态,并对通过重载状态的出接口转发的流量再次 进行负载分担计算, 且两次负载分担计算所釆用的算法不同, 能够有 效的解决负载分担不均的问题。
在本发明各个实施例中的流量转发设备的各功能单元可以集成 在一个处理单元中, 也可以是各个单元单独物理包括, 也可以两个或 两个以上单元集成在一个单元中。且上述的各单元既可以釆用硬件形 式实现, 也可以釆用硬件加软件功能单元的形式实现。
实现上述方法实施例的全部或部分步骤可以通过程序指令相关 的硬件来完成, 前述的程序可以存储于一计算机可读取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储介 质包括: U 盘、 移动硬盘、 只读存储器 (Read-Only Memory, 简称 ROM ) 、 随机存取存储器 ( Random Access Memory, 简称 RAM ) 、 磁碟或者光盘等各种可以存储程序代码的介质。 以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并 不局限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范 围内, 可轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应以所述权利要求的保护范围为准。

Claims

权利要求
1、 一种负载分担方法, 其特征在于, 包括:
釆用第一算法执行第 n次负载分担计算; 其中 n为大于或等于 1 的自然数;
在执行第 n次负载分担计算后, 判断出接口的负载状态, 其中, 所述出接口的负载状态可以为轻载状态、 重载状态或正常状态;
若有处于重载状态的出接口,对通过该重载状态的出接口转发的 流量, 釆用第二算法执行第 n+1次负载分担计算, 其中, 第一算法和 第二算法不相同; 其中, 在执行第 n+1次负载分担计算时, 在转发设 备的出接口列表中增加新的表项,所述新的表项对应处于轻载状态的 出接口。
2、 根据权利要求 1所述的方法, 其特征在于, 所述判断出各个 出接口的负载状态包括:
设定第一门限和第二门限; 其中, 第一门限大于第二门限; 当出接口的流量大于第一门限时,确定该出接口的负载状态为重 载状态; 或
当出接口的流量小于第二门限时,确定该出接口的负载状态为轻 载状态; 或
当出接口的流量大于等于第二门限小于等于第一门限时,确定该 出接口的负载状态为正常状态。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 还包括: 将所述重载状态的出接口用重载标记标识,将所述轻载状态的出 接口用轻载标记标识, 将所述处于正常状态的出接口, 用正常标记标 识。
4、 根据权利要求 1至 3任意一项所述的方法, 其特征在于, 若 有处于重载状态的出接口, 对通过该重载状态的出接口转发的流量, 釆用第二算法执行第 n+1次负载分担计算包括:
判定处于重载状态的出接口为使能再次负载分担,处于轻载状态 或者正常状态的出接口为不使能再次负载分担; 将被判定为不使能再次负载分担的出接口上的流量正常转发; 将被判定为使能再次负载分担的出接口上的流量执行第 n+1 次 负载分担计算。
5、 根据权利要求 1至 4中任一项所述的方法, 其特征在于, 包 括:
所述第一次负载分担计算所釆用的哈希算法包括循环冗余码校 验算法,所述第二次负载分担计算所釆用的哈希算法包括奇偶哈希算 法。
6、 一种流量转发设备, 其特征在于, 包括:
第一负载分担单元,用于釆用第一算法执行第 n次负载分担计算; 其中 n为大于或等于 1的自然数;
状态判断单元,用于在所述第一负载分担单元执行第 n次负载分 担计算后, 判断出接口的负载状态, 其中, 所述出接口的负载状态可 以为轻载状态、 重载状态或正常状态;
第二负载分担单元,若状态所述判断单元确定有出接口处于重载 状态, 用于对通过该重载状态的出接口转发的流量, 釆用第二算法执 行第 n+1次负载分担计算,其中,第一算法和第二算法不相同;其中, 在执行第 n+1次负载分担计算时,在转发设备的出接口列表中增加新 的表项, 所述新的表项对应处于轻载状态的出接口。
7、 根据权利要求 6所述的流量转发设备, 其特征在于, 所述状 态判断单元包括:
门限设定子单元, 用于设定第一门限和第二门限; 其中, 第一门 限大于第二门限;
判断子单元, 用于当出接口的流量大于第一门限时, 确定该出接 口的负载状态为重载状态;
所述判断子单元还用于当出接口的流量小于第二门限时,确定该 出接口的负载状态为轻载状态;
所述判断子单元还用于当出接口的流量大于等于第二门限小于 等于第一门限时, 确定该出接口的负载状态为正常状态。
8、 根据权利要求 6或 7所述的流量转发设备, 其特征在于, 所 述流量转发设备还包括:
标记单元, 用于将所述重载状态的出接口用重载标记标识, 将所 述轻载状态的出接口用轻载标记标识,将所述处于正常状态的出接口, 用正常标记标识。
PCT/CN2013/072378 2012-08-07 2013-03-11 一种负载分担方法和流量转发设备 WO2014023098A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210278736.6 2012-08-07
CN201210278736.6A CN102780632B (zh) 2012-08-07 2012-08-07 一种负载分担方法和流量转发设备

Publications (1)

Publication Number Publication Date
WO2014023098A1 true WO2014023098A1 (zh) 2014-02-13

Family

ID=47125393

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/072378 WO2014023098A1 (zh) 2012-08-07 2013-03-11 一种负载分担方法和流量转发设备

Country Status (2)

Country Link
CN (1) CN102780632B (zh)
WO (1) WO2014023098A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102780632B (zh) * 2012-08-07 2016-04-06 华为技术有限公司 一种负载分担方法和流量转发设备
CN103825834B (zh) * 2012-11-16 2017-08-08 新华三技术有限公司 一种evi中调整流量负载分担的方法及网络交换装置
CN103686079B (zh) * 2013-12-05 2017-07-14 浙江宇视科技有限公司 一种终端设备
CN105991426A (zh) * 2015-03-04 2016-10-05 中兴通讯股份有限公司 一种负荷分担中链路的管理方法和装置
CN110838986B (zh) * 2019-07-29 2022-02-22 迈普通信技术股份有限公司 一种lacp负载均衡的方法、设备及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101873251A (zh) * 2009-04-27 2010-10-27 中兴通讯股份有限公司 报文转发方法及装置
CN102025644A (zh) * 2010-12-31 2011-04-20 华为技术有限公司 一种负载分担方法及设备
CN102447636A (zh) * 2012-01-06 2012-05-09 中兴通讯股份有限公司 一种数据中心通讯设备的负载分担方法和装置
CN102780632A (zh) * 2012-08-07 2012-11-14 华为技术有限公司 一种负载分担方法和流量转发设备

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102055675B (zh) * 2011-01-21 2012-12-19 清华大学 一种基于负载均衡的多径路由分配方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101873251A (zh) * 2009-04-27 2010-10-27 中兴通讯股份有限公司 报文转发方法及装置
CN102025644A (zh) * 2010-12-31 2011-04-20 华为技术有限公司 一种负载分担方法及设备
CN102447636A (zh) * 2012-01-06 2012-05-09 中兴通讯股份有限公司 一种数据中心通讯设备的负载分担方法和装置
CN102780632A (zh) * 2012-08-07 2012-11-14 华为技术有限公司 一种负载分担方法和流量转发设备

Also Published As

Publication number Publication date
CN102780632B (zh) 2016-04-06
CN102780632A (zh) 2012-11-14

Similar Documents

Publication Publication Date Title
US11036529B2 (en) Network policy implementation with multiple interfaces
US20200351204A1 (en) Method, apparatus, and system for load balancing of service chain
CN107438994B (zh) 用于服务器负载均衡的方法、设备和计算机存储介质
US9419908B2 (en) Network congestion management using flow rebalancing
WO2017025021A1 (zh) 一种处理流表的方法及装置
US10284487B2 (en) Software load balancer to maximize utilization
WO2014023098A1 (zh) 一种负载分担方法和流量转发设备
US20210359952A1 (en) Technologies for protocol-agnostic network packet segmentation
WO2015114473A1 (en) Method and apparatus for locality sensitive hash-based load balancing
US10263809B2 (en) Selecting an optimal network device for reporting flow table misses upon expiry of a flow in a software defined network
WO2019061169A1 (zh) 一种基于混合资源的路由选路方法、装置和服务器
WO2018104769A1 (en) Method and apparatus for load balancing ip address selection in a network environment
WO2020103855A1 (zh) 一种信息中心网络中转发端口的确定方法及装置
US10693785B2 (en) Method and system for forwarding data, virtual load balancer, and readable storage medium
WO2015161737A1 (zh) 一种缓存数据的方法及转发设备
WO2018107908A1 (zh) 报文传输方法及交换机
WO2012109909A1 (zh) 数据流负荷分担方法及装置
US11316916B2 (en) Packet processing method, related device, and computer storage medium
CN106533946B (zh) 报文转发方法和装置
WO2020207148A1 (zh) 一种负载均衡方法和装置
WO2014206208A1 (zh) 数据查询方法、设备和系统
WO2015165270A1 (zh) 一种数据包处理方法及设备
WO2018188570A1 (zh) 一种数据传输方法及装置
CN106850726B (zh) 基于sdn的云数据中心负载可感知的请求路由方法
CN117579543B (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: 13828086

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

Country of ref document: EP

Kind code of ref document: A1