CN101827137A - Hash table-based and extended memory-based high-performance IPv6 address searching method - Google Patents

Hash table-based and extended memory-based high-performance IPv6 address searching method Download PDF

Info

Publication number
CN101827137A
CN101827137A CN201010145939A CN201010145939A CN101827137A CN 101827137 A CN101827137 A CN 101827137A CN 201010145939 A CN201010145939 A CN 201010145939A CN 201010145939 A CN201010145939 A CN 201010145939A CN 101827137 A CN101827137 A CN 101827137A
Authority
CN
China
Prior art keywords
prefix
hash
expansion
item
searching
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
CN201010145939A
Other languages
Chinese (zh)
Other versions
CN101827137B (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.)
Xi'an Post & Telecommunication College
Original Assignee
Xi'an Post & Telecommunication College
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 Xi'an Post & Telecommunication College filed Critical Xi'an Post & Telecommunication College
Priority to CN2010101459399A priority Critical patent/CN101827137B/en
Publication of CN101827137A publication Critical patent/CN101827137A/en
Application granted granted Critical
Publication of CN101827137B publication Critical patent/CN101827137B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a hash table searching-based and extended memory searching-based IPv6 address searching scheme. A system comprises one searching classifier, one updating classifier, seven parallel hash processing units, six extended memory processing units, seven hash collision processing units and one priority comparing unit. The first six hash processing units are correlated with the corresponding extended memories in two stages and combined with the corresponding hash collision processing units to form six paths of processing modules; the seventh hash processing unit and the corresponding hash collision processing unit form one path of processing module; and the seven paths of modules searches the IPv6 address in parallel so as to determine the next hop of information. Due to the adoption of the method, the searching operation of the IPv6 address is finished in one to two storage periods in combination with the principle of hash searching and extended memory searching according to the distribution rule of the prefix of the IPv6 address. The method has high searching and updating performance and high extensibility, so that the method is a searching scheme suitable for the high-performance IPv6 router.

Description

A kind of high-performance IPv 6 address searching method based on Hash table and extended menory
Technical field
The present invention relates to a kind of method of in High Speed IP v6 router, searching route table items, say exactly, relate to a kind of IPv6 address lookup method that adopts Hash table and extended menory, belong to IPv6 network equipment routing forwarding technical field.
Background technology
Ip router plays function served as bridge in network, a plurality of little networks can be connected into macroreticular, intercoms mutually by IP (Internet Protocol) agreement.And the main function of router is the forwarding of IP packet, promptly receive the IP packet from input interface, and according to the destination address in the IP bag stem, from route information table RIB (Routing Information Base), find out corresponding output interface information, then the IP bag is forwarded to corresponding output interface, thereby finishes the packet forward function.
In order to solve the problem that the route prefix number increases fast in the route information table, the IP address addressing scheme that does not have classification inter-domain routing CIDR (Classless Inter-Domain Routing) is formally adopted, thereby, must adopt longest prefix match LPM (Longest Prefix Matching) algorithm to solve IP address search problem, therefore, increased the complexity of IP address search greatly.
Growing along with the network user and communication service, cause the IPv4 address assignment to face exhaustion, and the restriction of problems such as IPv4 internet security and flexibility, so IETF (Internet Engineering TaskForce) has proposed IPv6 (Internet Protocol Version 6) addressing scheme, but, because the IP address is from 32 128 of becoming IPv6 of IPv4, a lot of IPv4 search 128 bit address that algorithm can not satisfy IPv6 and search.Be the initial stage of IPv6 development now, also have a lot of uncertain factors: the prefix regularity of distribution and list item increasing law in the IPv6 routing table, the design of IPv6 address search algorithm can only be according to the experience of IPv4 address search, thereby problems such as the efficient of IPv6 address search algorithm and realization cost need the designer to solve.
Existing IPv6 address lookup method all is direct or the traditional IPv4 address search scheme of indirect utilization designs, because search key rises to 128 from 32, so can there be a lot of problems in this mentality of designing, for example, use TCAM to carry out IPv6 address search meeting and improve design cost and system power dissipation to a great extent, the routing table of same list item quantity, use multistage TCAM to carry out cascade and just can finish searching work, when engineering system designed, cost that it is high and big power consumption can directly not used this scheme like this; Use Trie tree and derivative algorithm thereof (such as layer compression Trie tree, path compression Trie tree, many bits Trie tree etc.) when address search, memory accesses is multiplied, thereby it is bigger to cause searching delay, system searching efficient reduces; Use can make the increase of carrying cost exponentially level based on the lookup method of memory expansion, in the IPv6 address, what distributed quantity was maximum is that length is 32 route prefix, directly utilizes the method for memory expansion to design, it is searched as the first order, and the memory size that needs is 2 32Bit adds the memory of second level greater room, makes that directly using this scheme can not realize the IPv6 address search.
In a word, the IPv4 address lookup method is directly used in the IPv6 address search and is difficult to realize high-performance IPv 6 address searching, so when the IPv6 address lookup method designs, utilize characteristics (such as the IPv6 prefix regularity of distribution, IPv6 route table items growth trend etc.) and the traditional IPv4 address search thinking of IPv6 itself to design, can make the IPv6 address lookup method have realizability and high efficiency.
Summary of the invention
The purpose of this invention is to provide a kind of IPv6 address lookup method that adopts Hash table and extended menory two-layer configuration, this method has characteristics such as high-speed searching efficient, extensibility are strong, memory by using rate height, can be used in the high-performance IPv 6 core router.
(1) for convenience of description, at first do as giving a definition:
Define 1 Hash prefix HP (i) (Hashing Prefix): expression length i can be by the 8 prefix items of dividing exactly, and the Hash prefix of indication is in this method: HP (16), HP (24), HP (32), HP (40), HP (48), HP (56) and HP (64);
Definition 2 expansion prefix EP (j, k) (Expanded Prefix): two energy are by 8 all prefixes that divide exactly between the Hash prefix item, and j=8i+1, i are integer and 0≤i≤7, k=j+m, m is that the expansion prefix of indication in integer and this method of 1≤m≤6 comprises: EP (17,23), EP (25,31), EP (33,39), EP (41,47), EP (49,55) and EP (57,63) etc.In the IPv6 routing table, Hash prefix HP and expansion prefix EP have constituted whole routing table;
Definition 3 expansion prefix hashing item EPH (n) (Expanded Prefix Hashing Segment) and expansion Prefix Expansion item EPE (n) (Expanded Prefix Expanded Segment): length is that the expansion prefix of n can be divided into two part: 1~i and i+1~n, and i is can be by 8 integers of dividing exactly less than n and maximum.Value between 1~i bit in the expansion prefix is called EPH (n), and i+1~n is called expansion Prefix Expansion item EPE (n).For example, length is expansion prefix 2a01:c*/20 of 20 bits, and its expansion prefix hashing item EPH (20) is 2a01, and its expansion Prefix Expansion item EPE (20) is c.
Represent that with Hashm length is the Hash table that the Hash prefix of m bit is stored in the method.M=16 wherein, 24,32,40,48,56 and 64, promptly have Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64 respectively storage length be 16,24,32,40, the cryptographic Hash of 48,56 and 64 bit Hash prefixes; Represent to deposit the memory block of expanding prefix item institute respective value with RAMp_q, the RAM memory address is calculated with expansion Prefix Expansion item EPE, comprising RAM17_23, RAM25_31, RAM33_39, RAM41_47, RAM49_55, RAM57_63; Represent hash-collision processing unit (Collision Processing Element) with CPEs_t, comprise CPE16_23, CPE24_31, CPE32_39, CPE40_47, CPE48_55, CPE56_63, CPE64 in the method.
Annotate: regard Hashm, RAMp_q, CPEs_t as module name when describing, following description process in like manner.
(2) thinking of the present invention and general structure are as described below:
Along with the IPv6 networks development, IPv6 route table items number increases gradually, and present certain regularity of distribution, as Fig. 2 (routing table in the last core router of Potaroo), by analyzing the regularity of distribution of IPv6 route prefix length in the routing table, can find that the IPv6 routing table prefix is distributed with following characteristics:
1. IPv6 route prefix length is all less than 64 bits;
2. length can be very big by the 8 prefix distribution proportions of dividing exactly, and accounts for more than 93% of routing table altogether.For example, length be the prefix of 32 bits account for whole routing table 65.44%, length be the prefix of 48 bits account for whole routing table 24.15% or the like;
3. according to the data of Potaroo website statistics, length can be fast especially by the 8 prefix growth rate that divide exactly, and entire I Pv6 table of router item number purpose increases this part prefix quantity and accounts for significant proportion, for example, during year June in January, 08 to 09, length is that the prefix of 32 bits multinomially has been increased to 1176 from 600, length be 64 bits prefix from 10 multinomial be increased to 30 multinomial;
4. length can not be very little by 8 prefixes that divide exactly shared ratio in whole routing table, only have 6%, and growth rate is slow.
The present invention is according to above analysis result, utilizes principle of locality can be divided exactly and cannot be handled with different processing methods by the 8 prefix items of dividing exactly by 8 length.
With most prefixes (length can by 8 prefixes that divide exactly) as the data in the first order Hash table, most addresses just can be finished in the first order searches, and with the data of other prefix (length cannot by 8 prefixes that divide exactly) as second level extended menory, the minority address need be searched the second level and can be finished and search.In order to improve whole performance of searching system, the prefix regularity of distribution that this method utilization is added up is 16 bits with length, 24 bits, 32 bits, 40 bits, 48 bits, the prefix of 56 bits and 64 bits is searched data as the first order, and other prefix is searched as the second level.While is owing to 16 bits and 24 bits, 24 bits and 32 bits, 32 bits and 40 bits, 40 bits and 48 bits, 48 bits and 56 bits all differ 7 between 56 bits and 64 bits, can handle with extended menory the prefix of other length, as Fig. 4 and Figure 11.There is conflict in the Hash function, so manage conflict with the hash-collision processing module.The main thought that Here it is this paper proposes based on the IPv6 address search of Hash and extended menory.
Fig. 3 has provided the storage organization of Hash table and expansion RAM.In order to express easily, the description of in the drawings storage organization of various Hash table Hashi (i=16,24,32,40,48,56) being united, every kind of Hash table all is 17 the width and 65535 the degree of depth (2 16) memory; The description of also storage organization of various expansion RAM p_q being united, but when specific implementation, should consider the influence of hash-collision (also is the logarithm value W=log of memory depth D to the address width W of memory 2D) should do suitable adjustment.
● hash table storage organization (i=16,24,32,40,48,56 and 64) is shown in Fig. 3 (a):
1. E: expression has expansion Prefix Expansion item EPE, and promptly length is the prefix of i+1~i+7 bit, and E=1 represents this existence expansion Prefix Expansion item EPE, and E=0 represents that there is not expansion Prefix Expansion item in this;
2. Block_addr: be expansion Prefix Expansion item EPE the numbering of corresponding expansion RAM piece.
For example, if one the prefix item the value of corresponding Block_addr be " x ", the low level expansion of expansion Prefix Expansion item EPE can change into decimal number " y ", and then pairing next the jumping value of this prefix should leave in 128*x+y the address location of second level memory;
3. F: this be effectively to mate the prefix item for the expression Hash table.When F=0, Nh (i) is complete zero; During F=1, output Nh (i) is next jumping value; When to a certain insertion prefix corresponding informance of expansion RAM, the F field then is made as 1;
4. Nh (i) field is pairing next the jumping value of this prefix item.
● the list item storage organization of expansion, shown in Fig. 3 (b):
1. H: represent that this is the effective prefix item of coupling, can be with this pairing next jumping value Nh (i+1, i+7) output.During H=1, and Nh (i+1 is complete zero i+7), during F=1, output Nh (i+1, i+7); When this was inserted prefix information, the F field then was made as 1;
2. (i+1, i+7) field is pairing next the jumping value of this prefix item to Nh.
The storage organization of Hash table storage organization as defined above and expansion RAM organizing as shown in Figure 4 in this article, Hash table is deposited the information of Hash prefix HP and expansion prefix hashing item EPH, partial expansion RAM is deposited the information of expansion Prefix Expansion item EPE, connects by signal " E " between this two-stage look-up.In search procedure,, represent that then this is occurrence if " F " in the Hash term is " 1 "; If " E " in the hash table is " 1 ", then longer occurrence also need be searched in the expression address of being searched in expansion RAM; If " H " in the expansion RAM item is " 1 ", represent that then the value in this expansion RAM item is jumped index value for next of mating.
(3) the technical solution used in the present invention is described below:
A kind of IPv6 address lookup method of searching with extended menory of searching based on Hash table, comprise that 1 is searched grader, 1 renewal grader, 7 parallel Hash processing unit Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64,6 extended menory processing unit RAM17_23, RAM25_31, RAM33_39, RAM41_47, RAM49_55, RAM57_63,7 hash-collision processing unit CPE16_23, CPE24_31, CPE32_39, CPE40_47, CPE48_55, CPE56_63, CPE64,1 priority comparing unit; It is characterized in that the IPv6 address is searched, and the IPv6 route table items is upgraded, concrete steps are:
A. according to the statistics of the IPv6 routing table regularity of distribution, route table items is divided into two kinds: a kind of is that length can be by 8 prefixes that divide exactly, and a kind of is that length can not be by 8 prefixes that divide exactly;
B. two kinds of route table items are stored with Hash table and extended menory respectively, with hash-collision processing unit processes hash-collision item;
C. the priority comparator can be selected the pairing next hop information of longest matching prefix;
D. in search procedure, search in module parallel search for searching object 7 the tunnel with purpose IPv6 address, the pairing next hop information of longest matching prefix is a lookup result;
The concrete search procedure of this method is as shown in Figure 6:
Carry out the IPv6 address search, must earlier routing table be carried out initialization, the initialization detailed process hereinafter described;
If the routing table initial work is finished, then can search: earlier IPv6 is done first order Hash lookup, according to circumstances judge whether to carry out the second level then and search the IPv6 address.Search procedure can be divided into three steps and finish: first order Hash table is searched, second level expansion RAM search with priority ratio.
Specifically describe as follows:
The first step: 7 kinds of hash are in purpose IPv6 address search, promptly respectively in Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64 Hash lookup unit, preceding 16bits, 24bits, 32bits, 40bits, 48bits, 56bits and the 64bits of purpose IPv6 address done parallel search operation.If find occurrence, then next the jumping index value with correspondence outputs to preparation comparison in the priority comparator.
Second step: search in the second level in the unit and to also have longer prefix need do coupling to calculate if the first order is searched indication, then needing to carry out the second level searches, utilize the memory expansion technology in the second level, expansion Prefix Expansion item EPE can be inserted in the block RAM of 128 addresses.If the corresponding position of prefix is [i+1:i+7] (i is the length of Hash prefix), when searching, then according to destination address the (i+1~i+7) position calculates index value, utilize the addressing in the expansion RAM memory of this value, the pairing value in match address unit is next jumping value Nh (i+1, i+7), this next jumping value is outputed in the priority comparator compare.
The 3rd step: the value that will be input in the register of priority comparator preferentially compares, " next hop " value that output priority is the highest (being pairing next the jumping value of longest matching prefix) as next jumping value that this IPv6 destination address is mated, is the value of being found.
E. in renewal process, can carry out route table items by Hash calculation and extended menory address computation and upgrade, comprise routing table initialization (structure routing table), insert list item, remove entries and modification list item, specific as follows:
● routing table initialization and list item inserting step are:
1. determine to need to upgrade the position of list item by the route table items that needs to upgrade: judge earlier whether the length that needs to upgrade route prefix can be divided exactly by 8;
If 2. can be divided exactly by 8, select corresponding processing module by upgrading grader, this prefix is carried out Hash calculation, with gained cryptographic Hash index Hash table, if the hash table that indexes has been put into other routing iinformation, then the pairing routing iinformation of this prefix is put into the hash-collision processing unit and handle,, then the routing iinformation of correspondence is put into this if the hash table that indexes is a null term;
If 3. prefix length cannot be divided exactly by 8, select corresponding processing module by upgrading grader, earlier the expansion prefix hashing item of this prefix is done Hash calculation, with gained cryptographic Hash index Hash table, if this list item is empty, then the first address with the second level memory cell of being distributed deposits this list item in, then pairing routing iinformation is put into the correspondence position of institute memory allocated unit, if this list item is not different from the expansion prefix hashing item that inserts prefix for the expansion prefix hashing item of empty and this prefix, then the pairing routing iinformation of this prefix is inserted in the second level memory cell of having distributed, the expansion prefix hashing item for empty and this prefix is not identical with the expansion prefix hashing item that inserts prefix as this list item, then this prefix is put into the hash-collision processing unit and handles.
As shown in Figure 5, the detailed process of routing table structure and list item insertion is described below:
The first step: Hash table and expansion RAM are initialized as sky;
Second step: judge that according to being inserted into prefix length this prefix belongs to Hash prefix HP and still expands prefix EP, if HP, then this prefix is carried out Hash calculation, with gained cryptographic Hash index Hash table, if " F " field is " 0 " in the hash table that indexes, " F " field that then will this item is made as " 1 ", and " Nh (i) " field is made as pairing next the jumping value of this prefix; If " F " field is " 1 " in the respective items, show that this prefix item produces hash-collision, then carry out hash-collision and handle with CPE.
If EP, then the expansion prefix hashing item EPH with this prefix does Hash calculation, with gained cryptographic Hash index Hash table, judge whether hash table " E " field that indexes is " 0 ", if " E " field is " 0 ", then " E " field with the Hash table respective items is made as " 1 ", " Block_addr " field is the numbering for expansion Prefix Expansion item block RAM that EPE distributes, calculate relative address in the piece of block RAM with expansion Prefix Expansion item EPE, and next jumping value is put into corresponding memory cell; If " E " field is identical with the expansion prefix hashing item of the prefix of inserting this for the expansion prefix hashing item EPH part of " 1 " and this prefix, then next jumping value of this prefix is put into the indicated block RAM of distribution of this hash table " Block_addr " field, calculate relative address in the piece of block RAM with expansion Prefix Expansion item EPE, and next jumping value is put into corresponding memory cell; If " E " field shows that for the expansion prefix hashing item EPH part of " 1 " and this prefix is different with the expansion prefix hashing item of the prefix of inserting this this prefix item produces hash-collision, then carry out hash-collision and handle with CPE.
At this construction process of above routing table is described with an example: existing three route table items that are inserted into are respectively 2001:2abc: :/32, and next jumping value is A, 2001:2abc:9: :/36, next jumping value is B, 2abc:2001:9: :/36, next jumping value is C.When inserting prefix 2001:2abc:: in the time of/32, judging this prefix length earlier is 32 bits, can know that this prefix is the Hash prefix, obtaining the result through Hash calculation is 16 ' h0abd, judge that then whether " F " field in h0abd unit of Hash32 the 16th ' is established is " 0 ", if be " 0 ", then is made as " 1 " with " F " field in this unit, " Nh (32) " field is set to " A ", and all the other fields do not change; If be " 1 ", then with prefix item 2001:2abc: :/32 put among the CPE (32,39) and handle, and have so just finished the insertion of first list item;
When inserting prefix 2001:2abc:9:: in the time of/36, being the result that Hash calculation obtains with its preceding 32 is 16 ' h0abd, judge that then " E " field in h0abd unit of Hash32 the 16th ' is " 0 ", " E " field that then will this item is made as " 1 ", distribute one 8 bit wide to these expansion Prefix Expansion item 9 (binary system can be expressed as 1001000) again, the piece expansion RAM of 128 memory cell, the numbering of this block RAM is filled into " Block_addr " field of this hash table, next jumping value is deposited in (absolute address` then multiply by 128 for the numbering of this piece expansion RAM in the individual memory cell of the 72nd (it is 72 that binary one 001000 is converted to the decimal system) of expansion RAM, add the value of 72 gained), and the highest order " H " of this unit is set to 1, so just finished the insertion of route table items;
When inserting the 3rd prefix 2abc:2001:9:: in the time of/36, being the result that Hash calculation obtains with its preceding 32 is 16 ' h0abd, judge that then " E " field in h0abd unit of Hash32 the 16th ' is " 1 ", but the expansion prefix hashing item EPH of this prefix is different with the expansion prefix hashing item that inserts prefix, handles so this prefix is put into hash-collision processing module CPE.
Like this, all route table items are inserted the structure of just having finished routing table.
● list item deletion and modify steps are:
1. select corresponding processing module by upgrading grader;
2. utilize lookup method, find route table items to be updated, then the routing iinformation of this list item is deleted or revised.
Route table items deletion and the concrete condition of revising are described below:
The renewal of route table items mainly comprises three kinds of operations, inserts, deletes and revise, and will determine to upgrade the position of list item respectively according to be updated prefix value.Insert operation for prefix, can insert according to the establishment algorithm of routing table.Revise and deletion action for prefix, then be similar to the process of address search, at first utilize and search algorithm, find this prefix entries, and then carry out corresponding modification and deletion action, can be divided into following two kinds of situations:
The 1st kind of situation: when the prefix that will revise or delete was the Hash prefix, then " F " field was set to " 0 ", empties the value of other field;
The 2nd kind of situation: when the prefix that will revise or delete was the expansion prefix, then " E " field and " Block_addr " field were set to " 0 " entirely, regain the memory space of expansion RAM then.
Also the renewal of routing table can be regarded as the another kind of function of address search in fact, find certain location exactly, on this position, insert operation or deletion action.
Length can be stored with Hash table by 8 route prefix of dividing exactly, length can not be done the two-stage storage with Hash table and extended menory by 8 prefixes that divide exactly.
With length is that the prefix (n can not be divided exactly by 8) of n can be divided into two part: 1~i and i+1~n, i be less than n and maximum can be by 8 integers of dividing exactly.In Hash table, and the pairing information of the value between i+1~n is stored in the extended menory, and the field that connects each other is arranged between the two-stage with the pairing information stores of the value between 1~i bit in the prefix.As shown in Figure 4, Hash table is deposited the information of Hash prefix HP and expansion prefix hashing item EPH, and partial expansion RAM is deposited the information of expansion Prefix Expansion item EPE, connects by signal " E " between this two-stage look-up.In search procedure,, represent that then this is occurrence if " F " in the Hash term is " 1 "; If " E " in the hash table is " 1 ", then longer occurrence also need be searched in the expression address of being searched in expansion RAM; If " H " in the expansion RAM item is " 1 ", represent that then the value in this expansion RAM item is jumped index value for next of mating.
To weak point priority 13 registers from high to low are set from long according to prefix length in the priority comparator, realize the longest prefix match result.
The flow chart of priority comparator as shown in figure 13, the course of work is as follows:
The first step: define 13 registers, represent the priority of each lookup result respectively, its priority is set is followed successively by from high to low: " Nh64 ", " Nh57-63 ", " Nh56 ", " Nh49-55 ", " Nh48 ", " Nh41-47 ", " Nh40 ", " Nh 33-39 ", " Nh 32 ", " Nh 25-31 ", " Nh 24 ", " Nh 17-23 ", " Nh 16 ", and be zero with these 13 initialization of register.
Second step: if the value in which register is non-vanishing, then the value of being deposited in this register is to wait to look into next jumping that destination address mates, and pairing next the jumping value of the longest matching prefix of this destination address is the value in the highest register of priority, should be worth as next jumping value output, and be institute and look into.
16 place values that Hash processing unit Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64 are calculated are directly carried out index as cryptographic Hash in Hash table;
Hash processing unit Hash16, Hash24, Hash32, Hash40, Hash48, Hash56 and corresponding extended menory RAM17_23, RAM25_31, RAM33_39, RAM41_47, RAM49_55, RAM57_63 carries out the two-stage association, and and corresponding hash-collision processing unit CPE16_23, CPE24_31, CPE32_39, CPE40_47, CPE48_55, CPE56_63 constitutes 6 tunnel processing modules respectively, the 7th Hash processing unit hash64 and its corresponding hash-collision processing unit CPE64 constitute 1 tunnel processing module, 7 tunnel modules are parallel searches to determine its coupling prefix item the IPv6 address, in the result that 7 tunnel find out, compare to realize longest prefix match by the priority comparator.
Finish route table items renewal work by Hash calculation and extended menory address computation, the renewal of route table items mainly comprises three kinds of operations, insert, delete and revise, to determine to upgrade the position of list item respectively according to be updated prefix value, insert operation for prefix, can insert according to the establishment algorithm of routing table.Revise and deletion action for prefix, then be similar to the process of address search, at first utilize and search algorithm, find this prefix entries, and then carry out corresponding modification and deletion action, can be divided into following two kinds of situations:
The 1st kind of situation: when the prefix that will revise or delete was the Hash prefix, then " F " field was set to " 0 ", empties the value of other field;
The 2nd kind of situation: when the prefix that will revise or delete was the expansion prefix, then " E " field and " Block_addr " field were set to " 0 " entirely, regain the memory space of expansion RAM then.
Beneficial effect:
The present invention is the two-layer configuration lookup scheme that adopts based on Hash table and extended menory, having IPv6 address more than 93% can use a memory cycle to finish searches, IPv6 address less than 7% only needs two memory cycles to finish to search, so the present invention has very high search efficiency.
Because the address search scheme can take relatively large memory space, memory space also is one of main performance of weighing address search scheme quality, so according to the scale of 65536 IPv6 routing tables, the storage size that this method is shared is added up, and is as follows:
According to definition, to Hash table Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64 address bus with 20 bit wides, the data/address bus of 17 bit wides, like this, what Hash table was shared altogether is stored as: 2 20* (2 4+ 1) * 7=14.875 (MB);
If the expansion prefix is calculated by 7%, 4587 expansion prefixes are arranged in 65536 routing tables, and the shared memory space of each expansion prefix is 2 7* 8=1k (address bus of 7 bit wides, the data/address bus of 8 bit wides) can obtain the memory space that needs altogether and be: 4587 * 1k=4587k (b)=0.4587 (MB);
If collision rate distributes by the prefix distribution proportion, if the collision rate by 9.86% calculates (this collision rate statistics obtains, and can reduce along with the increase of the Hash table degree of depth), hash-collision can take place always to have 6462, when handling hash-collision, needed CAM is: 28.75kB;
Can obtain,, need CAM 28.75kB if 65536 routing table uses this programme to need RAM to be 15.33MB altogether.
Can also deposit more multirouting list item owing to preestablish the RAM and the CAM of size, and the degree of depth of Hash table can increase, so autgmentability of the present invention is strong and realize easily.
Therefore, the advantage of the inventive method is search efficiency height, memory by using rate height, extensibility is strong and it is simple to realize.
Description of drawings
Fig. 1 is based on the high-performance IPv 6 address searching method overall construction drawing of Hash table and extended menory;
Fig. 2 is the prefix regularity of distribution of IPv6 routing table;
Fig. 3: a is the Hash table storage organization, and b is the storage organization of extended menory;
Fig. 4 is the organizational form of Hash table and extended menory;
Fig. 5 is that routing table structure and prefix are inserted flow chart;
Fig. 6 is the search procedure flow chart;
Fig. 7: a is the Hash calculation process schematic diagram of 48 bit values, and b is 40 bit value Hash calculation process schematic diagrames;
Fig. 8 is the Hash organizational process of 1-16 bit value;
Fig. 9 is the tissue of expansion prefix in extended menory;
Figure 10 is a second level extended menory address assignment example schematic;
Figure 11 is a kind of special case that block RAM distributes;
Figure 12 is the membership credentials schematic diagram of hash units and extended menory;
Figure 13 is that priority ratio is than flow chart;
Figure 14 is hash-collision handling principle figure.
Embodiment
Specific implementation of the present invention is described below:
(1) overall implementation structure
This method is used 7 road Hash tables to walk abreast and is searched, as shown in Figure 1.Master-plan can be divided into four parts: the design of Hash table, the design of expansion RAM, the design of the design of hash-collision processing unit and priority comparator.But also the structure that need consider every kind of Hash table is all different, and how first order Hash table and second level expansion RAM are organized.
Owing to there is certain relation between Hash table and the expansion RAM: Hash table Hashi can deposit Hash prefix HP (i) and expansion prefix hashing item EPH (i+1, i+7) information, so concrete scheme is divided into: Hash16 and RAM17_23 search unit, Hash24 and RAM25_31 and search unit, Hash32 and RAM33_39 and search unit, Hash40 and RAM41_47 and search unit, Hash48 and RAM49_55 and search that unit, Hash56 and RAM57_63 search the unit, Hash64 searches unit and priority comparator.
According to such dividing elements, Hash16 and RAM17_23 search the unit, Hash24 and RAM25_31 search the unit, Hash32 and RAM33_39 search the unit, Hash40 and RAM41_47 search the unit, Hash48 and RAM49_55 search the unit, it is similar that Hash56 and RAM57_63 search the implementation method and the structure organization of unit, be that first order Hash lookup and second level expansion RAM are searched, only the hash function of different units need be changed and get final product, it only is Hash lookup that Hash64 searches the unit, and there is not expansion RAM, realize simplyr, and the tissue of first order Hash table and second level expansion RAM is realized easily.
So according to such division, specific implementation this several parts are arranged: the design of hash units, the design of expansion RAM unit, the tissue of hash units and expansion RAM, the design of the design of hash-collision processing unit and priority comparator.
In order to reduce the generation of hash-collision, each Hash table all is independent addressing, but the data structure of Hash table storage is all identical.Hash16 and RAM17_23 are searched unit, Hash24 and RAM25_31 to be searched unit, Hash32 and RAM33_39 and searches unit, Hash40 and RAM41_47 and search unit, Hash48 and RAM49_55 and search unit, Hash56 and RAM57_63 and search unit, Hash64 and search the hash-collision that the unit produces and all handle with CAM respectively, because under the situation that does not influence systematic function, CAM can use a memory cycle to finish once and search, and the design complexities of CAM and power consumption are lower than TCAM.
(2) search grader and design and the realization of upgrading grader
Search grader and get preceding 16,24,32,40,48,56,64 that wait to look into the IPv6 address, sending into parallel searching in 7 tunnel modules respectively.For example, waiting to look into purpose IPv6 address is 2001:4500:5a6b:44f9:0:0:0:0 (16 system representation), then with 2001,2001:45,2001:4500,2001:4500:5a, 2001:4500:5a6b, 2001:4500:5a6b:44,2001:4500:5a6b:44f9 be sent to respectively as handling in 7 tunnel modules among Fig. 1.
Upgrading grader judges that data to be updated send in the 7 tunnel corresponding modules and upgrades.For example, the route table items that is inserted into is 2001:2abc: :/32, and then the pairing routing iinformation of this list item is sent in the Hash32 module and inserts operation; Route table items to be deleted is 2001:2abc:ba5: :/44, and the corresponding list item of then Hash40 and RAM41_47 being searched the unit is deleted and is got final product.
(3) design of hash units and realization
Utilization is carried out Hash calculation based on the hash function of folding XOR algorithm, in order to reduce the hash-collision rate, 7 kinds of different folding XOR hash algorithms of The data to 7 kinds of different lengths, when describing, we are arranged to 16 bit wides with all hash index values, but when specific implementation, can distribute according to different prefixes is provided with different bit wides.The involved XOR Folding algorithm of this paper is divided into following two kinds of situations:
First kind of situation: direct jackknife method, if data can be divided into the subdata of equal length, and subdata length and desired hash index value bit wide equate, then data are done the experimental process data that directly are divided into equal length, then xor operation are carried out in the corresponding position of subdata.
For example, if one 48 binary number B[47:0 is arranged], the index value that need calculate is the Index[15:0 of 16 bit wides], then the Index computing formula is:
Figure GSA00000082437400141
Process such as following example:
The value of 48 bits is utilized the process of XOR Folding calculating hash index value, shown in Fig. 7 (a):
The first step: to 48 bit value B[47:0 of input] carry out Hash calculation, B[47:0] be the prefix of preceding 48 or 48 bit lengths of IPv6 address.
Second step:, can obtain median B1[15:0 to this value xor operation that reduces by half]:
B 1 [ 15 : 0 ] = { B [ 15 ] ⊕ B [ 31 ] , B [ 14 ] ⊕ B [ 30 ] , B [ 13 ] ⊕ B [ 29 ] , B [ 12 ] ⊕ B [ 28 ] ,
B [ 11 ] ⊕ B [ 27 ] , B [ 10 ] ⊕ B [ 26 ] , B [ 9 ] ⊕ B [ 25 ] , B [ 8 ] ⊕ B [ 24 ] ,
B [ 7 ] ⊕ B [ 23 ] , B [ 6 ] ⊕ B [ 22 ] , B [ 5 ] ⊕ B [ 21 ] , B [ 4 ] ⊕ B [ 20 ] ,
B [ 3 ] ⊕ B [ 19 ] , B [ 2 ] ⊕ B [ 18 ] , B [ 1 ] ⊕ B [ 17 ] , B [ 0 ] ⊕ B [ 16 ] } .
The 3rd step: to median B1[15:0] and B[47:32] carry out an xor operation, draw hash index value index[15:0]:
index [ 15 : 0 ] = { B 1 [ 15 ] ⊕ B [ 47 ] , B 1 [ 14 ] ⊕ B [ 46 ] , B 1 [ 13 ] ⊕ B [ 45 ] , B 1 [ 12 ] ⊕ B [ 44 ] ,
B 1 [ 11 ] ⊕ B [ 43 ] , B 1 [ 10 ] ⊕ B [ 42 ] , B 1 [ 9 ] ⊕ B [ 41 ] , B 1 [ 8 ] ⊕ B [ 40 ] ,
B 1 [ 7 ] ⊕ B [ 39 ] , B 1 [ 6 ] ⊕ B [ 38 ] , B 1 [ 5 ] ⊕ B [ 37 ] , B 1 [ 4 ] ⊕ B [ 36 ] ,
B 1 [ 3 ] ⊕ B [ 35 ] , B 1 [ 2 ] ⊕ B [ 34 ] , B 1 [ 1 ] ⊕ B [ 33 ] , B 1 [ 0 ] ⊕ B [ 32 ] } .
In this scheme, be 64 bits to length, the value of 48 bits and 32 bits uses direct jackknife method to carry out Hash calculation.
Second kind of situation: dislocation jackknife method, if data can be divided into the subdata of equal length, but subdata length and desired hash index value bit wide are unequal, then data are done the experimental process data that directly are divided into equal length, to misplace between the subdata then, gather and carry out xor operation again after equating with the index value bit wide.
If one 40 binary number B[39:0 is arranged].The index value that need calculate is the Index[15:0 of 16 bit wides], then the Index computing formula is:
Figure GSA00000082437400159
0<i, j, p, q<40.
For example, the value of 40 bits is utilized the process of XOR Folding calculating hash index value, shown in Fig. 7 (b):
The first step: to 40 bit value B[39:0 of input] carry out Hash calculation, B[39:0] be the prefix of preceding 40 or 40 bit lengths of IPv6 address.
Second step:, can obtain median B1[15:0 to this value xor operation that reduces by half] and B2[15:0]:
B 1 [ 15 : 0 ] = { B [ 19 ] , B [ 18 ] , B [ 17 ] , B [ 16 ] , B [ 15 ] , B [ 14 ] ,
B [ 9 ] ⊕ B [ 13 ] , B [ 8 ] ⊕ B [ 12 ] , B [ 7 ] ⊕ B [ 11 ] ,
B [ 6 ] ⊕ B [ 10 ] , B [ 5 ] , B [ 4 ] , B [ 3 ] . B [ 2 ] , B [ 1 ] } ,
B 2 [ 15 : 0 ] = { B [ 39 ] , B [ 38 ] , B [ 37 ] , B [ 36 ] , B [ 35 ] , B [ 34 ] , B [ 29 ] ⊕ B [ 33 ] ,
B [ 28 ] ⊕ B [ 32 ] , B [ 27 ] ⊕ B [ 31 ] , B [ 26 ] ⊕ B [ 30 ] ,
B [ 25 ] , B [ 24 ] , B [ 23 ] , B [ 22 ] , B [ 21 ] , B [ 20 ] } ;
The 3rd step: draw hash index value index[15:0]:
index [ 15 : 0 ] = { B 1 [ 15 ] ⊕ B 2 [ 15 ] , B 1 [ 14 ] ⊕ B 2 [ 14 ] , B 1 [ 13 ] ⊕ B 2 [ 13 ] , B 1 [ 12 ] ⊕ B 2 [ 12 ] ,
B 1 [ 11 ] ⊕ B 2 [ 11 ] , B 1 [ 10 ] ⊕ B 2 [ 10 ] , B 1 [ 9 ] ⊕ B 2 [ 9 ] , B 1 [ 8 ] ⊕ B 2 [ 8 ] ,
B 1 [ 7 ] ⊕ B 2 [ 7 ] , B 1 [ 6 ] ⊕ B 2 [ 6 ] , B 1 [ 5 ] ⊕ B 2 [ 5 ] , B 1 [ 4 ] ⊕ B 2 [ 4 ] ,
B 1 [ 3 ] ⊕ B 2 [ 3 ] , B 1 [ 2 ] ⊕ B 2 [ 2 ] , B 1 [ 1 ] ⊕ B 2 [ 1 ] , B 1 [ 0 ] ⊕ B 2 [ 0 ] } .
In this scheme, be 56 bits to length, the value of 40 bits and 24 bits uses the dislocation jackknife method to carry out Hash calculation.
It is as follows that the 1-16 bit value is carried out organizational process:
Can be directly with 16 value as hash index, as shown in Figure 8, hash16 can directly handle the value of 0-16 bit in fact, for example, the binary number of 10 bit long " 1000110110 " (converting decimal number to is 566), its hashed table index address is 16 ' d566, and so, 16 ' d566 unit is the unit that is found in the Hash table.Therefore, can solve searching of 1-16 position long data memory time with once visiting, and the hash-collision situation can not take place in this unit.
(4) realization of extended menory
A. expand the calculating of Prefix Expansion item EPE address in expansion RAM
A known expansion prefix EP, can obtain it expansion Prefix Expansion item EPE (i, n), wherein n is the length of EP, and i be less than n can be by 8 maximum integer that divide exactly, n-i+1<7.Can form one 7 binary number δ with EPE, use δ, the pairing next hop information of this prefix is inserted into to it distribute in δ the memory cell of block RAM, so just can finish the tissue of this prefix as index.The formed binary number δ of EPE with the Verilog language description is:
{ E P E, j{0}}, wherein j=n-i+1.
Be organized as the organizational form of example explanation expansion prefix in expansion RAM with 32 to 39 bit length prefixes, as shown in Figure 9,32 long prefixes are Hash prefix HP (32), then its information can directly be stored among the Hash table Hash32, and 33 to 39 long prefixes are the expansion prefix, the effective information of its high 32 expansion prefix hashing item EPH stores among the Hash table Hash32, and the low level information stores is in expansion RAM 3339.
B. the distribution of expansion RAM and recovery
This trifle is mainly described the distribution and the recovery of block RAM.
The distribution of block RAM is divided into following several situation, as shown in figure 10:
Situation 1: be inserted into the expansion prefix hashing item EPH of prefix and inserted the expansion prefix hashing item EPH of prefix all inequality.If inserted 4 all different prefixes, and the expansion prefix hashing item EPH of 4 prefixes is inequality, so all distribute the block RAM of 128 memory cell for every prefix, prefix information separately stores into respectively in the different block RAMs.Article 5, prefix is inserted into, and judges that earlier its expansion prefix hashing Xiang Yuyi distributes expansion prefix hashing item of prefix whether identical, if difference is then redistributed the block RAM of 128 memory cell;
Situation 2: the expansion prefix hashing item EPH that is inserted into prefix has identical situation with the expansion prefix hashing item EPH that inserts prefix.Article 5, prefix is inserted into, judge earlier whether its expansion prefix hashing item EPH is identical with the expansion prefix hashing item EPH that distributes prefix, if it is identical, for example the expansion prefix hashing item EPH with the second prefix is identical, then the routing iinformation with the 5th prefix is inserted in the 2nd block RAM that has distributed, and do not need to redistribute block RAM, can not clash like this.Because, if two different prefix P1 and P2 are arranged, when the expansion prefix hashing item EPH of P1 and P2 is identical, EPE is identical scarcely for its expansion Prefix Expansion item, and the routing iinformation of these two prefixes necessarily is stored in the same block RAM that is distributed, because EPE is inequality for expansion Prefix Expansion item, so the address that is calculated in same block RAM is different certainly.
The computational process of expansion prefix absolute address` in expansion RAM is: as the block_addr that is numbered of the block RAM that distributes, the decimal number that expansion Prefix Expansion item EPE converts to is V (epe), and then this prefix institute corresponding informance unit absolute address` ram_addr that should store is:
ram_addr=128×block_addr+V(epe)。(formula 1)
When carrying out the list item deletion, just need to reclaim the block RAM that has distributed, because the block RAM that this scheme is distributed each expansion prefix all is 128 memory cell, so when block RAM reclaimed, whole expansion RAM memory can not produce fragmentation.If insert list item for this free block, only the numbering that need obtain this free block is distributed gets final product.
(5) tissue of hash units and extended menory
The membership credentials of first order hash units and expansion RAM unit, the second level as shown in figure 12, any four prefix prefix1 are wherein arranged, prefix2, prefix3, prefix4, next jumping is respectively AA, BB, CC, DD, prefix1 and prefix3 are Hash prefix HP, and prefix2 and prefix4 are expansion prefix EP, and the value of prefix3 is identical with the value of prefix4 expansion prefix hashing item EPH.
Hash table the 16th ' routing iinformation of h00fi+1 unit storage prefix1, its next jumping value is AA; The 16th ' information of h00ff+2 unit storage prefix2 expansion prefix hashing item EPH, EPE has distributed the 69th block RAM to its expansion Prefix Expansion item; The 16th ' routing iinformation of h0fff+3 unit storage prefix3, its next jumping is BB, also stores the information of prefix4 expansion prefix hashing item EPH simultaneously, EPE has distributed the 115th block RAM to its expansion Prefix Expansion item.
According to formula 1, the first address of the 69th block RAM is 69*128+0, and carrying out the low level zero padding, the expansion Prefix Expansion item EPE of prefix2 is extended to 7 bits, converting decimal number at last to is 85, and then the next hop information CC with prefix2 is inserted in 69*128+85 the address location of expansion RAM.Equally, the first address of the 115th block RAM is 115*128+0, and carrying out the low level zero padding, the expansion Prefix Expansion item EPE of prefix4 is extended to 7 bits, converting decimal number at last to is 42, and then the next hop information DD with prefix4 is inserted in 115*128+42 the address location of expansion RAM.
Above process is the membership credentials between first order hash units and the second level expansion RAM, and the grey item among Figure 12 is represented the valid prefix item, and the expansion RAM that with dashed lines brackets is the block RAM that is assigned with.In this scheme, first order Hash table and the second level expansion RAM of all expansion prefix EP are all organized by this way.
(6) realization of priority comparator
The flow chart of priority comparator as shown in figure 13, the course of work is as follows:
The first step: define 13 registers, represent the priority of each lookup result respectively, its priority is set is followed successively by from high to low: " Nh64 ", " Nh57-63 ", " Nh56 ", " Nh49-55 ", " Nh48 ", " Nh41-47 ", " Nh40 ", " Nh 33-39 ", " Nh 32 ", " Nh 25-31 ", " Nh 24 ", " Nh 17-23 ", " Nh 16 ", and be zero with these 13 initialization of register.
Second step: if the value in which register is non-vanishing, then the value of being deposited in this register is to wait to look into next jumping that destination address mates, and pairing next the jumping value of the longest matching prefix of this destination address is the value in the highest register of priority, should be worth as next jumping value output, and be institute and look into.
Illustrate: in the address search process of clauses and subclauses, if in the priority comparator, the value of register " Nh48 " is 8 ' h0a, the value of register " Nh32 " is 8 ' h0b, the value of register " Nh17-23 " is 8 ' h0c, the value of all the other registers still is 8 ' h00, then there are three occurrences this address as can be seen, and in these three occurrences, pairing next jumping value is for being respectively 8 ' h0a, 8 ' h0b, 8 ' h0c, because the priority of register " Nh 48 " is higher than register " Nh 32 " and register " Nh17-23 ", so the value 8 ' h0a in the register " Nh48 " is pairing next the jumping value of this address longest matching prefix.
(7) realization of hash-collision processing module
In the Hash calculation process, the hash-collision situation can take place, handle so will carry out hash-collision.
The design of hash-collision processing module must be considered following problem:
The first, search fast and new capability more.If the search capacity of hash-collision processing module is not high, then can influence the disposal ability of whole system.
The second, guarantee to handle all conflict situations, so just can guarantee whole functional completeness of searching system.
The 3rd, when the selection of hash function, must consider will guarantee to clash less as far as possible.
Based on above several problems, this paper searches module with CAM and handles hash-collision.When design, utilize different CAM to carry out hash-collision to different prefixes and handle, need the CAM of 6 kinds of width altogether, i.e. 24 bit wides, 32 bit wides, 40 bit wides, 48 bit wides, the CAM of 56 bit wides and 64 bit wides, handle the 24-31 position respectively, 32-39 position, 40-47 position, 48-55 position, 56-63 position and 64 long prefixes.The concrete tissue of CAM is identical with the organizational form of first order Hash and second level expansion RAM.As shown in figure 14, CAM handles Hash prefix HP and expansion prefix hashing item EPH, and the information stores of expansion Prefix Expansion item EPE is in block RAM.The computational process of expansion prefix absolute address` in expansion RAM is: as the block_addr that is numbered of the block RAM that distributes, the zero padding of expansion Prefix Expansion item EPE low level forms 7 bits, the decimal number V (epe) that this 7 bit is converted to again, then this prefix institute corresponding informance unit absolute address` ram_addr that should store is:
ram_addr=128×block_addr+V(epe)。
(8) overall work process
● the detailed process that routing table structure and list item insert specifically describes as follows as shown in Figure 5:
The first step: Hash table and expansion RAM are initialized as sky;
Second step: judge that according to being inserted into prefix length this prefix belongs to Hash prefix HP and still expands prefix EP, if HP, then this prefix is carried out Hash calculation, with gained cryptographic Hash index Hash table, if " F " field is " 0 " in the hash table that indexes, " F " field that then will this item is made as " 1 ", and " Nh (i) " field is made as pairing next the jumping value of this prefix; If " F " field is " 1 " in the respective items, show that this prefix item produces hash-collision, then carry out hash-collision and handle with CPE.
If EP, then the expansion prefix hashing item EPH with this prefix does Hash calculation, with gained cryptographic Hash index Hash table, judge whether hash table " E " field that indexes is " 0 ", if " E " field is " 0 ", then " E " field with the Hash table respective items is made as " 1 ", " Block_addr " field is the numbering for expansion Prefix Expansion item block RAM that EPE distributes, calculate relative address in the piece of block RAM with expansion Prefix Expansion item EPE, and next jumping value is put into corresponding memory cell; If " E " field is identical with the expansion prefix hashing item of the prefix of inserting this for the expansion prefix hashing item EPH part of " 1 " and this prefix, then next jumping value of this prefix is put into the indicated block RAM of distribution of this hash table " Block_addr " field, calculate relative address in the piece of block RAM with expansion Prefix Expansion item EPE, and next jumping value is put into corresponding memory cell; If " E " field shows that for the expansion prefix hashing item EPH part of " 1 " and this prefix is different with the expansion prefix hashing item of the prefix of inserting this this prefix item produces hash-collision, then carry out hash-collision and handle with CPE.
● IPv6 address search process as shown in Figure 6:
Carry out the IPv6 address search, must earlier routing table be carried out initialization, the initialization detailed process hereinafter described;
If the routing table initial work is finished, then can search: earlier IPv6 is done first order Hash lookup, according to circumstances judge whether to carry out the second level then and search the IPv6 address.Search procedure can be divided into three steps and finish: first order Hash table is searched, second level expansion RAM search with priority ratio.Specifically describe as follows:
The first step: 7 kinds of hash are in purpose IPv6 address search, promptly respectively in Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64 Hash lookup unit, preceding 16bits, 24bits, 32bits, 40bits, 48bits, 56bits and the 64bits of purpose IPv6 address done parallel search operation.If find occurrence, then next the jumping index value with correspondence outputs to preparation comparison in the priority comparator.
Second step: search in the second level in the unit and to also have longer prefix need do coupling to calculate if the first order is searched indication, then needing to carry out the second level searches: utilize the memory expansion technology in the second level, expansion Prefix Expansion item EPE can be inserted in the block RAM of 128 addresses.If the corresponding position of prefix is [i+1:i+7] (i is the length of Hash prefix), when searching, then according to destination address the (i+1~i+7) position calculates index value, utilize the addressing in the expansion RAM memory of this value, the pairing value in match address unit is next jumping value Nh (i+1, i+7), this next jumping value is outputed in the priority comparator compare.
The 3rd step: the value that will be input in the register of priority comparator preferentially compares, " next hop " value that output priority is the highest (being pairing next the jumping value of longest matching prefix) as next jumping value that this IPv6 destination address is mated, is the value of being found.
● route table items deletion and the concrete condition of revising are described below:
The renewal of route table items mainly comprises three kinds of operations, inserts, deletes and revise, and will determine to upgrade the position of list item respectively according to be updated prefix value.Insert operation for prefix, can insert according to the establishment algorithm of routing table.Revise and deletion action for prefix, then be similar to the process of address search, at first utilize and search algorithm, find this prefix entries, and then carry out corresponding modification and deletion action, can be divided into following two kinds of situations:
The 1st kind of situation: when the prefix that will revise or delete was the Hash prefix, then " F " field was set to " 0 ", empties the value of other field;
The 2nd kind of situation: when the prefix that will revise or delete was the expansion prefix, then " E " field and " Block_addr " field were set to " 0 " entirely, regain the memory space of expansion RAM then.

Claims (7)

1. search the IPv6 address lookup method of searching with extended menory based on Hash table for one kind, comprise that 1 is searched grader, 1 renewal grader, 7 parallel Hash processing unit Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64,6 extended menory processing unit RAM17_23, RAM25_31, RAM33_39, RAM41_47, RAM49_55, RAM57_63,7 hash-collision processing unit CPE16_23, CPE24_31, CPE32_39, CPE40_47, CPE48_55, CPE56_63, CPE64,1 priority comparing unit; It is characterized in that the IPv6 address is searched, and the IPv6 route table items is upgraded, concrete steps are:
A. according to the statistics of the IPv6 routing table regularity of distribution, route table items is divided into two kinds: a kind of is that length can be by 8 prefixes that divide exactly, and a kind of is that length can not be by 8 prefixes that divide exactly;
B. two kinds of route table items are stored with Hash table and extended menory respectively, with hash-collision processing unit processes hash-collision item;
C. the priority comparator can be selected the pairing next hop information of longest matching prefix;
D. in search procedure, search in module parallel search for searching object 7 the tunnel with purpose IPv6 address, the pairing next hop information of longest matching prefix is a lookup result;
E. in renewal process, can carry out route table items by Hash calculation and extended menory address computation and upgrade, comprise the routing table initialization, insert list item, remove entries and modification list item, concrete steps are:
Routing table initialization and list item insertion process are:
1. determine to need to upgrade the position of list item by the route table items that needs to upgrade: judge earlier whether the length that needs to upgrade route prefix can be divided exactly by 8;
If 2. can be divided exactly by 8, select corresponding processing module by upgrading grader, this prefix is carried out Hash calculation, with gained cryptographic Hash index Hash table, if the hash table that indexes has been put into other routing iinformation, then the pairing routing iinformation of this prefix is put into the hash-collision processing unit and handle,, then the routing iinformation of correspondence is put into this if the hash table that indexes is a null term;
If 3. prefix length cannot be divided exactly by 8, select corresponding processing module by upgrading grader, earlier the expansion prefix hashing item of this prefix is done Hash calculation, with gained cryptographic Hash index Hash table, if this list item is empty, then the first address with the second level memory cell of being distributed deposits this list item in, then pairing routing iinformation is put into the correspondence position of institute memory allocated unit, if this list item is not different from the expansion prefix hashing item that inserts prefix for the expansion prefix hashing item of empty and this prefix, then the pairing routing iinformation of this prefix is inserted in the second level memory cell of having distributed, the expansion prefix hashing item for empty and this prefix is not identical with the expansion prefix hashing item that inserts prefix as this list item, then this prefix is put into the hash-collision processing unit and handles.
List item deletion and modification process are:
1. select corresponding processing module by upgrading grader;
2. utilize lookup method, find route table items to be updated, then the routing iinformation of this list item is deleted or revised.
2. the IPv6 address lookup method of searching with extended menory of searching based on Hash table according to claim 1, it is characterized in that, among the step b length can be stored with Hash table by 8 route prefix of dividing exactly, length can not be done the two-stage storage with Hash table and extended menory by 8 prefixes that divide exactly.
3. the IPv6 address lookup method of searching with extended menory of searching based on Hash table according to claim 1, it is characterized in that, the prefix (n can not be divided exactly by 8) that among the step b with length is n can be divided into two part: 1~i and i+1~n, i be less than n and maximum can be by 8 integers of dividing exactly.In Hash table, and the pairing information of the value between i+1~n is stored in the extended menory, and the field that connects each other is arranged between the two-stage with the pairing information stores of the value between 1~i bit in the prefix.
4. the IPv6 address lookup method of searching with extended menory of searching based on Hash table according to claim 1, it is characterized in that, to weak point priority 13 registers from high to low are set from long according to prefix length in the priority comparator among the step c, realize the longest prefix match result.
5. the IPv6 address lookup method of searching with extended menory of searching based on Hash table according to claim 1, it is characterized in that 16 place values of among the step b Hash processing unit Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64 being calculated are directly carried out index as cryptographic Hash in Hash table.
6. the IPv6 address lookup method of searching with extended menory of searching based on Hash table according to claim 1, it is characterized in that, Hash processing unit Hash16 in the steps d, Hash24, Hash32, Hash40, Hash48, Hash56 and corresponding extended menory RAM17_23, RAM25_31, RAM33_39, RAM41_47, RAM49_55, RAM57_63 carries out the two-stage association, and and corresponding hash-collision processing unit CPE16_23, CPE24_31, CPE32_39, CPE40_47, CPE48_55, CPE56_63 constitutes 6 tunnel processing modules respectively, the 7th Hash processing unit hash64 and its corresponding hash-collision processing unit CPE64 constitute 1 tunnel processing module, 7 tunnel modules are parallel searches to determine its coupling prefix item the IPv6 address, in the result that 7 tunnel find out, compare to realize longest prefix match by the priority comparator.
7. according to claim 1ly search the IPv6 address lookup method of searching with extended menory, it is characterized in that step e finishes route table items renewal work by Hash calculation and extended menory address computation based on Hash table.
CN2010101459399A 2010-04-13 2010-04-13 Hash table-based and extended memory-based high-performance IPv6 address searching method Expired - Fee Related CN101827137B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010101459399A CN101827137B (en) 2010-04-13 2010-04-13 Hash table-based and extended memory-based high-performance IPv6 address searching method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010101459399A CN101827137B (en) 2010-04-13 2010-04-13 Hash table-based and extended memory-based high-performance IPv6 address searching method

Publications (2)

Publication Number Publication Date
CN101827137A true CN101827137A (en) 2010-09-08
CN101827137B CN101827137B (en) 2013-01-30

Family

ID=42690833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010101459399A Expired - Fee Related CN101827137B (en) 2010-04-13 2010-04-13 Hash table-based and extended memory-based high-performance IPv6 address searching method

Country Status (1)

Country Link
CN (1) CN101827137B (en)

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051543A (en) * 2012-11-01 2013-04-17 广州微仕科信息技术有限公司 Route prefix processing, lookup, adding and deleting method
CN103414603A (en) * 2013-07-31 2013-11-27 清华大学 Ipv6 deep packet inspection method based on Hash folding method
CN104917852A (en) * 2015-05-29 2015-09-16 中国科学院信息工程研究所 Data rapid processing method aiming at IPv6 address
CN105978814A (en) * 2015-03-13 2016-09-28 联发科技股份有限公司 Network device and method for querying data in network device
CN106844233A (en) * 2016-12-07 2017-06-13 深圳市德传技术有限公司 A kind of router service data caching method and system based on Hash table
CN106878185A (en) * 2017-04-13 2017-06-20 济南浪潮高新科技投资发展有限公司 A kind of message IP address match circuit and method
CN109039911A (en) * 2018-07-27 2018-12-18 烽火通信科技股份有限公司 It is a kind of to search the method and system that mode shares RAM based on HASH
CN109582598A (en) * 2018-12-13 2019-04-05 武汉中元华电软件有限公司 A kind of preprocess method for realizing efficient lookup Hash table based on external storage
CN109656832A (en) * 2017-10-11 2019-04-19 深圳市中兴微电子技术有限公司 A kind of look-up method, computer readable storage medium
CN110753133A (en) * 2018-07-23 2020-02-04 华为技术有限公司 Method for processing address and network equipment
CN111291058A (en) * 2020-03-17 2020-06-16 芯启源(南京)半导体科技有限公司 Method for optimizing storage LPM (low power management) rule based on hierarchical pc-trie structure
CN111352931A (en) * 2018-12-21 2020-06-30 中兴通讯股份有限公司 Hash collision processing method and device and computer readable storage medium
CN111835359A (en) * 2019-04-22 2020-10-27 深圳捷誊技术有限公司 Compression device, storage medium, and method and device for repeating information query and update
CN111935021A (en) * 2020-09-27 2020-11-13 翱捷智能科技(上海)有限公司 Method and system for quickly matching network data packets
CN112769704A (en) * 2021-02-09 2021-05-07 芯河半导体科技(无锡)有限公司 High-speed extensible IP route lookup hardware device based on hash table
CN112818185A (en) * 2021-04-20 2021-05-18 芯启源(南京)半导体科技有限公司 Method for searching longest prefix matching hardware system based on SRAM
CN113726660A (en) * 2021-08-27 2021-11-30 西安微电子技术研究所 Route finder and method based on perfect hash algorithm
CN117093881A (en) * 2023-10-19 2023-11-21 深圳大普微电子股份有限公司 Data compression method and device, electronic equipment and storage medium
CN117221224A (en) * 2023-11-09 2023-12-12 格创通信(浙江)有限公司 Table item construction and search method and device, network equipment and storage medium
CN117997834A (en) * 2024-04-03 2024-05-07 格创通信(浙江)有限公司 Lookup table updating and table item searching methods, device, network equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050141519A1 (en) * 2003-12-31 2005-06-30 Stmicroelectronics, Inc. Apparatus and method using hashing for efficiently implementing an IP lookup solution in hardware
CN1655533A (en) * 2004-02-09 2005-08-17 阿尔卡特公司 Filter based on longest prefix match algorithm
CN1863169A (en) * 2006-03-03 2006-11-15 清华大学 Route searching result cache method based on network processor
CN101350788A (en) * 2008-08-25 2009-01-21 中兴通讯股份有限公司 Method for mixed loop-up table of network processor inside and outside

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050141519A1 (en) * 2003-12-31 2005-06-30 Stmicroelectronics, Inc. Apparatus and method using hashing for efficiently implementing an IP lookup solution in hardware
CN1655533A (en) * 2004-02-09 2005-08-17 阿尔卡特公司 Filter based on longest prefix match algorithm
CN1863169A (en) * 2006-03-03 2006-11-15 清华大学 Route searching result cache method based on network processor
CN101350788A (en) * 2008-08-25 2009-01-21 中兴通讯股份有限公司 Method for mixed loop-up table of network processor inside and outside

Cited By (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051543B (en) * 2012-11-01 2015-09-09 广州键智桥网络技术有限公司 A kind of process of route prefix, search, increase and delet method
CN103051543A (en) * 2012-11-01 2013-04-17 广州微仕科信息技术有限公司 Route prefix processing, lookup, adding and deleting method
CN103414603A (en) * 2013-07-31 2013-11-27 清华大学 Ipv6 deep packet inspection method based on Hash folding method
CN103414603B (en) * 2013-07-31 2016-08-10 清华大学 Ipv6 deep packet inspection method based on Hash method for folding
CN105978814A (en) * 2015-03-13 2016-09-28 联发科技股份有限公司 Network device and method for querying data in network device
CN104917852A (en) * 2015-05-29 2015-09-16 中国科学院信息工程研究所 Data rapid processing method aiming at IPv6 address
CN104917852B (en) * 2015-05-29 2019-01-18 中国科学院信息工程研究所 A kind of data quick-processing method for the address IPv6
CN106844233A (en) * 2016-12-07 2017-06-13 深圳市德传技术有限公司 A kind of router service data caching method and system based on Hash table
CN106878185A (en) * 2017-04-13 2017-06-20 济南浪潮高新科技投资发展有限公司 A kind of message IP address match circuit and method
CN106878185B (en) * 2017-04-13 2020-04-07 浪潮集团有限公司 Message IP address matching circuit and method
CN109656832A (en) * 2017-10-11 2019-04-19 深圳市中兴微电子技术有限公司 A kind of look-up method, computer readable storage medium
CN110753133A (en) * 2018-07-23 2020-02-04 华为技术有限公司 Method for processing address and network equipment
US11570106B2 (en) 2018-07-23 2023-01-31 Huawei Technologies Co., Ltd. Address processing method and network device
CN109039911A (en) * 2018-07-27 2018-12-18 烽火通信科技股份有限公司 It is a kind of to search the method and system that mode shares RAM based on HASH
CN109582598A (en) * 2018-12-13 2019-04-05 武汉中元华电软件有限公司 A kind of preprocess method for realizing efficient lookup Hash table based on external storage
CN109582598B (en) * 2018-12-13 2023-05-02 武汉中元华电软件有限公司 Preprocessing method for realizing efficient hash table searching based on external storage
CN111352931A (en) * 2018-12-21 2020-06-30 中兴通讯股份有限公司 Hash collision processing method and device and computer readable storage medium
CN111835359A (en) * 2019-04-22 2020-10-27 深圳捷誊技术有限公司 Compression device, storage medium, and method and device for repeating information query and update
CN111291058A (en) * 2020-03-17 2020-06-16 芯启源(南京)半导体科技有限公司 Method for optimizing storage LPM (low power management) rule based on hierarchical pc-trie structure
CN111291058B (en) * 2020-03-17 2023-06-16 芯启源(南京)半导体科技有限公司 LPM rule storage method based on layered pc-trie structure
CN111935021B (en) * 2020-09-27 2020-12-25 翱捷智能科技(上海)有限公司 Method and system for quickly matching network data packets
CN111935021A (en) * 2020-09-27 2020-11-13 翱捷智能科技(上海)有限公司 Method and system for quickly matching network data packets
CN112769704A (en) * 2021-02-09 2021-05-07 芯河半导体科技(无锡)有限公司 High-speed extensible IP route lookup hardware device based on hash table
CN112818185A (en) * 2021-04-20 2021-05-18 芯启源(南京)半导体科技有限公司 Method for searching longest prefix matching hardware system based on SRAM
CN113726660A (en) * 2021-08-27 2021-11-30 西安微电子技术研究所 Route finder and method based on perfect hash algorithm
CN113726660B (en) * 2021-08-27 2022-11-15 西安微电子技术研究所 Route finder and method based on perfect hash algorithm
CN117093881A (en) * 2023-10-19 2023-11-21 深圳大普微电子股份有限公司 Data compression method and device, electronic equipment and storage medium
CN117093881B (en) * 2023-10-19 2024-01-12 深圳大普微电子股份有限公司 Data compression method and device, electronic equipment and storage medium
CN117221224A (en) * 2023-11-09 2023-12-12 格创通信(浙江)有限公司 Table item construction and search method and device, network equipment and storage medium
CN117221224B (en) * 2023-11-09 2024-02-06 格创通信(浙江)有限公司 Table item construction and search method and device, network equipment and storage medium
CN117997834A (en) * 2024-04-03 2024-05-07 格创通信(浙江)有限公司 Lookup table updating and table item searching methods, device, network equipment and medium

Also Published As

Publication number Publication date
CN101827137B (en) 2013-01-30

Similar Documents

Publication Publication Date Title
CN101827137B (en) Hash table-based and extended memory-based high-performance IPv6 address searching method
US7418505B2 (en) IP address lookup using either a hashing table or multiple hash functions
CN100445999C (en) Data storaging and searching method
CN102377664B (en) TCAM (ternary content addressable memory)-based range matching device and method
CN100413285C (en) High-speed multi-dimension message classifying algorithm design and realizing based on network processor
EP1551141B1 (en) Apparatus and method using hashing for efficiently implementing an IP lookup solution in hardware
CN102281196B (en) Decision tree generation method and equipment, based on decision tree packet classification method and equipment
US6434144B1 (en) Multi-level table lookup
CN101753445A (en) Fast flow classification method based on keyword decomposition hash algorithm
US6985483B2 (en) Methods and systems for fast packet forwarding
US20110137930A1 (en) Method and apparatus for generating a shape graph from a binary trie
CN101345707B (en) Method and apparatus for implementing IPv6 packet classification
CN101594319B (en) Entry lookup method and entry lookup device
CN107291785A (en) A kind of data search method and device
CN104580027A (en) OpenFlow message forwarding method and equipment
CN103546378A (en) Multi-match 2-level hierarchical search method for ranges on basis of TCAM (ternary content addressable memory)
CN106302172A (en) Support Hash lookup and the storage of route querying, lookup method and device simultaneously
CN101848248B (en) Rule searching method and device
CN102045412B (en) Method and equipment for carrying out compressed storage on internet protocol version (IPv)6 address prefix
CN114884877B (en) IPv6 route searching method combining hash table and HOT
CN105515997A (en) BF_TCAM (Bloom Filter-Ternary Content Addressable Memory)-based high-efficiency range matching method for realizing zero range expansion
CN101500012B (en) Packet classification method and system
CN101277252A (en) Method for traversing multi-branch Trie tree
CN110191057B (en) Route searching method and route equipment
CN101556610B (en) Table creating and searching method used by network processor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130130

Termination date: 20130413