CN101827137B - 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
CN101827137B
CN101827137B CN2010101459399A CN201010145939A CN101827137B CN 101827137 B CN101827137 B CN 101827137B CN 2010101459399 A CN2010101459399 A CN 2010101459399A CN 201010145939 A CN201010145939 A CN 201010145939A CN 101827137 B CN101827137 B CN 101827137B
Authority
CN
China
Prior art keywords
hash
prefix
expanded
searching
length
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.)
Expired - Fee Related
Application number
CN2010101459399A
Other languages
Chinese (zh)
Other versions
CN101827137A (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
Xian University of Posts and Telecommunications
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 network connections can be become macroreticular, intercoms mutually by IP (Internet Protocol) agreement.And the main function of router is the forwarding of IP packet, namely 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 packet forwarding.
In order to solve the problem of route prefix number rapid growth in the route information table, IP address addressing scheme without 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, greatly increased the complexity of IP address search.
Growing along with the network user and communication service, cause the IPv4 address assignment to face exhaustion, and the restriction of the 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.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 the 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 to a great extent design cost and system power dissipation, the routing table of same list item quantity, use multistage TCAM to carry out cascade and just can finish searching work, when Design of Engineering Systems, the cost that it is high and large 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 larger to cause searching delay, the system searching Efficiency Decreasing; 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, can not realize the IPv6 address search so that directly use this scheme.
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, the method has high-speed searching efficient, strong, the space utilisation high of extensibility, can be used in the high-performance IPv 6 core router.
(1) for convenience of description, at first be defined as follows:
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 the method: HP (16), HP (24), HP (32), HP (40), HP (48), HP (56) and HP (64);
Define 2 expanded 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 expanded prefix of indication in integer and 1≤m≤6 the method 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 expanded prefix EP have consisted of whole routing table;
Define 3 expanded prefix Hash term EPH (n) (Expanded Prefix Hashing Segment) and expanded prefix extension EPE (n) (Expanded Prefix Expanded Segment): length is that the expanded 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 expanded prefix is called EPH (n), and i+1~n is called expanded prefix extension EPE (n).For example, length is the expanded prefix 2a01:c*/20 of 20 bits, and its expanded prefix Hash term EPH (20) is 2a01, and its expanded prefix extension 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, namely 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 expanded prefix item institute respective value with RAMp_q, the RAM memory address is calculated with expanded prefix extension 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 in the method CPE16_23, CPE24_31, CPE32_39, CPE40_47, CPE48_55, CPE56_63, CPE64.
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:
Development along with the IPv6 network, IPv6 route table items number increases gradually, and present certain regularity of distribution, such as Fig. 2 (routing table in the upper 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 features:
1. IPv6 route prefix length is all less than 64 bits;
2. length can be very large by the 8 prefix distribution proportions of dividing exactly, and accounts for altogether more than 93% of routing table.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% etc.;
3. according to the data of Potaroo website statistics, length can be fast especially by the 8 prefix growth rate that divide exactly, and whole IPv6 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 processed 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 to be searched the second level and can be finished and search.In order to improve the performance of whole seeking system, the prefix regularity of distribution that the 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 process with extended menory the prefix of other length, such 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 of the IPv6 address search based on Hash and extended menory in this paper that Here it is.
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 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 impact 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 expanded prefix extension EPE, and namely length is the prefix of i+1~i+7 bit, and E=1 represents that there is expanded prefix extension EPE in this, and E=0 represents that there is not the expanded prefix extension in this;
2. Block_addr: be expanded prefix extension 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 expanded prefix extension EPE can change into decimal number " y ", and then the corresponding down hop 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 the down hop 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 the corresponding down hop 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 corresponding down hop value Nh (i+1, i+7) output.During H=1, Nh (i+1, i+7) is complete zero, during F=1, and output Nh (i+1, i+7); When this was inserted prefix information, the F field then was made as 1;
2. Nh (i+1, i+7) field is the corresponding down hop value of this prefix item.
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 expanded prefix Hash term EPH, the expansion RAM of the second level is deposited the information of expanded prefix extension EPE, connects by signal " E " between this two-stage look-up.In search procedure, if " F " in the Hash term is " 1 ", represent that then this is occurrence; If " E " in the hash table is " 1 ", then longer occurrence also need to be searched in the expression address of searching in expansion RAM; If " H " in the expansion RAM item is " 1 ", then represent the down hop index value of value for mating in this expansion RAM item.
(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 corresponding 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 corresponding next hop information of longest matching prefix is lookup result;
The concrete search procedure of this method is as shown in Figure 6:
Carry out the IPv6 address search, must first routing table be carried out initialization, the initialization detailed process hereinafter described;
If the routing table initial work is finished, then can search the IPv6 address: first IPv6 is done first order Hash lookup, then according to circumstances judge whether to carry out the second level and search.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, namely respectively in Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64 Hash lookup unit, front 16bits, 24bits, 32bits, 40bits, 48bits, 56bits and the 64bits of purpose IPv6 address done the parallel search operation.If find occurrence, then the down hop index value with correspondence outputs to preparation comparison in the priority comparator.
Second step: search in the second level and to also have longer prefix need to do coupling in the unit 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, expanded prefix extension 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 corresponding value in match address unit is down hop value Nh (i+1, i+7), this down hop 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 the corresponding down hop value of longest matching prefix) as the down hop value that this IPv6 destination address mates, is the value of finding.
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 first 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 corresponding routing iinformation of this prefix is put into the hash-collision processing unit and process, if the hash table that indexes is null term, then the routing iinformation of correspondence is put into this;
If 3. prefix length cannot be divided exactly by 8, select corresponding processing module by upgrading grader, first the expanded prefix Hash term 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 distributing deposits this list item in, then corresponding routing iinformation is put into the correspondence position of institute memory allocated unit, if this list item is not different from the expanded prefix Hash term of inserting prefix for the expanded prefix Hash term of empty and this prefix, then the corresponding routing iinformation of this prefix is inserted in the second level memory cell of having distributed, the expanded prefix Hash term for empty and this prefix is not identical with the expanded prefix Hash term of inserting prefix such as this list item, then this prefix is put into the hash-collision processing unit and processes.
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 or expanded 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 the corresponding down hop 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 with CPE and process.
If EP, then the expanded prefix Hash term 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 expanded prefix extension block RAM that EPE distributes, calculate relative address in the piece of block RAM with expanded prefix extension EPE, and the down hop value is put into corresponding memory cell; If " E " field is identical with the expanded prefix Hash term of the prefix of inserting this for the expanded prefix Hash term EPH part of " 1 " and this prefix, then the down hop value of this prefix is put into the indicated distribution block RAM of this hash table " Block_addr " field, calculate relative address in the piece of block RAM with expanded prefix extension EPE, and the down hop value is put into corresponding memory cell; If " E " field shows that for the expanded prefix Hash term EPH part of " 1 " and this prefix is different with the expanded prefix Hash term of the prefix of inserting this this prefix item produces hash-collision, then carry out hash-collision with CPE and process.
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 the down hop value is A, 2001:2abc:9: :/36, the down hop value is B, 2abc:2001:9: :/36, the down hop value is C.When inserting prefix 2001:2abc:: in the time of/32, judging first this prefix length is 32 bits, can know that this prefix is the Hash prefix, obtaining the result through Hash calculation is 16 ' h0abd, then judge that 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 process, 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 front 32 is 16 ' h0abd, then judge that " E " field in h0abd unit of Hash32 the 16th ' is " 0 ", " E " field that then will this item is made as " 1 ", distribute 8 bit wides for again this expanded prefix extension 9 (binary system can be expressed as 1001000), the piece expansion RAM of 128 memory cell, the numbering of this block RAM is filled into " Block_addr " field of this hash table, the down hop 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 front 32 is 16 ' h0abd, then judge that " E " field in h0abd unit of Hash32 the 16th ' is " 1 ", but the expanded prefix Hash term EPH of this prefix is different with the expanded prefix Hash term of inserting prefix, processes 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 according to be updated prefix value respectively the position of list item.For the prefix update, 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 the 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 expanded prefix, then " E " field and " Block_addr " field were set to entirely " 0 ", then regain the memory space of expansion RAM.
In fact also the renewal of routing table can be regarded as the another kind of function of address search, find exactly specific position, carry out update or deletion action in this position.
Length can be stored with Hash table by 8 route prefix of dividing exactly, length can not be done two-level memory with Hash table and extended menory by 8 prefixes that divide exactly.
Be 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 with length, i be less than n and maximum can be by 8 integers of dividing exactly.The corresponding information of value between 1~i bit in the prefix is stored in the Hash table, and the corresponding 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.As shown in Figure 4, Hash table is deposited the information of Hash prefix HP and expanded prefix Hash term EPH, and the expansion RAM of the second level is deposited the information of expanded prefix extension EPE, connects by signal " E " between this two-stage look-up.In search procedure, if " F " in the Hash term is " 1 ", represent that then this is occurrence; If " E " in the hash table is " 1 ", then longer occurrence also need to be searched in the expression address of searching in expansion RAM; If " H " in the expansion RAM item is " 1 ", then represent the down hop index value of value for mating in this expansion RAM item.
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 respectively the priority of each lookup result, 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, the value of then depositing in this register is the down hop that destination address to be checked mates, and the corresponding down hop value of the longest matching prefix of this destination address is the value in the highest register of priority, should be worth as the output of down hop value, and be institute and look into.
16 place values that Hash processing unit Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64 calculate 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 consists of respectively 6 tunnel processing modules, the 7th Hash processing unit hash64 and its corresponding hash-collision processing unit CPE64 consist of 1 tunnel processing module, 7 tunnel modules are parallel searches to determine its coupling prefix item to 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 according to be updated prefix value respectively the position of list item, for the prefix update, 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 the 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 expanded prefix, then " E " field and " Block_addr " field were set to entirely " 0 ", then regain the memory space of expansion RAM.
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 the method is shared is added up, and is as follows:
According to definition, to Hash table Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, the Hash64 address bus with 20 bit wides, the data/address bus of 17 bit wides, like this, Hash table is shared being stored as altogether: 2 20* (2 4+ 1) * 7=14.875 (MB);
If expanded prefix calculates by 7%, 4587 expanded prefixes are arranged in 65536 routing tables, and the shared memory space of each expanded 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 altogether needs and be: 4587 * 1k=4587k (b)=0.4587 (MB);
If collision rate distributes by the prefix distribution proportion, (this collision rate statistics obtains if the collision rate by 9.86% calculates, can reduce along with the increase of the Hash table degree of depth), always have 6462 hash-collision can occur, when processing hash-collision, needed CAM is: 28.75kB;
Can obtain, if 65536 routing table uses this programme altogether to need RAM to be 15.33MB, need CAM 28.75kB.
Can also deposit more multirouting list item owing to preset 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 that search efficiency is high, space utilisation is high, 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 expanded prefix in extended menory;
Figure 10 is 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
The method is used 7 road Hash table parallel searchs, 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 to consider every kind of Hash table is all different, and how first order Hash table and second level expansion RAM are organized.
Because have certain relation between Hash table and the expansion RAM: Hash table Hashi can deposit Hash prefix HP (i) and expanded prefix Hash term 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 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 to 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 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 process with CAM respectively, because in the situation that does not affect systematic function, CAM can use a memory cycle to finish once and search, and the design complexities of CAM and power dissipation ratio TCAM are low.
(2) search grader and design and the realization of upgrading grader
Search grader and get front 16,24,32,40,48,56,64 of IPv6 to be checked address, send into respectively parallel search in 7 tunnel modules.For example, purpose IPv6 to be checked 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 processing 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 corresponding routing iinformation of this list item is sent to and carries out update in the Hash32 module; 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 arranges different bit wides.The involved XOR Folding algorithm of this paper is divided into following two kinds of situations:
The first 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 several subdatas 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 to 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 front 48 or 48 bit lengths of IPv6 address.
Second step: to this value xor operation that reduces by half, can obtain median B1[15:0]:
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.
The second 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 several subdatas that directly are divided into equal length, then will misplace between the subdata, gather into and carry out again xor operation after equating with the index value bit wide.
If one 40 binary number B[39:0 is arranged].The index value that need to 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 front 40 or 40 bit lengths of IPv6 address.
Second step: to this value xor operation that reduces by half, can obtain median B1[15:0] 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 process 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 finds in the Hash table.Therefore, can solve searching of 1-16 position long data memory time with once accessing, and the hash-collision situation can not occur in this unit.
(4) realization of extended menory
A. the calculating of expanded prefix extension EPE address in expansion RAM
A known expanded prefix EP can obtain its expanded prefix extension EPE (i, n), and 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 δ as index, the corresponding 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.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 expanded 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 expanded prefix, the effective information of its high 32 expanded prefix Hash term EPH stores among the Hash table Hash32, and low level information is stored in the expansion RAM 3339.
B. the distribution of expansion RAM and recovery
This trifle is mainly described 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: the expanded prefix Hash term EPH that is inserted into prefix is not identical with the expanded prefix Hash term EPH that inserts prefix.If inserted 4 all different prefixes, and the expanded prefix Hash term EPH of 4 prefixes is not identical, 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 first whether its expanded prefix Hash term is identical with the expanded prefix Hash term of distributing prefix, if different, then redistributes the block RAM of 128 memory cell;
Situation 2: the expanded prefix Hash term EPH that is inserted into prefix has identical situation with the expanded prefix Hash term EPH that inserts prefix.Article 5, prefix is inserted into, judge first whether its expanded prefix Hash term EPH is identical with the expanded prefix Hash term EPH that distributes prefix, if identical, for example the expanded prefix Hash term 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 expanded prefix Hash term EPH of P1 and P2 is identical, EPE is identical scarcely for its expanded prefix extension, and the routing iinformation of these two prefixes necessarily is stored in the same block RAM that distributes, because expanded prefix extension EPE is not identical, so the address that calculates in same block RAM is certainly different.
The computational process of expanded prefix absolute address` in expansion RAM is: as the block_addr that is numbered of the block RAM that distributes, the decimal number that expanded prefix extension 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 expanded prefix 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 need to obtain the numbering that this free block distributes is got 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, down hop is respectively AA, BB, CC, DD, prefix1 and prefix3 are Hash prefix HP, and prefix2 and prefix4 are expanded prefix EP, and the value of prefix3 is identical with the value of prefix4 expanded prefix Hash term EPH.
Hash table the 16th ' routing iinformation of h00fi+1 unit storage prefix1, its down hop value is AA; The 16th ' information of h00ff+2 unit storage prefix2 expanded prefix Hash term EPH has distributed the 69th block RAM for its expanded prefix extension EPE; The 16th ' routing iinformation of h0fff+3 unit storage prefix3, its down hop is BB, the information of also storing prefix4 expanded prefix Hash term EPH has simultaneously distributed the 115th block RAM for its expanded prefix extension EPE.
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 expanded prefix extension EPE of prefix2 is extended to 7 bits, converting at last decimal number 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 expanded prefix extension EPE of prefix4 is extended to 7 bits, converting at last decimal number 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 represents 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 expanded 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 respectively the priority of each lookup result, 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, the value of then depositing in this register is the down hop that destination address to be checked mates, and the corresponding down hop value of the longest matching prefix of this destination address is the value in the highest register of priority, should be worth as the output of down hop value, 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, can find out that then there are three occurrences this address, and in these three occurrences, corresponding down hop 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 the corresponding down hop value of this address longest matching prefix.
(7) realization of hash-collision processing module
In the Hash calculation process, the hash-collision situation can occur, process so will carry out hash-collision.
The design of hash-collision processing module must be considered following problem:
The first, fast finding reaches more new capability.If the search capacity of hash-collision processing module is not high, then can affect the disposal ability of whole system.
The second, guarantee to process all conflict situations, so just can guarantee the functional completeness of whole seeking 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 processes hash-collision.When design, utilize different CAM to carry out hash-collision to different prefixes and process, altogether need the CAM of 6 kinds of width, i.e. 24 bit wides, 32 bit wides, 40 bit wides, 48 bit wides, the CAM of 56 bit wides and 64 bit wides, process respectively the 24-31 position, 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 processes Hash prefix HP and expanded prefix Hash term EPH, and the information of expanded prefix extension EPE is stored in the block RAM.The computational process of expanded prefix absolute address` in expansion RAM is: as the block_addr that is numbered of the block RAM that distributes, the zero padding of expanded prefix extension EPE low level forms 7 bits, the decimal number V (epe) that again this 7 bit is converted to, 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 or expanded 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 the corresponding down hop 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 with CPE and process.
If EP, then the expanded prefix Hash term 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 expanded prefix extension block RAM that EPE distributes, calculate relative address in the piece of block RAM with expanded prefix extension EPE, and the down hop value is put into corresponding memory cell; If " E " field is identical with the expanded prefix Hash term of the prefix of inserting this for the expanded prefix Hash term EPH part of " 1 " and this prefix, then the down hop value of this prefix is put into the indicated distribution block RAM of this hash table " Block_addr " field, calculate relative address in the piece of block RAM with expanded prefix extension EPE, and the down hop value is put into corresponding memory cell; If " E " field shows that for the expanded prefix Hash term EPH part of " 1 " and this prefix is different with the expanded prefix Hash term of the prefix of inserting this this prefix item produces hash-collision, then carry out hash-collision with CPE and process.
● IPv6 address search process as shown in Figure 6:
Carry out the IPv6 address search, must first routing table be carried out initialization, the initialization detailed process hereinafter described;
If the routing table initial work is finished, then can search the IPv6 address: first IPv6 is done first order Hash lookup, then according to circumstances judge whether to carry out the second level and search.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, namely respectively in Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64 Hash lookup unit, front 16bits, 24bits, 32bits, 40bits, 48bits, 56bits and the 64bits of purpose IPv6 address done the parallel search operation.If find occurrence, then the down hop index value with correspondence outputs to preparation comparison in the priority comparator.
Second step: search in the second level and to also have longer prefix need to do coupling in the unit 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, expanded prefix extension 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 corresponding value in match address unit is down hop value Nh (i+1, i+7), this down hop 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 the corresponding down hop value of longest matching prefix) as the down hop value that this IPv6 destination address mates, is the value of finding.
● 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 according to be updated prefix value respectively the position of list item.For the prefix update, 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 the 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 expanded prefix, then " E " field and " Block_addr " field were set to entirely " 0 ", then regain the memory space of expansion RAM.

Claims (4)

1. search the IPv6 address lookup method of searching with extended menory based on Hash table for one kind, realize that the method uses 1 and search grader; 1 renewal grader; 7 parallel Hash processing unit Hash16, Hash24, Hash32, Hash40, Hash48, Hash56, Hash64, its respectively storage length be the Hash table of 16,24,32,40,48,56,64 bit Hash prefix items; 6 extended menory RAM17_23, RAM25_31, RAM33_39, RAM41_47, RAM49_55, RAM57_63, it deposits the corresponding down hop value of expanded prefix item, and wherein expanded prefix is that two length can be by 8 all prefixes that divide exactly between the Hash prefix item; 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, specifically length can be stored with Hash table by 8 route prefix of dividing exactly, length can not be done two-level memory with Hash table and extended menory by 8 route prefix of dividing exactly; Use hash-collision processing unit processes hash-collision item;
C. the priority comparator is selected the corresponding next hop information of longest matching prefix;
D. by 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 consists of respectively 6 tunnel processing modules, the 7th Hash processing unit hash64 and its corresponding hash-collision processing unit CPE64 consist of 1 tunnel processing module, in search procedure, 7 tunnel processing modules are parallel searches to determine its coupling prefix item to purpose IPv6 address, in whole coupling prefixes that 7 tunnel processing modules find out, compare to realize longest prefix match by the priority comparator, the corresponding next hop information of longest matching prefix is lookup result;
E. in renewal process, 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 first whether the length that needs to upgrade route prefix can be divided exactly by 8;
If 2. can be divided exactly by 8, select the d step by the renewal grader and describe corresponding processing module in 7 processing modules, 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 corresponding routing iinformation of this prefix is put into the hash-collision processing unit and process, if the hash table that indexes is null term, then the routing iinformation of correspondence is put into this;
If 3. prefix length cannot be divided exactly by 8, select corresponding processing module by upgrading grader, first the expanded prefix Hash term 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 extended menory unit that distributes deposits this list item in, then corresponding routing iinformation is put into the correspondence position of the extended menory unit that distributes, if this list item is not different from the expanded prefix Hash term of inserting prefix for the expanded prefix Hash term of empty and this prefix, then the corresponding routing iinformation of this prefix is inserted in the extended menory unit that has distributed, the expanded prefix Hash term for empty and this prefix is not identical with the expanded prefix Hash term of inserting prefix such as this list item, then this prefix is put into the hash-collision processing unit and processes.
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, the prefix that among the step b with length is n can be divided into two part: 1~i and i+1~n, i is can be by 8 integers of dividing exactly less than n and maximum, n is can not be by 8 integers of dividing exactly, the corresponding information of value between 1~i bit in the prefix is stored in the Hash table, and the corresponding 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.
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, 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.
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 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.
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 CN101827137A (en) 2010-09-08
CN101827137B true 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)

Families Citing this family (19)

* 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
CN103414603B (en) * 2013-07-31 2016-08-10 清华大学 Ipv6 deep packet inspection method based on Hash method for folding
US9654397B2 (en) * 2015-03-13 2017-05-16 Mediatek Inc. Method for looking up data in hash tables and associated network device
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
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
CN110753133B (en) 2018-07-23 2022-03-29 华为技术有限公司 Method for processing address and network equipment
CN109039911B (en) * 2018-07-27 2021-02-26 烽火通信科技股份有限公司 Method and system for sharing RAM based on HASH searching mode
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
CN111835359B (en) * 2019-04-22 2022-03-22 深圳捷誊技术有限公司 Compression device, storage medium, and method and device for repeating information query and update
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
CN112769704B (en) * 2021-02-09 2023-04-18 芯河半导体科技(无锡)有限公司 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
CN113726660B (en) * 2021-08-27 2022-11-15 西安微电子技术研究所 Route finder and method based on perfect hash algorithm
CN117093881B (en) * 2023-10-19 2024-01-12 深圳大普微电子股份有限公司 Data compression method and device, electronic 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

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

Also Published As

Publication number Publication date
CN101827137A (en) 2010-09-08

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
EP1551141B1 (en) Apparatus and method using hashing for efficiently implementing an IP lookup solution in hardware
US6434144B1 (en) Multi-level table lookup
CN102377664B (en) TCAM (ternary content addressable memory)-based range matching device and method
CN100445999C (en) Data storaging and searching method
US6985483B2 (en) Methods and systems for fast packet forwarding
CN100413285C (en) High-speed multi-dimension message classifying algorithm design and realizing based on network processor
US20110137930A1 (en) Method and apparatus for generating a shape graph from a binary trie
CN101594319B (en) Entry lookup method and entry lookup device
CN101753445A (en) Fast flow classification method based on keyword decomposition hash algorithm
CN103107945A (en) System and method of quick searching Internet protocol version 6 (IPV6) route
CN103546378A (en) Multi-match 2-level hierarchical search method for ranges on basis of TCAM (ternary content addressable memory)
CN101345707A (en) Method and apparatus for implementing IPv6 packet classification
CN114884877B (en) IPv6 route searching method combining hash table and HOT
CN106416152A (en) Lookup device, lookup configuration method and lookup method
CN110191057B (en) Route searching method and route equipment
CN101848248A (en) Rule searching method and device
CN101277252A (en) Method for traversing multi-branch Trie tree
CN101500012B (en) Packet classification method and system
CN105515997A (en) BF_TCAM (Bloom Filter-Ternary Content Addressable Memory)-based high-efficiency range matching method for realizing zero range expansion
CN113315705A (en) Flexible IP addressing method and device based on single Hash bloom filter
CN102984071B (en) Method for organizing routing table of segment address route and method for checking route
CN110995876B (en) Method and device for storing and searching IP
Kekely et al. Packet classification with limited memory resources

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