WO2007104204A1 - A method for managing the router table using the ternary content addressable memory - Google Patents

A method for managing the router table using the ternary content addressable memory Download PDF

Info

Publication number
WO2007104204A1
WO2007104204A1 PCT/CN2006/003750 CN2006003750W WO2007104204A1 WO 2007104204 A1 WO2007104204 A1 WO 2007104204A1 CN 2006003750 W CN2006003750 W CN 2006003750W WO 2007104204 A1 WO2007104204 A1 WO 2007104204A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
region
route
space
current
Prior art date
Application number
PCT/CN2006/003750
Other languages
French (fr)
Chinese (zh)
Inventor
Junchuan Wang
Qinghua Shao
Wenlong Liu
Original Assignee
Zte Corporation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zte Corporation filed Critical Zte Corporation
Publication of WO2007104204A1 publication Critical patent/WO2007104204A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

Definitions

  • the present invention relates to the field of computer network technologies, and in particular, to a technology for implementing routing table management using TCAM (Ternary Content Addressable Memory), which is mainly applied to Network devices such as routers, switches, firewalls, and intrusion detection systems.
  • TCAM Ternary Content Addressable Memory
  • IPv4 Internet Protocol version 4
  • IPv6 Internet Protocol version 6, Internet Protocol version 6
  • TCAM Tumor Access Memory
  • hardware implementation is definitely much faster than software, especially in some high-speed networks, where hardware is used to accelerate.
  • TCAM is a dedicated triple-content addressable memory that enables fast, massively parallel searches.
  • all entries in the memory are simultaneously compared with the search key, and the search result is the physical address of the match.
  • each bit of the entry can be 0, 1, or X. If it is X, then the bit does not participate in the comparison. The default is success, otherwise the keyword is compared with the corresponding bit of the entry. The same is successful or otherwise fails.
  • the comparison process if a bit does not match, the entry fails to match; if all bits match, then the entry matches successfully.
  • TCAM time division multiple access memory
  • LPM longest prefix match
  • IPv4/IPv6 routing is searched using LPM
  • LPM longest prefix match
  • IPv4/IPv6 routing is searched using LPM
  • the normal TCAM search process uses the principle of first matching, that is, if there are multiple matches, then the one that matches the first or the lowest address wins. Therefore, the LPM table must be sorted by the length of the prefix, which causes the existing entries to be moved when the delete entry is inserted, as shown in Figure 1.
  • General TCAM has tens of K or even hundreds of K entries. If the first item is inserted/deleted, and moved in the most simple way, then the number of times the item moves is large and moves.
  • the object of the present invention is to solve the problem of routing table management of IPv4/IPv6 implemented by TCAM, and to provide a simple and efficient method for updating routing entries.
  • the present invention provides a management method for a triple-content addressable memory routing table, which divides a routing table into multiple regions according to a prefix length of a route, where when updating a route in the routing table, When the actual space is insufficient or too large, dynamic adjustment of the area size is performed between the respective area spaces in the routing table.
  • Step 21 Determine whether the current area to which the route to be inserted belongs has a free space; Step 22 If yes, the route is directly inserted after the last route of the current area, and if not, the area above and below the current area is addressed to whether there is an area with free space; Step 23, if not If yes, the insertion fails. If yes, the current area is enlarged, the area with free space is reduced, and then the route is inserted in the current area. Step 24, incrementing the route count of the current area, and incrementing the route The total route count for the table.
  • Step 31 From the free space The lower boundary of the area shrinks the space of one entry; step 32, moves the last item of each area between the area i or the next area of the free space to the previous area of the current area to the same Above the first entry of a zone; Step 33: Expand a space of an entry from an upper boundary of the current area, and insert a route at an upper boundary of the current area.
  • the step 23 specifically includes the following steps: Step 41, the free space is provided The first entry of the region moves to the end of the last entry, and shrinks the space of an entry from the upper boundary of the free space; step 42, the previous region i of the region with free space or The first entry of each region between the next region of the current region moves below the last entry of the same region; Step 43, expanding the space of an entry from the lower boundary of the current region, and A route is inserted at a lower boundary of the current area.
  • the above-mentioned triple content addressable memory routing table management method wherein when the route is deleted in the routing table, the method includes the following steps: Step 51: Find a location of the route to be deleted in the TCAM, and calculate the to be deleted. Step 52, determining whether the route to be deleted is the last route of the current area; Step 53, if yes, directly deleting the route to be deleted, if not And moving the last item of the current area to the current deletion item position, and deleting the route to be deleted; Step 54: Decrement the prefix count of the current area, and decrement the total prefix count of the routing table.
  • the above-mentioned triple content addressable memory routing table management method further comprising the step of performing area shrinking, specifically comprising: Step 61: determining whether the size of the current area exceeds a desired value; Step 62, if not, not performing the areashrinking, if yes, searching for an area with insufficient space above and below the current area; Step 63, if not, stopping the area contraction, and if so, shrinking the current area, expanding the area with insufficient space .
  • Step 71 Add the current area to the area with insufficient space The first entry of each region between the next region moves to the bottom of the last entry of the same region; Step 72, the space of one entry is reduced at the lower boundary of the current region; Step 73, The lower boundary of an area with insufficient space expands the space of an entry.
  • Step 81 Send the next area of the current area to the The last entry of each region between the insufficient space regions moves to the top of the same region i or the first entry; Step 82, the lower boundary of the current region is reduced by an entry space; Step 83; Expanding the space of an entry from the lower boundary of the insufficient space area.
  • FIG. 1 is a schematic diagram showing a sequence of arrangement of an LPM table of the present invention in a TCAM;
  • FIG. 2 is a diagram showing a prefix area distribution after initialization of the present invention;
  • FIG. 3 is a flow chart of inserting a route of the present invention;
  • 5 is a flowchart of deleting a route according to the present invention;
  • FIG. 6 is an example of prefix region shrinking according to the present invention;
  • FIG. 7 is a flowchart of a prefix distribution learning of the present invention.
  • Fig. 1 is a schematic view showing the arrangement of LPM tables of the present invention in TCAM.
  • 2 is a prefix area i or a distribution map after initialization of the present invention.
  • each prefix area has a set of information, as follows: Upper_ boundary upper boundary lower_ boundary lower boundary preflx_num prefix number region— size area i or actual size expected—size area i or expected size global information g_region[N] information of all areas i or, as described above g__prefix_total routing table
  • the total number of prefixes g start The starting position of the routing table in the TCAM
  • g the capability routing table
  • the capacity presets the size of each area according to the previous statistical information, and initializes the area related information and the global information.
  • the allocation ratio for each region is stored in the percentage [N] array.
  • upper-boundary g— start g—region[N].
  • lower— boundary g—region[N].
  • region One size-1 G_region [N]. prefix— num 0
  • the region I ( ⁇ > 1 > 0, I from Nl ⁇ l ) is initialized as follows: g—region[I].
  • expected— size g—region[I].
  • Region— size
  • the prefix area I has no free space, then you can consider expanding the area.
  • the routing table has free space, and the prefix area can be extended.
  • the prefix area J with free space is searched in the upper and lower areas of the area I in turn, and the judgment conditions are as follows: g-region[J] .region_size> g-region[J], prefix-num
  • the judgment process is an iterative process, in order to make The number of moves is the least.
  • the judgment method is to judge J+l, J-1 first, and then judge J+2, J-2 until a prefix area with free space is found.
  • the free area J is above the area I. From the lower boundary of the region J shrinks 'j, the space of an entry: g-region[J] .region a size— G-region[J] .lower— boundary—
  • each region ⁇ between regions J-l to 1+1 is performed as follows (upward shift): g_region[x], upper_ boundary-
  • G_region[J].prefix_num) moves the first entry of the region to the end of the last entry in the region.
  • the move condition is g_region[x]. prefix a num > 0 from the upper bound of region J, the space of an entry: g — region[J]. region— size— g—region[ J]. upper-boundary ++
  • each region x (each region is full) between the regions J+l to 1-1 is sequentially processed as follows (g): g-region[x]. lower- boundary ++
  • S310 Expand the space of an entry from the lower boundary of the region I: g_region[I].region_size++ g_region[I].lower_boundai*y++ and insert a route at the g-region[I]. lower-boundary.
  • Figure 5 is a flow chart of the present invention for deleting a route.
  • Fig. 6 is an example of the prefix region contraction of the present invention. As shown in the figure, the length of the deleted route prefix is I. The specific steps are as follows:
  • the judgment process is an iterative process, in order to minimize the number of movements.
  • the judgment method is to judge J+l, J-1 first, and then judge J+2, J-2 until a prefix area with insufficient space is found.
  • the free area J is below the area I.
  • Each of the areas X between the areas 1-1 to J is sequentially operated as follows (upward shift): G_region[x] .upper-boundar - -
  • Figure 7 is a flow chart of the prefix distribution learning of the present invention. As shown in the figure, the following steps are included:
  • the count is updated every time the routing update is performed.
  • the method of learning each prefix distribution is as follows: Recalculate the expected_size of each prefix area I (1 ⁇ I ⁇ N).
  • g-region[I]. expected_ size (( g-region[I]. expected— size ⁇ g_capability ) ⁇ ( 1 — ⁇ ) + ( G_region[I].prefix_num ⁇ g__prefix_total ) ⁇ ) xg— capability
  • the meaning of the above formula is as follows:
  • the new expected value of the region I the old expected value of the region I X ( 1 - ⁇ ) + the ideal size ⁇ ⁇ of the region I calculated according to the proportion of the current prefix of the region I.
  • is a coefficient used to adjust the proportion of the ideal size of the region I. Since the route has been constantly changing, the ⁇ value cannot be large, otherwise the routing table management will always be in a turbulent state.
  • the above is the basic principle of the intelligent prefix distribution learning function. For detailed flowchart, refer to Figure 7.
  • the prefix distribution learning function can be implemented as long as it is called every time the routing is updated.
  • the intelligent prefix distribution learning function is an option that can be enabled. If the routing update is infrequent in the actual application, the function may not be enabled. If the update is frequent, it is recommended to enable the function. The value of the sampling period sample is updated. The frequency is decremented, and the specific value can be determined according to the actual application.

Abstract

A method for managing the router table using the ternary content addressable memory divides the router table into a plurality of areas according to the prefix length of the routing, it is characterized in that: during updating the routing of the router table, the area space is adjusted dynamically between the area spaces within the router table when the actual area space is not enough or too big. The invention can solve the problem that the ternary content addressable memory implements the management of the router table of the IPv4/IPv6 and provide a simple and efficient method for implementing the update of the routing entry.

Description

一种三重内容可寻址存储器路由表管理方法 技术领域 本发明涉及计算机网络技术领域, 尤其涉及使用 TCAM(Ternary Content Addressable Memory , 三重内容可寻址存储器)实现路由表管理方面的技术, 主 要应用在路由器, 交换机, 防火墙, 入侵检测系统等网络设备。 背景技术 现今的网络设备中, 路由是最基本的功能。 目前主要是使用 IPv4(Internet Protocol version 4, 互联网十办议第四版), 其地址是 32位, IPv6(Internet Protocol version 6, 互联网协议第六版)也已经开始慢慢应用起来, 其地址是 128位。 实 现路由查找对网络设备的性能是非常关键的, 目前主要有两种途径, 一种是使 用软件实现, 最典型的就是 Trie表算法; 另一种就是使用硬件实现, 最典型的 就是 TCAM。 当然硬件实现肯定比软件快很多, 尤其是在一些高速网络中, 一 ^殳都使用硬件进 4亍加速。  FIELD OF THE INVENTION The present invention relates to the field of computer network technologies, and in particular, to a technology for implementing routing table management using TCAM (Ternary Content Addressable Memory), which is mainly applied to Network devices such as routers, switches, firewalls, and intrusion detection systems. BACKGROUND OF THE INVENTION In today's network devices, routing is the most basic function. At present, IPv4 (Internet Protocol version 4) is used mainly. The address is 32-bit. IPv6 (Internet Protocol version 6, Internet Protocol version 6) has also been slowly applied. The address is 128 bits. Implementing route lookup is critical to the performance of network devices. There are two main ways to do this. One is to use software, the most typical is the Trie table algorithm; the other is to use hardware implementation, the most typical is TCAM. Of course, hardware implementation is definitely much faster than software, especially in some high-speed networks, where hardware is used to accelerate.
TCAM是一种专用三重内容可寻址存储器, 可以进行快速大量并行搜索。 搜索的时候, 存储器中所有的条目同时与搜索关键字比较, 搜索结果就是匹配 项的物理地址。 在进行条 ϋ匹配时, 条目的每个位可以是 0、 1、 X三种状态, 如果是 X , 那么该位不参与比较, 默认是成功, 否则关键字和条目的相应位进 行比较, 如果相同则成功否则失败。 在比较过程中, 如果某位不匹配, 那么该 条目匹配失败; 果所有位都匹配, 那么该条目 匹配成功。 TCAM is a dedicated triple-content addressable memory that enables fast, massively parallel searches. At the time of the search, all entries in the memory are simultaneously compared with the search key, and the search result is the physical address of the match. In the case of strip matching, each bit of the entry can be 0, 1, or X. If it is X, then the bit does not participate in the comparison. The default is success, otherwise the keyword is compared with the corresponding bit of the entry. The same is successful or otherwise fails. During the comparison process, if a bit does not match, the entry fails to match; if all bits match, then the entry matches successfully.
TCAM硬件的固有特性使得 TCAM非常适合做 LPM(longest prefix match, 最长前缀匹配)查找, 而 IPv4/IPv6路由就是使用 LPM查找的, 所以在高速网 络比如 10G网络中, 使用 TCAM进行路由查找是一个趋势。 普通 TCAM的查找过程是采用最先匹配的原则, 也就是说如果有多个匹 配项, 那么最先匹配的或者说地址最低的那个获胜。 所以 LPM表必须按 prefix 长度递减排序, 这导致插入删除条目时需要对已有的表项进行移动, 见图 1。 —般的 TCAM都有几十 K甚至几百 K的条目,如果插入 /删除的是第一个条目, 按照最筒单的方法移动的话, 那么条目移动的次数是很大的, 同时还要移动与 条目相关联的数据, 这根本无法满足高速网絡的路由更新需求。 论文 《Fast incremental updates on Ternary-CAMs for routing lookups and packet classification》 (http:〃 www.hoti.org/archive/hoti8papers/018.pdf)提出了两种方法 实现 TCAM路由表的管理: 第一个是 PLO—OPT(prefix-length ordering), 另一 个是 CAO— OPT(chain-ancestor ordering)。 PLO— OPT算法虽然简单, 但是平均 更新效率较低, CAOJDPT算法的更新效率高, 但是实现复杂度较高。 发明内容 本发明的目的在于解决 TCAM实现 IPv4/IPv6的路由表管理问题,提供一 种简单高效的方法实现路由条目的更新。 为实现上述目的,本发明提出了一种三重内容可寻址存储器路由表管理方 法, 将路由表按照路由的前缀长度划分为多个区域, 其中, 更新所述路由表中 的路由时, 当区域实际空间不足或过大时, 在所述路由表内的各个区域空间之 间进行区域大小的动态调整。 上述的三重内容可寻址存储器路由表管理方法,其中, 当在所述路由表中 插入路由时, 具体包括以下步骤: 步骤 21 , 判断所要插入的路由所属的当前区域是否有空闲空间; 步骤 22 , 若是, 则直接在所述当前区域最后的路由后面插入所述路由, 若否, 则在所述当前区域的上方和下方的其他区域寻址是否存在有空闲空间的 区域; 步骤 23 , 若不存在, 则插入失败, 若存在, 则扩大所述当前区域, 缩小 有空闲空间的区域, 然后在所述当前区域中插入路由; 步骤 24, 递增所述当前区域的路由计数, 并递增所述路由表的总路由计 数。 上述的三重内容可寻址存储器路由表管理方法,其中,若所述有空闲空间 的区域在所述当前区域的上方, 所述步 23具体包括以下步様: 步骤 31 , 从所述有空闲空间的区域的下边界收缩一个条目的空间; 步骤 32 , 将所述有空闲空间的区 i或的下一个区域到所述当前区域的上一 个区域之间的每个区域的最后一个条目移到同一个区域的第一个条目的上面; 步骤 33 , 从所述当前区域的上边界扩大一个条目的空间, 并在所述当前 区域的上边界处插入路由。 上述的三重内容可寻址存储器路由表管理方法, 其中,若所述有空闲空间 的区域在所述当前区域的下方, 所述步骤 23具体包括以下步驟: 步骤 41 , 将所述有空闲空间的区域的第一个条目移到最后一个条目的后 面, 并从所述有空闲空间的区域的上边界收缩一个条目的空间; 步骤 42 , 将所述有空闲空间的区域的上一个区 i或到所述当前区域的下一 个区域之间的每个区域的第一个条目移到同一个区域的最后一个条目的下面; 步骤 43 , 从所述当前区域的下边界扩大一个条目的空间, 并在所述当前 区域的下边界处插入路由。 上述的三重内容可寻址存储器路由表管理方法, 其中, 当在所述路由表中 删除路由时, 具体包括以下步骤: 步骤 51 , 查找所要删除的路由在 TCAM中的位置, 计算所述要删除的路 由在所属的当前区域内的相对位置; 步骤 52 , 判断所述要删除的路由是否是所述当前区域的最后一个路由; 步骤 53 , 若是, 则直接删除所述要删除的路由, 若否, 则将所述当前区 域最后一个条目移到当前删除条目位置, 再删除所述要删除的路由; 步骤 54 , 递减所述当前区域的前缀计数, 并递减所述路由表的总前缀计 数。 上述的三重内容可寻址存储器路由表管理方法, 其中,还包括进行区域收 缩的步骤, 具体包括: 步骤 61, 判断所述当前区域的大小是否超过期望值; 步骤 62, 若否, 则不进行区域收缩, 若是, 则依次在所述当前区域的上 方和下方查找是否有空间不足的区域; 步驟 63 , 若否, 则停止区域收缩, 若是, 则收缩所述当前区域, 扩大所 述空间不足的区域。 上述的三重内容可寻址存储器路由表管理方法, 其中, 当所述空间不足的 区域在所述当前区域上方时, 具体包括以下步骤: 步骤 71 , 将所述当前区域到所述空间不足的区域的下一个区域之间的每 个区域的第一个条目移到该同一区域的最后一个条目的下面; 步骤 72, 在所述当前区域的下边界缩小一个条目的空间; 步驟 73 , 将所述空间不足的区域的下边界扩大一个条目的空间。 上述的三重内容可寻址存储器路由表管理方法, 其中, 当所述空间不足的 区域在所述当前区域下方时, 具体包括以下步骤: 步骤 81 , 将所述当前区域的下一个区域到所述空间不足的区域之间的每 个区域的最后一个条目移到该同一个区 i或的第一个条目的上面; 步骤 82 , 将所述当前区域的下边界缩小一个条目的空间; 步骤 83 , 从所述空间不足的区域的下边界扩大一个条目的空间。 上述的三重内容可寻址存储器路由表管理方法, 其中, 还包括前缀分布自 学习过程, 具体包括: 步骤 91 , 路由更新进行计数; 步骤 92, 判断计数值是否到达采样周期, 若否, 结束自学习过程, 若是, 判断当前路由条目数是否超过门限值; 步骤 93 , 若否, 结束自学习过程, 若是, 对每个前缀区域进行重新计算, 公式如下: 区域的新期望值 =区域的旧期望值 X ( 1 - δ ) +按照区域当前前缀所占比 例算得的区域理想大小 X δ , δ是一个系数, 用于调整区域理想大小所占的比重。 上述的三重内容可寻址存储器路由表管理方法, 其中, 路由表初始化时, 根据设定的前缀长度分布概率分配每个路由区域的期望值大小, 所述期望值初 始化时与分配给每个区域的大小相同。 采用本发明所述方法可以筒单高效的解决 TC AM实现 IPv4/IPv6的路由表 管理问题。 它的优点如下: The inherent characteristics of TCAM hardware make TCAM very suitable for LPM (longest prefix match) lookup, while IPv4/IPv6 routing is searched using LPM, so in high-speed networks such as 10G networks, using TCAM for route lookup is a trend. The normal TCAM search process uses the principle of first matching, that is, if there are multiple matches, then the one that matches the first or the lowest address wins. Therefore, the LPM table must be sorted by the length of the prefix, which causes the existing entries to be moved when the delete entry is inserted, as shown in Figure 1. General TCAM has tens of K or even hundreds of K entries. If the first item is inserted/deleted, and moved in the most simple way, then the number of times the item moves is large and moves. The data associated with the entry, which simply does not meet the routing update requirements of high-speed networks. Paper "Fast The incremental updates on Ternary-CAMs for routing lookups and packet classification (http:〃 www.hoti.org/archive/hoti8papers/018.pdf) proposes two methods for managing TCAM routing tables: The first is PLO-OPT (prefix-length ordering), the other is CAO-OPT (chain-ancestor ordering). Although the PLO-OPT algorithm is simple, the average update efficiency is low, and the CAOJDPT algorithm has high update efficiency, but the implementation complexity is high. SUMMARY OF THE INVENTION The object of the present invention is to solve the problem of routing table management of IPv4/IPv6 implemented by TCAM, and to provide a simple and efficient method for updating routing entries. In order to achieve the above object, the present invention provides a management method for a triple-content addressable memory routing table, which divides a routing table into multiple regions according to a prefix length of a route, where when updating a route in the routing table, When the actual space is insufficient or too large, dynamic adjustment of the area size is performed between the respective area spaces in the routing table. The above-mentioned triple content addressable memory routing table management method, wherein when the route is inserted in the routing table, the method includes the following steps: Step 21: Determine whether the current area to which the route to be inserted belongs has a free space; Step 22 If yes, the route is directly inserted after the last route of the current area, and if not, the area above and below the current area is addressed to whether there is an area with free space; Step 23, if not If yes, the insertion fails. If yes, the current area is enlarged, the area with free space is reduced, and then the route is inserted in the current area. Step 24, incrementing the route count of the current area, and incrementing the route The total route count for the table. The above-mentioned triple content addressable memory routing table management method, wherein if the area having the free space is above the current area, the step 23 specifically includes the following steps: Step 31: From the free space The lower boundary of the area shrinks the space of one entry; step 32, moves the last item of each area between the area i or the next area of the free space to the previous area of the current area to the same Above the first entry of a zone; Step 33: Expand a space of an entry from an upper boundary of the current area, and insert a route at an upper boundary of the current area. The above-mentioned triple content addressable memory routing table management method, wherein, if the area with the free space is below the current area, the step 23 specifically includes the following steps: Step 41, the free space is provided The first entry of the region moves to the end of the last entry, and shrinks the space of an entry from the upper boundary of the free space; step 42, the previous region i of the region with free space or The first entry of each region between the next region of the current region moves below the last entry of the same region; Step 43, expanding the space of an entry from the lower boundary of the current region, and A route is inserted at a lower boundary of the current area. The above-mentioned triple content addressable memory routing table management method, wherein when the route is deleted in the routing table, the method includes the following steps: Step 51: Find a location of the route to be deleted in the TCAM, and calculate the to be deleted. Step 52, determining whether the route to be deleted is the last route of the current area; Step 53, if yes, directly deleting the route to be deleted, if not And moving the last item of the current area to the current deletion item position, and deleting the route to be deleted; Step 54: Decrement the prefix count of the current area, and decrement the total prefix count of the routing table. The above-mentioned triple content addressable memory routing table management method, further comprising the step of performing area shrinking, specifically comprising: Step 61: determining whether the size of the current area exceeds a desired value; Step 62, if not, not performing the area Shrinking, if yes, searching for an area with insufficient space above and below the current area; Step 63, if not, stopping the area contraction, and if so, shrinking the current area, expanding the area with insufficient space . The above-mentioned triple content addressable memory routing table management method, wherein when the area with insufficient space is above the current area, the method specifically includes the following steps: Step 71: Add the current area to the area with insufficient space The first entry of each region between the next region moves to the bottom of the last entry of the same region; Step 72, the space of one entry is reduced at the lower boundary of the current region; Step 73, The lower boundary of an area with insufficient space expands the space of an entry. The above-mentioned triple content addressable memory routing table management method, wherein when the area with insufficient space is below the current area, the method specifically includes the following steps: Step 81: Send the next area of the current area to the The last entry of each region between the insufficient space regions moves to the top of the same region i or the first entry; Step 82, the lower boundary of the current region is reduced by an entry space; Step 83; Expanding the space of an entry from the lower boundary of the insufficient space area. The above-mentioned triple content addressable memory routing table management method, further comprising a prefix distribution self-learning process, specifically comprising: Step 91: routing update to count; Step 92, determining whether the count value reaches the sampling period, and if not, ending the self The learning process, if yes, determines whether the current number of routing entries exceeds the threshold; Step 93, if not, ends the self-learning process, and if so, recalculates each prefix region, the formula is as follows: New expected value of the region = old expected value of the region X ( 1 - δ ) + The ideal area size X δ calculated according to the proportion of the current prefix of the region. δ is a coefficient used to adjust the proportion of the ideal size of the region. The above-mentioned triple content addressable memory routing table management method, wherein, when the routing table is initialized, an expected value size of each routing area is allocated according to a set prefix length distribution probability, and the expected value is initialized and allocated to each area. the same. By adopting the method of the invention, the routing table management problem of UDP AM to implement IPv4/IPv6 can be solved efficiently. Its advantages are as follows:
1. 实现简单, 没有复杂的算法和数据结构; 1. Simple implementation, no complicated algorithms and data structures;
2. 更新效率非常高: 添加路由平均移动条目数《0 , 删除路由平均移动条 目数 -1 ; 2. The update efficiency is very high: Add the average number of moving entries in the route "0, delete the average number of moving routes -1;
3. 具有自动调整恢复功能, 可以保持稳定的更新效率; 3. With automatic adjustment and recovery function, it can maintain stable update efficiency;
4. 具有智能自学习功能, 可以根据实际路由分布情况自动调整; 4. With intelligent self-learning function, it can be automatically adjusted according to the actual route distribution;
5. 可以扩展应用到其它 LPM表的管理。 附图说明 图 1是本发明 LPM表在 TCAM中的排列顺序示意图; 图 2是本发明初始化后的前缀区域分布图; 图 3是本发明插入路由的流程图; 图 4是本发明前缀区域扩展例子; 图 5是本发明删除路由的流程图; 图 6是本发明前缀区域收缩例子; 图 7是本发明前缀分布学习流程图。 具体实施方式 下面结合附图详细说明本发明实施例如下。 图 1是本发明 LPM表在 TCAM中的排列顺序示意图。图 2是本发明 初始化后的前缀区 i或分布图。 如图所示: 假设路由长度为 N , 那么系统有 N个前缀区域, 每个前缀区域有一组信 息, 如下: upper— boundary 上边界 lower— boundary 下边界 preflx_num 前缀个数 region— size 区 i或实际大小 expected— size 区 i或期望大小 全局信息 g_region[N] 所有区 i或的信息, 结构如上所述 g__prefix_total 路由表前缀总个数 g— start 路由表在 TCAM中的起始位置 g— capability 路由表, 、容量 根据以前统计信息预设每个区域大小,并初始化区域相关信息以及全局信 息。 每个区域的分配比例存放在 percentage [N]数组中。 全局信息初始化如下: g_prefix_total = 0 g— start =路由表在 TCAM中的起始位置 g— capability =路由表总容量 区域 N信息首先初始 fc如下: g—region[N]. expected— size = g__region[N]. region— size = 5. It is possible to extend the management applied to other LPM tables. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a schematic diagram showing a sequence of arrangement of an LPM table of the present invention in a TCAM; FIG. 2 is a diagram showing a prefix area distribution after initialization of the present invention; FIG. 3 is a flow chart of inserting a route of the present invention; 5 is a flowchart of deleting a route according to the present invention; FIG. 6 is an example of prefix region shrinking according to the present invention; and FIG. 7 is a flowchart of a prefix distribution learning of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments of the present invention will be described in detail below with reference to the accompanying drawings BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a schematic view showing the arrangement of LPM tables of the present invention in TCAM. 2 is a prefix area i or a distribution map after initialization of the present invention. As shown in the figure: Assuming the route length is N, then the system has N prefix areas, each prefix area has a set of information, as follows: Upper_ boundary upper boundary lower_ boundary lower boundary preflx_num prefix number region— size area i or actual size expected—size area i or expected size global information g_region[N] information of all areas i or, as described above g__prefix_total routing table The total number of prefixes g—start The starting position of the routing table in the TCAM g—the capability routing table, the capacity presets the size of each area according to the previous statistical information, and initializes the area related information and the global information. The allocation ratio for each region is stored in the percentage [N] array. The global information is initialized as follows: g_prefix_total = 0 g— start = the starting position of the routing table in the TCAM g — capability = total capacity of the routing table. Area information The initial initial fc is as follows: g—region[N]. expected— size = g__region[ N]. region— size =
g一 capability xpercentage[N] g—region[N]. upper一 boundary = g— start g—region[N]. lower— boundary = g—region[N]. upper— boundary + g_region[N]. region一 size― 1 g一 region [N]. prefix— num = 0 区域 I ( Ν > 1 > 0, I从 N-l→l )信息依次初始化如下: g—region[I]. expected— size = g—region[I] .region— size = G-capability x percentage[N] g—region[N]. upper-boundary = g— start g—region[N]. lower— boundary = g—region[N]. upper— boundary + g_region[N]. region One size-1 G_region [N]. prefix— num = 0 The region I ( Ν > 1 > 0, I from Nl→l ) is initialized as follows: g—region[I]. expected— size = g—region[I]. Region— size =
g— capability xpercentage[I] g—region[I]. upper一 boundary = g_region[I+ 1 ] .lower_boundary+ 1 g—region[I] .lower— boundary = g_region[I]. upper— boundary + g_region[I]. region一 size - 1 g_region[I]. prefix— num = 0 图 3是本发明插入路由的流程图。 图 4是本发明前缀区域扩展例子。如图 所示, 假设插入的路由前缀长度是 I, 具体步骤描述如下: G— capability xpercentage[I] g—region[I]. upper-boundary = g_region[I+ 1 ] .lower_boundary+ 1 g—region[I] .lower— boundary = g_region[I]. upper— boundary + g_region[I] Region one size - 1 g_region[I]. prefix - num = 0 Figure 3 is a flow chart of the insertion route of the present invention. 4 is an example of a prefix area extension of the present invention. As shown in the figure, the assumed route prefix length is I. The specific steps are as follows:
5301 ,判断插入的路由所在的前缀区域 I是否有空闲的条目,判断方法是: g—region[I]. region— size > g— region [I] .prefix一 num。 ^口果有空闲空间, 那么在 g_region[I].upper_boundary+g_region[I].prefix_num处插入路由 ,然后跳到 S311。 5301. Determine whether the prefix area where the inserted route is located I has an idle entry, and the judgment method is: g-region[I]. region_size> g-region [I] .prefix-num. ^ If there is free space in the mouth, insert a route at g_region[I].upper_boundary+g_region[I].prefix_num and jump to S311.
5302 , 前缀区域 I没有空闲空间, 这时可以考虑扩展该区域。 首先判断整 个路由表是否有空闲空间, 判断方法如下: g— capability > g_prefix_total。 如果 整个路由表都没有空闲空间, 那么插入失败, 3兆到 S312。 5302, the prefix area I has no free space, then you can consider expanding the area. First, determine whether the entire routing table has free space. The judgment method is as follows: g_ capability > g_prefix_total. If the entire routing table has no free space, then the insertion fails, 3 megabytes to S312.
5303 , 路由表有空闲空间, 可以进行前缀区域扩展。 依次在区域 I的上下 区域查找有空闲空间的前缀区域 J , 判断条件如下: g—region[J] .region一 size > g—region[J], prefix— num 判断过程是一个迭代过程, 为了使移动的次数最少, 判断方法是先判断 J+l、 J-1 , 然后判断 J+2、 J-2, 直到找到有空闲空间的前缀区域。 5303, the routing table has free space, and the prefix area can be extended. The prefix area J with free space is searched in the upper and lower areas of the area I in turn, and the judgment conditions are as follows: g-region[J] .region_size> g-region[J], prefix-num The judgment process is an iterative process, in order to make The number of moves is the least. The judgment method is to judge J+l, J-1 first, and then judge J+2, J-2 until a prefix area with free space is found.
5304, 如果】< 1, 兆到步骤 S308。 区域扩展例子参见图 4。 5304, if 】< 1, megabyte to step S308. See Figure 4 for an example of regional expansion.
5305 , 空闲区域 J在区域 I的上面。 从区域 J的下边界缩' j、一个条目的空 间: g— region[J] .region一 size— g—region[J] .lower— boundary— 5305, the free area J is above the area I. From the lower boundary of the region J shrinks 'j, the space of an entry: g-region[J] .region a size— G-region[J] .lower— boundary—
5306 , 将区域 J-l到 1+1之间的每个区域 χ (每个区域都是满的)依次进 行如下操作 (上移): g一 region[x], upper— boundary— 5306, each region 区域 between regions J-l to 1+1 (each region is full) is performed as follows (upward shift): g_region[x], upper_ boundary-
Move(g_region[x].lo er_boundary→g_region[x].upper_boundary) , 将区域 最后一个条目移到同一个区域的第一个条目的上面, 移动条件是 g— region[x]. prefix— rmm > 0 g一 region[x] .lower— boundary— Move(g_region[x].lo er_boundary→g_region[x].upper_boundary) , move the last entry of the region to the top of the first entry in the same region. The move condition is g-region[x]. prefix— rmm > 0 g a region[x] .lower— boundary—
5307, 从区 i或 I的上边界扩大一个条目的空间: g_region[I].region_size++ g_region[I]. upper一 boundary— 并在 g—region[I]. upper— boundary处插入路由, '然后 ji兆到 S311。 5307, expand the space of an entry from the upper boundary of the region i or I: g_region[I].region_size++ g_region[I]. upper-boundary—and insert a route at the g-region[I]. upper— boundary, then ji Mega to S311.
5308 , 空闲区: t或 J在区域 I的下面。 5308, free area: t or J is below area I.
Move(g_region[J].upper_boundary→g__region[J].upper_boundary+ Move(g_region[J].upper_boundary→g__region[J].upper_boundary+
g_region[J].prefix_num) , 将区域第一个条目移到区域最后一个条目的后面, 移 动条件是 g_region[x]. prefix一 num > 0 从区域 J的上边界缩 、一个条目的空间: g— region[J]. region— size— g—region[ J]. upper一 boundary ++ G_region[J].prefix_num) , moves the first entry of the region to the end of the last entry in the region. The move condition is g_region[x]. prefix a num > 0 from the upper bound of region J, the space of an entry: g — region[J]. region— size— g—region[ J]. upper-boundary ++
5309, 将区域 J+l到 1-1之间的每个区域 x (每个区域都是满的)依次进 行如下搡作 (下移): g— region[x]. lower— boundary ++ 5309, each region x (each region is full) between the regions J+l to 1-1 is sequentially processed as follows (g): g-region[x]. lower- boundary ++
Move(g一 region[x], upper— boundary→g_region[x], lower— boundary) , 夺区域 第一个条目移到同一个区域的最后一个条目的下面, 移动条件是 g_regi0n[x]. prefix_num > 0。 g_region[x] . upper— boundary++ Move (g a region [x], upper- boundary → g_region [x], lower- boundary), the first entry capture area moves following the last entry in the same region of a moving condition g_ re gi 0 n [ x]. Prefix_num > 0. G_region[x] . upper— boundary++
S310: 从区域 I的下边界扩大一个条目的空间: g_region[I].region_size++ g_region[I].lower_boundai*y++ 并在 g—region[I]. lower— boundary处插入路由。 S310: Expand the space of an entry from the lower boundary of the region I: g_region[I].region_size++ g_region[I].lower_boundai*y++ and insert a route at the g-region[I]. lower-boundary.
5311 , 更新前缀计数信息 g_region[I] .preflx_num++ g_prefix__total++ 5311, update prefix count information g_region[I] .preflx_num++ g_prefix__total++
5312 , 4翁入结束。 图 5是本发明删除路由的流程图。 图 6是本发明前缀区域收缩例子。 如图 所示, 假设删除的路由前缀长度是 I, 具体步骤描述如下: 5312, 4 Weng entered the end. Figure 5 is a flow chart of the present invention for deleting a route. Fig. 6 is an example of the prefix region contraction of the present invention. As shown in the figure, the length of the deleted route prefix is I. The specific steps are as follows:
5501 , 查找路由在 TC AM中的位置 location, 计算路由在前缀区域 I内部 的相^†位置 rela—loca = location-g—region[I].upper—boundary。 5501, find the location of the route in the TC AM location, calculate the location of the route in the prefix area I rela_loca = location-g-region[I].upper-boundary.
5502 , 判断路由是否是区域内部最后一个路由, 判断方法如下: rela—loca = g_region[I] .prefix_num - 1。 如果是则直接在 location处删除该路由, 否则将 区 域 最 后 一 个 条 目 移 到 当 前 删 除 条 目 位 置 Move(g_region[I].upper_boundary+g_region[I] .prefix— num- 1—location)„ 5502. Determine whether the route is the last route in the area. The judgment method is as follows: rela_loca = g_region[I] .prefix_num - 1. If yes, delete the route directly at the location, otherwise move the last entry in the region to the current delete entry location (g_region[I].upper_boundary+g_region[I] .prefix— num- 1—location) „
5503 , 更新前缀计数信息: g_region[I] .prefix— num— g_prefix_total~ 5503, update the prefix count information: g_region[I] .prefix— num— g_prefix_total~
5504 , 判断是否需要进行区域收缩, 这主要是为了防止路由频繁动荡导 致区域分布恶化, 进而降氐平均更新效率。 在更新过程中主动调整' !·灰复前缀区 域分布可以有效的保证删除时最多移动一个条目, 而插入则不用移动条目, 这 样就可以维持 4艮高的更新效率。 判断是否需要进行区域收缩的方法如下: g— region[I]. region— size > g一 region[I]. expected一 size。 :¾口果不需要贝 3兆 !j S513。 5504. Determine whether regional shrinkage is required. This is mainly to prevent the regional distribution from deteriorating due to frequent turbulence of the route, thereby reducing the average update efficiency. Proactively adjusting the '!· gray complex prefix area distribution during the update process can effectively ensure that at most one entry is moved when deleting, and the insertion does not need to move the entry. This can maintain a 4 艮 high update efficiency. The method for judging whether or not the region shrinks is required is as follows: g - region[I]. region_ size > g_region[I]. expected one size. : 3⁄4 mouth fruit does not need shell 3 trillion! j S513.
5505 , 需要进行区域收缩。 依次在区域 I的上下区域查找满足下面奈件的 区域 J: g—region[J] .region一 size < g—region[J] .expected— size 判断过程是一个迭代过程, 为了使移动的次数最少, 判断方法是先判断 J+l、 J-1 , 然后判断 J+2、 J-2, 直到找到空间不足的前綴区域。 5505, need to shrink the area. In the upper and lower areas of the area I, the area J that satisfies the following conditions is searched sequentially: g-region[J].region_size<g-region[J].expected-size The judgment process is an iterative process, in order to minimize the number of movements. The judgment method is to judge J+l, J-1 first, and then judge J+2, J-2 until a prefix area with insufficient space is found.
5506 , 如果 J < I, 兆到步骤 S510。 区域收缩例子参见图 6。 5506, if J < I, mega to step S510. See Figure 6 for examples of area shrinkage.
5507, 空闲区域 J在区域 I的上面。 将区 i或 I到 J- 1之间的每个区域 X依 次进行如下操作 (下移): g—region[x] .lower一 boundary ++ 5507, free area J is above area I. Each area X between the areas i or I to J-1 is performed as follows (downward): g-region[x] .lower a boundary ++
Move(g_region[x].upper_boundary—»g_region[x].upper_boundary Move(g_region[x].upper_boundary—»g_region[x].upper_boundary
+g_region[x].prefix_num) , 将区域第一个条目移到区域最后一个条目的后面, 移动条件是 g_region[x]. prefix_num > 0 g_region[x] .upper— boundary ++ +g_region[x].prefix_num) , moves the first entry in the region to the end of the last entry in the region. The move condition is g_region[x]. prefix_num > 0 g_region[x] .upper— boundary ++
5508 , 从区域 I的下边界缩' j、一个条目的空间: (注意区域 I已经下移过) g一 region[I]. region— size— g_region[I].lo er_boundary~ 5508, shrinking from the lower boundary of the region I, j, the space of an entry: (note that the region I has moved down) g a region[I]. region— size— g_region[I].lo er_boundary~
5509 , 从区 i或 J的下边界扩大一个条目的空间: g_region[J].region_size++ g—region[J]. lower一 boundary ++ 然后 3兆到 S513 5509, expand the space of an entry from the lower boundary of zone i or J: g_region[J].region_size++ g-region[J]. lower one boundary ++ then 3 trillion to S513
S510, 空闲区域 J在区域 I的下面。 将区域 1-1到 J之间的每个区域 X依 次进行如下操作 (上移): g_region[x] .upper—boundar - - S510, the free area J is below the area I. Each of the areas X between the areas 1-1 to J is sequentially operated as follows (upward shift): G_region[x] .upper-boundar - -
Move(g_region[x].upper__boundary+g_region[x].prefix_num→g_region[x].u pper_boundai ), 将区域最后一个条目移到该同一个区域的第一个条目的上面, 移动条件是 g_region[x]. prefix一 num > 0 g—region[x] .lower一 boundary- - Move(g_region[x].upper__boundary+g_region[x].prefix_num→g_region[x].u pper_boundai ), move the last entry of the region to the top of the first entry in the same region, and the move condition is g_region[x ]. prefix-num > 0 g-region[x] .lower-boundary- -
S511 , 从区域 I的下边界缩小一个奈目的空间: g_region[I] .region— size— g—region[I]. lower— boundary- - S511, shrinking a space from the lower boundary of the region I: g_region[I] .region_size_ g-region[I]. lower_ boundary- -
S512: 从区域 J的下边界扩大一个条目的空间: (注意区域 J已经上移过) g_region[J].region__size++ g_region[J] . lower— boundary ++ S513 , 删除结束。 当路由更新非常频繁时, 那么原始设定的区域 expected— size值可能不能 适应当前的前缀分布情况, 这时可以采用一种动态调整的技术, 使得区域 expected—size按一定周期进行更新, 这尤可以保" ^正区 i或 expected— size反映当前 路由表中实际前缀的分布比例, 这其实就是一种智能的路由前缀分布自学习功 f] 因为只有当添加删除路由时才会引起前缀分布的变化,所以只需要在路由 更新时进行学习即可。 最 ^青确的反映当前前缀的分布莫过于每次路由更新时都 进行学习, 但是这样 CPU 性能会消耗 4艮多, 所以不可取, 这时可以设定一个 采样周期 sample, 具体实施方法如下。 图 7是本发明前缀分布学习流程图。 如图所示, 包括以下步骤: S512: Expand the space of an entry from the lower boundary of the region J: (note that the region J has been moved up) g_region[J].region__size++ g_region[J] . lower- boundary ++ S513 , the end of the deletion. When the route update is very frequent, then the original set area expected_size value may not be able to adapt to the current prefix distribution. In this case, a dynamic adjustment technique can be used to make the area expected-size update according to a certain period. It can be guaranteed that "^ positive area i or expected_ size reflects the distribution ratio of the actual prefix in the current routing table. This is actually an intelligent routing prefix distribution self-learning function f] because the prefix distribution is only caused when adding a deleted route. Change, so you only need to learn when the route is updated. The most accurate reflection of the current prefix distribution is to learn every time the route is updated, but this CPU performance will consume more than 4 ,, so it is not desirable, this A sampling period sample can be set, and the specific implementation method is as follows: Figure 7 is a flow chart of the prefix distribution learning of the present invention. As shown in the figure, the following steps are included:
S701 , 每次进行路由更新时都更新计数 counter S701, the count is updated every time the routing update is performed.
S702 , 当 counter MOD sample = 0时就进行前缀分布学习。 S703 , 在学习前首先还需要判断当前状态是否值得学习, 只有当 g_prefix_total > threadshold 时即路由条目超过一定门 P艮后才进行学习, 这样可 以确保学习的准确性, 因为采样样本越大, 计算结果越准确。 每次前缀分布学习方法如下: 对每个前缀区域 I ( 1≤I≤N )的 expected— size 进行重新计算。 S702, the prefix distribution learning is performed when counter MOD sample = 0. S703, firstly, it is necessary to judge whether the current state is worth learning before learning. Only when g_prefix_total > threadshold, the routing entry exceeds a certain threshold P艮, the learning accuracy is ensured, because the sampling sample is larger, the calculation result is obtained. The more accurate. The method of learning each prefix distribution is as follows: Recalculate the expected_size of each prefix area I (1≤I≤N).
5704, 首先, 对 I赋值 1=1。 5704, First, assign 1 to I=1.
5705 , 判断 I是否超过 N, 如果超过, 则结束学习。 5705, judge whether I exceeds N, and if it exceeds, end learning.
5706 , 如果 I没有超过 N, 则按照下面的公式进行计算: g—region[I]. expected— size = ( ( g—region[I]. expected— size÷g_capability ) χ ( 1 — δ ) + ( g_region[I].prefix_num÷g__prefix_total ) χδ ) x g— capability 5706, if I does not exceed N, then calculate according to the following formula: g-region[I]. expected_ size = (( g-region[I]. expected— size÷g_capability ) χ ( 1 — δ ) + ( G_region[I].prefix_num÷g__prefix_total ) χδ ) xg— capability
= g_region[I]. expected— sizex ( 1 — δ ) + = g_region[I]. expected— sizex ( 1 — δ ) +
( g_region[I].prefix_num÷g_prefix_total ) χ g— capability χδ  ( g_region[I].prefix_num÷g_prefix_total ) χ g— capability χδ
( 0 < δ < 0.5 , 建议取 0.1 )0 ( 0 < δ < 0.5 , recommended to take 0.1 ) 0
5707, 计算完成后, 赋值 1=1+1 , 然后返回 S705。 上面公式的含义如下: 区域 I的新期望值 =区域 I的旧期望值 X ( 1 - δ ) +按照区域 I当前前缀所占比例算得的区域 I理想大小 χδ。其中 δ是一个系数, 用于调整区域 I理想大小所占的比重, 由于路由一直在不停的变化, 所以 δ值 不能大, 否则会使路由表管理一直处于一种动荡状态。 上面是智能前缀分布学习功能的基本原理, 详细流程图参见图 7, 只要在 每次路由更新时调用即可实现前缀分布学习功能。 智能前缀分布学习功能是可以启用的选项,如果在实际的应用中路由更新 的不频繁, 那么可以不启用该功能; 如果更新比较频繁, 那么建议启用该功能, 采样周期 sample的值随着更新的频繁度递减,具体值可以根据实际的应用进行 确定。 当然, 本发明还可有其它多种实施例, 在不背离本发明精神及其实质的情 况下 , 熟悉本领域的普通技术人员当可根据本发明 #爻出各种相应的改变和变 形, 但这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。 5707, after the calculation is completed, assign 1 = 1+1, and then return to S705. The meaning of the above formula is as follows: The new expected value of the region I = the old expected value of the region I X ( 1 - δ ) + the ideal size χ δ of the region I calculated according to the proportion of the current prefix of the region I. Where δ is a coefficient used to adjust the proportion of the ideal size of the region I. Since the route has been constantly changing, the δ value cannot be large, otherwise the routing table management will always be in a turbulent state. The above is the basic principle of the intelligent prefix distribution learning function. For detailed flowchart, refer to Figure 7. The prefix distribution learning function can be implemented as long as it is called every time the routing is updated. The intelligent prefix distribution learning function is an option that can be enabled. If the routing update is infrequent in the actual application, the function may not be enabled. If the update is frequent, it is recommended to enable the function. The value of the sampling period sample is updated. The frequency is decremented, and the specific value can be determined according to the actual application. The invention may, of course, be embodied in various other embodiments without departing from the spirit and scope of the invention. The corresponding changes and modifications are intended to fall within the scope of the appended claims.

Claims

权 利 要 求 书 Claim
1. 一种三重内容可寻址存储器路由表管理方法, 将路由表按照路由的前缀 长度划分为多个区域, 其特征在于, 更新所述路由表中的路由时, 当区 域实际空间不足或过大时, 在所述路由表内的各个区域空间之间进行区 域大小的动态调整。 A method for managing a routing table of a triple-content addressable memory, which divides a routing table into a plurality of areas according to a prefix length of a route, wherein when the route in the routing table is updated, when the actual space of the area is insufficient or excessive When large, the dynamic adjustment of the area size is performed between the respective area spaces in the routing table.
2. 根据权利要求 1 所述的三重内容可寻址存储器路由表管理方法, 其特征 在于, 当在所述路由表中插入路由时, 具体包括以下步骤: The method for managing a triple content addressable memory routing table according to claim 1, wherein when the route is inserted in the routing table, the method includes the following steps:
步骤 21 , 判断所要插入的路由所属的当前区域是否有空闲空间; 步骤 22, 若是, 则直接在所述当前区 i或最后的路由后面插入所述 路由, 若否, 则在所述当前区域的上方和下方的其他区域寻址是否存在 有空闲空间的区域;  Step 21: Determine whether there is free space in the current area to which the route to be inserted belongs; Step 22, if yes, insert the route directly after the current area i or the last route, and if not, in the current area The other areas above and below address whether there is an area with free space;
步骤 23 , 若不存在, 则插入失败, 若存在, 则扩大所述当前区域, 缩小有空闲空间的区域, 然后在所述当前区域中插入路由;  Step 23, if not, the insertion fails, if yes, the current area is enlarged, the area with the free space is reduced, and then the route is inserted in the current area;
步骤 24, 递增所述当前区域的路由计数, 并递增所述路由表的总 路由计数。  Step 24: Increment the route count of the current area, and increment the total route count of the routing table.
3. 根据权利要求 2所述的三重内容可寻址存储器路由表管理方法, 其特征 在于, 若所述有空闲空间的区域在所述当前区域的上方, 所述步骤 23 具体包括以下步骤: The method of claim 2, wherein the step 23 includes the following steps:
步骤 31 , 从所述有空闲空间的区域的下边界收缩一个条目的空间; 步骤 32, 将所述有空闲空间的区域的下一个区域到所述当前区域 的上一个区域之间的每个区域的最后一个条目移到同一个区域的第一个 条目的上面;  Step 31: Shrink the space of one entry from the lower boundary of the area with the free space; Step 32, each area between the next area of the area with the free space to the previous area of the current area The last entry is moved to the top of the first entry in the same region;
步骤 33 , 从所述当前区域的上边界扩大一个条目的空间, 并在所 述当前区域的上边界处插入路由。  Step 33: Expand a space of an entry from an upper boundary of the current area, and insert a route at an upper boundary of the current area.
4. 根据权利要求 2所述的三重内容可寻址存储器路由表管理方法, 其特征 在于, 若所述有空闲空间的区域在所述当前区域的下方, 所述步 t 23 具体包 4舌以下步骤: 步骤 41 , 将所述有空闲空间的区域的第一个条目移到最后一个条 目的后面, 并从所述有空闲空间的区域的上边界收缩一个条目的空间; 步驟 42 , 将所述有空闲空间的区域的上一个区域到所述当前区域 的下一个区域之间的每个区域的第一个条目移到同一个区域的最后一个 条目的下面; The method for managing a triple content addressable memory routing table according to claim 2, wherein if the area having the free space is below the current area, the step t23 is specifically below the tongue step: Step 41: Move the first entry of the area with free space to the end of the last entry, and shrink the space of an entry from the upper boundary of the area with the free space; Step 42, the idle The first entry of each region between the previous region of the region of the space to the next region of the current region moves below the last entry of the same region;
步骤 43 , 从所述当前区域的下边界扩大一个条目的空间, 并在所 述当前区域的下边界处插入路由。  Step 43: Expand a space of an entry from a lower boundary of the current area, and insert a route at a lower boundary of the current area.
5. 根据权利要求 1 所述的三重内容可寻址存储器路由表管理方法, 其特征 在于, 当在所述路由表中删除路由时, 具体包括以下步骤: The method for managing a triple content addressable memory routing table according to claim 1, wherein when the route is deleted in the routing table, the method includes the following steps:
步骤 51 , 查找所要删除的路由在 TCAM中的位置, 计算所述要删 除的路由在所属的当前区域内的相对位置;  Step 51: Find a location of the route to be deleted in the TCAM, and calculate a relative location of the route to be deleted in the current area to which it belongs;
步骤 52 , 判断所述要删除的路由是否是所述当前区域的最后一个 路由;  Step 52: Determine whether the route to be deleted is the last route of the current area;
步骤 53 , 若是, 则直接删除所述要删除的路由, 若否, 则将所述 当前区域最后一个条目移到当前删除条目位置, 再删除所述要删除的路 由;  Step 53, if yes, directly deleting the route to be deleted, and if not, moving the last item in the current area to the current deletion item position, and deleting the route to be deleted;
步骤 54, 递减所述当前区域的前缀计数, 并递减所述路由表的总 前缀计数。  Step 54 decrements the prefix count of the current region and decrements the total prefix count of the routing table.
6. 根据权利要求 5所述的三重内容可寻址存储器路由表管理方法, 其特征 在于, 还包 4舌进^ 区域收缩的步骤, 具体包括: The method for managing a triple-content addressable memory routing table according to claim 5, wherein the step of shrinking the region is further included:
步骤 61 , 判断所述当前区域的大小是否超过期望值; 步骤 62 , 若否, 则不进行区域收缩, 若是, 则依次在所述当前区 域的上方和下方查找是否有空间不足的区域;  Step 61: Determine whether the size of the current area exceeds a desired value; Step 62, if not, do not perform area contraction, and if yes, search for an area with insufficient space above and below the current area;
步驟 63 , 若否, 则停止区域收缩, 若是, 则收缩所述当前区域, 扩大所述空间不足的区 i或。  Step 63, if no, stop the area contraction, and if so, shrink the current area to expand the area i or where the space is insufficient.
7. 根据权利要求 6所述的三重内容可寻址存储器路由表管理方法, 其特征 在于, 当所述空间不足的区域在所述当前区域上方时, 具体包括以下步 骤: The method for managing a triple-content addressable memory routing table according to claim 6, wherein when the area with insufficient space is above the current area, the method further includes the following steps:
步骤 71 , 将所述当前区域到所述空间不足的区域的下一个区域之 间的每个区域的第一个条目移到该同一区域的最后一个条目的下面; 步骤 72 , 在所述当前区域的下边界缩 、一个条目的空间; 步骤 73 , 将所述空间不足的区域的下边界扩大一个条目的空间。 Step 71, the current area is to the next area of the space-deficient area The first entry of each region between the two moves to the bottom of the last entry of the same region; Step 72, shrinking the space of one entry at the lower boundary of the current region; Step 73, the region with insufficient space The lower boundary expands the space of an entry.
8. 根据权利要求 6所述的三重内容可寻址存储器路由表管理方法, 其特征 在于, 当所述空间不足的区域在所述当前区域下方时, 具体包括以下步 骤: The method for managing a triple-content addressable memory routing table according to claim 6, wherein when the area with insufficient space is below the current area, the method further includes the following steps:
步骤 81 , 将所述当前区域的下一个区域到所述空间不足的区域之 间的每个区域的最后一个条目移到该同一个区域的第一个奈目的上面; 步骤 82 , ^!寻所述当前区域的下边界缩小一个条目的空间; 步骤 83 , 从所述空间不足的区域的下边界扩大一个条目的空间。  Step 81: Move the last item of each area between the next area of the current area to the area of the insufficient space to the first item of the same area; Step 82, ^! Finding a lower boundary of the current region to reduce the space of one entry; Step 83, expanding an entry space from a lower boundary of the insufficient space.
9. 根据权利要求 1 所述的三重内容可寻址存储器路由表管理方法, 其特征 在于, 还包■ ^前缀分布自学习过程, 具体包括: The method for managing a triple-content addressable memory routing table according to claim 1, further comprising: a prefix distribution self-learning process, specifically comprising:
步骤 91 , 路由更新进 4亍计数;  Step 91, the route is updated into 4 counts;
步骤 92 , 判断计数值是否到达采样周期, 若否, 结束自学习过程, 若是, 判断当前路由条目数是否超过门限值;  Step 92: Determine whether the count value reaches the sampling period, and if not, end the self-learning process, and if yes, determine whether the current number of routing entries exceeds a threshold;
步骤 93 , 若否, 结束自学习过程, 若是, 对每个前缀区域进行重 新计算, 公式如下:  Step 93, if no, end the self-learning process, and if so, recalculate each prefix area, the formula is as follows:
区域的新期望值 =区域的旧期望值 X ( 1 - δ ) +按照区域当前前缀 所占比例算得的区域理想大小 χδ ,  The new expected value of the region = the old expected value of the region X ( 1 - δ ) + the ideal size of the region calculated by the proportion of the current prefix of the region χδ ,
δ是一个系数, 用于调整区域理想大小所占的比重。  δ is a coefficient used to adjust the proportion of the ideal size of the area.
10. 根据权利要求 9所述的三重内容可寻址存储器路由表管理方法, 其特征 在于, 路由表初始化时, 根据设定的前缀长度分布概率分配每个路由区 域的期望值大小, 所述期望值初始化时与分配给每个区域的大小相同。 10. The triple content addressable memory routing table management method according to claim 9, wherein, when the routing table is initialized, an expected value size of each routing area is allocated according to a set prefix length distribution probability, and the expected value is initialized. The time is the same as the size assigned to each area.
PCT/CN2006/003750 2006-03-15 2006-12-30 A method for managing the router table using the ternary content addressable memory WO2007104204A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200610011497.2 2006-03-15
CN2006100114972A CN101039252B (en) 2006-03-15 2006-03-15 Method for managing route table of ternary content addressable memory

Publications (1)

Publication Number Publication Date
WO2007104204A1 true WO2007104204A1 (en) 2007-09-20

Family

ID=38509027

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2006/003750 WO2007104204A1 (en) 2006-03-15 2006-12-30 A method for managing the router table using the ternary content addressable memory

Country Status (2)

Country Link
CN (1) CN101039252B (en)
WO (1) WO2007104204A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113328948A (en) * 2021-06-02 2021-08-31 杭州迪普信息技术有限公司 Resource management method, device, network equipment and computer readable storage medium

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692653B (en) * 2009-09-25 2012-04-04 中兴通讯股份有限公司 Management method and management device for routing table
US20120173840A1 (en) * 2010-12-31 2012-07-05 Patel Sidheshkumar R Sas expander connection routing techniques
CN102164080B (en) * 2011-03-29 2014-03-12 华为技术有限公司 Routing address inquiry method and device
CN102291296B (en) * 2011-08-04 2016-12-21 中兴通讯股份有限公司 The update method of a kind of routing table and system
CN102508786B (en) * 2011-11-02 2014-12-17 盛科网络(苏州)有限公司 Chip design method for optimizing space utilization rate and chip thereof
CN104125155A (en) * 2013-04-26 2014-10-29 上海斐讯数据通信技术有限公司 Forwarding database optimal configuration method for switches
CN104009922B (en) * 2014-05-09 2017-03-15 烽火通信科技股份有限公司 IPV4/IPV6 routing capacity sharing methods based on TCAM
CN105743678A (en) * 2014-12-11 2016-07-06 中兴通讯股份有限公司 Method and apparatus for managing table space of ternary content addressable memory (TCAM)
CN108279853A (en) * 2018-01-19 2018-07-13 盛科网络(苏州)有限公司 IPMC date storage methods based on TCAM
US10482965B1 (en) * 2018-04-30 2019-11-19 Micron Technology, Inc. Memory start voltage management

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6532516B1 (en) * 2001-09-27 2003-03-11 Coriolis Networks, Inc. Technique for updating a content addressable memory
CN1447223A (en) * 2003-04-04 2003-10-08 清华大学 TCAM high speed updating method supporting route compress
CN1561047A (en) * 2004-02-20 2005-01-05 清华大学 Distributed paralled IP route searching method based on TCAM

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6532516B1 (en) * 2001-09-27 2003-03-11 Coriolis Networks, Inc. Technique for updating a content addressable memory
CN1447223A (en) * 2003-04-04 2003-10-08 清华大学 TCAM high speed updating method supporting route compress
CN1561047A (en) * 2004-02-20 2005-01-05 清华大学 Distributed paralled IP route searching method based on TCAM

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
FU K. ET AL.: "An Algorithm for Fast Incremental Updates on Ternary-CAMs", COMPUTER ENGINEERING, vol. 29, no. 9, June 2003 (2003-06-01), pages 19 - 21 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113328948A (en) * 2021-06-02 2021-08-31 杭州迪普信息技术有限公司 Resource management method, device, network equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN101039252B (en) 2012-05-23
CN101039252A (en) 2007-09-19

Similar Documents

Publication Publication Date Title
WO2007104204A1 (en) A method for managing the router table using the ternary content addressable memory
CN108337172B (en) Large-scale OpenFlow flow table accelerated searching method
US9871728B2 (en) Exact match hash lookup databases in network switch devices
US7031320B2 (en) Apparatus and method for performing high-speed IP route lookup and managing routing/forwarding tables
US8295286B2 (en) Apparatus and method using hashing for efficiently implementing an IP lookup solution in hardware
KR101511945B1 (en) Method and system for facilitating forwarding a packet in a content-centric network
JP4556761B2 (en) Packet transfer device
KR100612256B1 (en) Apparatus and Method for Managing Ternary Content Addressable Memory
US7424468B2 (en) Internet protocol address look-up device
US20170366502A1 (en) IP Route Caching with Two Search Stages on Prefix Length
JP2004023450A (en) Router device
CN111131029B (en) High-energy-efficiency OpenFlow flow table searching method supporting rule dependence
JP3570323B2 (en) How to store prefixes for addresses
US7277399B1 (en) Hardware-based route cache using prefix length
TW200406107A (en) Determining routing information for an information packet in accordance with a destination address and a device address
Le et al. The performance of caching strategies in content centric networking
EP1533956A2 (en) Dynamic forwarding of data packets using binary search
JP4646823B2 (en) Router device and route determination method in router device
RU2233473C2 (en) Device and method for performing high-speed search for routes of internet protocol and controlling routing/transfer tables
CN113810298B (en) OpenFlow virtual flow table elastic acceleration searching method supporting network flow jitter
WO2016184069A1 (en) Route lookup method and device
KR100493099B1 (en) Route lookup and routing/forwarding table management for high-speed internet protocol router
CN114640641B (en) Flow-aware OpenFlow flow table elastic energy-saving searching method
KR100406570B1 (en) Routing apparatus using internet traffic flow characteristics and the method thereof
KR100459542B1 (en) Internet protocol address look-up device

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

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

Country of ref document: EP

Kind code of ref document: A1