WO2016173241A1 - 一种路由控制方法、装置、系统及存储介质 - Google Patents
一种路由控制方法、装置、系统及存储介质 Download PDFInfo
- Publication number
- WO2016173241A1 WO2016173241A1 PCT/CN2015/094738 CN2015094738W WO2016173241A1 WO 2016173241 A1 WO2016173241 A1 WO 2016173241A1 CN 2015094738 W CN2015094738 W CN 2015094738W WO 2016173241 A1 WO2016173241 A1 WO 2016173241A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- path
- path member
- group
- probability
- member group
- 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.)
- Ceased
Links
Images
Definitions
- the present invention relates to a network communication technology, and in particular, to a weighted multipath (WCMP) route control method, apparatus, system, and storage medium.
- WCMP weighted multipath
- WCMP can flexibly transmit traffic on the link according to the weight ratio.
- the network device can use WCMP to distribute the traffic to the same destination network and distribute it to different links according to the weight ratio.
- ECMP Equal-Cost Multipath Routing
- the implementation method of WCMP is as shown in Figure 1. It includes two parts: 1. The design of the forwarding surface table item; 2. The design of the control surface table.
- the first-level index is usually adopted, that is, the query routing table obtains the multi-path member group information under the route, and the multi-path member group information may include the index base address of the multi-path member (member.base_idx). And the number of multipath members (count), and then the hash module obtains a hash index (random value) to perform modulo operation on the number of multipath members, and obtains a random corresponding to each path member in the multipath member group information.
- Relative offset (member.offset), plus the index base address (member.base_idx) of the multipath member can get the forwarding information of any member path.
- the control plane configuration is implemented to implement the WCMP process. If a route includes forwarding information of N path members, the upper layer software aggregates the forwarding information of the N path members to obtain the member table. Allocating a member index base address corresponding to the path member in the table from the member table, and sequentially writing N path member entries according to the member index base address, and the weight between the different path members can be repeated in the member table according to the member entry. The number of times of padding is reflected in the principle that the path member with a larger weight is larger, and the probability of randomly hitting the path member is larger to implement WCMP. It can be understood that ECMP is implemented when N path member entries are only filled once in the member table.
- the above processing method will occur when some path members occupy multiple member table entries in the member table.
- the number of entries included in the member table is much larger than the actual number of path members. As shown in Figure 2, the number of members is 8 and the number of entries in the member table is 16. Since the entry width of each entry of the member table is wide, the resource consumption of the member table is very large, and the most valuable resource in the processor chip of the network device is the storage resource of the entry. Therefore, for the implementation of WCMP, Need to consume a large amount of table storage resources.
- the embodiment of the present invention is to provide a WCMP routing control method, device, system, and storage medium, which can reduce the consumption of table item storage resources when WCMP is implemented, and save chip storage space.
- an embodiment of the present invention provides a routing control method for weighted multipath WCMP, where the method includes:
- the device acquires path information of the weighted multipath forwarding.
- the weights of the path members according to the same route are corresponding to the probability of randomly fetching each path member, including:
- the grouping according to a preset grouping policy according to the probability of randomly hitting each path member, to obtain at least one member group including:
- the relationship between the probability P of randomly hitting a path member and the probability N of randomly hitting each member group satisfies P nN+p1, where n is a natural number and the remainder p1 is less than N, and n corresponding to the path member are set.
- a member group, and an additional member group is set for the path member whose remainder has a total of N according to a preset setting rule.
- the path member is additionally set to a path member whose remainder is N according to a preset setting rule, and includes:
- the quotient obtained by dividing the remainder of the path member with the larger remainder by the remainder of the path member with the smallest remainder is copied to the path member with the larger remainder, and after copying
- the path member and the least remaining path member set the member group.
- the establishing a correspondence between the path member and the member group, and obtaining a multi-level index table specifically includes:
- the correspondence between the path member and the member group is established according to the path member included in each member group, and an index table between the member group table and the member table is established.
- an embodiment of the present invention provides a routing control method for weighted multipath WCMP, where the method includes:
- the control plane And receiving, by the control plane, a multi-level index table, where the multi-level index table includes a member group table and a path member table, where the member group table includes at least one member group entry, and each member group entry corresponds to a path member At least one path member in the table; and the probability N of randomly hitting each member group entry is the same; and after hitting the member group entry, the probability of randomly hitting each path member corresponding to the member group entry is the same;
- the forwarding information of the path member is obtained according to the multi-level index table.
- the obtaining the forwarding information of the path member according to the multi-level index table includes:
- the pointer ptr of the member group table in the multi-level index table is obtained;
- the path member index obtains forwarding information of the path member.
- an embodiment of the present invention provides a control plane device, where the control plane device includes: an acquiring unit, a grouping unit, an establishing unit, and a sending unit, where
- the acquiring unit is configured to obtain a probability of randomly hitting each path member according to the weight of each path member in the same route;
- the grouping unit is configured to group according to a preset grouping policy according to the probability of randomly hitting each path member, to obtain at least one member group; wherein the probability N of randomly hitting each member group is the same; and after hitting the member group The probability of each path member in the random hit member group is the same;
- the establishing unit is configured to establish a correspondence between the path member and the member group, and obtain a multi-level index table
- the sending unit is configured to send the multi-level index table to the forwarding plane device;
- the multi-level index table is used to cause the forwarding plane device to obtain the path information of the weighted multi-path forwarding.
- the obtaining unit is configured to:
- the grouping unit is configured to:
- the relationship between the probability P of randomly hitting a path member and the probability N of randomly hitting each member group satisfies P nN+p1, where n is a natural number and the remainder p1 is less than N, and n corresponding to the path member are set.
- a member group, and an additional member group is set for the path member whose remainder has a total of N according to a preset setting rule.
- the grouping unit is configured to:
- the quotient obtained by dividing the remainder of the path member with the larger remainder by the remainder of the path member with the smallest remainder is copied to the path member with the larger remainder, and after copying
- the path member and the least remaining path member set the member group.
- the establishing unit is configured to:
- the correspondence between the path member and the member group is established according to the path member included in each member group, and an index table between the member group table and the member table is established.
- an embodiment of the present invention provides a forwarding plane device, where the forwarding plane device includes: a receiving unit and a query acquiring unit, where
- the receiving unit is configured to receive a multi-level index table sent by the control plane, where the multi-level index table includes a member group table and a path member table, where the member group table includes at least one member group entry, and each The member group entry corresponds to at least one path member in the path member table; and the probability N of randomly hitting each member group entry is the same; and after hitting the member group entry, randomly hitting the member group entry The corresponding path members have the same probability;
- the query obtaining unit is configured to obtain the forwarding information of the path member according to the multi-level index table after the routing table is queried according to the packet.
- the query obtaining unit is further configured to:
- the path member index obtains forwarding information of the path member.
- an embodiment of the present invention provides a routing control system for weighted multipath WCMP, where the system includes: a control plane device and a forwarding plane device, where
- the control plane device is configured to obtain a probability of randomly hitting each path member according to the weight of each path member in the same route;
- the multi-level index table is configured to enable the forwarding plane device to obtain path information of the weighted multi-path forwarding
- the forwarding plane device is configured to receive a multi-level index table sent by the control plane device, where the multi-level index table includes a member group table and a path member table, where the member group table includes at least one member a group entry, each member group entry corresponding to at least one path member in the path member table; The probability of randomly hitting each member group entry is the same; and after hitting the member group entry, the probability of randomly hitting each path member corresponding to the member group entry is the same; and,
- the forwarding information of the path member is obtained according to the multi-level index table.
- the embodiment of the present invention provides a method, a device, a system, and a storage medium for routing control of a WCMP.
- the multi-level mapping method is used to describe the weights of multiple path members under the same route by conditional probability, so that the member table is made.
- the number of entries in the middle entry is the same as the number of path members, which can reduce the consumption of table entry storage resources when WCMP is implemented, and save chip storage space.
- FIG. 1 is a schematic structural diagram of an implementation method of WCMP in the prior art
- FIG. 2 is a schematic diagram of a member table for implementing WCMP in the prior art
- FIG. 3 is a schematic flowchart of a WCMP route control method according to an embodiment of the present disclosure
- FIG. 4 is a schematic diagram of a multi-level index table according to an embodiment of the present invention.
- FIG. 5 is a schematic flowchart of another WCMP route control method according to an embodiment of the present disclosure.
- FIG. 6 is a schematic flowchart of obtaining forwarding information of a path member according to a multi-level index table according to an embodiment of the present disclosure
- FIG. 7 is a schematic structural diagram of a control plane device according to an embodiment of the present invention.
- FIG. 8 is a schematic structural diagram of a forwarding plane device according to an embodiment of the present disclosure.
- FIG. 9 is a schematic structural diagram of a WCMP routing control system according to an embodiment of the present invention.
- the weight of each path member in the same route can be expressed by the probability of randomly hitting each path member. Therefore, the basic idea of the embodiment of the present invention is: random hit by multi-level mapping
- the probability of each path member is expressed in the form of a conditional probability such that the number of entry entries in the member table is the same as the number of path members.
- a method for controlling a WCMP route is provided in an embodiment of the present invention.
- the method may be applied to a control plane device for generating a forwarding table in a network device, and the method may include:
- S301 Acquire a probability of randomly hitting each path member according to weights of each path member in the same route.
- the implementation process of S301 may specifically be:
- the weights of all path members under the same route are summed as the denominator; and the weight of each path member is used as a numerator to obtain the probability of randomly hitting each path member.
- S302 grouping according to a preset grouping policy according to a probability of randomly hitting each path member, to obtain at least one member group;
- the probability N of randomly hitting each member group is the same; and after hitting the member group, the probability of each path member in the random hit member group is the same;
- the technical features of the probability that each path member in the random hit member group has the same probability are preset according to the probability of randomly hitting each path member.
- the grouping policies are grouped to obtain at least one member group, which may include:
- the relationship between the probability P of randomly hitting a path member and the probability N of randomly hitting each member group satisfies P nN+p1, where n is a natural number and the remainder p1 is less than N, and n corresponding to the path member are set.
- the member group is additionally set for the path member whose remainder is N according to the preset setting rule, and may include:
- the quotient obtained by dividing the remainder of the path member with the larger remainder by the remainder of the path member with the smallest remainder is copied to the path member with the larger remainder, and after copying
- the path member and the least remaining path member set the member group.
- each path member can be decomposed into: member 1: Member 2: Member 3: Member 4: Member 5: Member 6: Member 7: Member 8: Because the random hit probability of 8 path members can be decomposed into The product of other numbers, therefore, the eight path members can be divided into four groups, and the probability N of randomly hitting any of the four groups is
- member 1 For member 1, member 2, member 3, member 4, the remainder of each is And the sum of the remainders of the four members is For member 5 and member 6, the remainder is And the sum of the remainders of the two members is Therefore, member 1, member 2, member 3, member 4 can be set as one member group, and member 5 and member 6 can be set as one member group;
- a member group is set for member 7 and member 8, respectively;
- member 1, member 2, member 3, member 4 are set to group a; member 5 and member 6 are set to group b; member 7 is set to group c; member 8 is set to group d, and it can be known that in group a Among them, the probability that member 1, member 2, member 3, and member 4 are hit is In group b, the probability of member 5 and member 6 being hit is In group c, the probability that member 7 is hit is 1; in group d, the probability that member 8 is hit is 1, thus achieving the same probability N for randomly hitting each member group; and after hitting the member group, random hit The probability of each path member in a member group is the same.
- the path member is copied as two path members so that the two path members after the copy and the other two remainders are The path member is set to a member group. It can be understood that since the path members whose remainders are different and the sum of the remainders is N are usually the path members remaining in the previously set member group, the number of path members that need to be copied is extremely small, and does not cause all the descriptions in the prior art.
- the large-weight path members are all replicated, which can also reduce the consumption of the table storage resources and save the chip storage space.
- S303 Establish a correspondence between the path member and the member group, and obtain a multi-level index table.
- the correspondence between the path member and the member group is established, and the multi-level index table is obtained, which may specifically include:
- the correspondence between the path member and the member group is established according to the path member included in each member group, and an index table between the member group table and the member table is established.
- the eight path members corresponding to the route A shown in FIG. 2 are taken as an example, member 1, member 2, member 3, member 4 and group a, member 5, and member 6 and group b, members. 7 has a corresponding relationship with the group c and between the member 8 and the group d; then the member group table is established for the group a, the group b, the group c, and the group d, so that the correspondence relationship as shown in FIG. 4 can be obtained.
- the number of entries of the member table is consistent with the number of path members of the WCMP.
- the multi-level index table is used to enable the forwarding plane device to obtain the path information of the weighted multi-path forwarding.
- control plane converts the weight of each path member in the same route into a conditional probability to establish a multi-level index table, so that the number of entries in the member table of the multi-level index table is the same as the number of path members. Therefore, the consumption of the storage resources of the entries caused by the manner in which the path members with larger weights are satisfied by the method of repeating the filling is avoided, and the storage space of the chip is saved.
- the embodiment of the present invention further provides a first computer readable storage medium, the storage medium comprising a set of instructions for performing the above-described routing control method applied to the weighted multipath WCMP of the control plane device.
- a WCMP routing control method which can be applied to a forwarding plane device for forwarding according to a forwarding table in a network device, and the method may include:
- S501 Receive a multi-level index table sent by the control plane
- the multi-level index table includes a member group table and a path member table, where the member group table includes at least one member group entry, each member group entry corresponds to at least one path member in the path member table; and randomly hits each member group The probability N of the entry is the same; and after hitting the member group entry, the probability of randomly hitting each path member corresponding to the member group entry is the same;
- the forwarding information of the path member is obtained according to the multi-level index table, as shown in FIG. 6, including:
- the high-order Hash_index_Msb of the random hash factor generated by the hash module may be used to obtain a member group entry in the member group table with the pointer ptr of the obtained member group table; the hash module is generated.
- the high-order Hash_index_Lsb of the random hash factor is used to perform a modulo operation on the number of path members corresponding to the member group entry in the path member table. This embodiment of the present invention does not describe this.
- the forwarding plane obtains the forwarding information of the path member according to the multi-level index table in the foregoing embodiment, so that when the forwarding plane saves the multi-level index table, the number of entries in the path member table is consistent with the number of path members, thereby avoiding The consumption of storage resources on the forwarding plane saves chip storage space.
- the embodiment of the invention further provides a second computer readable storage medium, the storage medium comprising a group An instruction for performing the routing control method applied to the weighted multipath WCMP of the forwarding plane device as described above.
- the control plane device 70 includes: an obtaining unit 701, a grouping unit 702, and an establishing unit 703. And transmitting unit 704, wherein
- the obtaining unit 701 is configured to obtain a probability of randomly hitting each path member according to the weight of each path member in the same route.
- the grouping unit 702 is configured to perform grouping according to a preset grouping policy according to a probability of randomly hitting each path member, to obtain at least one member group; wherein, the probability N of randomly hitting each member group is the same; and after hitting the member group, randomly hitting The probability of each path member in the member group is the same;
- the establishing unit 703 is configured to establish a correspondence between the path member and the member group to obtain a multi-level index table.
- the sending unit 704 is configured to send the multi-level index table to the forwarding plane device; wherein the multi-level index table is configured to enable the forwarding plane device to obtain the path information of the weighted multi-path forwarding.
- the obtaining unit 701 is specifically configured to:
- the weight of each path member is taken as a numerator, and the probability of randomly hitting each path member is obtained.
- the grouping unit 702 is specifically configured to:
- the relationship between the probability P of randomly hitting a path member and the probability N of randomly hitting each member group satisfies P nN+p1, where n is a natural number and the remainder p1 is less than N, and n corresponding to the path member are set.
- a member group, and an additional member group is set for the path member whose remainder has a total of N according to a preset setting rule.
- grouping unit 702 is specifically configured to:
- the quotient obtained by dividing the remainder of the path member with the larger remainder by the remainder of the path member with the smallest remainder is copied to the path member with the larger remainder, and after copying
- the path member and the least remaining path member set the member group.
- the establishing unit 703 is specifically configured to:
- the correspondence between the path member and the member group is established according to the path member included in each member group, and an index table between the member group table and the member table is established.
- the control plane device 70 converts the weight of each path member in the same route into a conditional probability to establish a multi-level index table, so that the number of entries of the member table in the multi-level index table and the path member are The number of the storage is the same, which avoids the consumption of the storage resources of the entries caused by the way of satisfying the path members with larger weights by means of repeated filling, thereby saving the storage space of the chips.
- the obtaining unit 701, the grouping unit 702, the establishing unit 703, and the sending unit 704 may each be a central processing unit (CPU), or a digital signal processing (DSP), or a field. It is implemented by a Field Programmable Gate Array (FPGA) or the like; the CPU, the DSP, and the FPGA may be built in the control plane device 70.
- CPU central processing unit
- DSP digital signal processing
- FPGA Field Programmable Gate Array
- the forwarding plane device 80 includes a receiving unit 801 and a query obtaining unit 802.
- the receiving unit 801 is configured to receive the multi-level index table sent by the control plane.
- the multi-level index table includes a member group table and a path member table, where the member group table includes at least one member group entry, and each member group entry corresponds to At least one path member in the path member table; and the probability N of randomly hitting each member group entry is the same; and after hitting the member group entry, the probability of each path member corresponding to the random hit member group entry is the same;
- the query obtaining unit 802 is configured to obtain the forwarding information of the path member according to the multi-level index table after the routing table is queried according to the packet.
- the query obtaining unit 802 is specifically configured to:
- the random hash factor generated by the hash module performs a modulo operation on the number of path members corresponding to the member group entry in the path member table, and obtains a random relative offset offset;
- the relative offset offset is added to the path member index base address base_idx corresponding to the member group entry in the path member table, and the path member index in the path member table in the multi-level index table is obtained, and the path member forwarding is obtained according to the path member index. information.
- the forwarding plane device 80 provided in this embodiment obtains the forwarding information of the path member according to the multi-level index table in the foregoing embodiment, so that when the forwarding plane saves the multi-level index table, the number of entries in the path member table is consistent with the number of path members. The consumption of storage resources on the forwarding surface is avoided, and the chip storage space is saved.
- the receiving unit 801 and the query obtaining unit 802 may each be a central processing unit (CPU), or a digital signal processing (DSP), or a field programmable gate array (FPGA, Field Programmable Gate Array) or the like is implemented; the CPU, DSP, and FPGA may be built in the forwarding plane device 80.
- CPU central processing unit
- DSP digital signal processing
- FPGA field programmable gate array
- the system 90 includes: a control plane device 70 and a forwarding plane device 80, wherein
- the control plane device 70 is configured to obtain a probability of randomly hitting each path member according to the weight of each path member under the same route;
- the probability of randomly hitting each path member grouping according to a preset grouping strategy, at least a member group; wherein the probability N of randomly hitting each member group is the same; and after hitting the member group, the probability of each path member in the random hit member group is the same; and,
- the multi-level index table is configured to enable the forwarding plane device 80 to obtain the path information of the weighted multi-path forwarding;
- the forwarding plane device 80 is configured to receive the multi-level index table sent by the control plane device 70.
- the multi-level index table includes a member group table and a path member table, where the member group table includes at least one member group entry, and each member The group entry corresponds to at least one path member in the path member table; and the probability N of randomly hitting each member group entry is the same; and after hitting the member group entry, the probability of each path member corresponding to the random hit member group entry is the same;
- the forwarding information of the path member is obtained according to the multi-level index table.
- embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
- the embodiment of the present invention uses the multi-level mapping method to describe the weights of multiple path members in the same route by using the conditional probability, so that the number of entries in the member table is the same as the number of path members, thereby reducing
- the storage of table storage resources is realized when WCMP is implemented, and the chip storage space is saved.
Landscapes
- Navigation (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例公开了一种WCMP的路由控制方法、装置、系统及存储介质,该方法可以包括:根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;根据所述随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组;其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;建立所述路径成员和所述成员组之间对应关系,得到多级索引表;将所述多级索引表发送至转发面装置;其中,多级索引表用于使得转发面装置获取加权多路径转发的路径信息。
Description
本发明涉及网络通信技术,尤其涉及一种加权多路径(WCMP,Weighted Cost Multipath)的路由控制方法、装置、系统及存储介质。
WCMP能够非常灵活的按照权重比例在链路上传递流量,网络设备可以利用WCMP将到达同一目的网络的流量,按权重比例分担到不同的链路上转发出去。当不同链路的权重相同时,此时可以称为等价多路径(ECMP,Equal-Cost Multipath Routing),可以理解地,ECMP是WCMP的特例。
在当前的网络设备中,WCMP的实现方法如图1所示,包括两部分描述:1、转发面表项设计;2、控制面配表设计。
对于转发面表项设计来说,通常采用一级索引的形式,即查询路由表获取该路由下的多路径成员组信息,多路径成员组信息可以包括多路径成员的索引基址(member.base_idx)和多路径成员个数(count),然后由哈希模块获取哈希索引(随机值)对多路径成员个数进行取模运算,获得多路径成员组信息中各路径成员对应的一个随机的相对偏移(member.offset),再加上多路径成员的索引基址(member.base_idx),即可获得任一成员路径的转发信息。
在此转发面的表项设计下,控制面配表设计来实现WCMP的过程如下:若某路由包括N个路径成员的转发信息,则上层软件会将N个路径成员的转发信息汇总得到成员表,从成员表中分配一个对应该表内路径成员的成员索引基址,按成员索引基址连续写入N个路径成员条目,不同路径成员之间的权重可以根据成员条目在该成员表中重复填充的次数来体现,按照权重越大的路径成员,那么随机命中该路径成员的概率越大的原则来实现WCMP。可以理解地,当N个路径成员条目在成员表中仅填充一次时,则实现了ECMP。如图2所示,假
设某路由对应8个路径成员,权重比例为1:1:1:1:2:2:4:4,那么根据各路径成员的权重比例,随机命中各路径成员的概率依次为:成员1:1/16,成员2:1/16,成员3:1/16,成员4:1/16,成员5:2/16,成员6:2/16,成员7:4/16,成员8:4/16。此时,可以将成员5和成员6在成员表中填充了2次,成员7和成员8在成员表中填充了4次。通过重复填充的方式,满足权重越大的路径成员,那么随机命中该路径成员的概率越大的原则。
上述处理方式会出现某些路径成员会在成员表中占据多个成员表条目的现象。对于WCMP来说,成员表中所包括的条目数要远大于实际的路径成员个数,如图2中,成员个数为8个而成员表中的表项的条目个数为16个。由于成员表的每一个条目的表项宽度都较宽,导致成员表资源消耗很大,而网络设备的处理器芯片中,最宝贵资源就是表项存储资源,因此,目前对于WCMP的实现,均需要大量地消耗表项存储资源。
发明内容
为解决上述技术问题,本发明实施例期望提供一种WCMP的路由控制方法、装置、系统及存储介质,能够减少实现WCMP时表项存储资源的消耗,节省芯片存储空间。
本发明实施例的技术方案是这样实现的:
第一方面,本发明实施例提供了一种加权多路径WCMP的路由控制方法,所述方法包括:
根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;
根据所述随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组;其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;
建立所述路径成员和所述成员组之间对应关系,得到多级索引表;
将所述多级索引表发送至转发面装置;其中,多级索引表用于使得转发面
装置获取加权多路径转发的路径信息。
在上述方案中,所述根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率,包括:
将同一路由下的所有路径成员的权重进行求和,作为分母;
将所述各路径成员的权重作为分子,获取得到随机命中各路径成员的概率。
在上述方案中,所述根据随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组,包括:
当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=mN,其中,m为正整数时,设置m个对应于该路径成员的成员组;
当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=nN+p1,其中,n为自然数,余数p1小于N时,设置n个对应于该路径成员的成员组,并且按照预设的设置规则为余数总和为N的路径成员额外设置成员组。
在上述方案中,所述按照预设的设置规则为余数总和为N的路径成员额外设置成员组,包括:
将余数相同且余数总和为N的路径成员设置成员组;以及,
在余数不同且余数总和为N的路径成员中,按照余数较大的路径成员的余数除以余数最小的路径成员的余数所得到的商数对余数较大的路径成员进行复制,并将复制后的路径成员与余数最小的路径成员设置成员组。
在上述方案中,所述建立路径成员和成员组之间对应关系,得到多级索引表,具体包括:
将所有成员组归纳为成员组表;
将所有路径成员归纳为成员表;
按照每个成员组所包括的路径成员建立路径成员和成员组之间的对应关系,并且建立成员组表与成员表之间的索引表。
第二方面,本发明实施例提供了一种加权多路径WCMP的路由控制方法,所述方法包括:
接收控制面发送的多级索引表;其中,所述多级索引表包括成员组表和路径成员表,其中,所述成员组表中包括至少一个成员组条目,每个成员组条目对应路径成员表中至少一个路径成员;并且随机命中各成员组条目的概率N相同;且在命中成员组条目后,随机命中所述成员组条目所对应的各路径成员的概率相同;
根据报文查询路由表后,按照所述多级索引表获取路径成员的转发信息。
在上述方案中,所述按照多级索引表获取路径成员的转发信息,包括:
根据所述报文查询所述路由表后,获取所述多级索引表中成员组表的指针ptr;
根据哈希模块产生的随机哈希因子与所述获取的成员组表的指针ptr随机索引得到所述成员组表中的成员组条目,并获取所述成员组条目在所述路径成员表中所对应的路径成员索引基址base_idx以及路径成员个数count;
通过哈希模块产生的随机哈希因子对所述成员组条目在路径成员表中所对应的路径成员个数进行取模运算,获得随机的相对偏移offset;
将所述相对偏移offset加上所述成员组条目在路径成员表中所对应的路径成员索引基址base_idx,得到所述多级索引表中路径成员表内的路径成员索引,并根据所述路径成员索引获取所述路径成员的转发信息。
第三方面,本发明实施例提供了一种控制面装置,所述控制面装置,包括:获取单元、分组单元、建立单元和发送单元,其中,
所述获取单元,配置为根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;
所述分组单元,配置为根据所述随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组;其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;
所述建立单元,配置为建立所述路径成员和所述成员组之间对应关系,得到多级索引表;
所述发送单元,配置为将所述多级索引表发送至所述转发面装置;其中,
多级索引表用于使得转发面装置获取加权多路径转发的路径信息。
在上述方案中,所述获取单元,配置为:
将同一路由下的所有路径成员的权重进行求和,作为分母;以及,
将所述各路径成员的权重作为分子,获取得到随机命中各路径成员的概率。
在上述方案中,所述分组单元,配置为:
当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=mN,其中,m为正整数时,设置m个对应于该路径成员的成员组;
当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=nN+p1,其中,n为自然数,余数p1小于N时,设置n个对应于该路径成员的成员组,并且按照预设的设置规则为余数总和为N的路径成员额外设置成员组。
在上述方案中,所述分组单元,配置为:
将余数相同且余数总和为N的路径成员设置成员组;以及,
在余数不同且余数总和为N的路径成员中,按照余数较大的路径成员的余数除以余数最小的路径成员的余数所得到的商数对余数较大的路径成员进行复制,并将复制后的路径成员与余数最小的路径成员设置成员组。
在上述方案中,所述建立单元,配置为:
将所有成员组归纳为成员组表;以及,
将所有路径成员归纳为成员表;以及,
按照每个成员组所包括的路径成员建立路径成员和成员组之间的对应关系,并且建立成员组表与成员表之间的索引表。
第四方面,本发明实施例提供了一种转发面装置,所述转发面装置,包括:接收单元和查询获取单元,其中,
所述接收单元,配置为接收控制面发送的多级索引表;其中,所述多级索引表包括成员组表和路径成员表,其中,所述成员组表中包括至少一个成员组条目,每个成员组条目对应路径成员表中至少一个路径成员;并且随机命中各成员组条目的概率N相同;且在命中成员组条目后,随机命中所述成员组条目
所对应的各路径成员的概率相同;
所述查询获取单元,配置为根据报文查询路由表后,按照所述多级索引表获取路径成员的转发信息。
在上述方案中,所述查询获取单元,还配置为:
根据所述报文查询所述路由表后,获取所述多级索引表中成员组表的指针ptr;以及,
根据哈希模块产生的随机哈希因子与所述获取的成员组表的指针ptr随机索引得到所述成员组表中的成员组条目,并获取所述成员组条目在所述路径成员表中所对应的路径成员索引基址base_idx以及路径成员个数count;以及,
通过哈希模块产生的随机哈希因子对所述成员组条目在路径成员表中所对应的路径成员个数进行取模运算,获得随机的相对偏移offset;以及,
将所述相对偏移offset加上所述成员组条目在路径成员表中所对应的路径成员索引基址base_idx,得到所述多级索引表中路径成员表内的路径成员索引,并根据所述路径成员索引获取所述路径成员的转发信息。
第五方面,本发明实施例提供了一种加权多路径WCMP的路由控制系统,所述系统包括:控制面装置和转发面装置,其中,
所述控制面装置,配置为根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;以及,
根据所述随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组;其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;以及,
建立所述路径成员和所述成员组之间对应关系,得到多级索引表;以及,
将所述多级索引表发送至所述转发面装置;其中,多级索引表用于使得转发面装置获取加权多路径转发的路径信息;
所述转发面装置,配置为接收所述控制面装置发送的多级索引表;其中,所述多级索引表包括成员组表和路径成员表,其中,所述成员组表中包括至少一个成员组条目,每个成员组条目对应路径成员表中至少一个路径成员;并且
随机命中各成员组条目的概率N相同;且在命中成员组条目后,随机命中所述成员组条目所对应的各路径成员的概率相同;以及,
根据报文查询路由表后,按照所述多级索引表获取路径成员的转发信息。
本发明实施例提供了一种WCMP的路由控制方法、装置、系统及存储介质,利用多级映射的手段,通过条件概率对相同路由下的多个路径成员的权值进行表述,从而使得成员表中表项的条目数与路径成员的个数相同,从而能够减少实现WCMP时表项存储资源的消耗,节省芯片存储空间。
图1为现有技术中WCMP的实现方法结构示意图;
图2为现有技术中实现WCMP的成员表示意图;
图3为本发明实施例提供的一种WCMP的路由控制方法流程示意图;
图4为本发明实施例提供的一种多级索引表示意图;
图5为本发明实施例提供的另一种WCMP的路由控制方法流程示意图;
图6为本发明实施例提供的按照多级索引表获取路径成员的转发信息的流程示意图;
图7为本发明实施例提供的一种控制面装置结构示意图;
图8为本发明实施例提供的一种转发面装置结构示意图;
图9为本发明实施例提供的一种WCMP的路由控制系统的结构示意图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
在WCMP的实现过程中,由于同一路由下的各路径成员的权重均可以由随机命中各路径成员的概率进行表述,因此,本发明实施例的基本思想是:通过多级映射的方式将随机命中各路径成员的概率表述成条件概率的形式,从而使得成员表中的表项条目数量与路径成员的个数相同。
基于上述基本思想,参见图3,其示出了本发明实施例提供的一种WCMP的路由控制方法,该方法可以应用于网络设备中用于生成转发表的控制面装置,该方法可以包括:
S301:根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;
示例性地,S301的实现过程具体可以为:
将同一路由下的所有路径成员的权重进行求和,作为分母;并将各路径成员的权重作为分子就能够得到随机命中各路径成员的概率。
如图2所示,路由A对应8个路径成员,权重比例为1:1:1:1:2:2:4:4,那么,所有路径成员的权重求和可以得到1+1+1+1+2+2+4+4=16,并且将这一结果作为分母;将各路径成员的权重作为分子,从而得到随机命中各路径成员的概率依次为:成员1:1/16,成员2:1/16,成员3:1/16,成员4:1/16,成员5:2/16,成员6:2/16,成员7:4/16,成员8:4/16。
S302:根据随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组;
其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;
具体地,随机命中任一路径成员的概率P可以理解为:在命中该路径成员所在成员组的条件下,在该路径成员所在的成员组中随机命中该路径成员的概率。因此,随机命中各路径成员的概率P的计算公式为P=N×X,其中,P为随机命中一个路径成员的概率,N为随机命中该路径成员所在成员组的概率,X为在命中该路径成员所在成员组的条件下,在该路径成员所在的成员组中随机命中该路径成员的概率。
具体地,为了实现随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同这一技术特征,根据随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组,可以包括:
当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系
满足P=mN,其中,m为正整数时,设置m个对应于该路径成员的成员组;
当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=nN+p1,其中,n为自然数,余数p1小于N时,设置n个对应于该路径成员的成员组,并且按照预设的设置规则为余数总和为N的路径成员额外设置成员组;
进一步地,按照预设的设置规则为余数总和为N的路径成员额外设置成员组,可以包括:
将余数相同且余数总和为N的路径成员设置成员组;以及,
在余数不同且余数总和为N的路径成员中,按照余数较大的路径成员的余数除以余数最小的路径成员的余数所得到的商数对余数较大的路径成员进行复制,并将复制后的路径成员与余数最小的路径成员设置成员组。
还是以图2所示的路由A对应的8个路径成员为例,随机命中各路径成员的概率可以分解为:成员1:成员2:成员3:成员4: 成员5: 成员6: 成员7: 成员8:由于8个路径成员的随机命中概率均能分解为与其他数的乘积,因此,可以将这8个路径成员分为四组,随机命中这四个组中的任一组的概率N为
对于成员1、成员2、成员3、成员4来说,各自的余数均为且这四个成员的余数之和为对于成员5和成员6来说,各自的余数均为且这两个成员的余数之和为因此,可以将成员1、成员2、成员3、成员4设置为一个成员组,将成员5和成员6设置为一个成员组;
从而,将成员1、成员2、成员3、成员4设置为组a;成员5和成员6设置为组b;成员7设置为组c;成员8设置为组d之后,可以得知在组a中,成员1、成员2、成员3、成员4被命中的概率均为在组b中,成员5和成员6被命中的概率均为在组c中,成员7被命中的概率为1;在组d中,成员8被命中的概率为1,从而实现了随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同。
需要说明的是,若路径成员的随机命中概率分别为的时候,这三个路径成员的余数也分别为且这三个路径成员的余数总和也为此时,需要将余数为的路径成员进行复制,并且由于因此,需要将余数为的路径成员复制为两个路径成员,以使得并且将复制后的两个路径成员与另外两个余数为的路径成员设置为一个成员组。可以理解地,由于余数不同且余数总和为N的路径成员通常为之前设置成员组所剩余的路径成员,因此,需要复制的路径成员数量极少,也不会造成现有技术中所描述的所有大权重的路径成员均进行复制的情况,从而也能减少表项存储资源的消耗现象,节省了芯片存储空间。
还需要说明的是,对于成员概率的最简分数形式的分母不为偶数的情况,为了达到更好的压缩效果,还需要控制面对权重进行微调,此时微调权重所引起的误差需要根据实际应用情况来决定
S303:建立路径成员和成员组之间对应关系,得到多级索引表;
示例性地,建立路径成员和成员组之间对应关系,得到多级索引表,具体可以包括:
将所有成员组归纳为成员组表;
将所有路径成员归纳为成员表;
按照每个成员组所包括的路径成员建立路径成员和成员组之间的对应关系,并且建立成员组表与成员表之间的索引表。
具体地,还是以图2所示的路由A对应的8个路径成员为例,成员1、成员2、成员3、成员4与组a之间、成员5和成员6与组b之间、成员7与组c之间、成员8与组d之间均具有对应关系;随后为组a、组b、组c、组d建立成员组表,从而可以得到如图4所示的对应关系。
可以理解地,多级索引表中,成员表的表项数量与WCMP的路径成员个数一致。
S304:将多级索引表发送至转发面装置;
其中,多级索引表用于使得转发面装置获取加权多路径转发的路径信息。
本实施例对控制面根据同一路由下的各路径成员的权重转化为条件概率来建立多级索引表,从而使得多级索引表中的成员表的表项个数与路径成员的个数相同,从而避免了现有技术由于通过重复填充的方式来满足权重较大的路径成员的方式所导致的表项存储资源的消耗现象,节省了芯片存储空间。
本发明实施例还提出一种第一计算机可读存储介质,该存储介质包括一组指令,所述指令用于执行以上所述的应用于控制面装置的加权多路径WCMP的路由控制方法。
基于前述实施例相同的技术构思,当转发面装置在接收到多级索引表之后,就可以根据多级索引表进行转发路径的查询,参见图5,其示出了本发明实施例提供的另一种WCMP的路由控制方法,该方法可以应用于网络设备中用于根据转发表进行转发的转发面装置,该方法可以包括:
S501:接收控制面发送的多级索引表;
其中,该多级索引表包括成员组表和路径成员表,其中,成员组表中包括至少一个成员组条目,每个成员组条目对应路径成员表中至少一个路径成员;并且随机命中各成员组条目的概率N相同;且在命中成员组条目后,随机命中该成员组条目所对应的各路径成员的概率相同;
可以理解地,多级索引表的生成过程前述实施例中已有详细描述,在此不再赘述。
S502:根据报文查询路由表后,按照多级索引表获取路径成员的转发信息;
可以理解地,由于多级索引表中路径成员表中表项条目数量与WCMP路径成员的个数一致,使得转发面装置对路径成员的表项进行保存所消耗的存储资源要远小于现有技术,因此,减少表项存储资源的消耗现象,节省了芯片存储空间。
具体地,按照多级索引表获取路径成员的转发信息,可以如图6所示,包括:
某报文查询路由表后,获取多级索引表中成员组表的指针ptr;
根据哈希模块产生的随机哈希因子与获取的成员组表的指针ptr随机索引得到成员组表中的成员组条目,并获取成员组条目在路径成员表中所对应的路径成员索引基址base_idx以及路径成员个数count;
通过哈希模块产生的随机哈希因子对成员组条目在路径成员表中所对应的路径成员个数进行取模运算,获得随机的相对偏移offset;
将所述相对偏移offset加上成员组条目在路径成员表中所对应的路径成员索引基址base_idx,得到多级索引表中路径成员表内的路径成员索引,并根据路径成员索引获取路径成员的转发信息。
优选地,在实际应用中,可以将哈希模块产生的随机哈希因子的高位Hash_index_Msb用于与获取的成员组表的指针ptr随机索引得到成员组表中的成员组条目;将哈希模块产生的随机哈希因子的高位Hash_index_Lsb用于对成员组条目在路径成员表中所对应的路径成员个数count进行取模运算。本发明实施例对此不作赘述。
本实施例对转发面根据前述实施例中多级索引表获取路径成员的转发信息进行了描述,从而使得转发面保存多级索引表时,路径成员表中的条目数与路径成员数量一致,避免了转发面的存储资源的消耗现象,节省了芯片存储空间。
本发明实施例还提出一种第二计算机可读存储介质,该存储介质包括一组
指令,所述指令用于执行以上所述的应用于转发面装置的加权多路径WCMP的路由控制方法。
基于前述实施例相同的技术构思,参见图7,其示出了本发明实施例提供的一种控制面装置70,所述控制面装置70,包括:获取单元701、分组单元702、建立单元703和发送单元704,其中,
获取单元701,配置为根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;
分组单元702,配置为根据随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组;其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;
建立单元703,配置为建立路径成员和成员组之间对应关系,得到多级索引表;
发送单元704,配置为将多级索引表发送至转发面装置;其中,多级索引表用于使得转发面装置获取加权多路径转发的路径信息。
示例性地,获取单元701,具体配置为:
将同一路由下的所有路径成员的权重进行求和,作为分母;以及,
将各路径成员的权重作为分子,获取得到随机命中各路径成员的概率。
示例性地,分组单元702,具体配置为:
当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=mN,其中,m为正整数时,设置m个对应于该路径成员的成员组;
当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=nN+p1,其中,n为自然数,余数p1小于N时,设置n个对应于该路径成员的成员组,并且按照预设的设置规则为余数总和为N的路径成员额外设置成员组。
进一步地,分组单元702,具体配置为:
将余数相同且余数总和为N的路径成员设置成员组;以及,
在余数不同且余数总和为N的路径成员中,按照余数较大的路径成员的余数除以余数最小的路径成员的余数所得到的商数对余数较大的路径成员进行复制,并将复制后的路径成员与余数最小的路径成员设置成员组。
示例性地,建立单元703,具体配置为:
将所有成员组归纳为成员组表;以及,
将所有路径成员归纳为成员表;以及,
按照每个成员组所包括的路径成员建立路径成员和成员组之间的对应关系,并且建立成员组表与成员表之间的索引表。
本实施例提供的控制面装置70,根据同一路由下的各路径成员的权重转化为条件概率来建立多级索引表,从而使得多级索引表中的成员表的表项个数与路径成员的个数相同,从而避免了现有技术由于通过重复填充的方式来满足权重较大的路径成员的方式所导致的表项存储资源的消耗现象,节省了芯片存储空间。
在实际应用中,所述获取单元701、分组单元702、建立单元703和发送单元704均可由中央处理单元(CPU,Central Processing Unit)、或数字信号处理(DSP,Digital Signal Processor)、或现场可编程门阵列(FPGA,Field Programmable Gate Array)等来实现;所述CPU、DSP、FPGA均可内置于控制面装置70中。
基于前述实施例相同的技术构思,参见图8,其示出了本发明实施例提供的一种转发面装置80,该转发面装置80,包括:接收单元801、和查询获取单元802,其中,
接收单元801,配置为接收控制面发送的多级索引表;其中,多级索引表包括成员组表和路径成员表,其中,成员组表中包括至少一个成员组条目,每个成员组条目对应路径成员表中至少一个路径成员;并且随机命中各成员组条目的概率N相同;且在命中成员组条目后,随机命中成员组条目所对应的各路径成员的概率相同;
查询获取单元802,配置为根据报文查询路由表后,按照多级索引表获取路径成员的转发信息。
示例性地,查询获取单元802,具体配置为:
根据报文查询路由表后,获取多级索引表中成员组表的指针ptr;以及
根据哈希模块产生的随机哈希因子与获取的成员组表的指针ptr随机索引得到成员组表中的成员组条目,并获取成员组条目在路径成员表中所对应的路径成员索引基址base_idx以及路径成员个数count;以及,
通过哈希模块产生的随机哈希因子对成员组条目在路径成员表中所对应的路径成员个数进行取模运算,获得随机的相对偏移offset;以及,
将相对偏移offset加上成员组条目在路径成员表中所对应的路径成员索引基址base_idx,得到多级索引表中路径成员表内的路径成员索引,并根据路径成员索引获取路径成员的转发信息。
本实施例提供的转发面装置80,根据前述实施例中多级索引表获取路径成员的转发信息,从而使得转发面保存多级索引表时,路径成员表中的条目数与路径成员数量一致,避免了转发面的存储资源的消耗现象,节省了芯片存储空间。
在实际应用中,所述接收单元801、和查询获取单元802均可由中央处理单元(CPU,Central Processing Unit)、或数字信号处理(DSP,Digital Signal Processor)、或现场可编程门阵列(FPGA,Field Programmable Gate Array)等来实现;所述CPU、DSP、FPGA均可内置于转发面装置80中。
基于前述实施例相同的技术构思,参见图9,其示出了本发明实施例提供的一种WCMP的路由控制系统90,该系统90包括:控制面装置70和转发面装置80,其中,
控制面装置70,配置为根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;以及,
根据随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少
一个成员组;其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;以及,
建立路径成员和成员组之间对应关系,得到多级索引表;以及,
将多级索引表发送至转发面装置80;其中,多级索引表用于使得转发面装置80获取加权多路径转发的路径信息;
转发面装置80,配置为接收控制面装置70发送的多级索引表;其中,多级索引表包括成员组表和路径成员表,其中,成员组表中包括至少一个成员组条目,每个成员组条目对应路径成员表中至少一个路径成员;并且随机命中各成员组条目的概率N相同;且在命中成员组条目后,随机命中成员组条目所对应的各路径成员的概率相同;以及,
根据报文查询路由表后,按照多级索引表获取路径成员的转发信息。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
本发明实施例利用多级映射的手段,通过条件概率对相同路由下的多个路径成员的权值进行表述,从而使得成员表中表项的条目数与路径成员的个数相同,从而能够减少实现WCMP时表项存储资源的消耗,节省芯片存储空间。
Claims (17)
- 一种加权多路径WCMP的路由控制方法,包括:根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;根据所述随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组;其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;建立所述路径成员和所述成员组之间对应关系,得到多级索引表;将所述多级索引表发送至转发面装置;其中,多级索引表用于使得转发面装置获取加权多路径转发的路径信息。
- 根据权利要求1所述的方法,其中,所述根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率,包括:将同一路由下的所有路径成员的权重进行求和,作为分母;将所述各路径成员的权重作为分子,获取得到随机命中各路径成员的概率。
- 根据权利要求1所述的方法,其中,所述根据随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组,包括:当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=mN,其中,m为正整数时,设置m个对应于该路径成员的成员组;当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=nN+p1,其中,n为自然数,余数p1小于N时,设置n个对应于该路径成员的成员组,并且按照预设的设置规则为余数总和为N的路径成员额外设置成员组。
- 根据权利要求3所述的方法,其中,所述按照预设的设置规则为余数总和为N的路径成员额外设置成员组,包括:将余数相同且余数总和为N的路径成员设置成员组;以及,在余数不同且余数总和为N的路径成员中,按照余数较大的路径成员的余数除以余数最小的路径成员的余数所得到的商数对余数较大的路径成员进行复制,并将复制后的路径成员与余数最小的路径成员设置成员组。
- 根据权利要求1所述的方法,其中,所述建立路径成员和成员组之间对应关系,得到多级索引表,具体包括:将所有成员组归纳为成员组表;将所有路径成员归纳为成员表;按照每个成员组所包括的路径成员建立路径成员和成员组之间的对应关系,并且建立成员组表与成员表之间的索引表。
- 一种加权多路径WCMP的路由控制方法,包括:接收控制面发送的多级索引表;其中,所述多级索引表包括成员组表和路径成员表,其中,所述成员组表中包括至少一个成员组条目,每个成员组条目对应路径成员表中至少一个路径成员;并且随机命中各成员组条目的概率N相同;且在命中成员组条目后,随机命中所述成员组条目所对应的各路径成员的概率相同;根据报文查询路由表后,按照所述多级索引表获取路径成员的转发信息。
- 根据权利要求6所述的方法,其中,所述按照多级索引表获取路径成员的转发信息,包括:根据所述报文查询所述路由表后,获取所述多级索引表中成员组表的指针ptr;根据哈希模块产生的随机哈希因子与所述获取的成员组表的指针ptr随 机索引得到所述成员组表中的成员组条目,并获取所述成员组条目在所述路径成员表中所对应的路径成员索引基址base_idx以及路径成员个数count;通过哈希模块产生的随机哈希因子对所述成员组条目在路径成员表中所对应的路径成员个数进行取模运算,获得随机的相对偏移offset;将所述相对偏移offset加上所述成员组条目在路径成员表中所对应的路径成员索引基址base_idx,得到所述多级索引表中路径成员表内的路径成员索引,并根据所述路径成员索引获取所述路径成员的转发信息。
- 一种控制面装置,包括:获取单元、分组单元、建立单元和发送单元,其中,所述获取单元,配置为根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;所述分组单元,配置为根据所述随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组;其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;所述建立单元,配置为建立所述路径成员和所述成员组之间对应关系,得到多级索引表;所述发送单元,配置为将所述多级索引表发送至所述转发面装置;其中,多级索引表用于使得转发面装置获取加权多路径转发的路径信息。
- 根据权利要求8所述的控制面装置,其中,所述获取单元,配置为:将同一路由下的所有路径成员的权重进行求和,作为分母;以及,将所述各路径成员的权重作为分子,获取得到随机命中各路径成员的概率。
- 根据权利要求8所述的控制面装置,其中,所述分组单元,配置 为:当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=mN,其中,m为正整数时,设置m个对应于该路径成员的成员组;当随机命中一路径成员的概率P与随机命中各成员组的概率N之间的关系满足P=nN+p1,其中,n为自然数,余数p1小于N时,设置n个对应于该路径成员的成员组,并且按照预设的设置规则为余数总和为N的路径成员额外设置成员组。
- 根据权利要求10所述的控制面装置,其中,所述分组单元,配置为:将余数相同且余数总和为N的路径成员设置成员组;以及,在余数不同且余数总和为N的路径成员中,按照余数较大的路径成员的余数除以余数最小的路径成员的余数所得到的商数对余数较大的路径成员进行复制,并将复制后的路径成员与余数最小的路径成员设置成员组。
- 根据权利要求8所述的控制面装置,其中,所述建立单元,配置为:将所有成员组归纳为成员组表;以及,将所有路径成员归纳为成员表;以及,按照每个成员组所包括的路径成员建立路径成员和成员组之间的对应关系,并且建立成员组表与成员表之间的索引表。
- 一种转发面装置,包括:接收单元和查询获取单元,其中,所述接收单元,配置为接收控制面发送的多级索引表;其中,所述多级索引表包括成员组表和路径成员表,其中,所述成员组表中包括至少一个成员组条目,每个成员组条目对应路径成员表中至少一个路径成员;并且随机命中各成员组条目的概率N相同;且在命中成员组条目后,随机命 中所述成员组条目所对应的各路径成员的概率相同;所述查询获取单元,配置为根据报文查询路由表后,按照所述多级索引表获取路径成员的转发信息。
- 根据权利要求13所述的转发面装置,其中,所述查询获取单元,还配置为:根据所述报文查询所述路由表后,获取所述多级索引表中成员组表的指针ptr;以及,根据哈希模块产生的随机哈希因子与所述获取的成员组表的指针ptr随机索引得到所述成员组表中的成员组条目,并获取所述成员组条目在所述路径成员表中所对应的路径成员索引基址base_idx以及路径成员个数count;以及,通过哈希模块产生的随机哈希因子对所述成员组条目在路径成员表中所对应的路径成员个数进行取模运算,获得随机的相对偏移offset;以及,将所述相对偏移offset加上所述成员组条目在路径成员表中所对应的路径成员索引基址base_idx,得到所述多级索引表中路径成员表内的路径成员索引,并根据所述路径成员索引获取所述路径成员的转发信息。
- 一种加权多路径WCMP的路由控制系统,包括:控制面装置和转发面装置,其中,所述控制面装置,配置为根据同一路由下的各路径成员的权重对应获取随机命中各路径成员的概率;以及,根据所述随机命中各路径成员的概率按照预设的分组策略进行分组,得到至少一个成员组;其中,随机命中各成员组的概率N相同;且在命中成员组后,随机命中成员组中的各路径成员的概率相同;以及,建立所述路径成员和所述成员组之间对应关系,得到多级索引表;以及,将所述多级索引表发送至所述转发面装置;其中,多级索引表用于使得转发面装置获取加权多路径转发的路径信息;所述转发面装置,配置为接收所述控制面装置发送的多级索引表;其中,所述多级索引表包括成员组表和路径成员表,其中,所述成员组表中包括至少一个成员组条目,每个成员组条目对应路径成员表中至少一个路径成员;并且随机命中各成员组条目的概率N相同;且在命中成员组条目后,随机命中所述成员组条目所对应的各路径成员的概率相同;以及,根据报文查询路由表后,按照所述多级索引表获取路径成员的转发信息。
- 一种第一计算机可读存储介质,该存储介质包括一组指令,所述指令用于执行权利要求1至5任一项所述的加权多路径WCMP的路由控制方法。
- 一种第二计算机可读存储介质,该存储介质包括一组指令,所述指令用于执行权利要求6或7所述的加权多路径WCMP的路由控制方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510219341.2A CN106209635B (zh) | 2015-04-30 | 2015-04-30 | 一种加权多路径wcmp的路由控制方法、装置和系统 |
| CN201510219341.2 | 2015-04-30 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016173241A1 true WO2016173241A1 (zh) | 2016-11-03 |
Family
ID=57198913
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2015/094738 Ceased WO2016173241A1 (zh) | 2015-04-30 | 2015-11-16 | 一种路由控制方法、装置、系统及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106209635B (zh) |
| WO (1) | WO2016173241A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110505148A (zh) * | 2019-07-24 | 2019-11-26 | 烽火通信科技股份有限公司 | 实现加权多路径的方法及系统 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1897564A (zh) * | 2005-07-11 | 2007-01-17 | 中兴通讯股份有限公司 | 基于递归流分类算法的策略路由匹配方法 |
| CN101094179A (zh) * | 2007-07-16 | 2007-12-26 | 中兴通讯股份有限公司 | 一种多级索引路由查找方法及装置 |
| CN101753455A (zh) * | 2009-12-15 | 2010-06-23 | 中兴通讯股份有限公司 | 转发方法及装置 |
| US8982700B1 (en) * | 2012-01-27 | 2015-03-17 | Google Inc. | System and method for minimizing hardware resources for given performance using weighted cost multi-path flow distribution |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8180725B1 (en) * | 2007-08-01 | 2012-05-15 | Google Inc. | Method and apparatus for selecting links to include in a probabilistic generative model for text |
| US9071541B2 (en) * | 2012-04-25 | 2015-06-30 | Juniper Networks, Inc. | Path weighted equal-cost multipath |
| CN103854072B (zh) * | 2014-03-17 | 2017-12-12 | 湖南工学院 | 用于路径选择的处理方法及系统 |
-
2015
- 2015-04-30 CN CN201510219341.2A patent/CN106209635B/zh active Active
- 2015-11-16 WO PCT/CN2015/094738 patent/WO2016173241A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1897564A (zh) * | 2005-07-11 | 2007-01-17 | 中兴通讯股份有限公司 | 基于递归流分类算法的策略路由匹配方法 |
| CN101094179A (zh) * | 2007-07-16 | 2007-12-26 | 中兴通讯股份有限公司 | 一种多级索引路由查找方法及装置 |
| CN101753455A (zh) * | 2009-12-15 | 2010-06-23 | 中兴通讯股份有限公司 | 转发方法及装置 |
| US8982700B1 (en) * | 2012-01-27 | 2015-03-17 | Google Inc. | System and method for minimizing hardware resources for given performance using weighted cost multi-path flow distribution |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106209635B (zh) | 2019-06-11 |
| CN106209635A (zh) | 2016-12-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12363190B1 (en) | Weighted load balancing using scaled parallel hashing | |
| CN109740376B (zh) | 基于近邻查询的位置隐私保护方法、系统、设备及介质 | |
| CN106471488B (zh) | 用于基于位置信息的服务器控制的平铺技术 | |
| US9608913B1 (en) | Weighted load balancing in a multistage network | |
| US10742722B2 (en) | Server load balancing | |
| CN110099112B (zh) | 基于点对点网络的数据存储方法、装置、介质及终端设备 | |
| CN107317887B (zh) | 一种负载均衡方法、装置和系统 | |
| CN103905332B (zh) | 一种确定缓存策略的方法及设备 | |
| CN114237985B (zh) | 修复纠删码存储系统中失效存储块的方法及相关设备 | |
| CN104166821B (zh) | 一种数据处理的方法和装置 | |
| CN108108815A (zh) | 基于改进遗传算法的虚拟网络映射方法及装置 | |
| CN106856459A (zh) | 一种报文调度方法和装置 | |
| CN108259334A (zh) | 一种等价路由表项建立方法和装置 | |
| Sadeh et al. | Optimal representations of a traffic distribution in switch memories | |
| US8595239B1 (en) | Minimally disruptive hash table | |
| CN106886674B (zh) | 一种地理位置距离批量计算方法及装置 | |
| CN105204782B (zh) | 一种实现数据存储的方法及装置 | |
| US12088500B2 (en) | Method to mitigate hash correlation in multi-path networks | |
| WO2016173241A1 (zh) | 一种路由控制方法、装置、系统及存储介质 | |
| CN118972316A (zh) | 算力路由生成方法、算力路由调度方法、设备、存储介质和程序产品 | |
| CN104901947B (zh) | 一种基于tcam连续数值匹配方法和装置 | |
| CN108092805A (zh) | 一种基于群体优化的电力通信网跨域虚拟网分配机制 | |
| US12278766B1 (en) | Advanced storage operations for WAN optimization | |
| US12309062B2 (en) | Advanced storage operations for wan optimization | |
| CN114006867B (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: 15890616 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: 15890616 Country of ref document: EP Kind code of ref document: A1 |