WO2016095439A1 - Equal cost multi-path (ecmp) based packet transmission method and device - Google Patents

Equal cost multi-path (ecmp) based packet transmission method and device Download PDF

Info

Publication number
WO2016095439A1
WO2016095439A1 PCT/CN2015/080061 CN2015080061W WO2016095439A1 WO 2016095439 A1 WO2016095439 A1 WO 2016095439A1 CN 2015080061 W CN2015080061 W CN 2015080061W WO 2016095439 A1 WO2016095439 A1 WO 2016095439A1
Authority
WO
WIPO (PCT)
Prior art keywords
egress
encapsulation
package
obtaining
base address
Prior art date
Application number
PCT/CN2015/080061
Other languages
French (fr)
Chinese (zh)
Inventor
谢密
张启申
孟庆明
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016095439A1 publication Critical patent/WO2016095439A1/en

Links

Images

Definitions

  • the present invention relates to the field of communications, and in particular to an ECMP (Equal Cost Multi-Path)-based message transmission method and apparatus.
  • ECMP Equal Cost Multi-Path
  • ECMP Equal Cost Multi-Path
  • IP networks In the traditional shortest path algorithm, if two or more shortest paths exist at the same time, the algorithm chooses the optimal one. ECMP has been improved, and traffic is distributed among multiple equal-cost paths. After ECMP is deployed on a MPLS network (Multi-Protocol Label Switching) network, you need to meet the carrier-class protection switching requirements when the link is faulty.
  • MPLS Multi-Protocol Label Switching
  • FIG. 1 is a flowchart of a method for transmitting ECMP-based messages according to the related art.
  • the message transmission device passes MAC address (Media Access Control, media access).
  • the control, the source MAC address, the destination IP address, the source IP address, and other fields are hashed to obtain a hash value.
  • the egress encapsulation table has multiple consecutive entries, corresponding to multiple equal-cost forwarding paths, when the destination destination MAC address, source MAC address, and destination When the fields such as IP and source IP are changed, different hash values are obtained through the hash module.
  • By adding the hash value to the base address of the export encapsulation table different egress encapsulation table entries can be corresponding to achieve packet sharing.
  • N MPLS ECMPs are formed in the MPLS (Multiple Protocol Label Switch) network
  • all MPLS ECMPs share the shared link.
  • the prior art cannot directly take all the hash values, and only a part of the bits can be discarded, and the actual number of links is taken.
  • the actual number of links is 32
  • the number of bits is 5. (2 to the 5th power)
  • the possible hash value change is not within 5 bits of the fetch, that is, after hashing different message fields, the lower 5 bits of the hash value are unchanged, which will cause uneven link sharing, resulting in uneven link sharing.
  • the shared flow accuracy exceeded the standard.
  • the present invention provides an ECMP-based message transmission method and apparatus, so as to at least solve the problem that the transmission link cannot uniformly share the message transmission in the related art.
  • an ECMP-based message transmission method including: receiving a message, and obtaining a hash value of the packet and a base address of a corresponding egress encapsulation table; acquiring a transmission link Number, and modulo the hash value to the number of the transmission links to obtain a modulus value; according to the base address and location of the egress package table The modulo value obtains the encapsulation information from the egress package table; encapsulates the packet according to the encapsulation information, and sends the packet.
  • obtaining the encapsulation information from the egress package table according to the base address of the egress package table and the modulus value includes: obtaining a base address of the share policy table, where the share policy table includes Determining an offset address of the transport link in the egress package table; obtaining an offset address of the egress package table from the share policy table according to a base address of the share policy table and the modulus value; The base address of the egress package table and the offset address obtain encapsulation information from the egress package table.
  • the obtaining the number of transmission links includes: acquiring the number of the transmission links from the stored transmission link number table.
  • the transmission link number table is updated, and the offset address corresponding to the transmission link in the sharing policy table is deleted.
  • obtaining the offset address of the egress encapsulation table from the base of the share policy table and the modulus value from the share policy table includes: base address according to the share policy table and The modulo value is obtained as an index of the sharing policy table; the loyalty policy table index is used to query the sharing policy table corresponding to the index of the sharing policy table, and the offset address of the egress encapsulation table is obtained, where the sharing policy is The table stores the mapping relationship between the index of the sharing policy table and the offset address of the egress encapsulation table; obtaining the encapsulation information from the egress encapsulation table according to the base address of the egress encapsulation table and the offset address includes: Deriving the egress package table index according to the base address of the egress package table and the offset address; querying an egress package table corresponding to the egress package table index according to the egress package table index, and obtaining the encapsulation information,
  • the egress package table stores a
  • an ECMP-based message transmission apparatus including: an obtaining module, configured to receive a message, and obtain a hash value of the packet and a corresponding base address of an export encapsulation table. And obtaining a number of transmission links; the processing module is configured to modulo the number of transmission links acquired by the obtaining module by using a hash value obtained by the acquiring module to obtain a modulus value; and the acquiring module is further configured to: And obtaining the encapsulation information from the egress package table according to the base address of the egress package table obtained by the obtaining module and the modulus value obtained by the processing module; and the encapsulating and sending module is configured to encapsulate the encapsulation information acquired according to the acquiring module. Describe the message and send the message.
  • the acquiring module is configured to obtain a base address of the sharing policy table, where the sharing policy table includes an offset address of the transmission link in the egress encapsulation table, and according to the The base address of the share policy table and the modulus value are obtained from the share policy table, and the offset address of the egress package table is obtained, and the egress package is encapsulated according to the base address of the egress package table and the offset address.
  • the package information is obtained in the table.
  • the acquiring module is configured to acquire the number of the transmission links from the stored transmission link number table.
  • the processing module is further configured to: when the transmission link is faulty, update the transmission link number table, and the corresponding to the transmission link in the sharing policy table The offset address is deleted.
  • the acquiring module is configured to obtain the sharing policy table index according to the base address of the sharing policy table and the modulus, and query the sharing policy table according to the sharing policy table index. Indexing a corresponding sharing policy table, and obtaining an offset address of the egress encapsulation table, where the sharing policy table stores a correspondence between the sharing policy table index and an offset address of the egress encapsulation table;
  • the obtaining module is configured to obtain the egress encapsulation table index according to the base address of the egress encapsulation table and the offset address, and query an egress encapsulation table corresponding to the egress encapsulation table index according to the egress encapsulation table index, and Obtaining the encapsulation information, wherein the egress package table stores a correspondence between the egress package table index and the encapsulation information.
  • the packet transmission apparatus is used to receive the packet, and obtain the hash value of the packet and the corresponding base address of the egress encapsulation table, obtain the number of transmission links, and transmit the hash value to the packet.
  • the number of links is obtained by modulo, and the encapsulation information is obtained from the egress package table according to the base address of the egress package table and the modulus value, and the packet is encapsulated according to the encapsulation information, and the packet is sent to solve the problem.
  • the transmission link cannot uniformly share the message transmission, thereby improving the load sharing accuracy.
  • FIG. 1 is a flowchart of a method for ECMP-based message transmission according to the related art
  • FIG. 2 is a flowchart of a method for ECMP-based message transmission according to an embodiment of the present invention
  • FIG. 3a is a schematic diagram of a sharing policy table according to an embodiment of the present invention.
  • FIG. 3b is a schematic diagram of a transmission link number table according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of another ECMP-based message transmission method according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of message transmission by a message transmission apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of another message transmission apparatus performing message transmission according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a message transmission apparatus according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of ECMP-based message transmission according to an embodiment of the present invention. As shown in FIG. 2, the process includes the following steps. :
  • Step S202 receiving a packet, and obtaining a hash value of the packet and a base address of the corresponding export encapsulation table
  • Step S204 obtaining the number of transmission links, and modulating the number of the transmission links to obtain a modulus value
  • Step S206 obtaining encapsulation information from the egress package table according to the base address of the egress package table and the modulus value;
  • Step S208 the packet is encapsulated according to the encapsulation information, and the packet is sent.
  • the base address of the distribution policy table is obtained, and the offset address of the egress package table is obtained from the share policy table according to the base address of the share policy table and the modulus value, according to the basis of the egress package table.
  • the address and the offset address obtain the encapsulation information from the egress encapsulation table, so that multiple ECMP groups can be configured to correspond to one sharing policy table.
  • FIG. 3a is a schematic diagram of a sharing policy table according to an embodiment of the present invention. As shown in FIG. 3a, the sharing policy table includes an offset address of the transmission link in the egress encapsulation table.
  • the sharing policy table includes consecutive M entries (M is the number of transmission links), and the table is based on the link interface combination and the link-sharing weight aggregation, that is, the ECMP service with the same link interface and the same weight. Share a shared strategy table.
  • the number of the transmission links is obtained from the stored transmission link number table.
  • FIG. 3b is a schematic diagram of a transmission link number table according to an embodiment of the present invention.
  • the transmission link number table stores the number of transmission links, and the table is based on a link interface combination and a link.
  • the ECMP service with the same link interface and the same weight is shared.
  • the transmission link number table is updated, and the offset address corresponding to the transmission link in the sharing policy table is deleted, so that although there are multiple ECMP groups
  • switching a shared strategy table can achieve one-to-one switching, avoiding switching of each egress package table, and significantly improving handover performance.
  • the sharing policy table index is obtained according to the base address of the sharing policy table and the modulus value, and the sharing policy table corresponding to the sharing policy table index is queried according to the sharing policy table index, and the export encapsulation table is obtained.
  • the offset information, the encapsulation information obtained from the egress encapsulation table according to the base address of the egress encapsulation table and the offset address includes: wherein the sharing policy table stores the offset of the sharing policy table index and the egress encapsulation table The correspondence of addresses.
  • the egress package table corresponding to the egress package table index is queried according to the egress package table index, and the package information is obtained, wherein the egress package table stores the egress package table index and the corresponding information of the package information. relationship.
  • FIG. 4 is a flowchart of another method for transmitting ECMP based message according to an embodiment of the present invention.
  • the executor may be a message transmission device, and the message transmission device may be a router.
  • the embodiment of the present invention is not limited thereto.
  • the process of the method includes:
  • the message transmission device receives the packet, and obtains a hash value of the packet and a base address of the corresponding export encapsulation table.
  • the packet processing device obtains the destination MAC address, source MAC address, destination IP address, and source IP address of the packet to obtain a hash value.
  • the message transmission device obtains the number of transmission links from the stored transmission link number table, and modulates the number of the transmission links to obtain a modulus value.
  • all 16-bit (bit) hash values are used to perform a modulo operation on the number of shared links (ie, the remainder), and the value after the modulo operation does not exceed 8 due to the characteristics of the modulo operation, thereby avoiding The part of the hash value taken is unchanged or unevenly changed.
  • the message transmission device obtains the share policy table index according to the base address of the share policy table and the modulus value.
  • the message transmission device queries the sharing policy table corresponding to the index of the sharing policy table according to the sharing policy table index, and obtains an offset address of the egress encapsulation table.
  • the sharing policy table stores a correspondence between the sharing policy table index and an offset address of the egress encapsulation table.
  • the message transmission device obtains the egress package table index according to the base address of the egress package table and the offset address.
  • the message transmission device queries the egress package table corresponding to the egress package table index according to the egress package table index, and obtains the package information.
  • the egress package table stores a correspondence between the egress package table index and the encapsulation information.
  • the packet transmission device encapsulates the packet according to the encapsulation information, and sends the packet.
  • each route is learned from each of the eight shared links. This route forms load sharing. There are eight egresses. The egress MPLS label (encapsulated into outgoing packets) corresponding to each egress is different. That is, each route corresponds to 8 outgoing MPLS labels, and 1000 routes correspond to 1000 egress encapsulation tables. Each egress encapsulation table contains 8 entries, and each entry stores an outgoing MPLS label.
  • FIG. 5 is a schematic diagram of message transmission by a message transmission apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of message transmission by the message transmission apparatus according to an embodiment of the present invention.
  • the packet processing device obtains the destination MAC, source MAC, destination IP, source IP, and other fields to obtain a hash value by hashing, and reads the number of transmission links to obtain the number of transmission links; the obtained hash value pair
  • the number of transmission links is modulo, and the modulus value is obtained. Due to the characteristics of the modulo operation, the modulus value does not exceed the number of transmission links, and the obtained modulus value is added according to the base address of the sharing strategy table (the modulus value is the shared strategy table offset).
  • the index of the share policy table is obtained, and the corresponding share policy table entry is found, and the export package table offset is obtained.
  • the export package table index is obtained according to the obtained offset value of the export package table base address, and the corresponding export package table table is found. Item, obtains the export package information, and distributes the message according to the package information and sends the message.
  • the transmission link number table is updated, and the offset address corresponding to the transmission link in the sharing policy table is deleted, so that although there are multiple ECMP groups
  • switching a shared strategy table can achieve one-to-one switching, avoiding switching of each egress package table, and significantly improving handover performance.
  • FIG. 6 is a schematic diagram of another message transmission apparatus performing message transmission according to an embodiment of the present invention.
  • N ECMP groups share one 8 links (link 1 to link 8 respectively). Interface link group, and share a shared policy table.
  • the value recorded in the number of transmission link tables is 8, and the sharing policy table
  • the offset addresses of the eight links are sequentially recorded.
  • the packet transmission device deletes the offset address corresponding to the third link of the sharing policy table, and the transmission link bibliography is The value recorded in the record is adjusted from 8 to 7, so that only one sharing strategy table needs to be switched, thereby improving the switching performance.
  • the foregoing implementation manner solves the problem that the transmission link cannot uniformly share the packet transmission in the prior art, thereby improving the accuracy of the sharing and improving the load sharing precision.
  • the table can be used to achieve one-to-one switching, avoiding the switching of each egress package table, and significantly improving the switching performance.
  • a message transmission device is also provided, which is used to implement the foregoing embodiments and preferred embodiments, and has not been described again.
  • 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.
  • FIG. 7 is a structural block diagram of a message transmission apparatus according to an embodiment of the present invention. As shown in FIG. 7, the apparatus 70 includes:
  • the obtaining module 71 is configured to receive the packet, obtain the hash value of the packet and the base address of the corresponding egress encapsulation table, and obtain the number of transmission links.
  • the processing module 72 is configured to obtain the acquisition module 71.
  • the hash value is obtained by modulating the number of transmission links obtained by the obtaining module to obtain a modulus value; the obtaining module 71 is further configured to: according to the base address of the egress encapsulation table acquired by the obtaining module 71 and the modulus value obtained by the processing module
  • the encapsulation information is obtained in the egress package table.
  • the encapsulation sending module 73 is configured to encapsulate the packet according to the encapsulation information acquired by the acquisition module 71, and send the packet.
  • the obtaining module 71 is further configured to obtain a base address of the sharing policy table, where the sharing policy table includes an offset address of the transmission link in the egress encapsulation table, and according to the sharing policy table
  • the base address and the modulus value obtain an offset address of the egress package table from the share policy table, and obtain encapsulation information from the egress package table according to the base address of the egress package table and the offset address.
  • the obtaining module 71 is further configured to obtain the number of the transmission links from the stored transmission link number table.
  • the processing module 72 is further configured to: when the transmission link is faulty, update the transmission link number table, and delete the offset address corresponding to the transmission link in the sharing policy table.
  • the obtaining module 71 is further configured to obtain the index of the sharing policy table according to the base address of the sharing policy table and the modulus, and query the sharing corresponding to the index of the sharing policy table according to the index of the sharing policy table.
  • the obtaining module 71 is further configured to obtain the egress encapsulation table index according to the base address of the egress encapsulation table and the offset address, and query an egress encapsulation table corresponding to the egress encapsulation table index according to the egress encapsulation table index, and obtain the Encapsulation information, wherein the egress package table stores a correspondence between the egress package table index and the encapsulation information.
  • the above device solves the problem that the transmission link cannot uniformly share the message transmission in the prior art, thereby improving the sharing precision and improving the load sharing precision.
  • the purpose of the embodiment of the present invention is to perform a modulo operation by taking more bits of a hash value obtained from a hash module to improve load sharing accuracy, even if each link is evenly shared;
  • the common part of the egress encapsulation table in the prior art that is, the common link, is separated and placed in the sharing policy table, so that multiple ECMP groups have the same sharing policy table because of the shared link, when the link occurs.
  • switching a shared policy table can achieve multiple-to-one switching, which can significantly improve the switching performance.
  • modules or steps of the embodiments of the present invention can be implemented by a general computing device, which can be concentrated on a single computing device or distributed in 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 steps shown or described are performed sequentially, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated into a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
  • the above embodiments and the preferred embodiments solve the problem that the transmission link cannot uniformly share the message transmission in the prior art, thereby improving the load sharing accuracy.

Abstract

Disclosed are an equal cost multi-path (ECMP) based packet transmission method and device. The method comprises: receiving a packet, and obtaining a hash value of the packet and a base address of a corresponding export encapsulation table; obtaining a quantity of transmission links, and obtaining a modulus value by performing a modulus operation on the hash value and the quantity of transmission links; obtaining encapsulation information from the export encapsulation table according to the base address of the export encapsulation table and the modulus value; and encapsulating the packet according to the encapsulation information, and sending the packet, to at least resolve the problem in the prior art that transmission links cannot evenly share packet transmission.

Description

基于等价多路径ECMP的报文传输方法及装置Message transmission method and device based on equivalent multipath ECMP 技术领域Technical field
本发明涉及通信领域,具体而言,涉及一种基于ECMP(Equal Cost Multi-Path,等价多路径)的报文传输方法和装置。The present invention relates to the field of communications, and in particular to an ECMP (Equal Cost Multi-Path)-based message transmission method and apparatus.
背景技术Background technique
ECMP(Equal Cost Multi-Path,等价多路径)是改进IP网络中基于最短路径的内部网关路由协议不足的一种技术。在传统最短路径算法中,如果两条或多条最短路径同时存在,算法会选择最优的一条。而ECMP作了改进,流量在多条等价路径中分配。在MPLS(Multi-protocol Label Switching,多协议标签交换)网络部署ECMP后,需要在链路故障时达到电信级的保护倒换要求。ECMP (Equal Cost Multi-Path) is a technique for improving the shortest path based internal gateway routing protocol in IP networks. In the traditional shortest path algorithm, if two or more shortest paths exist at the same time, the algorithm chooses the optimal one. ECMP has been improved, and traffic is distributed among multiple equal-cost paths. After ECMP is deployed on a MPLS network (Multi-Protocol Label Switching) network, you need to meet the carrier-class protection switching requirements when the link is faulty.
在相关技术中,图1是根据相关技术中的一种基于ECMP的报文传输的方法的流程图,如图1所示,报文传输装置通过对报文目的MAC(Media Access Control,介质访问控制)、源MAC、目的IP、源IP等字段进行哈希后获得哈希值,出口封装表中存在多个连续条目,对应多条等价转发路径,当报文目的MAC、源MAC、目的IP、源IP等字段变化时,经过哈希模块得到不同的哈希值,通过出口封装表基址加上啥希值,就可以对应到不同的出口封装表条目,以达到将报文分担到多条路径上转发的目的。当MPLS(Multiple Protocol Label Switch,多协议标签交换协议)网络中形成N个MPLS ECMP时,所有MPLS ECMP共用分担链路。对不同的分担链路数,现有技术不能直接取全部哈希值,只能舍弃一部分比特位,按实际链路数来取,比如实际链路数为32时,取的比特位数为5(2的5次方),可能哈希值变化不在取的5bit以内,即对不同的报文字段做哈希后,哈希值的低5bit不变,这样会使得链路分担不均,造成分担流量精度超标。In the related art, FIG. 1 is a flowchart of a method for transmitting ECMP-based messages according to the related art. As shown in FIG. 1, the message transmission device passes MAC address (Media Access Control, media access). The control, the source MAC address, the destination IP address, the source IP address, and other fields are hashed to obtain a hash value. The egress encapsulation table has multiple consecutive entries, corresponding to multiple equal-cost forwarding paths, when the destination destination MAC address, source MAC address, and destination When the fields such as IP and source IP are changed, different hash values are obtained through the hash module. By adding the hash value to the base address of the export encapsulation table, different egress encapsulation table entries can be corresponding to achieve packet sharing. The purpose of forwarding on multiple paths. When N MPLS ECMPs are formed in the MPLS (Multiple Protocol Label Switch) network, all MPLS ECMPs share the shared link. For the number of shared links, the prior art cannot directly take all the hash values, and only a part of the bits can be discarded, and the actual number of links is taken. For example, when the actual number of links is 32, the number of bits is 5. (2 to the 5th power), the possible hash value change is not within 5 bits of the fetch, that is, after hashing different message fields, the lower 5 bits of the hash value are unchanged, which will cause uneven link sharing, resulting in uneven link sharing. The shared flow accuracy exceeded the standard.
发明内容Summary of the invention
本发明提供了一种基于ECMP的报文传输方法及装置,以至少解决相关技术中传输链路无法均匀分担报文传输的问题。The present invention provides an ECMP-based message transmission method and apparatus, so as to at least solve the problem that the transmission link cannot uniformly share the message transmission in the related art.
根据本发明的一个方面,提供了一种基于ECMP的报文传输方法,包括:接收报文,并获得所述报文的哈希值和对应的出口封装表的基址;获取传输链路的数目,并将所述哈希值对所述传输链路的数目取模得到模值;根据所述出口封装表的基址和所 述模值从所述出口封装表中得到封装信息;根据所述封装信息封装所述报文,并发送所述报文。According to an aspect of the present invention, an ECMP-based message transmission method is provided, including: receiving a message, and obtaining a hash value of the packet and a base address of a corresponding egress encapsulation table; acquiring a transmission link Number, and modulo the hash value to the number of the transmission links to obtain a modulus value; according to the base address and location of the egress package table The modulo value obtains the encapsulation information from the egress package table; encapsulates the packet according to the encapsulation information, and sends the packet.
在本发明实施例中,根据所述出口封装表的基址和所述模值从所述出口封装表中得到封装信息包括:获取分担策略表的基址,其中,所述分担策略表包括所述传输链路在所述出口封装表的偏移地址;根据所述分担策略表的基址和所述模值从所述分担策略表中得到所述出口封装表的偏移地址;根据所述出口封装表的基址和所述偏移地址从所述出口封装表中得到封装信息。In the embodiment of the present invention, obtaining the encapsulation information from the egress package table according to the base address of the egress package table and the modulus value includes: obtaining a base address of the share policy table, where the share policy table includes Determining an offset address of the transport link in the egress package table; obtaining an offset address of the egress package table from the share policy table according to a base address of the share policy table and the modulus value; The base address of the egress package table and the offset address obtain encapsulation information from the egress package table.
在本发明实施例中,所述获取传输链路的数目包括:从存储的传输链路数目表中获取所述传输链路的数目。In the embodiment of the present invention, the obtaining the number of transmission links includes: acquiring the number of the transmission links from the stored transmission link number table.
在本发明实施例中,在所述传输链路故障时,更新所述传输链路数目表,并将所述分担策略表中所述传输链路对应的所述偏移地址删除。In the embodiment of the present invention, when the transmission link is faulty, the transmission link number table is updated, and the offset address corresponding to the transmission link in the sharing policy table is deleted.
在本发明实施例中,根据所述分担策略表的基址和所述模值从所述分担策略表中得到所述出口封装表的偏移地址包括:根据所述分担策略表的基址和所述模值得到所述分担策略表索引;根据所述分担策略表索引查询所述分担策略表索引对应的分担策略表,并得到所述出口封装表的偏移地址,其中,所述分担策略表存储有所述分担策略表索引和所述出口封装表的偏移地址的对应关系;根据所述出口封装表的基址和所述偏移地址从所述出口封装表中得到封装信息包括:根据所述出口封装表的基址和所述偏移地址得到所述出口封装表索引;根据所述出口封装表索引查询所述出口封装表索引对应的出口封装表,并得到所述封装信息,其中,所述出口封装表存储有所述出口封装表索引和所述封装信息的对应关系。In the embodiment of the present invention, obtaining the offset address of the egress encapsulation table from the base of the share policy table and the modulus value from the share policy table includes: base address according to the share policy table and The modulo value is obtained as an index of the sharing policy table; the loyalty policy table index is used to query the sharing policy table corresponding to the index of the sharing policy table, and the offset address of the egress encapsulation table is obtained, where the sharing policy is The table stores the mapping relationship between the index of the sharing policy table and the offset address of the egress encapsulation table; obtaining the encapsulation information from the egress encapsulation table according to the base address of the egress encapsulation table and the offset address includes: Deriving the egress package table index according to the base address of the egress package table and the offset address; querying an egress package table corresponding to the egress package table index according to the egress package table index, and obtaining the encapsulation information, The egress package table stores a correspondence between the egress package table index and the encapsulation information.
根据本发明的另一方面,提供了一种基于ECMP的报文传输装置,包括:获取模块,设置为接收报文,并获得所述报文的哈希值和对应的出口封装表的基址,以及获取传输链路的数目;处理模块,设置为将所述获取模块获取的哈希值对所述获取模块获取的传输链路的数目取模得到模值;所述获取模块还设置为,根据所述获取模块获取的出口封装表的基址和所述处理模块得到的模值从所述出口封装表中得到封装信息;封装发送模块,设置为根据所述获取模块获取的封装信息封装所述报文,并发送所述报文。According to another aspect of the present invention, an ECMP-based message transmission apparatus is provided, including: an obtaining module, configured to receive a message, and obtain a hash value of the packet and a corresponding base address of an export encapsulation table. And obtaining a number of transmission links; the processing module is configured to modulo the number of transmission links acquired by the obtaining module by using a hash value obtained by the acquiring module to obtain a modulus value; and the acquiring module is further configured to: And obtaining the encapsulation information from the egress package table according to the base address of the egress package table obtained by the obtaining module and the modulus value obtained by the processing module; and the encapsulating and sending module is configured to encapsulate the encapsulation information acquired according to the acquiring module. Describe the message and send the message.
在本发明实施例中,所述获取模块设置为,获取分担策略表的基址,其中,所述分担策略表包括所述传输链路在所述出口封装表的偏移地址,并根据所述分担策略表的基址和所述模值从所述分担策略表中得到所述出口封装表的偏移地址,并根据所述出口封装表的基址和所述偏移地址从所述出口封装表中得到封装信息。 In the embodiment of the present invention, the acquiring module is configured to obtain a base address of the sharing policy table, where the sharing policy table includes an offset address of the transmission link in the egress encapsulation table, and according to the The base address of the share policy table and the modulus value are obtained from the share policy table, and the offset address of the egress package table is obtained, and the egress package is encapsulated according to the base address of the egress package table and the offset address. The package information is obtained in the table.
在本发明实施例中,所述获取模块设置为,从存储的传输链路数目表中获取所述传输链路的数目。In the embodiment of the present invention, the acquiring module is configured to acquire the number of the transmission links from the stored transmission link number table.
在本发明实施例中,所述处理模块还设置为,在所述传输链路故障时,更新所述传输链路数目表,并将所述分担策略表中所述传输链路对应的所述偏移地址删除。In the embodiment of the present invention, the processing module is further configured to: when the transmission link is faulty, update the transmission link number table, and the corresponding to the transmission link in the sharing policy table The offset address is deleted.
在本发明实施例中,所述获取模块设置为,根据所述分担策略表的基址和所述模值得到所述分担策略表索引,并根据所述分担策略表索引查询所述分担策略表索引对应的分担策略表,并得到所述出口封装表的偏移地址,其中,所述分担策略表存储有所述分担策略表索引和所述出口封装表的偏移地址的对应关系;所述获取模块设置为,根据所述出口封装表的基址和所述偏移地址得到所述出口封装表索引,并根据所述出口封装表索引查询所述出口封装表索引对应的出口封装表,并得到所述封装信息,其中,所述出口封装表存储有所述出口封装表索引和所述封装信息的对应关系。In the embodiment of the present invention, the acquiring module is configured to obtain the sharing policy table index according to the base address of the sharing policy table and the modulus, and query the sharing policy table according to the sharing policy table index. Indexing a corresponding sharing policy table, and obtaining an offset address of the egress encapsulation table, where the sharing policy table stores a correspondence between the sharing policy table index and an offset address of the egress encapsulation table; The obtaining module is configured to obtain the egress encapsulation table index according to the base address of the egress encapsulation table and the offset address, and query an egress encapsulation table corresponding to the egress encapsulation table index according to the egress encapsulation table index, and Obtaining the encapsulation information, wherein the egress package table stores a correspondence between the egress package table index and the encapsulation information.
通过本发明实施例,采用报文传输装置接收报文,并获得该报文的哈希值和对应的出口封装表的基址,获取传输链路的数目,并将该哈希值对该传输链路的数目取模得到模值,并根据该出口封装表的基址和该模值从该出口封装表中得到封装信息,并根据该封装信息封装该报文,并发送该报文,解决了现有技术中传输链路无法均匀分担报文传输的问题,从而提高负荷分担精度。In the embodiment of the present invention, the packet transmission apparatus is used to receive the packet, and obtain the hash value of the packet and the corresponding base address of the egress encapsulation table, obtain the number of transmission links, and transmit the hash value to the packet. The number of links is obtained by modulo, and the encapsulation information is obtained from the egress package table according to the base address of the egress package table and the modulus value, and the packet is encapsulated according to the encapsulation information, and the packet is sent to solve the problem. In the prior art, the transmission link cannot uniformly share the message transmission, thereby improving the load sharing accuracy.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1是根据相关技术中的一种基于ECMP的报文传输的方法的流程图;1 is a flowchart of a method for ECMP-based message transmission according to the related art;
图2是根据本发明实施例的一种基于ECMP的报文传输的方法的流程图;2 is a flowchart of a method for ECMP-based message transmission according to an embodiment of the present invention;
图3a是根据本发明实施例的一种分担策略表的示意图;FIG. 3a is a schematic diagram of a sharing policy table according to an embodiment of the present invention; FIG.
图3b是根据本发明实施例的一种传输链路数目表的示意图;FIG. 3b is a schematic diagram of a transmission link number table according to an embodiment of the present invention; FIG.
图4是根据本发明实施例的另一种基于ECMP的报文传输的方法的流程图;4 is a flowchart of another ECMP-based message transmission method according to an embodiment of the present invention;
图5是根据本发明实施例的一种报文传输装置进行报文传输的示意图;FIG. 5 is a schematic diagram of message transmission by a message transmission apparatus according to an embodiment of the present invention; FIG.
图6是根据本发明实施例另一种报文传输装置进行报文传输的示意图; FIG. 6 is a schematic diagram of another message transmission apparatus performing message transmission according to an embodiment of the present invention; FIG.
图7是根据本发明实施例的一种报文传输装置的结构示意图。FIG. 7 is a schematic structural diagram of a message transmission apparatus according to an embodiment of the present invention.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
在本实施例中提供了一种基于ECMP的报文传输的方法,图2是根据本发明实施例的一种基于ECMP的报文传输的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a method for ECMP-based message transmission is provided. FIG. 2 is a flowchart of ECMP-based message transmission according to an embodiment of the present invention. As shown in FIG. 2, the process includes the following steps. :
步骤S202,接收报文,并获得该报文的哈希值和对应的出口封装表的基址;Step S202, receiving a packet, and obtaining a hash value of the packet and a base address of the corresponding export encapsulation table;
步骤S204,获取传输链路的数目,并将该哈希值对该传输链路的数目取模得到模值;Step S204, obtaining the number of transmission links, and modulating the number of the transmission links to obtain a modulus value;
步骤S206,根据该出口封装表的基址和该模值从该出口封装表中得到封装信息;Step S206, obtaining encapsulation information from the egress package table according to the base address of the egress package table and the modulus value;
步骤S208,根据该封装信息封装该报文,并发送该报文。Step S208, the packet is encapsulated according to the encapsulation information, and the packet is sent.
通过上述步骤,解决了现有技术中传输链路无法均匀分担报文传输的问题,从而提高符合分担精度,提高了负荷分担精度。Through the above steps, the problem that the transmission link cannot uniformly share the message transmission in the prior art is solved, thereby improving the sharing precision and improving the load sharing precision.
在本发明实施例中,获取分担策略表的基址,根据该分担策略表的基址和该模值从该分担策略表中得到该出口封装表的偏移地址,根据该出口封装表的基址和该偏移地址从该出口封装表中得到封装信息,这样,可以实现多个ECMP组对应一个分担策略表。In the embodiment of the present invention, the base address of the distribution policy table is obtained, and the offset address of the egress package table is obtained from the share policy table according to the base address of the share policy table and the modulus value, according to the basis of the egress package table. The address and the offset address obtain the encapsulation information from the egress encapsulation table, so that multiple ECMP groups can be configured to correspond to one sharing policy table.
其中,图3a是根据本发明实施例的一种分担策略表的示意图,如图3a所示,该分担策略表包括该传输链路在该出口封装表的偏移地址。FIG. 3a is a schematic diagram of a sharing policy table according to an embodiment of the present invention. As shown in FIG. 3a, the sharing policy table includes an offset address of the transmission link in the egress encapsulation table.
需要说明的是,该分担策略表包含连续M条表项(M为传输链路数目),该表基于链路接口组合与链路分担权重聚合,即链路接口相同且分担权重相同的ECMP业务共用一个分担策略表。It should be noted that the sharing policy table includes consecutive M entries (M is the number of transmission links), and the table is based on the link interface combination and the link-sharing weight aggregation, that is, the ECMP service with the same link interface and the same weight. Share a shared strategy table.
在本发明实施例中,从存储的传输链路数目表中获取该传输链路的数目。In the embodiment of the present invention, the number of the transmission links is obtained from the stored transmission link number table.
其中,图3b是根据本发明实施例的一种传输链路数目表的示意图,如图3b所示,该传输链路数目表保存了传输链路数目,该表基于链路接口组合与链路分担权重聚合,即链路接口相同且分担权重相同的ECMP业务共用一个传输链路数目表。 FIG. 3b is a schematic diagram of a transmission link number table according to an embodiment of the present invention. As shown in FIG. 3b, the transmission link number table stores the number of transmission links, and the table is based on a link interface combination and a link. The ECMP service with the same link interface and the same weight is shared.
在本发明实施例中,在该传输链路故障时,更新该传输链路数目表,并将该分担策略表中该传输链路对应的该偏移地址删除,这样,虽然有多个ECMP组,但切换一个分担策略表即可,实现多到一的切换,避免了对每个出口封装表的切换,显著提高了切换性能。In the embodiment of the present invention, when the transmission link is faulty, the transmission link number table is updated, and the offset address corresponding to the transmission link in the sharing policy table is deleted, so that although there are multiple ECMP groups However, switching a shared strategy table can achieve one-to-one switching, avoiding switching of each egress package table, and significantly improving handover performance.
在本发明实施例中,根据该分担策略表的基址和该模值得到该分担策略表索引,根据该分担策略表索引查询该分担策略表索引对应的分担策略表,并得到该出口封装表的偏移地址,根据该出口封装表的基址和该偏移地址从该出口封装表中得到封装信息包括:其中,该分担策略表存储有该分担策略表索引和该出口封装表的偏移地址的对应关系。In the embodiment of the present invention, the sharing policy table index is obtained according to the base address of the sharing policy table and the modulus value, and the sharing policy table corresponding to the sharing policy table index is queried according to the sharing policy table index, and the export encapsulation table is obtained. The offset information, the encapsulation information obtained from the egress encapsulation table according to the base address of the egress encapsulation table and the offset address includes: wherein the sharing policy table stores the offset of the sharing policy table index and the egress encapsulation table The correspondence of addresses.
在本发明实施例中,根据该出口封装表索引查询该出口封装表索引对应的出口封装表,并得到该封装信息,其中,该出口封装表存储有该出口封装表索引和该封装信息的对应关系。In the embodiment of the present invention, the egress package table corresponding to the egress package table index is queried according to the egress package table index, and the package information is obtained, wherein the egress package table stores the egress package table index and the corresponding information of the package information. relationship.
本发明实施例提供一种基于ECMP的报文传输方法,图4是根据本发明实施例的另一种基于ECMP的报文传输的方法的流程图,如图4所示,本发明实施例的执行主体可以是报文传输装置,该报文传输装置可以是路由器,本发明实施例对此不作限定,该方法的流程包括:The embodiment of the present invention provides a method for transmitting a message based on ECMP, and FIG. 4 is a flowchart of another method for transmitting ECMP based message according to an embodiment of the present invention. As shown in FIG. The executor may be a message transmission device, and the message transmission device may be a router. The embodiment of the present invention is not limited thereto. The process of the method includes:
S401,报文传输装置接收报文,并获取该报文的哈希值和对应的出口封装表的基址。S401. The message transmission device receives the packet, and obtains a hash value of the packet and a base address of the corresponding export encapsulation table.
其中,报文处理设备获取报文目的MAC、源MAC、目的IP、源IP等字段经过哈希得到哈希值。The packet processing device obtains the destination MAC address, source MAC address, destination IP address, and source IP address of the packet to obtain a hash value.
S402,报文传输装置从存储的传输链路数目表中获取传输链路的数目,并将该哈希值对该传输链路的数目取模得到模值。S402. The message transmission device obtains the number of transmission links from the stored transmission link number table, and modulates the number of the transmission links to obtain a modulus value.
例如,本发明实施例取全部16bit(比特)的哈希值对分担链路数8做模运算(即取余),由于模运算的特性,做模运算后的值不会超过8,避免了所取的部分哈希值不变或变化不均匀。For example, in the embodiment of the present invention, all 16-bit (bit) hash values are used to perform a modulo operation on the number of shared links (ie, the remainder), and the value after the modulo operation does not exceed 8 due to the characteristics of the modulo operation, thereby avoiding The part of the hash value taken is unchanged or unevenly changed.
S403,报文传输装置根据该分担策略表的基址和该模值得到该分担策略表索引。S403. The message transmission device obtains the share policy table index according to the base address of the share policy table and the modulus value.
S404,报文传输装置根据该分担策略表索引查询该分担策略表索引对应的分担策略表,并得到该出口封装表的偏移地址。 S404: The message transmission device queries the sharing policy table corresponding to the index of the sharing policy table according to the sharing policy table index, and obtains an offset address of the egress encapsulation table.
其中,该分担策略表存储有该分担策略表索引和该出口封装表的偏移地址的对应关系。The sharing policy table stores a correspondence between the sharing policy table index and an offset address of the egress encapsulation table.
S405,报文传输装置根据该出口封装表的基址和该偏移地址得到该出口封装表索引。S405. The message transmission device obtains the egress package table index according to the base address of the egress package table and the offset address.
S406,报文传输装置根据该出口封装表索引查询该出口封装表索引对应的出口封装表,并得到该封装信息。S406. The message transmission device queries the egress package table corresponding to the egress package table index according to the egress package table index, and obtains the package information.
其中,该出口封装表存储有该出口封装表索引和该封装信息的对应关系。The egress package table stores a correspondence between the egress package table index and the encapsulation information.
S407,报文传输装置根据该封装信息封装该报文,并发送该报文。S407. The packet transmission device encapsulates the packet according to the encapsulation information, and sends the packet.
需要说明的是,由于不同的ECMP组出口封装信息不一样(即MPLS标签不一样),因此不同的出口封装表对应不同的ECMP组。It should be noted that, because different ECMP group export encapsulation information is different (that is, MPLS labels are different), different egress package tables correspond to different ECMP groups.
例如,1000条路由,每条路由从8条分担链路分别学习到,这条路由形成负荷分担,出口有8个,每个出口对应的出向MPLS标签(封装到出去的报文中)不同,即每条路由对应8个出向MPLS标签,1000条路由就对应1000个出口封装表,每个出口封装表中包含8个条目,每个条目中保存一个出向MPLS标签。For example, 1000 routes are learned from each of the eight shared links. This route forms load sharing. There are eight egresses. The egress MPLS label (encapsulated into outgoing packets) corresponding to each egress is different. That is, each route corresponds to 8 outgoing MPLS labels, and 1000 routes correspond to 1000 egress encapsulation tables. Each egress encapsulation table contains 8 entries, and each entry stores an outgoing MPLS label.
综上,图5是根据本发明实施例的一种报文传输装置进行报文传输的示意图,如图5所示,图5为本发明实施例中该报文传输装置进行报文传输的示意图,报文处理设备获取报文目的MAC、源MAC、目的IP、源IP等字段经过哈希得到哈希值,并读取传输链路数目表获取传输链路数;将得到的哈希值对传输链路数取模,得到模值,由于模运算的特性,模值不会超过传输链路数,根据分担策略表的基址加上得到的模值(模值即分担策略表偏移)得到分担策略表索引,查到对应的分担策略表表项,得到出口封装表偏移,根据出口封装表基址加上得到的偏移值得到出口封装表索引,查到对应的出口封装表表项,得到出口封装信息,并根据该封装信息分装报文并发送。In summary, FIG. 5 is a schematic diagram of message transmission by a message transmission apparatus according to an embodiment of the present invention. As shown in FIG. 5, FIG. 5 is a schematic diagram of message transmission by the message transmission apparatus according to an embodiment of the present invention. The packet processing device obtains the destination MAC, source MAC, destination IP, source IP, and other fields to obtain a hash value by hashing, and reads the number of transmission links to obtain the number of transmission links; the obtained hash value pair The number of transmission links is modulo, and the modulus value is obtained. Due to the characteristics of the modulo operation, the modulus value does not exceed the number of transmission links, and the obtained modulus value is added according to the base address of the sharing strategy table (the modulus value is the shared strategy table offset). The index of the share policy table is obtained, and the corresponding share policy table entry is found, and the export package table offset is obtained. The export package table index is obtained according to the obtained offset value of the export package table base address, and the corresponding export package table table is found. Item, obtains the export package information, and distributes the message according to the package information and sends the message.
在本发明实施例中,在该传输链路故障时,更新该传输链路数目表,并将该分担策略表中该传输链路对应的该偏移地址删除,这样,虽然有多个ECMP组,但切换一个分担策略表即可,实现多到一的切换,避免了对每个出口封装表的切换,显著提高了切换性能。In the embodiment of the present invention, when the transmission link is faulty, the transmission link number table is updated, and the offset address corresponding to the transmission link in the sharing policy table is deleted, so that although there are multiple ECMP groups However, switching a shared strategy table can achieve one-to-one switching, avoiding switching of each egress package table, and significantly improving handover performance.
例如,图6是根据本发明实施例另一种报文传输装置进行报文传输的示意图,如图6所示,N个ECMP组共用一个8条链路(分别为链路1至链路8)的接口链路组,并且共用一个分担策略表,此时,该传输链路数目表中记录的值为8,该分担策略表 分别依次记载该8条链路的偏移地址,当第3条链路发生故障时,报文传输装置将分担策略表第3条链路对应的偏移地址删除,并将传输链路书目表中记录的值由8调整为7,这样,只需要切换一个分担策略表即可,从而提高了切换性能。For example, FIG. 6 is a schematic diagram of another message transmission apparatus performing message transmission according to an embodiment of the present invention. As shown in FIG. 6, N ECMP groups share one 8 links (link 1 to link 8 respectively). Interface link group, and share a shared policy table. At this time, the value recorded in the number of transmission link tables is 8, and the sharing policy table The offset addresses of the eight links are sequentially recorded. When the third link fails, the packet transmission device deletes the offset address corresponding to the third link of the sharing policy table, and the transmission link bibliography is The value recorded in the record is adjusted from 8 to 7, so that only one sharing strategy table needs to be switched, thereby improving the switching performance.
采用上述实施方式,解决了现有技术中传输链路无法均匀分担报文传输的问题,从而提高符合分担精度,提高了负荷分担精度,另外,在该传输链路故障时,只切换一个分担策略表即可,实现多到一的切换,避免了对每个出口封装表的切换,显著提高了切换性能。The foregoing implementation manner solves the problem that the transmission link cannot uniformly share the packet transmission in the prior art, thereby improving the accuracy of the sharing and improving the load sharing precision. In addition, when the transmission link is faulty, only one sharing strategy is switched. The table can be used to achieve one-to-one switching, avoiding the switching of each egress package table, and significantly improving the switching performance.
在本实施例中还提供了一种报文传输装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a message transmission device is also provided, which is used to implement the foregoing embodiments and preferred embodiments, and has not been described again. As used below, the term "module" may implement a combination of software and/or hardware of a predetermined function. Although 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.
图7是根据本发明实施例的一种报文传输装置的结构框图,如图7所示,该装置70包括:FIG. 7 is a structural block diagram of a message transmission apparatus according to an embodiment of the present invention. As shown in FIG. 7, the apparatus 70 includes:
获取模块71,设置为接收报文,并获得该报文的哈希值和对应的出口封装表的基址,以及获取传输链路的数目;处理模块72,设置为将该获取模块71获取的哈希值对该获取模块获取的传输链路的数目取模得到模值;该获取模块71还设置为,根据该获取模块71获取的出口封装表的基址和该处理模块得到的模值从该出口封装表中得到封装信息;封装发送模块73,设置为根据该获取模块71获取的封装信息封装该报文,并发送该报文。The obtaining module 71 is configured to receive the packet, obtain the hash value of the packet and the base address of the corresponding egress encapsulation table, and obtain the number of transmission links. The processing module 72 is configured to obtain the acquisition module 71. The hash value is obtained by modulating the number of transmission links obtained by the obtaining module to obtain a modulus value; the obtaining module 71 is further configured to: according to the base address of the egress encapsulation table acquired by the obtaining module 71 and the modulus value obtained by the processing module The encapsulation information is obtained in the egress package table. The encapsulation sending module 73 is configured to encapsulate the packet according to the encapsulation information acquired by the acquisition module 71, and send the packet.
在本发明实施例中,该获取模块71,还设置为获取分担策略表的基址,其中,该分担策略表包括该传输链路在该出口封装表的偏移地址,并根据该分担策略表的基址和该模值从该分担策略表中得到该出口封装表的偏移地址,并根据该出口封装表的基址和该偏移地址从该出口封装表中得到封装信息。In the embodiment of the present invention, the obtaining module 71 is further configured to obtain a base address of the sharing policy table, where the sharing policy table includes an offset address of the transmission link in the egress encapsulation table, and according to the sharing policy table The base address and the modulus value obtain an offset address of the egress package table from the share policy table, and obtain encapsulation information from the egress package table according to the base address of the egress package table and the offset address.
在本发明实施例中,该获取模块71,还设置为从存储的传输链路数目表中获取该传输链路的数目。In the embodiment of the present invention, the obtaining module 71 is further configured to obtain the number of the transmission links from the stored transmission link number table.
在本发明实施例中,该处理模块72,还设置为在该传输链路故障时,更新该传输链路数目表,并将该分担策略表中该传输链路对应的该偏移地址删除。In the embodiment of the present invention, the processing module 72 is further configured to: when the transmission link is faulty, update the transmission link number table, and delete the offset address corresponding to the transmission link in the sharing policy table.
在本发明实施例中,该获取模块71,还设置为根据该分担策略表的基址和该模值得到该分担策略表索引,并根据该分担策略表索引查询该分担策略表索引对应的分担 策略表,并得到该出口封装表的偏移地址,其中,该分担策略表存储有该分担策略表索引和该出口封装表的偏移地址的对应关系;In the embodiment of the present invention, the obtaining module 71 is further configured to obtain the index of the sharing policy table according to the base address of the sharing policy table and the modulus, and query the sharing corresponding to the index of the sharing policy table according to the index of the sharing policy table. a policy table, and obtaining an offset address of the egress encapsulation table, where the sharing policy table stores a correspondence between the index of the sharing policy table and an offset address of the egress encapsulation table;
该获取模块71,还设置为根据该出口封装表的基址和该偏移地址得到该出口封装表索引,并根据该出口封装表索引查询该出口封装表索引对应的出口封装表,并得到该封装信息,其中,该出口封装表存储有该出口封装表索引和该封装信息的对应关系。The obtaining module 71 is further configured to obtain the egress encapsulation table index according to the base address of the egress encapsulation table and the offset address, and query an egress encapsulation table corresponding to the egress encapsulation table index according to the egress encapsulation table index, and obtain the Encapsulation information, wherein the egress package table stores a correspondence between the egress package table index and the encapsulation information.
采用上述装置,解决了现有技术中传输链路无法均匀分担报文传输的问题,从而提高符合分担精度,提高了负荷分担精度。The above device solves the problem that the transmission link cannot uniformly share the message transmission in the prior art, thereby improving the sharing precision and improving the load sharing precision.
综上所述,本发明实施例的目的是通过对从哈希模块得到的哈希值取更多的比特位进行模运算,提高负荷分担精度,即使各链路均匀分担;增加分担策略表,将现有技术中出口封装表中公共的部分,即公共的链路独立出来,放到分担策略表中,这样多个ECMP组因为分担链路一样,对应同一个分担策略表,当发生链路故障时,虽然有多个ECMP组,但切换一个分担策略表即可,实现多到一的切换,能显著提高切换性能。In summary, the purpose of the embodiment of the present invention is to perform a modulo operation by taking more bits of a hash value obtained from a hash module to improve load sharing accuracy, even if each link is evenly shared; The common part of the egress encapsulation table in the prior art, that is, the common link, is separated and placed in the sharing policy table, so that multiple ECMP groups have the same sharing policy table because of the shared link, when the link occurs. In the case of a fault, although there are multiple ECMP groups, switching a shared policy table can achieve multiple-to-one switching, which can significantly improve the switching performance.
显然,本领域的技术人员应该明白,上述的本发明实施例的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above modules or steps of the embodiments of the present invention can be implemented by a general computing device, which can be concentrated on a single computing device or distributed in 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 steps shown or described are performed sequentially, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated into a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
工业实用性Industrial applicability
如上所述,通过上述实施例及优选实施方式,解决了现有技术中传输链路无法均匀分担报文传输的问题,从而提高负荷分担精度。 As described above, the above embodiments and the preferred embodiments solve the problem that the transmission link cannot uniformly share the message transmission in the prior art, thereby improving the load sharing accuracy.

Claims (10)

  1. 一种基于等价多路径ECMP的报文传输方法,包括:A message transmission method based on equivalent multipath ECMP, comprising:
    接收报文,并获得所述报文的哈希值和对应的出口封装表的基址;Receiving a packet, and obtaining a hash value of the packet and a base address of the corresponding export encapsulation table;
    获取传输链路的数目,并将所述哈希值对所述传输链路的数目取模得到模值;Obtaining a number of transmission links, and modulating the hash value to a number of the transmission links to obtain a modulus value;
    根据所述出口封装表的基址和所述模值从所述出口封装表中得到封装信息;Obtaining package information from the egress package table according to a base address of the egress package table and the modulus value;
    根据所述封装信息封装所述报文,并发送所述报文。And encapsulating the packet according to the encapsulation information, and sending the packet.
  2. 根据权利要求1所述的方法,其中,根据所述出口封装表的基址和所述模值从所述出口封装表中得到封装信息包括:The method of claim 1, wherein obtaining the package information from the egress package table according to the base address of the egress package table and the modulus value comprises:
    获取分担策略表的基址,其中,所述分担策略表包括所述传输链路在所述出口封装表的偏移地址;Obtaining a base address of the sharing policy table, where the sharing policy table includes an offset address of the transmission link in the egress encapsulation table;
    根据所述分担策略表的基址和所述模值从所述分担策略表中得到所述出口封装表的偏移地址;Obtaining an offset address of the egress package table from the share policy table according to the base address of the share policy table and the modulus value;
    根据所述出口封装表的基址和所述偏移地址从所述出口封装表中得到封装信息。Encapsulating information is obtained from the egress package table according to the base address of the egress package table and the offset address.
  3. 根据权利要求2所述的方法,其中,所述获取传输链路的数目包括:The method of claim 2 wherein said obtaining the number of transmission links comprises:
    从存储的传输链路数目表中获取所述传输链路的数目。The number of the transmission links is obtained from the stored number of transmission link tables.
  4. 根据权利要求3所述的方法,其中,在所述传输链路故障时,更新所述传输链路数目表,并将所述分担策略表中所述传输链路对应的所述偏移地址删除。The method according to claim 3, wherein, when the transmission link fails, the transmission link number table is updated, and the offset address corresponding to the transmission link in the sharing policy table is deleted. .
  5. 根据权利要求2至4任一项所述的方法,其中,根据所述分担策略表的基址和所述模值从所述分担策略表中得到所述出口封装表的偏移地址包括:The method according to any one of claims 2 to 4, wherein the offset address of the egress package table obtained from the share policy table according to the base address of the share policy table and the modulus value comprises:
    根据所述分担策略表的基址和所述模值得到所述分担策略表索引;Obtaining the share policy table index according to the base address of the share policy table and the modulus value;
    根据所述分担策略表索引查询所述分担策略表索引对应的分担策略表,并得到所述出口封装表的偏移地址,其中,所述分担策略表存储有所述分担策略表索引和所述出口封装表的偏移地址的对应关系; Querying, according to the share policy table index, the share policy table corresponding to the share policy table index, and obtaining an offset address of the export package table, where the share policy table stores the share policy table index and the Correspondence between offset addresses of the export encapsulation table;
    根据所述出口封装表的基址和所述偏移地址从所述出口封装表中得到封装信息包括:Obtaining the package information from the egress package table according to the base address of the egress package table and the offset address includes:
    根据所述出口封装表的基址和所述偏移地址得到所述出口封装表索引;Obtaining the egress package table index according to the base address of the egress package table and the offset address;
    根据所述出口封装表索引查询所述出口封装表索引对应的出口封装表,并得到所述封装信息,其中,所述出口封装表存储有所述出口封装表索引和所述封装信息的对应关系。Querying, according to the egress encapsulation table index, an egress encapsulation table corresponding to the egress encapsulation table index, and obtaining the encapsulation information, where the egress encapsulation table stores a correspondence between the egress encapsulation table index and the encapsulation information .
  6. 一种基于等价多路径ECMP的报文传输装置,包括:A message transmission device based on equivalent multipath ECMP, comprising:
    获取模块,设置为接收报文,并获得所述报文的哈希值和对应的出口封装表的基址,以及获取传输链路的数目;Obtaining a module, configured to receive a packet, obtain a hash value of the packet, a base address of the corresponding export encapsulation table, and obtain a number of transmission links;
    处理模块,设置为将所述获取模块获取的哈希值对所述获取模块获取的传输链路的数目取模得到模值;a processing module, configured to modulo the number of transmission links acquired by the acquiring module by using a hash value obtained by the acquiring module to obtain a modulus value;
    所述获取模块还设置为,根据所述获取模块获取的出口封装表的基址和所述处理模块得到的模值从所述出口封装表中得到封装信息;The obtaining module is further configured to obtain, according to the base address of the egress package table acquired by the obtaining module and the modulus value obtained by the processing module, the encapsulation information from the egress package table;
    封装发送模块,设置为根据所述获取模块获取的封装信息封装所述报文,并发送所述报文。The encapsulating and sending module is configured to encapsulate the packet according to the encapsulation information acquired by the acquiring module, and send the packet.
  7. 根据权利要求6所述的装置,其中,所述获取模块还设置为,获取分担策略表的基址,其中,所述分担策略表包括所述传输链路在所述出口封装表的偏移地址,并根据所述分担策略表的基址和所述模值从所述分担策略表中得到所述出口封装表的偏移地址,并根据所述出口封装表的基址和所述偏移地址从所述出口封装表中得到封装信息。The apparatus according to claim 6, wherein the obtaining module is further configured to acquire a base address of the sharing policy table, wherein the sharing policy table includes an offset address of the transmission link in the egress encapsulation table And obtaining an offset address of the egress package table from the share policy table according to the base address of the share policy table and the modulus value, and according to the base address and the offset address of the egress package table Encapsulation information is obtained from the egress package table.
  8. 根据权利要求7所述的装置,其中,所述获取模块还设置为,从存储的传输链路数目表中获取所述传输链路的数目。The apparatus of claim 7, wherein the acquisition module is further configured to obtain the number of the transmission links from a stored list of transmission link numbers.
  9. 根据权利要求8所述的装置,其中,所述处理模块还设置为,在所述传输链路故障时,更新所述传输链路数目表,并将所述分担策略表中所述传输链路对应的所述偏移地址删除。The apparatus according to claim 8, wherein said processing module is further configured to: when said transmission link fails, update said transmission link number table, and said transmission link in said sharing policy table The corresponding offset address is deleted.
  10. 根据权利要求7至9任一项所述的装置,其中,The apparatus according to any one of claims 7 to 9, wherein
    所述获取模块还设置为,根据所述分担策略表的基址和所述模值得到所述分担策略表索引,并根据所述分担策略表索引查询所述分担策略表索引对应的 分担策略表,并得到所述出口封装表的偏移地址,其中,所述分担策略表存储有所述分担策略表索引和所述出口封装表的偏移地址的对应关系;The obtaining module is further configured to: obtain the index of the sharing policy table according to the base address of the sharing policy table and the modulus value, and query the index corresponding to the sharing policy table index according to the sharing policy table index Sharing a policy table, and obtaining an offset address of the egress encapsulation table, where the sharing policy table stores a correspondence between the sharing policy table index and an offset address of the egress encapsulation table;
    所述获取模块还设置为,根据所述出口封装表的基址和所述偏移地址得到所述出口封装表索引,并根据所述出口封装表索引查询所述出口封装表索引对应的出口封装表,并得到所述封装信息,其中,所述出口封装表存储有所述出口封装表索引和所述封装信息的对应关系。 The obtaining module is further configured to obtain the egress encapsulation table index according to the base address of the egress encapsulation table and the offset address, and query the egress encapsulation corresponding to the egress encapsulation table index according to the egress encapsulation table index And obtaining the encapsulation information, wherein the egress package table stores a correspondence between the egress package table index and the encapsulation information.
PCT/CN2015/080061 2014-12-18 2015-05-28 Equal cost multi-path (ecmp) based packet transmission method and device WO2016095439A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410802647.6A CN105791145B (en) 2014-12-18 2014-12-18 Message transmitting method and device based on equal cost multipath ECMP
CN201410802647.6 2014-12-18

Publications (1)

Publication Number Publication Date
WO2016095439A1 true WO2016095439A1 (en) 2016-06-23

Family

ID=56125778

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/080061 WO2016095439A1 (en) 2014-12-18 2015-05-28 Equal cost multi-path (ecmp) based packet transmission method and device

Country Status (2)

Country Link
CN (1) CN105791145B (en)
WO (1) WO2016095439A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107770085A (en) * 2016-08-23 2018-03-06 华为技术有限公司 A kind of network load balancing method, equipment and system
CN113472647A (en) * 2021-06-11 2021-10-01 新华三信息安全技术有限公司 Message forwarding method and device

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109450819B (en) * 2018-10-25 2021-08-17 锐捷网络股份有限公司 Method and system for forwarding broadcast message
CN110011919B (en) * 2019-03-27 2021-12-07 新华三技术有限公司 Message forwarding method, device, network equipment and storage medium
CN111092813B (en) * 2019-12-18 2022-04-08 新华三半导体技术有限公司 Equivalent multipath ECMP switching method, network equipment and system
CN113660160B (en) * 2021-08-20 2023-04-28 烽火通信科技股份有限公司 UCMP load sharing method and device
CN115914098A (en) * 2021-09-30 2023-04-04 中兴通讯股份有限公司 Equivalent multipath-based routing method, device and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7260096B2 (en) * 2002-07-09 2007-08-21 International Business Machines Corporation Method and router for forwarding internet data packets
US20080049742A1 (en) * 2006-08-22 2008-02-28 Deepak Bansal System and method for ecmp load sharing
CN101420383A (en) * 2008-12-12 2009-04-29 北京邮电大学 ECMP path soft resuming method in MPLS-TP packet transmission network
CN101496348A (en) * 2006-07-31 2009-07-29 思科技术公司 Technique for multiple path forwarding of label-switched data traffic
CN101888330A (en) * 2009-05-13 2010-11-17 阿瓦亚公司 Be used to provide the method and apparatus of the quick rerouting of grouping
CN102333028A (en) * 2011-06-22 2012-01-25 杭州华三通信技术有限公司 Method and communication equipment for sending messages by using layered bi-layer virtual private network
CN103368806A (en) * 2012-03-26 2013-10-23 华为技术有限公司 Method and system for processing data flow and device
US8619584B2 (en) * 2010-04-30 2013-12-31 Cisco Technology, Inc. Load balancing over DCE multipath ECMP links for HPC and FCoE
US20140098675A1 (en) * 2012-10-05 2014-04-10 Cisco Technology, Inc. Mpls segment-routing
CN104184676A (en) * 2013-05-27 2014-12-03 华为技术有限公司 Data center network, flow balancing method thereof and controller

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7594032B2 (en) * 2002-11-07 2009-09-22 Hewlett-Packard Development Company, L.P. Method and system for communicating information between a switch and a plurality of servers in a computer network
US7760719B2 (en) * 2004-06-30 2010-07-20 Conexant Systems, Inc. Combined pipelined classification and address search method and apparatus for switching environments
CN102263700B (en) * 2011-08-18 2017-02-08 中兴通讯股份有限公司 Method, device and system for sending and receiving messages
CN104144120A (en) * 2013-05-07 2014-11-12 杭州华三通信技术有限公司 Forwarding information configuration method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7260096B2 (en) * 2002-07-09 2007-08-21 International Business Machines Corporation Method and router for forwarding internet data packets
CN101496348A (en) * 2006-07-31 2009-07-29 思科技术公司 Technique for multiple path forwarding of label-switched data traffic
US20080049742A1 (en) * 2006-08-22 2008-02-28 Deepak Bansal System and method for ecmp load sharing
CN101420383A (en) * 2008-12-12 2009-04-29 北京邮电大学 ECMP path soft resuming method in MPLS-TP packet transmission network
CN101888330A (en) * 2009-05-13 2010-11-17 阿瓦亚公司 Be used to provide the method and apparatus of the quick rerouting of grouping
US8619584B2 (en) * 2010-04-30 2013-12-31 Cisco Technology, Inc. Load balancing over DCE multipath ECMP links for HPC and FCoE
CN102333028A (en) * 2011-06-22 2012-01-25 杭州华三通信技术有限公司 Method and communication equipment for sending messages by using layered bi-layer virtual private network
CN103368806A (en) * 2012-03-26 2013-10-23 华为技术有限公司 Method and system for processing data flow and device
US20140098675A1 (en) * 2012-10-05 2014-04-10 Cisco Technology, Inc. Mpls segment-routing
CN104184676A (en) * 2013-05-27 2014-12-03 华为技术有限公司 Data center network, flow balancing method thereof and controller

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107770085A (en) * 2016-08-23 2018-03-06 华为技术有限公司 A kind of network load balancing method, equipment and system
CN107770085B (en) * 2016-08-23 2021-08-31 华为技术有限公司 Network load balancing method, equipment and system
CN113472647A (en) * 2021-06-11 2021-10-01 新华三信息安全技术有限公司 Message forwarding method and device

Also Published As

Publication number Publication date
CN105791145B (en) 2019-10-25
CN105791145A (en) 2016-07-20

Similar Documents

Publication Publication Date Title
WO2016095439A1 (en) Equal cost multi-path (ecmp) based packet transmission method and device
US10348672B2 (en) Using a virtual internet protocol address to represent dually connected hosts in an internet protocol overlay network
US10050877B2 (en) Packet forwarding method and apparatus
EP3072274B1 (en) Source routing with entropy-header
US8976794B2 (en) Method to carry FCoE frames over a TRILL based network
US20120163164A1 (en) Method and system for remote load balancing in high-availability networks
US20140153577A1 (en) Session-based forwarding
TW201225579A (en) Load balancing in shortest-path-bridging networks
US20130259050A1 (en) Systems and methods for multi-level switching of data frames
KR101613640B1 (en) Packet forwarding
US9306835B2 (en) Scalable forwarding table with overflow address learning
US10313154B2 (en) Packet forwarding
WO2017008712A1 (en) Reachability detection for path between vxlan tunnel end points (vtep)
US10439936B2 (en) Packet data routing
US10313274B2 (en) Packet forwarding
TWI543567B (en) Device for multipath routing of packets in computer networking and method thereof
WO2016058261A1 (en) Network-based flat routing method
US10826822B2 (en) Label-based forwarding with enhanced scalability
WO2020244439A1 (en) Method and apparatus for realizing message mirroring, and storage medium
WO2016192215A1 (en) Method and device for sharing network load
WO2015039616A1 (en) Method and device for packet processing

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

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

Country of ref document: EP

Kind code of ref document: A1