CN102271087A - Routing search method and device - Google Patents

Routing search method and device Download PDF

Info

Publication number
CN102271087A
CN102271087A CN2011102119276A CN201110211927A CN102271087A CN 102271087 A CN102271087 A CN 102271087A CN 2011102119276 A CN2011102119276 A CN 2011102119276A CN 201110211927 A CN201110211927 A CN 201110211927A CN 102271087 A CN102271087 A CN 102271087A
Authority
CN
China
Prior art keywords
address
table items
route table
items information
prefix
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.)
Granted
Application number
CN2011102119276A
Other languages
Chinese (zh)
Other versions
CN102271087B (en
Inventor
李彧
程晨
张炜
闫昭博
全成斌
赵有健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201110211927.6A priority Critical patent/CN102271087B/en
Publication of CN102271087A publication Critical patent/CN102271087A/en
Application granted granted Critical
Publication of CN102271087B publication Critical patent/CN102271087B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a routing search method and device. Routing table entry information is stored in an external memory or a routing addressing chip on the basis of a counting bloom filter data structure, and the routing table entry information corresponding to a target IP (Internet Protocol) address is searched from the stored routing table information. Compared with the tree structure-based stream processing in the prior art, the invention obviously reduces the memory amount requirement and is easy for maintaining the stored routing table entry. By adopting the routing search scheme provided by the invention, the use of the routing addressing chip is reduced, and larger power consumption and heating capability can not be generated.

Description

A kind of method for searching route and device
Technical field
The present invention relates to data communication technology field, relate in particular to a kind of method for searching route and device.
Background technology
Along with the fast development of Internet, the interface rate that is used for the interconnected core router of backbone network reaches 100Gbps, and this rate requirement core router route querying speed under the situation of supporting big capacity routing table reaches per second millions of times.
Every route table items information in the routing table comprises prefix and next hop information, searching purpose IP (Internet Protocol, Internet protocol) need obtain longest matching prefix during the address, because the needs of high-speed searching, the software lookup method is inapplicable, Recent study personnel have proposed the multiple hardwares lookup method and searched speed with raising, and are wherein popular with stream treatment and TCAM (ternary content addressable memory, three-state content addressing memory).
Stream treatment can access higher throughput usually based on tree structure.But because the particularity of tree structure makes every grade of flowing water be difficult to reach the storage balance, and each tree node all will safeguard child's node information, causes storage demand very big.Even utilize some optimization methods can reach the storage balance, also cause flowing water progression too much easily, be difficult to safeguard.
TCAM is the technology comparatively widely of using in the present route querying, and search procedure is simple, but will satisfy the rate requirement of searching of 100Gbps, and then needs multi-disc TCAM scheduling to search, and power consumption and caloric value will become serious problems.
Summary of the invention
The technical problem to be solved in the present invention is, a kind of method for searching route and device are provided, and realizes route querying based on bloom filter algorithm, overcomes by hardware mode in the prior art and realizes power consumption and the big defective of caloric value that route querying causes.
The technical solution used in the present invention is that described method for searching route comprises:
Based on counting bloom filter data structure storage route table items information in memory or the routing addressing chip externally, from the route table items information of storage, search the route table items information of purpose IP address correspondence.
Further, described based on counting bloom filter data structure storage route table items information, specifically comprise:
Deposit all the route table items information in the routing table in external memory storage based on counting bloom filter data structure, deposit in the routing addressing chip depositing the route table items information of overflowing in the external memory storage process in.
Further, describedly from the route table items information of storage, search the route table items information of purpose IP address correspondence, specifically comprise based on counting bloom filter data structure:
Externally search the route table items information of purpose IP address correspondence in the memory based on counting bloom filter data structure, in the routing addressing chip, search the route table items information of purpose IP address correspondence simultaneously;
If only externally find route table items information in memory or the routing addressing chip, then with its route table items information as purpose IP address correspondence;
If externally all find route table items information in memory and the routing addressing chip, will wherein have the route table items information of longer prefix person as purpose IP address correspondence.
Further, describedly externally search the route table items information of purpose IP address correspondence in the memory, specifically comprise based on counting bloom filter data structure:
Based on counting bloom filter data structure is purpose IP matching addresses target prefix, determines external memory address according to the bit of target prefix mid-1;
By the external memory address access external memory, obtain the longest-prefix of purpose IP address correspondence, the route table items information at described longest-prefix place is the route table items information of the purpose IP address correspondence that finally finds.
Further, described is purpose IP matching addresses target prefix based on counting bloom filter data structure, determines external memory address according to the bit of target prefix mid-1, specifically comprises:
If counting bloom filter data structure is corresponding plural memory space respectively, in each memory space, purpose IP address PARALLEL MATCHING is obtained corresponding result set and address set;
Result set that each memory space is corresponding respectively and the target prefix that obtains afterwards with purpose IP matching addresses;
Concentrate the content of relevant position to determine external memory address according to the bit corresponding address of target prefix mid-1.
Based on said method, the present invention also provides a kind of device for searching route, comprising:
The storage operation unit is used for based on counting bloom filter data structure memory or routing addressing chip storage route table items information externally;
The search operation unit is used for searching the route table items information of purpose IP address correspondence based on counting bloom filter data structure from the route table items information of storage.
Further, described storage operation unit specifically comprises:
The first storage operation module is used for depositing all route table items information of routing table in external memory storage based on counting bloom filter data structure, calls the second storage operation submodule when overflowing;
The second storage operation module is used for depositing in the routing addressing chip depositing the route table items information that the external memory storage process overflows in.
Further, described search operation unit specifically comprises:
The first search operation module, be used for based on counting bloom filter data structure externally memory search the route table items information of purpose IP address correspondence;
The second search operation module is used for starting simultaneously with the first search operation module, finds the route table items information of purpose IP address correspondence in the routing addressing chip;
Comparison module is used for will wherein having the route table items information of longer prefix person as purpose IP address correspondence when the first search operation module and the second search operation module all find route table items information.
Further, the described first search operation module specifically comprises:
Submodule is determined in the address, and being used for based on counting bloom filter data structure is purpose IP matching addresses target prefix, determines external memory address according to the bit of target prefix mid-1;
Prefix is determined submodule, is used for by the external memory address access external memory, obtains the longest-prefix of purpose IP address correspondence, and the route table items information at described longest-prefix place is the route table items information of the purpose IP address correspondence that finally finds.
Further, submodule is determined in described address, specifically is used for:
In two above memory spaces of counting bloom filter data structure correspondence, purpose IP address PARALLEL MATCHING is obtained corresponding result set and address set, result set that each memory space is corresponding respectively and the target prefix that obtains afterwards with purpose IP matching addresses are determined external memory address according to the content of the concentrated relevant position of bit corresponding address of target prefix mid-1.
Adopt technique scheme, the present invention has following advantage at least:
Method for searching route of the present invention and device, realize route querying based on counting bloom filter data structure, compare with the stream treatment based on tree structure in the prior art, memory space is required obviously to reduce, also be easy to the route table items of storage is safeguarded.Adopt Route Lookup Scheme of the present invention to reduce the use of routing addressing chip, can not produce big power consumption and caloric value.
Description of drawings
Fig. 1 is the method for searching route flow chart of first embodiment of the invention;
Fig. 2 is the Route Lookup Scheme schematic diagram of first embodiment of the invention;
Fig. 3 is for externally searching the process schematic diagram of the route table items information of purpose IP address correspondence among the first embodiment of the invention step S103 in the memory based on counting bloom filter data structure;
Fig. 4 is the particular flow sheet of first embodiment of the invention steps A 1;
Fig. 5 is the device for searching route structural representation of second embodiment of the invention;
Fig. 6 is the device for searching route structural representation of third embodiment of the invention;
Fig. 7 (a) is first and second memory space structural representation in the fourth embodiment of the invention;
Fig. 7 (b) is the 3rd a memory space structural representation in the fourth embodiment of the invention;
Fig. 8 is the corresponding relation schematic diagram of the offset address of the filter index index of the 3rd memory space in the fourth embodiment of the invention and the outer dram (dynamic random access memory, dynamic random access memory) of sheet.
Embodiment
Reach technological means and the effect that predetermined purpose is taked for further setting forth the present invention, below in conjunction with accompanying drawing and preferred embodiment, the present invention is described in detail as after.
First embodiment of the invention, a kind of method for searching route as shown in Figure 1, comprises following concrete steps:
Step S101, deposit all the route table items information in the routing table in external memory storage based on counting bloom filter data structure, deposit in the routing addressing chip depositing the route table items information of overflowing in the external memory storage process in, the routing addressing chip can be TCAM.External memory storage can be the outer dram of sheet.Step S101 specifically comprises:
If the corresponding bit wide of counting bloom filter data structure is that M bit, address size are first memory space of N bit, M is desirable more than or equal to 1 integer, and M is big more, the probability that false positive false positive takes place in follow-up searching is low more, but be subjected to the restriction of the memory space that hardware provides, the M maximum can get 4 usually.
The numerical value that each cell block of first memory space can be inserted is 0,1 ..., 2 MEach cell block address of-1, first memory space is represented with filter index index; As known in the art, use P1 hash function with counting bloom filter data structure corresponding memory space binding, the prefix in the route list item information is carried out result value that computing obtains can be above the address realm of this memory space.
Prefix in each bar route table items information in the routing table is carried out P1 hash function computing, each Hash calculation all can obtain the filter index index of a cell block, the number of times that each filter index index is occurred is counted and is added up and count value is inserted in the cell block of this filter index index correspondence, and the initial value of count value is 0.
If current route table items information has been 2 before the count value of the filter index index that certain hash function computing obtains is adding up M-1, then expression is overflowed, and no longer the accumulated counts value is inserted this route table items information in the routing addressing chip;
If the count value of the filter index index that the prefix in the current route table items information is obtained through P1 hash function computing is all above 2 M-1, the filter index index of selection count value minimum, externally offset address is (2 in the memory M-1) * the index place inserts this route table items information.
Well known in the art, the address size N of memory space, the number P1 of hash function, take place when externally carrying out route querying in the memory false positive probability F between conversion relation as follows:
N=ceil ((n log (F))/log (1.0/ (pow (2.0, log (2.0))))); P1=round (Nlog (2.0)/n); The route table items number that the n representative is inserted into.
Step S102 searches the route table items information of purpose IP address correspondence in internal storage, if find, then flow process finishes, if do not find, and execution in step S103 then.The Route Lookup Scheme schematic diagram of present embodiment as shown in Figure 2.Internal storage can be sram in the sheet (static random access memory, static random access memory), perhaps edram (enhanced dynamic random access memory strengthens dynamic random access memory) in the sheet.
Step S103, externally search the route table items information of purpose IP address correspondence in the memory based on counting bloom filter data structure, in the routing addressing chip, search simultaneously the route table items information of purpose IP address correspondence, be divided into following dual mode according to the situation of searching and handle:
1) if only externally finds route table items information in memory or the routing addressing chip, then with its route table items information as purpose IP address correspondence;
2) as if externally all finding route table items information in memory and the routing addressing chip, the route table items information of longer prefix person as purpose IP address correspondence will be had wherein.
Externally search the process of the route table items information of purpose IP address correspondence among the step S103 based on counting bloom filter data structure in the memory, as shown in Figure 3, specifically comprise:
A1 is a purpose IP matching addresses target prefix based on counting bloom filter data structure.As shown in Figure 4, steps A 1 specifically comprises:
If the length of purpose IP address is L, the scope of all prefixes of purpose IP address is to be L from length 1 to length; If counting bloom filter data structure is corresponding plural memory space respectively, each cell block address of described memory space is represented with filter index index, different memory spaces is bound different hash functions respectively, for the ease of realizing, the number of the hash function of different memory space bindings is identical in the present embodiment, is P2; The bit wide of each memory space can be the same or different, and address size can be the same or different.In this step, M is desirable more than or equal to 1 integer, and M is big more, and the probability that false positive false positive takes place in follow-up searching is low more, but is subjected to the restriction of the memory space that hardware provides, and the M maximum can get 4 usually.
A11 inserts purpose IP address relevant information respectively in each memory space.
In the specific memory space, all prefixes to purpose IP address are carried out P2 hash function computing successively, each Hash calculation all can obtain the filter index index of a cell block, and the number of times that each filter index index is occurred is counted and added up and count value is inserted in the cell block of this filter index index correspondence:
If purpose IP address current length prefix does not reach the count value upper limit before the count value of the filter index index that certain hash function computing obtains is adding up, then count value adds 1;
If purpose IP address current length prefix reached the count value upper limit before the count value of the filter index index that certain hash function computing obtains is adding up,, accumulated counts value no longer then.Cell block in the memory space of different bit wides has the different count value upper limits, establishes the bit wide that M1 is a memory space, is limited to 2 on the count value of this memory space so M1-1.
A12 determines the result set and the address set of purpose IP address correspondence according to the count value in each memory space.
In each memory space, purpose IP address PARALLEL MATCHING is obtained corresponding result set and address set.Each result set and address set all can be regarded the array that length is L as, the content of filling in the corresponding address collection relevant position, position of result set mid-1.
The detailed process of mating in each memory space is: in a specific memory space, if the prefix of the some length of purpose IP address carried out the count value whole non-0 of filling in the cell block of P2 the filter index index correspondence that P2 hash function computing obtain, the match is successful in described memory space for then described prefix, to be that the length correspondence position of prefix described in the result set of L puts 1 in length, and in the count value of filling in the cell block with P2 filter index index correspondence the filter index index of reckling correspondence to insert the position of length correspondence of prefix described in the address set (special, if the bit wide M=1 of this memory space is that 1 filter index index selects a position of inserting the length correspondence of prefix described in the address set arbitrarily in count value then);
If the count value that the prefix of each length of purpose IP address is carried out filling in the cell block of P2 the filter index index correspondence that P2 hash function computing obtain has at least one to be 0, it fails to match in described memory space for then described prefix, to be that the length correspondence position of prefix described in the result set of L puts 0 in length, be that the length correspondence position of prefix described in the address set of L composes 0 in length simultaneously.
A13, result set that each memory space is corresponding respectively and the target prefix that obtains afterwards with purpose IP matching addresses.
A2 concentrates the filter index index of relevant position to determine that external memory address is (2 according to the bit corresponding address of target prefix mid-1 M-1) * and index, wherein, M is the bit wide of first memory space of counting bloom filter data structure correspondence.
A3, by the external memory address access external memory of determining in the steps A 2, the longest-prefix that obtains purpose IP address correspondence is (when external memory address has two when above, through relatively obtaining the longest-prefix of purpose IP address correspondence), the route table items information at described longest-prefix place is the route table items information of the purpose IP address correspondence that finally finds.
Step S104 inserts the route table items information of the purpose IP address correspondence that finds in the internal storage.
Second embodiment of the invention, a kind of device for searching route as shown in Figure 5, comprises following part:
1) the storage operation unit 10, are used for based on counting bloom filter data structure memory or routing addressing chip storage route table items information externally.Storage operation unit 10 specifically comprises:
The first storage operation module 11 is used for depositing all route table items information of routing table in external memory storage based on counting bloom filter data structure, calls the second storage operation submodule when overflowing.Device for searching route of the present invention can be at FPGA (Field-Programmable Gate Array, field programmable gate array) or ASIC (Application Specific Integrated Circuits, realize on the chip that application-specific integrated circuit (ASIC)) external memory storage can be the outer dram of sheet.
Concrete, if the corresponding bit wide of counting bloom filter data structure is that M bit, address size are first memory space of N bit, M is desirable more than or equal to 1 integer, and M is big more, the probability that false positive false positive takes place in follow-up searching is low more, but be subjected to the restriction of the memory space that hardware provides, the M maximum can get 4 usually.The numerical value that each cell block of first memory space can be inserted is 0,1 ..., 2 MEach cell block address of-1, first memory space is represented with filter index index.
Prefix in each bar route table items information in 11 pairs of routing tables of the first storage operation module is carried out P1 hash function computing, each Hash calculation all can obtain the filter index index of a cell block, the number of times that each filter index index is occurred is counted and is added up and count value is inserted in the cell block of this filter index index correspondence, and the initial value of count value is 0.
If current route table items information has been 2 before the count value of the filter index index that certain hash function computing obtains is adding up M-1, then expression is overflowed, and no longer the accumulated counts value is called the second storage operation module 12;
If the count value of the filter index index that the prefix in the current route table items information is obtained through P1 hash function computing is all above 2 M-1, the filter index index of selection count value minimum, externally offset address is (2 in the memory M-1) * the index place inserts this route table items information.
The second storage operation module 12 is used for depositing in the routing addressing chip depositing the route table items information that the external memory storage process overflows in.The routing addressing chip can be TCAM.
2) the search operation unit 20, are used for searching from the route table items information of storage based on counting bloom filter data structure the route table items information of purpose IP address correspondence.Search operation unit 20 specifically comprises:
The first search operation module 21 is used for searching at internal storage the route table items information of purpose IP address correspondence, if find, then EO if do not find, then calls the second search operation submodule.Internal storage can be edram in sram in the sheet or the sheet.
The second search operation module 22, be used for based on counting bloom filter data structure externally memory search the route table items information of purpose IP address correspondence: if find, then the route table items information of the purpose IP address correspondence that finds is inserted in the internal storage; If do not find, then call the 3rd and search the operation submodule.The second search operation module 22 specifically comprises:
Submodule 221 is determined in the address, and being used for based on counting bloom filter data structure is purpose IP matching addresses target prefix, determines external memory address according to the bit of target prefix mid-1.
Concrete, the length of establishing purpose IP address is L, the scope of all prefixes of purpose IP address is to be L from length 1 to length; If counting bloom filter data structure is corresponding plural memory space respectively, each cell block address of described memory space is represented with filter index index, different memory spaces is bound different hash functions respectively, for the ease of realizing, the number of the hash function of different memory space bindings is identical in the present embodiment, is P2.
In the specific memory space, all prefixes to purpose IP address are carried out P2 hash function computing successively, each Hash calculation all can obtain the filter index index of a cell block, and the number of times that each filter index index is occurred is counted and added up and count value is inserted in the cell block of this filter index index correspondence:
If current route table items information does not reach the count value upper limit before the count value of the filter index index that certain hash function computing obtains is adding up, then count value adds 1;
If current route table items information reached the count value upper limit before the count value of the filter index index that certain hash function computing obtains is adding up, accumulated counts value no longer then; Cell block in the memory space of different bit wides has the different count value upper limits, establishes the bit wide that M1 is a memory space, is limited to 2 on the count value of this memory space so M1-1.In each memory space, purpose IP address PARALLEL MATCHING is obtained corresponding result set and address set;
Result set that each memory space is corresponding respectively and the target prefix that obtains afterwards with purpose IP matching addresses.
Concentrate the filter index index of relevant position to determine that external memory address is (2 according to the bit corresponding address of target prefix mid-1 M-1) * and index, wherein, M is the bit wide of first memory space of counting bloom filter data structure correspondence.
Prefix is determined submodule 222, be used for by the external memory address access external memory, the longest-prefix that obtains purpose IP address correspondence is (when external memory address has two when above, through relatively obtaining the longest-prefix of purpose IP address correspondence), the route table items information at described longest-prefix place is the route table items information of the purpose IP address correspondence that finally finds.
The 3rd searches operational module 23, is used for starting simultaneously with the second search operation module 22, searches in the routing addressing chip and the route table items information of the purpose IP address correspondence that finds is inserted in the internal storage.
Comparison module 24, be used for when the second search operation module 22 and the 3rd is searched operational module 23 and all found route table items information, the route table items information of longer prefix person as purpose IP address correspondence will wherein be had, and insert in the internal storage, if with above-mentioned two to search the result that module fills in different, then the result with comparison module 24 is as the criterion.
Need to prove, only have 1 among the present invention) the second search operation module or the 3rd search in the operational module both one of find the route table items information of purpose IP address correspondence; 2) the second search operation module and the 3rd is searched the route table items information that operational module all finds purpose IP address correspondence, both of these case.
Route Lookup Scheme provided by the invention, compare with existing lookup method, following advantage is arranged: 1) because based on counting bloom filter data structure, do not increase with route table items after the data structure initialization, storage consumption is very little and be easy to manage; 2) process of determining the offset address of dram outside the sheet in sheet only need consume the access time that is equivalent to once sram in the sheet, has improved route querying speed greatly.
Third embodiment of the invention, a kind of device for searching route, the present embodiment and second embodiment are roughly the same, difference is that the concrete composition of search operation unit 20 and the function of being finished thereof wherein do not relate to searching at internal storage, concrete, as shown in Figure 6, search operation unit 20 specifically comprises:
The first search operation module 41, be used for based on counting bloom filter data structure externally memory search the route table items information of purpose IP address correspondence.
The second search operation module 42 is used for starting simultaneously with the second search operation module 22, finds purpose IP address in the routing addressing chip.
Comparison module 24, be used for when the second search operation module 22 and the 3rd is searched operational module 23 and all found route table items information, the route table items information of longer prefix person as purpose IP address correspondence will wherein be had, and insert in the internal storage, if with above-mentioned two to search the result that module fills in different, then the result with comparison module 24 is as the criterion.
Because the access speed of internal storage is fast, but capacity is less, the next hop information of the purpose IP address correspondence that will find among second embodiment is put into internal storage, when follow-up searching, at first visit internal storage and can further improve the efficient of searching, so the search efficiency of present embodiment is lower than the search efficiency among second embodiment.
Fourth embodiment of the invention is an example with three specific memory spaces of adopting counting bloom filter data structure correspondence, introduces the process of carrying out the route storage among the dram and searching outside sheet:
First and second memory space bit wide is 1, and address size is 10, and its structure is shown in Fig. 7 (a), and each cell block in these two memory spaces (square frame among the figure is a cell block) is 1 bit, and initial value is 0.
The 3rd memory space bit wide is that bit wide is 2, address size is 10, its structure is shown in Fig. 7 (b), each cell block in the 3rd memory space (two square frames are a cell block about among the figure) is 2 bit, initial value is 00, the denotable binary counting value of each cell block is 00,01,10,11, respectively corresponding decimal system count value 0,1,2,3.
For guaranteeing that entire system false positive is 10 -4, above-mentioned three memory spaces need 12 hash functions altogether, corresponding 4 hash functions of each memory space, 32 prefix lengths, and the hash function of certain memory space correspondence can be chosen wantonly, with other two different getting final product of memory space.
One, insert route table items and form the forwarding structure:
1) deposits all the route table items information in the routing table in sheet outer dram based on counting bloom filter data structure, deposit among the TCAM depositing the route table items information of overflowing in the outer dram process of sheet in.
For the 3rd memory space, the prefix in each the bar route table items information in the routing table is carried out 4 hash function computings, each bar route table items information comprises prefix and next hop information.
After each Hash hits the filter index index of the 3rd memory space, the count value of this filter index index is added 1, and insert in the corresponding cell block.Because the count initialized value in each cell block is 0, if the filter index index of this cell block correspondence does not hit, then count value is constant.
The count value of current certain filter index index was less than 3 o'clock, if certain Hash hits this filter index index, then count value adds 1, since each cell block of the 3rd memory space at most can only mark 3 non-0 count value, like this, the address size of outside dram be the 3rd memory space filter index index total length 3 (promptly by 2 2-1 calculates) doubly, therefore, with this filter index index * 3 of the hitting offset address as the outer dram of sheet, the index of dram * 3 route table items information of the current Hash operation of insertion to the address realm of index * 3+2 gets final product sheet outside.The corresponding relation of the offset address of the outer dram of the filter index index of the 3rd memory space and sheet as shown in Figure 8.
The count value of current certain filter index index was less than 3 o'clock, represent that this cell block in the 3rd memory space is full, if certain Hash hits this filter index index, then overflow, accumulated counts value no longer, and this route table items information (comprising prefix and next hop information) inserted TCAM.According to experiment statistics, this part spillover route list item accounts for 0.1% of whole routing table list item.
The address redundancy of the outer dram of sheet can reduce the insertion bar number that overflow probability promptly reduces TCAM, simultaneously in order to reduce the flowing water interruption that the 3rd memory space generation false positive false positive causes, can be with dram particle redundancy, i.e. dram outside the sheet of additional two storage identical contents outside sheet, information when searching two offset addresss of a prefix correspondence simultaneously can effectively reduce outage probability.
2) based on counting bloom filter data structure with the prefix of all length in the purpose IP address all through 4 hash function computings, insert first and second memory space according to the hash function operation result.
The count initialized value of first and second each cell block of memory space is 0, with the prefix of purpose IP address all length respectively through 4 hash function computings to different filter index index (4 Hash can guarantee that the probability that false positive takes place memory space is 0.05):
If purpose IP address current length prefix is 0 before the count value of the filter index index that certain hash function computing obtains is adding up, then count value adds 1;
If purpose IP address current length prefix before the count value of the filter index index that certain hash function computing obtains is adding up for non-0, accumulated counts value no longer then.
Two, find the next hop information of given purpose IP address:
1) the target prefix of coupling purpose IP address.
Parallel searching in first and second memory space.In each specific memory space, each prefix of this purpose IP address (is 1 to be 32 to length from length) is mated, finish the result set that the back produces a 32bits.For any length prefix wherein, if calculate through 4 hash functions 4 filter index index all non-0 of correspondence as a result, the match is successful in this memory space then to prove this prefix, this prefix is put 1 in the result set corresponding address and (result set can be considered as length and be 32, the subscript array since 0, if being the prefix of k, length hits, the k-1 position 1 of result set then), and with 4 as a result among the filter index index of correspondence in the count value reckling insert this prefix corresponding position in address set;
As long as if 4 have one to be 0 among the filter index index of correspondence as a result, then this prefix is not hit, this prefix is at result set correspondence position 0.
2) with the result set of two memory space correspondences with obtain the final result collection afterwards, i.e. target prefix.
3) in dram, search longest-prefix and next hop information according to the target prefix.
According to the bit corresponding address of target prefix mid-1 concentrate the filter index index of relevant position determine the outer dram address of sheet be 3 * index (the 3rd, by 2 2-1 calculates).
By the outer dram of address 3 * index visit sheet, because the route table items that existence is overflowed in the first step is not inserted into dram outside the sheet but has inserted among the TCAM, simultaneously also TCAM being carried out in this purpose IP address searches, be that lookup result may appear among TCAM or the outer dram of sheet, but owing to only inserted 0.1% of total list item among the TCAM, therefore, less for performance impact.Through relatively obtaining the longest-prefix of purpose IP address correspondence, the route table items information at this longest-prefix place is the route table items information of the purpose IP address correspondence that finally finds.
In addition, if adopt parallel the searching of the outer dram of two sheets, the probability of false positive all to occur be 10 for the longest and vice-minister's prefix in the target prefix -4* 10 -4=10 -8, promptly the flowing water interrupt probability is 10 -8
Fifth embodiment of the invention, on the basis of above-mentioned four embodiment, introduce the example that a route table items inserts and searches, this example adopts the memory space of four counting bloom filter data structures, and different memory spaces is bound different hash functions respectively.
The route table items form is: (prefix, next hop information are port numbers).
Suppose to exist route table items: (10.10.*.*/16,5), (10.*.*.*/8,2), wherein, prefix 10.10.*.* replaces with pre1, and prefix 10.*.*.* replaces with pre2:
The filter index index that pre1 inserts first memory space is [2 (1), 4 (3), 6 (2), 7 (2)], numeral count value in last group round bracket then according to least count value principle, should be selected address 2, then the offset address of the outer dram of sheet is 2 * 3=6, do not overflow that (count value of address 2 is 1, shows that the outer dram of sheet has only inserted 1, can insert 3 altogether, therefore do not overflow), then to be stored in the offset address of the outer dram of sheet be 6 places to prefix.
The filter index index that pre2 inserts first memory space is [3 (2), 4 (3), 2 (2), 7 (1)], the numeral count value in last group round bracket is then according to least count value principle, should select address 7, then the offset address of the outer dram of sheet is 7 * 3=21, does not overflow, and then to be stored in the offset address of the outer dram of sheet be 21 places to prefix.
Suppose for purpose IP address to be matched: IP1 (10.10.10.10) IP2 (11.10.10.10):
Three result sets that 32 prefixes of IP1 obtain after the PARALLEL MATCHING in second~the 4th memory space, with three result sets and the target prefix that obtains a 32bit afterwards, suppose to have the outer dram of two sheets, then get higher hitting in the target prefix and put 1--the 16th and the 8th count value of corresponding positions in address set multiply by 3 offset addresss 6 and 21 that obtain dram outside the sheet, visit the outer dram of two sheets, obtain two prefixes and next hop information, after relatively, pre1 is real longest-prefix, and the packet that then will carry this purpose IP address is forwarded to port No. 5.
Suppose to have occurred false positive, IP2 has hit pre2, and then the 8th of the target prefix of IP2 correspondence hit and put 1, finds to get the prefix and the IP2 that obtain behind the outer dram of offset address 21 visit sheets and is not inconsistent.If do not find among the TCAM yet, then reduce the target prefix and hit and put 1 bit position, promptly get and be lower than the 8th hit and put 1 and calculate offset address, continue outside sheet to search among dram and the TCAM, and the like, finally also must get prefix than the elder as route searching result.
By the explanation of embodiment, should be to reach technological means and the effect that predetermined purpose takes to be able to more deeply and concrete understanding to the present invention, yet appended diagram only provide with reference to the usefulness of explanation, be not to be used for the present invention is limited.

Claims (10)

1. a method for searching route is characterized in that, comprising:
Based on counting bloom filter data structure storage route table items information, from the route table items information of storage, search the route table items information of purpose IP address correspondence.
2. method for searching route according to claim 1 is characterized in that, and is described based on counting bloom filter data structure storage route table items information, specifically comprises:
Deposit all the route table items information in the routing table in external memory storage based on counting bloom filter data structure, deposit in the routing addressing chip depositing the route table items information of overflowing in the external memory storage process in.
3. method for searching route according to claim 2 is characterized in that, describedly searches the route table items information of purpose IP address correspondence based on counting bloom filter data structure from the route table items information of storage, specifically comprises:
Externally search the route table items information of purpose IP address correspondence in the memory based on counting bloom filter data structure, in the routing addressing chip, search the route table items information of purpose IP address correspondence simultaneously;
If only externally find route table items information in memory or the routing addressing chip, then with its route table items information as purpose IP address correspondence;
If externally all find route table items information in memory and the routing addressing chip, will wherein have the route table items information of longer prefix person as purpose IP address correspondence.
4. method for searching route according to claim 3 is characterized in that, describedly externally searches the route table items information of purpose IP address correspondence in the memory based on counting bloom filter data structure, specifically comprises:
Based on counting bloom filter data structure is purpose IP matching addresses target prefix, determines external memory address according to the bit of target prefix mid-1;
By the external memory address access external memory, obtain the longest-prefix of purpose IP address correspondence, the route table items information at described longest-prefix place is the route table items information of the purpose IP address correspondence that finally finds.
5. method for searching route according to claim 4, it is characterized in that, described is purpose IP matching addresses target prefix based on counting bloom filter data structure, determines external memory address according to the bit of target prefix mid-1, specifically comprises:
If counting bloom filter data structure is corresponding plural memory space respectively, in each memory space, purpose IP address PARALLEL MATCHING is obtained corresponding result set and address set;
Result set that each memory space is corresponding respectively and the target prefix that obtains afterwards with purpose IP matching addresses;
Concentrate the content of relevant position to determine external memory address according to the bit corresponding address of target prefix mid-1.
6. a device for searching route is characterized in that, comprising:
The storage operation unit is used for based on counting bloom filter data structure storage route table items information;
The search operation unit is used for searching the route table items information of purpose IP address correspondence based on counting bloom filter data structure from the route table items information of storage.
7. device for searching route according to claim 6 is characterized in that, described storage operation unit specifically comprises:
The first storage operation module is used for depositing all route table items information of routing table in external memory storage based on counting bloom filter data structure, calls the second storage operation submodule when overflowing;
The second storage operation module is used for depositing in the routing addressing chip depositing the route table items information that the external memory storage process overflows in.
8. device for searching route according to claim 7 is characterized in that, described search operation unit specifically comprises:
The first search operation module, be used for based on counting bloom filter data structure externally memory search the route table items information of purpose IP address correspondence;
The second search operation module is used for starting simultaneously with the first search operation module, finds the route table items information of purpose IP address correspondence in the routing addressing chip;
Comparison module is used for will wherein having the route table items information of longer prefix person as purpose IP address correspondence when the first search operation module and the second search operation module all find route table items information.
9. device for searching route according to claim 8 is characterized in that, the described first search operation module specifically comprises:
Submodule is determined in the address, and being used for based on counting bloom filter data structure is purpose IP matching addresses target prefix, determines external memory address according to the bit of target prefix mid-1;
Prefix is determined submodule, is used for by the external memory address access external memory, obtains the longest-prefix of purpose IP address correspondence, and the route table items information at described longest-prefix place is the route table items information of the purpose IP address correspondence that finally finds.
10. device for searching route according to claim 9 is characterized in that, submodule is determined in described address, specifically is used for:
In two above memory spaces of counting bloom filter data structure correspondence, purpose IP address PARALLEL MATCHING is obtained corresponding result set and address set, result set that each memory space is corresponding respectively and the target prefix that obtains afterwards with purpose IP matching addresses are determined external memory address according to the content of the concentrated relevant position of bit corresponding address of target prefix mid-1.
CN201110211927.6A 2011-07-27 2011-07-27 A kind of method for searching route and device Active CN102271087B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110211927.6A CN102271087B (en) 2011-07-27 2011-07-27 A kind of method for searching route and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110211927.6A CN102271087B (en) 2011-07-27 2011-07-27 A kind of method for searching route and device

Publications (2)

Publication Number Publication Date
CN102271087A true CN102271087A (en) 2011-12-07
CN102271087B CN102271087B (en) 2017-09-29

Family

ID=45053254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110211927.6A Active CN102271087B (en) 2011-07-27 2011-07-27 A kind of method for searching route and device

Country Status (1)

Country Link
CN (1) CN102271087B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102333036A (en) * 2011-10-17 2012-01-25 中兴通讯股份有限公司 Method and system for realizing high-speed routing lookup
CN103973571A (en) * 2013-02-05 2014-08-06 中兴通讯股份有限公司 Network processor and routing searching method
WO2014201902A1 (en) * 2013-06-19 2014-12-24 中兴通讯股份有限公司 Tcam-based table query processing method and apparatus
WO2015081524A1 (en) * 2013-12-05 2015-06-11 北京大学深圳研究生院 Method and apparatus for forwarding heterogeneous address route
CN107204926A (en) * 2017-05-16 2017-09-26 上海博达数据通信有限公司 Pre-process cache route fast searching method
CN111782561A (en) * 2020-09-07 2020-10-16 新华三半导体技术有限公司 SRAM storage space allocation method, device and chip
CN112769704A (en) * 2021-02-09 2021-05-07 芯河半导体科技(无锡)有限公司 High-speed extensible IP route lookup hardware device based on hash table
CN113824814A (en) * 2021-09-23 2021-12-21 新华三信息安全技术有限公司 Address matching method and device of forwarding table, network equipment and medium
CN113872863A (en) * 2021-08-25 2021-12-31 优刻得科技股份有限公司 Path searching method and device
CN113986818A (en) * 2021-12-30 2022-01-28 中科声龙科技发展(北京)有限公司 Chip address reconstruction method, chip, electronic device and storage medium
CN115412893A (en) * 2022-10-19 2022-11-29 成都锐成芯微科技股份有限公司 Low-power-consumption Bluetooth attribute access method and low-power-consumption Bluetooth system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585358A (en) * 2003-08-19 2005-02-23 华为技术有限公司 Route searching method and system
CN101150483A (en) * 2007-11-02 2008-03-26 华为技术有限公司 Route table adjustment method, route query method and device and route table storage device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585358A (en) * 2003-08-19 2005-02-23 华为技术有限公司 Route searching method and system
CN101150483A (en) * 2007-11-02 2008-03-26 华为技术有限公司 Route table adjustment method, route query method and device and route table storage device

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102333036A (en) * 2011-10-17 2012-01-25 中兴通讯股份有限公司 Method and system for realizing high-speed routing lookup
CN102333036B (en) * 2011-10-17 2015-06-03 中兴通讯股份有限公司 Method and system for realizing high-speed routing lookup
CN103973571A (en) * 2013-02-05 2014-08-06 中兴通讯股份有限公司 Network processor and routing searching method
WO2014201902A1 (en) * 2013-06-19 2014-12-24 中兴通讯股份有限公司 Tcam-based table query processing method and apparatus
WO2015081524A1 (en) * 2013-12-05 2015-06-11 北京大学深圳研究生院 Method and apparatus for forwarding heterogeneous address route
CN107204926A (en) * 2017-05-16 2017-09-26 上海博达数据通信有限公司 Pre-process cache route fast searching method
CN111782561A (en) * 2020-09-07 2020-10-16 新华三半导体技术有限公司 SRAM storage space allocation method, device and chip
CN112769704A (en) * 2021-02-09 2021-05-07 芯河半导体科技(无锡)有限公司 High-speed extensible IP route lookup hardware device based on hash table
CN113872863A (en) * 2021-08-25 2021-12-31 优刻得科技股份有限公司 Path searching method and device
CN113824814A (en) * 2021-09-23 2021-12-21 新华三信息安全技术有限公司 Address matching method and device of forwarding table, network equipment and medium
CN113986818A (en) * 2021-12-30 2022-01-28 中科声龙科技发展(北京)有限公司 Chip address reconstruction method, chip, electronic device and storage medium
CN113986818B (en) * 2021-12-30 2022-04-08 中科声龙科技发展(北京)有限公司 Chip address reconstruction method, chip, electronic device and storage medium
CN115412893A (en) * 2022-10-19 2022-11-29 成都锐成芯微科技股份有限公司 Low-power-consumption Bluetooth attribute access method and low-power-consumption Bluetooth system

Also Published As

Publication number Publication date
CN102271087B (en) 2017-09-29

Similar Documents

Publication Publication Date Title
CN102271087A (en) Routing search method and device
US6985483B2 (en) Methods and systems for fast packet forwarding
CN102377664B (en) TCAM (ternary content addressable memory)-based range matching device and method
CN101692651B (en) Method and device for Hash lookup table
CN100445999C (en) Data storaging and searching method
Bando et al. FlashTrie: beyond 100-Gb/s IP route lookup using hash-based prefix-compressed trie
US8848707B2 (en) Method for IP longest prefix match using prefix length sorting
Le et al. Scalable tree-based architectures for IPv4/v6 lookup using prefix partitioning
CN101505279A (en) Route searching method and apparatus
Le et al. Memory-efficient and scalable virtual routers using FPGA
Zhong An IPv6 address lookup algorithm based on recursive balanced multi-way range trees with efficient search and update
CN101277252A (en) Method for traversing multi-branch Trie tree
Veeramani et al. Minimization of flow table for TCAM based openflow switches by virtual compression approach
CN101741737B (en) Maintenance method and device of route table
CN103973571A (en) Network processor and routing searching method
CN103457855B (en) Classless inter-domain routing table is established and the method and apparatus of message forwarding
Bando et al. Flashlook: 100-gbps hash-tuned route lookup architecture
Rasmussen et al. TCAM-based high speed Longest prefix matching with fast incremental table updates
CN107896193B (en) Switch, and creation method and search method of lookup table of switch
Huang et al. Fast routing table lookup based on deterministic multi-hashing
CN112769704B (en) High-speed extensible IP route lookup hardware device based on hash table
CN104009922A (en) IPV4/IPV6 routing capacity sharing method based on TCAM
CN103064901A (en) Random access memory (RAM), network processing system and RAM table look-up method
Hsiao et al. A high-throughput and high-capacity IPv6 routing lookup system
Tong et al. A memory efficient IPv6 lookup engine on FPGA

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20111207

Assignee: SHENZHEN ZTE MICROELECTRONICS TECHNOLOGY CO., LTD.

Assignor: ZTE Corporation

Contract record no.: 2015440020319

Denomination of invention: Routing search method and device

License type: Common License

Record date: 20151123

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model
GR01 Patent grant
GR01 Patent grant