CN1299468C - 一种聚合组流量均衡方法 - Google Patents

一种聚合组流量均衡方法 Download PDF

Info

Publication number
CN1299468C
CN1299468C CNB031132669A CN03113266A CN1299468C CN 1299468 C CN1299468 C CN 1299468C CN B031132669 A CNB031132669 A CN B031132669A CN 03113266 A CN03113266 A CN 03113266A CN 1299468 C CN1299468 C CN 1299468C
Authority
CN
China
Prior art keywords
port
xor
aggregation group
result
flow equalization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB031132669A
Other languages
English (en)
Other versions
CN1538665A (zh
Inventor
马开
俞杰
李振刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Pizhou Runhong Industry Co., Ltd.
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNB031132669A priority Critical patent/CN1299468C/zh
Publication of CN1538665A publication Critical patent/CN1538665A/zh
Application granted granted Critical
Publication of CN1299468C publication Critical patent/CN1299468C/zh
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明涉及一种流量均衡的方法,尤其涉及通讯领域中的聚合组中的快速流量均衡,通过将端口号与参数的异或结果与端口号进行值的唯一对应,如果待选的端口流量拥塞,则选择下一个端口号的端口,这样减少多级查询表项达到了快速处理流量均衡的效果,节省了系统处理流量的时间,提高了系统处理性能。

Description

一种聚合组流量均衡方法
技术领域
本发明涉及一种流量均衡的方法,尤其涉及通讯领域中的聚合组中的快速流量均衡。
背景技术
目前流量均衡方法采用如下模式:根据聚合组中的最多端口数的不同(2个、4个或8个等,以4个为例),取数据包目的地址和源地址等其它参数项的最后1位、2位或3位(以2位为例)做异或。如图1所示,取2位异或时将有四种异或结果,每一种异或结果对应映射表的一项索引。然后将异或结果作为索引查映射表,得到一个端口选择队列号,再根据端口选择队列号在端口选择表中找到端口选择顺序(即端口选择队列),然后在端口选择队列找到其中的第一个可用端口。端口选择表由系统配置。如图1所示:取多个参数项的最后2位异或结果为01,则在映射表中查到端口选择表队列号4;在端口选择表队列4中,首先选择的是端口1,如果端口1流量拥塞,选择端口4,端口4应其他原因无法使用则选择端口3等。通过参数异或,映射,端口选择表是各个端口可能被选择的概率都相等,从而达到流量均衡的目的。但现有算法不仅复杂度高,需要查询多个表项,更给系统处理增加了时间负荷,对于特别是高速以太网系统的处理性能影响很大。
发明内容
本发明解决的技术问题是为了克服了现有流量均衡方法中端口选择需经过多级映射与检索,系统处理的时间较长,特别是在各个表项不再同一存储区,查找过程耗费的系统时间更将迅速增加,这给高速以太网的处理增加了沉重的负荷等缺点,提供一种简单快速的聚合组流量均衡方法。
本发明所述的聚合组流量均衡方法,包括以下处理步骤:
1)把聚合组中的2n个端口进行顺序编号,n=1、2、3…;数据包多个参数中的n位异或后的每种异或结果对应一个端口号;
2)将数据包多个已知参数取需要异或的n位进行异或;
3)根据步骤2)中的异或结果按照步骤1)的对应关系选择聚合组的一个对应端口;
4)根据所述步骤3)的对应端口的流量状态决定是否可选择此端口,如果可以,则结束;如果该端口不可选,则转步骤5);
5)将异或结果对应的端口号按2n进制加法进行累加,从个位起取累加结果中小于2n的值作为替代步骤3)中的待选端口号,转步骤4);
6)循环2n次后如果还没有找到可选择的端口,返回选择失败。
采用本发明所述流量均衡方法,与现有技术相比,在各个端口被选择的概率上相同,即流量均衡能力相同,并取得了减少多级查询表项的进步,达到了快速处理流量均衡的效果,节省了系统处理流量的时间,提高了系统处理性能等等
附图说明
图1是现有技术的流量均衡方法原理图。
图2是本发明的流量均衡方法原理图。
图3是本发明的流量均衡方法处理流程图。
具体实施方式
下面结合附图对技术方案的实施作进一步的详细描述:
以聚合组中有4个端口为例,端口从0开始编号;
将数据包多个参数的最后2位进行异或;
结果:00:先选端口0,如不行则选端口0++(=端口1),不行再++;
01:先选端口1,如不行则选端口1++(=端口2),不行再++;
10:先选端口2,如不行则选端口2++(=端口3),不行再++;
11:先选端口3,如不行则选端口3++(=端口0),不行再++;
按四进制加法取个位,最多循环4次。
端口的选择顺序参考图2所示。
如图3所示,具体处理流程包括:
1)把聚合组中的2n,n=1、2、3…个端口进行顺序编号,本例中端口的编号分别为0、1、2、3;数据包多个参数中的2位异或后的每种异或结果对应一个端口号,00对应端口号0,01对应端口号1,10对应端口号2,11对应端口号3;
2)将数据包多个已知参数取需要异或的2位进行异或;
3)根据步骤2)中的异或结果按照步骤1)的对应关系选择聚合组的一个对应端口;假设异或结果是11,则选择端口号为3的端口;
4)根据所述步骤3)的对应端口(即端口号为3的端口)的流量状态决定是否可选择此端口,如果可以,则结束;如果该端口不可选,则转步骤5);
5)将异或结果对应的端口号按4进制加法进行累加(累加结果的个位为0),从个位起取累加结果中小于4的值作为替代步骤3)中的待选端口号即端口号为0的端口,转步骤4);
6)循环4次后如果还没有找到可选择的端口,返回选择失败。
本发明的方法与现有技术相比在各端口的流量均衡方面具有相同的性能,即各个端口被选择的概率相同。同时本发明的方法方便快速,省去了多级检索表项的步骤,大大地减少了系统处理每个包的时间,从而显著地提高了系统处理能力。经验数据表明查表一次需要3个指令周期,一个包的整个处理周期大约为50个指令周期。则现有技术在查表时需要两次查表6个指令周期,而快速算法需要1个指令周期。那么快速算法对大约提高10%的系统效率。
虽然本发明的优选实施例和其他实施例已被说明和描述,但很明显本发明是不受限制的。在不偏离由附属权利要求书所确定的本发明的精神和范围的条件下,本领域的技术人员将会考虑到许多修正、更换、变化、替代和等效的内容。

Claims (2)

1.一种聚合组流量均衡方法,其特征在于,所述流量均衡方法包括以下处理步骤:
1)把聚合组中的2n个端口进行顺序编号,n=1、2、3...;数据包多个参数中的n位异或后的每种异或结果对应一个端口号,端口号从0开始;
2)将数据包多个已知参数取需要异或的n位进行异或;
3)根据步骤2)中的异或结果按照步骤1)的对应关系选择聚合组的一个对应端口;
4)根据所述步骤3)的对应端口的流量状态决定是否可选择此端口,如果可以,则结束;如果该端口不可选,则转步骤5);
5)将异或结果对应的端口号按2n进制加法进行累加,从个位起取累加结果中小于2n的值作为替代步骤3)中的待选端口号,转步骤4);
6)循环2n次后如果还没有找到可选择的端口,返回选择失败。
2.根据权利要求1所述的聚合组流量均衡方法,其特征在于,所述步骤2)中可选择多个已知参数的最后n位进行异或。
CNB031132669A 2003-04-18 2003-04-18 一种聚合组流量均衡方法 Expired - Fee Related CN1299468C (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB031132669A CN1299468C (zh) 2003-04-18 2003-04-18 一种聚合组流量均衡方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB031132669A CN1299468C (zh) 2003-04-18 2003-04-18 一种聚合组流量均衡方法

Publications (2)

Publication Number Publication Date
CN1538665A CN1538665A (zh) 2004-10-20
CN1299468C true CN1299468C (zh) 2007-02-07

Family

ID=34320025

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB031132669A Expired - Fee Related CN1299468C (zh) 2003-04-18 2003-04-18 一种聚合组流量均衡方法

Country Status (1)

Country Link
CN (1) CN1299468C (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100426773C (zh) * 2005-11-30 2008-10-15 中兴通讯股份有限公司 一种多mac端口互联时均衡端口流量的方法
CN101547154B (zh) * 2009-05-06 2011-06-08 烽火通信科技股份有限公司 一种trunk分发方法
CN101950279B (zh) * 2010-09-30 2012-09-19 华为技术有限公司 均衡数据信息流量的方法、总线系统和译码器

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1328729A (zh) * 1998-10-02 2001-12-26 艾利森电话股份有限公司 波分复用信道均衡器
JP2002305541A (ja) * 2001-04-04 2002-10-18 Kddi Research & Development Laboratories Inc メッシュ網におけるロードバランシング方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1328729A (zh) * 1998-10-02 2001-12-26 艾利森电话股份有限公司 波分复用信道均衡器
JP2002305541A (ja) * 2001-04-04 2002-10-18 Kddi Research & Development Laboratories Inc メッシュ網におけるロードバランシング方法

Also Published As

Publication number Publication date
CN1538665A (zh) 2004-10-20

Similar Documents

Publication Publication Date Title
CN108337172B (zh) 大规模OpenFlow流表加速查找方法
CN103873371B (zh) 一种名字路由快速匹配查找方法与装置
CN1064500C (zh) 临时存储数据包的方法和设备
Panigrahy et al. Reducing TCAM power consumption and increasing throughput
US6775737B1 (en) Method and apparatus for allocating and using range identifiers as input values to content-addressable memories
CN101604337B (zh) 一种哈希表项存储、查找装置及方法
Clerry Compact hash tables using bidirectional linear probing
CN1858734A (zh) 一种数据存储及搜索方法
CN101655821B (zh) 一种解决地址空间映射哈希地址冲突的方法及装置
CN1299468C (zh) 一种聚合组流量均衡方法
CN102045412B (zh) IPv6地址前缀压缩存储方法及设备
US20030018693A1 (en) Method and apparatus for set intersection rule matching
CN1897560A (zh) 一种提高路由表容量的方法
CN102147802B (zh) 一种伪随机类nfs应用加速系统
CN103780692B (zh) 一种键值存储的数据访问方法及其系统
CN100352233C (zh) 路由表的组织与查找方法
Demetriades et al. An efficient hardware-based multi-hash scheme for high speed IP lookup
CN110995876A (zh) 一种ip存储与查找的方法及装置
CN1866203A (zh) 一种字符串引用方法
Chang et al. A high-speed and memory efficient pipeline architecture for packet classification
Li et al. Deterministic and efficient hash table lookup using discriminated vectors
CN1571352A (zh) 在网络设备中处理五元流组的方法
Lin et al. Fast tcam-based multi-match packet classification using discriminators
CN1134177C (zh) 一种分段式ip路由线速率查表方法
CN107305532A (zh) 一种表项替换方法、装置及终端

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20181016

Address after: 510640 2414-2416 of the main building 371, five mountain road, Tianhe District, Guangzhou, Guangdong.

Patentee after: Guangdong Gaohang Intellectual Property Operation Co., Ltd.

Address before: 518057 Department of law, Zhongxing building, South Science and technology road, Nanshan District hi tech Industrial Park, Shenzhen

Patentee before: ZTE Corporation

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20181102

Address after: 221311 Industrial Park, Pizhou, Xuzhou, Jiangsu

Patentee after: Pizhou Cheng Ding mechanical equipment Co., Ltd.

Address before: 510640 2414-2416 of the main building 371, five mountain road, Tianhe District, Guangzhou, Guangdong.

Patentee before: Guangdong Gaohang Intellectual Property Operation Co., Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20190701

Address after: 510000 Room 2101, No. 48 Longxi East Road, Liwan District, Guangzhou City, Guangdong Province, 0189

Patentee after: Guangzhou magnesium Data System Co., Ltd.

Address before: 221311 Industrial Park, Pizhou, Xuzhou, Jiangsu

Patentee before: Pizhou Cheng Ding mechanical equipment Co., Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191115

Address after: 221300 north side of Qingnian East Road, Yunhe Town, Pizhou City, Xuzhou City, Jiangsu Province

Patentee after: Pizhou Runhong Industry Co., Ltd.

Address before: 510000 Room 2101, No. 48 Longxi East Road, Liwan District, Guangzhou City, Guangdong Province, 0189

Patentee before: Guangzhou magnesium Data System Co., Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070207

Termination date: 20190418

CF01 Termination of patent right due to non-payment of annual fee