CN103051543A - Route prefix processing, lookup, adding and deleting method - Google Patents

Route prefix processing, lookup, adding and deleting method Download PDF

Info

Publication number
CN103051543A
CN103051543A CN2012104322255A CN201210432225A CN103051543A CN 103051543 A CN103051543 A CN 103051543A CN 2012104322255 A CN2012104322255 A CN 2012104322255A CN 201210432225 A CN201210432225 A CN 201210432225A CN 103051543 A CN103051543 A CN 103051543A
Authority
CN
China
Prior art keywords
prefix
node
mask
trie
longest
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
CN2012104322255A
Other languages
Chinese (zh)
Other versions
CN103051543B (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.)
Guangzhou Aipu Road Network Technology Co Ltd
Original Assignee
GUANGZHOU WISCO INFORMATION TECHNOLOGY Co Ltd
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 GUANGZHOU WISCO INFORMATION TECHNOLOGY Co Ltd filed Critical GUANGZHOU WISCO INFORMATION TECHNOLOGY Co Ltd
Priority to CN201210432225.5A priority Critical patent/CN103051543B/en
Publication of CN103051543A publication Critical patent/CN103051543A/en
Application granted granted Critical
Publication of CN103051543B publication Critical patent/CN103051543B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a route prefix processing, lookup, adding and deleting method. A multi-way Trie tree is utilized to artfully design a Trie node data structure, and the technical problems that the traditional routing table realization method can not satisfy the quick route lookup requirement, the memory access times are reduced, the cost of construction is high and the use efficiency is low can be solved by a prefix list item storage data structure and algorithm, a high-speed longest route prefix lookup method, a quick route prefix increasing method and a quick route prefix deleting method. The route prefix processing, lookup, adding and deleting method has the advantages of high lookup speed, high update speed and good use benefit.

Description

A kind of processing of route prefix, search, increase and delet method
Technical field
The invention belongs to network communications technology field, be specifically related to a kind of route prefix processing, search, increase and delet method.
Background technology
Internet development rapidly, core router, with the interface bandwidth of the network equipment of route forwarding capability 10G even more than the 40G all, also at 1,000,000 the order of magnitude, this requires the large capacity of routing table support to the list item capacity of IPV4FIB, and seek rate is very fast; The additions and deletions of routing table operation is also very frequent, and the inner route of per second changes hundreds of can occur under the worst case, searches correctness for adapting to faster dynamic change of route table items and assurance, and what this required routing table also will have good renewal speed.
Route querying is from enabling CIDR(without the classification inter-domain routing) since, its focus is with regard on the problem that concentrates on longest prefix match.Various Routing Algorithms just are presented as data structure that longest prefix match is searched and the corresponding algorithm of searching with it.
Existing route table implementation method mainly contains: a) hash table; B) Radix Trie; C) path compression Trie tree; D) Multi-branch Trie Tree; E) TCAM; F) various FPGA algorithms (such as the gupta algorithm).Wherein a) and b) to IPV4, searching number of times is 1-32 time, average out to 16 times does not satisfy the requirement of fast routing lookups; C) suitable reduction Trie height of tree degree, memory accesses reduces, seek rate slightly is better than a) and b); D) by selecting suitable wide larger reduction Trie height of tree degree of step, it is the better method that software is realized route, each is variant again in realization, the Tries tree structure that separates based on index is arranged, Multi-branch Trie Tree based on hash index, with the method for using special processing in multi-branched Trie tree etc., in fact the Trie tree algorithm speed of these special processings is not the fastest, and how not have to realize the fast method of renewal; E) and advantage f) be simple in structure, seek rate is fast; Shortcoming is that cost is expensive, supports that route entry is limited, do not support to upgrade fast, and some hardware algorithm can cause the memory service efficiency not high.
Multi-branch Trie Tree is most popular method in the route querying.Here it is briefly introduced.Trie is a kind of tree form data structure, and its utilization has been preserved common prefix and come conserve space; Its seek rate is fast, and seek rate and key length, the Trie tree degree of depth are relevant, and be irrelevant with number of prefixes; Its renewal speed is also very fast, because the main cost that upgrades is to search and revise affected Trie tree node.(1) basic Trie tree is binary system Trie tree (Binary Trie), and the memory Average visits is many, therefore search with renewal speed not high.As to ipv4, need reference to storage 1-32 time.(2) for reducing memory access speed, must reduce the degree of depth of tree, path compression Trie tree is a kind of method wherein.The method has kept the feature of binary system Trie tree, but delete the subtree root node that those do not contain single branch intermediate node of forwarding information or meet the full binary tree rule, thereby the node of some lower levels is risen on the higher level, the degree of depth of tree is reduced.Therefore, each node needs the bit of safeguarding that a variable indicates next step to check; The prefix node need to be preserved the Bit String of address prefix.This method increases the check of algorithm and looks for polygamy, and is in addition, when prefix assignment is not sparse, also limited to improving the seek rate contribution.(3) another kind of method is exactly Multi-branch Trie Tree.Multi-branch Trie Tree has adopted wide and Prefix Expansion technology of suitable step; Each step of searching checks a plurality of bits in the address; Going on foot wide is K, then each node maximum branch tree 2 KThe step in each step wide can be identical, also can be different; To going on foot wide K, its value is larger, and seek rate is faster, and internal memory expends also larger, such as IPV4, K is 1 and deteriorates to binary system Trie tree, and memory consumption is economized most, and K is 32, then only need search for 1 time, internal memory expends and is 4G, so multi-fork Trie tree structure need to select the suitable step wide, makes compromise between speed and memory consumption.In addition, each step in the multi-fork Trie tree search procedure needs to check a plurality of bits, therefore can not support the address prefix of random length, needs to use the Prefix Expansion technology, and being about to the IP prefix length is not the IP prefix of the integral multiple of wide K of step, expands to the integral multiple of K.This can copy to a route prefix in a plurality of storage item, causes the memory space utilance to descend, and needs simultaneously to introduce other auxiliary strategies and solves.At present, adopt the Trie mode to realize that routing table/longest-prefix table is searched the Patents of aspect as follows: the disclosed publication number of State Intellectual Property Office is CN 1414745A, and name is called a kind of method that realizes fast routing lookups based on the IP address.The method adopts 64K table and expansion table (expansion table is the Trie tree in fact, can correspond to the follow-up 16-4-4-4-4Trie tree of mentioning of the present invention), and the method has realized the fast finding of route, but does not mention the problem how to upgrade fast.Publication number is CN101141389A, and name is called enhancing multidigit TRI E tree searching method and device.The method is utilized Trie, has improved the relation between expansion bitmap and the superior and the subordinate's tree node, has realized the routing table solution that high power capacity, linear speed are searched in conjunction with FPGA and DDRII.Routing update is finished by other subsystems, and is unspecified.Publication number is CN 101577662A, and name is called a kind of longest prefix match method and apparatus based on tree form data structure.The method adopts the Prefix Expansion bitmap to add that the prefix indicator diagram sets to realize in conjunction with many bits of compression Trie.Publication number is CN 1787477A IPV6, and name is called the lookup method of routing table, and the method is in implementation procedure, major part adopts HASH index and parallel search, and used Multi-branch Trie Tree to search in the part, the renewal of routing table is by other section processes, and is unspecified.
Summary of the invention
For solve existing route table implementation method exist do not satisfy can high-speed searching, upgrade fast, again can internal memory expend lessly, the technical problem such as cost is lower the invention provides a kind of processing method of route prefix, comprises searching, increasing and the operation such as deletion.
A kind of processing method of route prefix is characterized in that: said method comprising the steps of:
1) fast finding: the relationship map of IP prefix and route table items is become all concrete IP addresses of IP prefix representative and the relation of route table items, and constantly preserve the corresponding route table items of longest-prefix by each concrete IP address;
2) upgrade fast: the non-longest-prefix of each concrete IP address is preserved, when longest-prefix changes because of additions and deletions, can from other non-longest-prefixes, be sought rapidly a longest-prefix;
3) prefix diffusion: solve the incidence relation of prefix between the adjacent Tire node by the prefix diffusion method, avoided the back tracking operation in the search procedure.
2, the processing method of route prefix according to claim 1 is characterized in that: described Tire node is the Tire node in the Multi-branch Trie Tree structure, and when Trie node step-length was K, this Trie node comprised 2 KIndividual IP bit section has comprised K+1 kind mask simultaneously, wherein mask 0 expression default mask or from the expansion mask of father node, mask 2 K-1 is long code mask.
As further improvement in the technical proposal, above-mentioned Trie tree structure is preserved corresponding all K+1 kind masks of each IP bit section in the described Trie node; Long code mask is corresponding one by one with concrete IP address, but not long code mask is the corresponding of one-to-many with the IP address.
As further improvement in the technical proposal, the structure of above-mentioned Trie tree is carried out the prefix diffusion between adjacent two-stage Trie node, by the longest-prefix of father node is spread to all child nodes, full 0 mask as own node is kept among the Trie of child node, child node is when searching longest-prefix, if find own to longer prefix, just the long code mask of the mask of this full 0 as oneself.
A kind of lookup method of route prefix said method comprising the steps of:
1) obtain IP address to be checked, IP address bit position begins to point to high-order Far Left, and the Trie tree is pointed to root node;
2) obtain the wide M of being of this grade Trie node step, then in the IP address, follow order from the left side and get the M bit value;
3) in this grade Trie node, directly search the longest-prefix descriptor that obtains correspondence with the M bit value;
4) in the longest-prefix descriptor, if the index territory equals-1, then failure; Otherwise, if the leaf territory equals 1, then to search successfully, route table items is index; If the leaf territory equals 0, then index is the index of next stage Trie node, jumps to next stage Trie node, and repeating step 2 again.
A kind of increase method of route prefix is characterized in that: said method comprising the steps of:
1) obtain IP prefix addresses to be added/MASK address, corresponding route table items Rn, IP/MASK address bit position begins to point to high-order Far Left, and the Trie tree is pointed to root node;
2) obtain the wide M of being of this grade Trie node step, in the IP/MASK address, then sequentially get the M bit value from the left side, be respectively ip_M, mask_M, the right, MASK address remainder score value is mask_L;
3) in this grade Trie node, directly find corresponding longest-prefix descriptor with ip_M;
4) if mask_M is not complete 1 mask, illustrate that the prefix back is 0 entirely, need not to continue to process, then add and upgrade Trie node at the corresponding levels;
If this Trie node also has child node, then prefix diffusion;
At this moment, interpolation is finished, and withdraws from.
5) if mask_M is complete 1 mask, and mask_L is 0, and explanation is that prefix has arrived the end, and perhaps the back is 0 entirely, need not to continue to process;
If prefix has arrived the end, the longest-prefix descriptor that then upgrades Trie node i p_M position is Rn, otherwise, read ip_M nodes of locations state;
If be 1, then prefix diffusion, otherwise the longest-prefix descriptor of renewal Trie node i p_M position is Rn;
At this moment, interpolation is finished, and withdraws from;
6) if mask_M is complete 1 mask, and mask_L is not 0, and the child node that also has at the corresponding levels is described, needs to continue to process;
Obtaining ip_M nodes of locations state at the corresponding levels, is 0, then needs to create child node; The longest-prefix descriptor that upgrades simultaneously Trie node i p_M position is the child node sequence number; If 1, need not operation; Be 2 and 3, then need to create child node, the prefix diffusion, the longest-prefix descriptor that upgrades simultaneously Trie node i p_M position is the child node sequence number;
7) jump to next node, and repeat repeating step 2.
As further improvement in the technical proposal, add the method for upgrading Trie node at the corresponding levels in the described step 4 and may further comprise the steps:
1) obtains Trie node at the corresponding levels, IP bit section address ip_M, MASK bit section address mask_M, corresponding route table items Rn;
2) the number affect_N of the calculating concrete IP address that mask_M had influence on; The IP address number that affects such as the mask_M of full 0 is 2 M, and the IP address number that complete 1 mask_M has influence on is 2 0=1;
3) from ip_M, circular treatment affect_N IP address, namely ip_M is to ip_M+affect_N;
4) obtaining each pending ip nodes of locations state, is 0, and the longest-prefix descriptor that then will revise this ip position is Rn; Be 1 and 3, then do not process; Be 2, judge that then this mask_M is the longest-prefix in the ip_M network segment, if so, the longest-prefix descriptor of then revising this ip position is Rn, otherwise does not process;
5) cycle-index is enough affect_N time, then carries out next step, and if not, then repeating step 3;
6) corresponding relation with this prefix ip_M and route Rn adds in the alternate prefix descriptor.
As further improvement in the technical proposal, the method for prefix diffusion may further comprise the steps in the described step 4:
1) obtains child node Trie corresponding to father node, prefix ip_M to be spread, and corresponding route table items Rn, and the Prefix Expansion length spread_prefixlen of the accepted father node of this child node;
2) if the length of prefix ip_M to be spread is little and the Prefix Expansion length spread_prefixlen of the accepted father node of this node, withdraw from, need not diffusion;
3) obtain the wide K of step of this node, then affected concrete IP address is 2 KIndividual, from 0 to 2 K-1 circular treatment;
4) obtaining each pending ip nodes of locations state, is 0, and the longest-prefix descriptor that then will revise this ip position is Rn; Be 1 and 3, then do not process; Be 2, judge that then this ip_M is the longest-prefix in the ip network segment, if so, the longest-prefix descriptor of then revising this ip position is Rn, otherwise does not process;
5) Rn is added in the descriptor for subsequent use of each ip and go;
6) cycle-index enough 2 KInferior, then carry out next step, if not, then repeating step 3;
7) the Prefix Expansion length spread_prefixlen that revises the accepted father node of this node is the length of ip_M.
A kind of delet method of route prefix said method comprising the steps of:
1) obtain IP address to be deleted/MASK address, IP/MASK address bit position begins to point to Far Left, and the Trie tree is pointed to root node;
2) obtain this grade Trie node and go on foot wide M, order is obtained M bit value ip_M in the IP address, and order is obtained M bit value mask_M in the MASK address, and the right, MASK address remainder score value is mask_L;
3) in this grade Trie node, directly find corresponding longest-prefix descriptor with ip_M;
4) if mask_M is not complete 1 coding, illustrate that the prefix back is 0 entirely, need not to continue to process, then the corresponding list item of ip_M (as described in [10] [1]) in the backup sheet of deletion renewal Trie node at the corresponding levels; If node at the corresponding levels has child node, then oppositely prefix diffusion (as described in [10] [2]);
5) if mask_M is complete 1 mask, and mask_L is 0, and explanation is that prefix has arrived the end, and perhaps the back is 0 entirely; Reading ip_M nodes of locations state, is 1, then oppositely prefix diffusion (as described in [10] [2]); Be 3, then delete the corresponding list item of ip_M (as described in [10] [1]) in the prefix table that upgrades Trie node at the corresponding levels; Being 0 and 2, is non-existent situation, deletes unsuccessfully, returns;
6) if mask_M is complete 1 mask, and mask_L is not 0, then in addition child node at the corresponding levels; Read the prefix descriptor, if prefix descriptor index territory is invalid, then prefix to be deleted does not exist, and deletes unsuccessfully, returns;
7) obtain child node, jump to next stage Trie node, repeating step 2.
As further improvement in the technical proposal, when Trie node at the corresponding levels is upgraded in the deletion in described step 4 and the step 5, if prefix to be deleted is complete 1, then delete the corresponding list item of ip_M in the prefix table, seeking simultaneously a prefix the longest from descriptor for subsequent use is filled in the prefix table, if there has not been any list item in backing sheet, then prefix table will become invalidly, and its index territory is-1; If prefix to be deleted is not complete 1, the corresponding list item of ip_M in the deletion backing sheet needs to detect the whether longest-prefix of all concrete ip that ip_M affects of this alternate prefix simultaneously.
As further improvement in the technical proposal, the method that Trie node at the corresponding levels is upgraded in described deletion may further comprise the steps:
1) obtains Trie node at the corresponding levels, IP bit section address ip_M to be deleted, MASK bit section address mask_M;
2) calculate the number affect_N of the concrete IP address that mask_M has influence on;
3) from ip_M, circular treatment affect_N IP address, namely ip_M is to ip_M+affect_N;
4) obtain each pending ip nodes of locations state, if 0,1,3 are not processed; If 2 needs are processed, because this mask_M may appear at the ip position in the prefix table descriptor;
Judge that mask_M is the longest-prefix of ip position in this node prefix table,
If so, then again be longest-prefix of ip searching in the backing sheet descriptor, the ip that is filled in the prefix descriptor is the position, if nothing, it is invalid that the ip position is made as;
If not, then do not process;
5) if cycle-index reaches affect_N time, then carry out next step, otherwise repeating step 3;
6) the corresponding route table items of deletion ip_M in descriptor for subsequent use.
As further improvement in the technical proposal, when oppositely prefix spreads in described step 4 and the step 5, if the father node of a child node is deleted, then need simultaneously to delete the prefix diffusion of this father node in byte point.Moreover, father node also needs longest-prefix remaining in its backing sheet is spread to child node.
As further improvement in the technical proposal, when also comprising deletion, described method recalls step, if namely in delete procedure success found prefix to be deleted, and in most end one-level Trie node with the final stage prefix bits from the prefix table of Trie or for subsequent use after the deletion, and do not mean that end; Specifically further comprising the steps of:
1) the Trie tree pointer points to afterbody Trie node;
2) if this grade Trie node has not comprised any one prefix information, then directly this knot removal is fallen; If only remain next prefix information, then this prefix information must be from the father node diffusion, with the position that this diffusion prefix can be write the prefix descriptor of father node, then deletes this node;
3) the Trie tree pointer points to the father node of present node, if father node is empty, explanation is the Trie root node, withdraws from.Otherwise carry out next step;
4) if this node surplus next prefix only is that ip prefix to be deleted is corresponding to the prefix bits section of this section Trie node so certainly.Implement the present invention and have following beneficial effect:
1) memory consumption: it is again 2 times that general T rie sets that the inventive method expends internal memory;
2) seek rate is fast: the seek rate of multi-fork Trie tree is very fast among the present invention, and generally the 1-5 step finishes, and each step is exactly an addressing and numerical value comparison operation, without other any extra process.Its processing speed is only second to the parallel search of hardware.
3) renewal speed is fast: update time mainly by the time of searching and more new data two parts form.The time of searching is very fast among the present invention, and more new data only relates to those concrete IP addresses that the final stage of prefix to be updated has influence in corresponding Trie node, and the step of this Trie node is wide, then affects concrete IP address just many, go on foot wide narrowlyer, then affect concrete IP address just few.But operating procedure is limited generally, and opereating specification is concentrated, and does not affect the operation of other Trie node, does not need outside assisting, and therefore more new data rate is still very fast.Concrete operations number of times and node go on foot wide K, and prefix length L is relevant.Go on foot wide K also little, prefix length L is larger, and then number of operations is fewer.In a word, the concrete operations number of times is 1-2 K, most cases.
4) utilization benefit is good: available pure software realization, and efficient is high, and need not other subsystem supports, and independence is good, can realize the linear forward efficiency of 10G on multi-core network processor.
Description of drawings
Fig. 1 is the flow chart that high speed of the present invention is searched the route longest-prefix;
Fig. 2 is the flow chart that increases fast route prefix among the present invention;
Fig. 2 A adds the flow chart that upgrades Trie node at the corresponding levels among the present invention;
Fig. 2 B adds the flow chart that upgrades the Trie of subordinate node among the present invention;
Fig. 3 is the flow chart of deleting fast route prefix among the present invention;
Fig. 3 A is the flow chart that Trie node at the corresponding levels is upgraded in deletion among the present invention.
Embodiment
The present invention mainly proposes a kind of high-speed searching of realizing route table items based on Multi-branch Trie Tree, and realize upgrading fast, namely add fast and fast deletion, and the method for storage consumption preferably, the method can be widely used in the express network forward node.The present invention utilizes multi-fork Trie tree, ingehious design Trie node data structure, and unique Processing Algorithm has been proposed.Specifically comprise route prefix list item store data structure and algorithm; High-speed searching route longest-prefix method; Increase fast the route prefix method; And delete fast the route prefix method.
The route table items prefix store data structure and the algorithm that wherein provide are specifically described as follows: the concrete methods of realizing of this algorithm is:
Step 1, the relationship map of IP prefix and route table items is become all concrete IP addresses of IP prefix representative and the relation of route table items, and constantly be the corresponding route table items of each concrete IP address preservation longest-prefix.Realize thus fast finding;
Step 2, the non-longest-prefix of each concrete IP address is preserved, when longest-prefix changes because of additions and deletions, can from other non-longest-prefixes, be sought rapidly a longest-prefix.Realize thus upgrading fast.
Step 3, employing prefix diffusion technique solve the incidence relation of prefix between the adjacent Tire node.
On the basis that above-mentioned algorithm is considered carefully, the present invention has also designed a kind of special routing table prefix storage organization, makes a concrete analysis of as follows:
When Trie node step-length was K, this Trie node had just comprised 2 KIndividual IP bit section; Comprised simultaneously K+1 mask, wherein mask 0(full 0) the expression default mask, perhaps from the expansion mask of father node, and mask 2 K-1(complete 1) then represent long code mask.
Store corresponding all route table items situations of mask among this K+1 fully, the simplest situation needs 2 K(K+1) individual memory cell.Ingehious design of the present invention is 2 KX2=2 K+1Individual memory cell, its mathematical principle are that 1 memory cell of storage full 0 mask needs is stored complete 1 mask needs 2 KIndividual memory cell, from the full 0 mask to complete 1 mask, tolerance of memory cell formation is 2 Geometric Sequence, therefore altogether needing memory cell is 2 K+1-1.Complete 1 mask has represented the longest-prefix of corresponding IP bit section, and other masks have then represented non-longest-prefix, i.e. alternate prefix.
Prefix diffusion technique wherein, different from the Prefix Expansion technology of carrying in the background, refer in the present invention in the Trie tree structure, different section in IP bit/MASK bit that every one-level node is corresponding respectively, all prefixes that the intersection of adjacent two-stage node (father node and child node) is father node are the prefix of child node all, when the parton node of a father node has longer prefix, and the parton node is during without longer prefix.When searching, just should choose the prefix of father node as its longest-prefix without the part child node of longer prefix.For avoiding this back tracking operation, just need to spread the longest-prefix of the sensing route of father node performance to all child nodes, exist as the full 0 mask of child node, will be the long code mask of the mask of this full 0 as oneself without the child node of longer prefix.This diffusion is only limited between the adjacent two-stage.
When increasing operation, prefix spreads to child node from father node; During deletion action, if father node deletion then needs to delete simultaneously in the child node from the diffusion prefix of father node, be referred to as reverse prefix diffusion.
Therefore, Trie node data structural design such as table 1:
Figure BDA00002344856600101
Figure BDA00002344856600111
Table 1
Wherein, longest-prefix descriptor nodind structure such as table 2:
Figure BDA00002344856600112
Table 2
In the table 2, have 2 flag bits, to its coding, explain such as table 3:
Figure BDA00002344856600113
Table 3
Follow-up leaf and this combination of from are called: certain nodes of locations state.The renewal operation of Trie node is carried out according to its nodes of locations state.In addition, below mention ip prefix length or mask address size, refer to the number on the left side continuous 1 in the ip/mask Bit String.Supported the fast finding that the present invention will realize by above data structure and rudimentary algorithm, the various concrete operations that increase and delete.
The method of high-speed searching route longest-prefix provided by the invention as shown in Figure 1, concrete lookup method may further comprise the steps:
Step 1 is obtained IP address to be checked, and IP address bit position begins to point to Far Left (high position), and the Trie tree is pointed to root node;
Step 2 is obtained the wide M of being of this grade Trie node step, then follows order from the left side in the IP address and gets the M bit value;
Step 3 is directly searched with the M bit value in this grade Trie node and is obtained corresponding longest-prefix descriptor (array search operation);
Step 4, in the longest-prefix descriptor, if the index territory equals-1, then failure; Otherwise, if the leaf territory equals 1, then to search successfully, route table items is index; If the leaf territory equals 0, then index is the index of next stage Trie node, jumps to next stage Trie node, repeating step 2;
In the above-mentioned search procedure, once circulation is exactly an addressing and numerical value comparison operation, and is very simple.Search time complexity 0 (1).
Referring to shown in Figure 2, the process of quick increase routing table provided by the present invention is: add and preserve all prefixes, and guarantee that the nodind territory of corresponding all the concrete IP addresses of prefix keeps all corresponding values of its longest-prefix all the time.
Concrete grammar may further comprise the steps:
Step 1, obtain IP prefix addresses to be added/MASK address, corresponding route table items Rn, IP/MASK address bit position begins to point to Far Left (high position), and the Trie tree is pointed to root node;
Step 2, obtain this grade Trie node step and widely be M, in the IP/MASK address from the left side then order get the M bit value, be respectively ip_M, mask_M, the right, MASK address remainder score value is mask_L;
Step 3, in this grade Trie node, directly find corresponding longest-prefix descriptor (array search operation) with ip_M;
If step 4 mask_M is not complete 1 mask, illustrate that the prefix back is 0 entirely, need not to continue to process, then add and upgrade Trie node at the corresponding levels, if this Trie node also has child node, then prefix diffusion; At this moment, interpolation is finished, and withdraws from.
If step 5 mask_M is complete 1 mask, and mask_L is 0, explanation is that prefix has arrived the end, and perhaps the back is 0 entirely, need not to continue to process.If prefix has arrived the end, the longest-prefix descriptor that then upgrades Trie node i p_M position is Rn; Otherwise, read ip_M nodes of locations state, if be 1, then prefix diffusion, otherwise the longest-prefix descriptor of renewal Trie node i p_M position is Rn.At this moment, interpolation is finished, and withdraws from.
If step 6 mask_M is complete 1 mask, and mask_L is not 0, the child node that also has at the corresponding levels is described, need to continue to process.Obtaining ip_M nodes of locations state at the corresponding levels, is 0, then needs to create child node; The longest-prefix descriptor that upgrades simultaneously Trie node i p_M position is the child node sequence number; Be 1, need not operation; Be 2 and 3, then need to create child node, the prefix diffusion, the longest-prefix descriptor that upgrades simultaneously Trie node i p_M position is the child node sequence number.
Step 7, jump to next node, repeating step 2.
Shown in Fig. 2 A, add the method for upgrading Trie node at the corresponding levels in the above-mentioned steps 4 and 5 and may further comprise the steps:
Step 1, obtain Trie node at the corresponding levels, IP bit section address ip_M, MASK bit section address mask_M, corresponding route table items Rn;
The number affect_N of step 2, the calculating concrete IP address that mask_M had influence on.The IP address number that affects such as the mask_M of full 0 is 2 M, and the IP address number that complete 1 mask_M has influence on is 2 0=1.
Step 3, from ip_M, circular treatment affect_N IP address, namely ip_M is to ip_M+affect_N;
Step 4, obtaining each pending ip nodes of locations state, is 0, and the longest-prefix descriptor that then will revise this ip position is Rn; Be 1 and 3, then do not process; Be 2, judge that then this mask_M is the longest-prefix in the ip_M network segment, if so, the longest-prefix descriptor of then revising this ip position is Rn, otherwise does not process;
Enough affect_N time of step 5, cycle-index jump to step 6, otherwise repeating step 3;
Step 6, the corresponding relation of this prefix ip_M and route Rn added in the alternate prefix descriptor go.
Shown in Fig. 2 B, add the method for upgrading the Trie of subordinate node in the above-mentioned steps 4,5 and 6 and may further comprise the steps:
Step 1, obtain child node Trie corresponding to father node, prefix ip_M to be spread, and corresponding route table items Rn, and the Prefix Expansion length spread_prefixlen of the accepted father node of this child node.
If the length of the prefix ip_M that step 2 is to be spread is little and the Prefix Expansion length spread_prefixlen of the accepted father node of this node, withdraw from, need not diffusion;
Step 3, obtain the wide K of step of this node, then affected concrete IP address is 2 KIndividual.From 0 to 2 K-1Circular treatment;
Step 4, obtaining each pending ip nodes of locations state, is 0, and the longest-prefix descriptor that then will revise this ip position is Rn; Be 1 and 3, then do not process; Be 2, judge that then this ip_M is the longest-prefix in the ip network segment, if so, the longest-prefix descriptor of then revising this ip position is Rn, otherwise does not process;
Step 5, Rn added in the descriptor for subsequent use of each ip and go;
Step 6, cycle-index enough 2 KInferior, jump to step 7, otherwise repeating step 3;
Step 7, the Prefix Expansion length spread_prefixlen that revises the accepted father node of this node are the length of ip_M.
Referring to shown in Figure 3, quick deletion route prefix method provided by the invention is: delete prefix to be deleted, revise simultaneously the nodind territory of all concrete IP addresses that this prefix affects, make it keep eventually all corresponding route table items values of longest-prefix.The method specifically may further comprise the steps:
Step 1, obtain IP address to be deleted/MASK address, IP/MASK address bit position begins to point to Far Left, and the Trie tree is pointed to root node;
Step 2, obtain this grade Trie node and go on foot wide M, order is obtained M bit value ip_M in the IP address, and order is obtained M bit value mask_M in the MASK address, and the right, MASK address remainder score value is mask_L.
Step 3, in this grade Trie node, directly find corresponding longest-prefix descriptor (array search operation) with ip_M;
If step 4 mask_M is not complete 1 coding, illustrate that the prefix back is 0 entirely, need not to continue to process, then the corresponding list item of ip_M (as shown in Figure 3A) in the backup sheet of deletion renewal Trie node at the corresponding levels; If node at the corresponding levels has child node, then oppositely prefix diffusion (shown in Fig. 3 B);
If step 5 mask_M is complete 1 mask, and mask_L is 0, explanation is that prefix has arrived the end, and perhaps the back is 0 entirely.Reading ip_M nodes of locations state, is 1, then oppositely prefix diffusion (shown in Fig. 3 B); Be 3, then delete the corresponding list item of ip_M (as shown in Figure 3A) in the prefix table that upgrades Trie node at the corresponding levels; Being 0 and 2, is non-existent situation, deletes unsuccessfully, returns;
If step 6 mask_M is complete 1 mask, and mask_L is not 0, the child node that also has at the corresponding levels is described.Read the prefix descriptor, if prefix descriptor index territory is invalid, illustrate that prefix to be deleted does not exist, delete unsuccessfully, return;
Step 7, obtain child node, jump to next stage Trie node, repeating step 2.
Shown in Fig. 3 A, Trie node at the corresponding levels is upgraded in deletion in above-mentioned steps 4 and the step 5, if prefix to be deleted is complete 1, then delete the corresponding list item of ip_M in the prefix table, seeking simultaneously a prefix the longest from descriptor for subsequent use is filled in the prefix table, if there has not been any list item in backing sheet, then prefix table will become invalidly, and its index territory is-1.If prefix to be deleted is not complete 1, the corresponding list item of ip_M in the deletion backing sheet needs to detect the whether longest-prefix of all concrete ip that ip_M affects of this alternate prefix simultaneously.Its processing method is specific as follows:
Step 1, obtain Trie node at the corresponding levels, IP bit section address ip_M to be deleted, MASK bit section address mask_M;
The number affect_N of step 2, the calculating concrete IP address that mask_M had influence on;
Step 3, from ip_M, circular treatment affect_N IP address, namely ip_M is to ip_M+affect_N;
Step 4, obtain each pending ip nodes of locations state, be 0,1,3 and do not process; Be that 2 needs are processed, because this mask_M may appear at the ip position in the prefix table descriptor.Judge that mask_M is the longest-prefix of ip position in this node prefix table, if so, then again be longest-prefix of ip searching in the backing sheet descriptor, the ip that is filled in the prefix descriptor is the position, if nothing, it is invalid that the ip position is made as; If not, then do not process;
Enough affect_N time of step 5, cycle-index jump to step 6, otherwise repeating step 3;
Step 6, in descriptor for subsequent use deletion ip_M corresponding route table items.
The reverse process of prefix diffusion when the reverse prefix diffusion in above-mentioned steps step 4 and the step 5 is this operation.If the father node of a child node is deleted, then need simultaneously to delete the prefix diffusion of this father node in byte point.Moreover, father node also needs longest-prefix remaining in its backing sheet is spread to child node.Whole process with referring to shown in Fig. 2 B, repeat no more here.
Back tracking operation when also comprising deletion in the delet method provided by the invention, in delete procedure, if success found prefix to be deleted, and in most end one-level Trie node with the final stage prefix bits from the prefix table of Trie or for subsequent use after the deletion, and do not mean that end.This moment is further comprising the steps of:
Step 1, Trie tree pointer point to afterbody Trie node;
If this grade of step 2 Trie node has not comprised any one prefix information, then directly this knot removal is fallen; If only remain next prefix information, then this prefix information must be from the father node diffusion, with the position that this diffusion prefix can be write the prefix descriptor of father node, then deletes this node;
Step 3, Trie tree pointer point to the father node of present node, if father node is empty, explanation is the Trie root node, withdraws from.Otherwise carry out next step;
If this node of step 4 is surplus next prefix only, be that ip prefix to be deleted is corresponding to the prefix bits section of this section Trie node so certainly.
Method of operation is with (2); Repeat (3). by upper, the operation of deletion prefix is very similar to increasing the prefix operating process.
Further said method is described below in conjunction with object lesson:
Example: realize the IPV4 routing table based on 256 Trie of branch tree
1, step-length be 8 Multi-branch Trie Tree of (namely 256) such as adopt to realize the quick renewal of IPV4 routing table prefix and search in the example.
2, data structure adopts described in the above-mentioned table 1-table 3.
3, adding procedure:
According to the implementation method of above-mentioned interpolation route prefix, to add following route table items as example:
The route table items prefix The route table items index
192.168.1.1/0 be 0.0.0.0 N0
192.168.1.1/1 be 128.0.0.0 N1
...... ......
192.168.1.1/10 be 192.128.0.0 Na
192.168.1.1/11 be 192.160.0.0 Nb
...... ......
192.168.1.1/24 be 192.168.1.0 N18
...... ......
192.168.1.1/31 be 192.168.1.0 N1f
192.168.1.1/32 be 192.168.1.1 N20
Table 4
Routing table memory map after the interpolation is as shown in table 4:
Wherein, taken altogether 4 Tire node: node1-node4, left side one row of each node have represented the part alternate prefix descriptor of this node, and right side one row have represented the part longest-prefix descriptor of this node.In the longest-prefix descriptor, arrow represents to point to next node, and data value then represents to point to concrete route table items.
4, search procedure
In table 5, carry out search operation:
(1) if purpose ip is 191.2.2.2, then can be in node1 to 0xbf(namely 191) can to find route be N1 in the position;
(2) if purpose ip is 192.167.2.2, then can in node1, search 0xc0(namely 192) position points to node2, at the 0xa7(of node2 namely 167) can to search route be N8 in the position;
(3) if purpose ip is 192.168.2.2, can find route in 2 positions of node 3 is N10;
(4) if purpose ip is 192.168.1.2, can search route in 2 positions of node4 is N18;
(5) if purpose ip is 192.168.1.1, can find route in 1 position of node4 is N20;
Above-mentioned lookup result is correct (satisfying the longest-prefix principle), and speed is very fast!
Below, to search (3) as example, purpose ip to be found is that the search procedure of 192.168.2.2 is:
(1) Bit String of 192.168.2.2 is that the whenever wide step by step of 11,000,000 10,101,000 00,000,010 00000010, Trie tree node is 8.
(2) getting front 8 bits of purpose ip, is 11000000, namely 0xc0. in the prefix descriptor of Trie root node node1 take 0xc0 as index, search nodind[0xc0], obtaining the index territory is 2, points to child node, Trie tree sensing index is 2 child node, i.e. node2;
(3) continuing to get 8 bits in purpose ip, is 10101000, namely in the prefix descriptor of 0xa0. in node2 take 0xa0 as index, search nodind[0xa0], obtaining the index territory is 3, points to child node, Trie tree sensing index is 3 child node, i.e. node3;
(4) continuing to get 8 bits at purpose ip, is 00000010, namely in the prefix descriptor of 0x02. in node3 take 0x02 as index, search nodind[0x02], obtaining the index territory is N10, points to route table items;
(5) search and finish, the route table items that obtains 192.168.2.2 is N10, and its longest-prefix is 192.168.1.1/16, i.e. 192.168.0.0.
Figure BDA00002344856600201
Table 5
5, delete procedure is as follows: in the table 4 added finish after routing table as example, as delete 192.168.1.1/0 (being 0.0.0.0), then the routing table memory-mapped is attempted to change, and is as shown in table 6, behind the deletion 192.168.1.1/0 (being 0.0.0.0), N0 has not closely existed in node1.This moment, the 0x00-0x80 position of longest-prefix descriptor became-1, and expression is without route table items; As delete 192.168.1.1/24 (being 192.168.1.0)-192.168.1.1/32 (being 192.168.1.1), namely delete prefix length greater than 24 route table items, then routing table memory map.
Table 6
As shown in table 7, deletion is greater than after 24 the prefix, and node4 has not existed, and route table items has directly been pointed in 1 position of node3, and no longer points to child node.If be 192.168.1.1 searching purpose ip this moment, can find route in 1 position of node3 is N18, rather than original N20.
Figure BDA00002344856600211
Table 7
Implement the concrete comparative illustration of beneficial effect of the present invention as follows:
1, memory consumption: with other common similar approach relatively, the memory consumption situation is referring to table 8:
Figure BDA00002344856600212
Table 8
Memory size depends on two parts: the step in (1) each step is wide; (2) for the data width of storing prefix index and down hop index, as require total number below 60,000,16 data width (is used short int type, 16 bit widths), require more than 60,000 to millions, then need the data width more than 24 (to use the int type, 32 bit widths).The internal memory that the latter uses is the former 2 times.Wherein go on foot wide greatlyr, seek rate is just faster, and memory consumption is just larger; Otherwise.Therefore must compromise to some extent.The below analyzes the situation of several practicalities take IPV4 as example.A wide Trie node required memory for K of step is 2 K+1* 2byte. or 2 K+1* 4byte
Figure BDA00002344856600221
Figure BDA00002344856600231
Table 9
Can find out, adopt bifurcated Trie tree, it is many that internal memory expends, but at nowadays 32, especially in the 64 bit CPU environment (such as multi-core network processor), above-mentioned internal memory can be accepted fully, and seek rate is very fast.
2, the 1-5 step finishes in the situation, and each step is exactly an addressing and numerical value comparison operation, without other any extra process.Its processing speed is only second to the parallel search of hardware.
3, renewal speed is fast: update time mainly by the time of searching and more new data two parts form.The time of searching is very fast among the present invention, and more new data only relates to those concrete IP addresses that the final stage of prefix to be updated has influence in corresponding Trie node.The step of this Trie node is wide, then affects concrete IP address just many, go on foot wide narrowlyer, then affects concrete IP address just less.But operating procedure is limited generally, and opereating specification is concentrated, and does not affect the operation of other Trie node, does not need outside assisting, and therefore more new data rate is still very fast.Concrete operations number of times and node go on foot wide K, and prefix length L is relevant.Go on foot wide K also little, prefix length L is larger, and then number of operations is fewer.In a word, the concrete operations number of times is 1-2 K, most cases.
4, utilization benefit: available pure software realization, efficient is high, and need not other subsystem supports, and independence is good.On the multi-core network processor of our company's exploitation, realized the linear forward efficiency of 10G.
Above-described embodiment is the embodiment of one embodiment of the present invention; but embodiments of the present invention are not restricted to the described embodiments; other any do not deviate from change, the modification done under Spirit Essence of the present invention and the principle, substitutes, combination, simplify; all should be the substitute mode of equivalence, be included within protection scope of the present invention.

Claims (15)

1. the processing method of a route prefix is characterized in that: said method comprising the steps of:
1) fast finding: the relationship map of IP prefix and route table items is become all concrete IP addresses of IP prefix representative and the relation of route table items, and constantly preserve the corresponding route table items of longest-prefix by each concrete IP address;
2) upgrade fast: the non-longest-prefix of each concrete IP address is preserved, when longest-prefix changes because of additions and deletions, can from other non-longest-prefixes, be sought rapidly a longest-prefix;
3) prefix diffusion: solve the incidence relation of prefix between the adjacent Tire node by the prefix diffusion method, avoided the back tracking operation in the search procedure.
2. the processing method of route prefix according to claim 1, it is characterized in that: described Tire node is the Tire node in the Multi-branch Trie Tree structure, when Trie node step-length was K, this Trie node comprised 2 KIndividual IP bit section has comprised K+1 kind mask simultaneously, wherein mask 0 expression default mask or from the expansion mask of father node, mask 2 K-1 is long code mask.
3. the processing method of route prefix according to claim 2, be further characterized in that: described Trie tree structure is preserved corresponding all K+1 kind masks of each IP bit section in the described Trie node; Long code mask is corresponding one by one with concrete IP address, but not long code mask is the corresponding of one-to-many with the IP address.
4. the processing method of route prefix according to claim 3, be further characterized in that: the structure of described Trie tree is carried out the prefix diffusion between adjacent two-stage Trie node, by the longest-prefix of father node is spread to all child nodes, full 0 mask as own node is kept among the Trie of child node, child node is when searching longest-prefix, if find own to longer prefix, just the long code mask of the mask of this full 0 as oneself.
5. the processing method of route prefix according to claim 4 is characterized in that: comprise the increase operating procedure in the described prefix diffusion method, when increasing operation, prefix spreads to child node from father node.
6. the processing method of route prefix according to claim 5 is characterized in that: comprise the deletion action step in the described prefix diffusion method, when deletion action, if the father node deletion then needs to delete simultaneously in the child node diffusion prefix from father node.
7. the lookup method of a route prefix is characterized in that: said method comprising the steps of:
1) obtain IP address to be checked, IP address bit position begins to point to high-order Far Left, and the Trie tree is pointed to root node;
2) obtain the wide M of being of this grade Trie node step, then in the IP address, follow order from the left side and get the M bit value;
3) in this grade Trie node, directly search the longest-prefix descriptor that obtains correspondence with the M bit value;
4) in the longest-prefix descriptor, if the index territory equals-1, then failure; Otherwise, if the leaf territory equals 1, then to search successfully, route table items is index; If the leaf territory equals 0, then index is the index of next stage Trie node, jumps to next stage Trie node, and repeating step 2 again.
8. the increase method of a route prefix is characterized in that: said method comprising the steps of:
1) obtain IP prefix addresses to be added/MASK address, corresponding route table items Rn, IP/MASK address bit position begins to point to high-order Far Left, and the Trie tree is pointed to root node;
2) obtain the wide M of being of this grade Trie node step, in the IP/MASK address, then sequentially get the M bit value from the left side, be respectively ip_M, mask_M, the right, MASK address remainder score value is mask_L;
3) in this grade Trie node, directly find corresponding longest-prefix descriptor with ip_M;
4) if mask_M is not complete 1 mask, illustrate that the prefix back is 0 entirely, need not to continue to process, then add and upgrade Trie node at the corresponding levels;
If this Trie node also has child node, then prefix diffusion;
At this moment, interpolation is finished, and withdraws from.
5) if mask_M is complete 1 mask, and mask_L is 0, and explanation is that prefix has arrived the end, and perhaps the back is 0 entirely, need not to continue to process;
If prefix has arrived the end, the longest-prefix descriptor that then upgrades Trie node i p_M position is Rn, otherwise, read ip_M nodes of locations state;
If be 1, then prefix diffusion, otherwise the longest-prefix descriptor of renewal Trie node i p_M position is Rn;
At this moment, interpolation is finished, and withdraws from;
6) if mask_M is complete 1 mask, and mask_L is not 0, and the child node that also has at the corresponding levels is described, needs to continue to process;
Obtaining ip_M nodes of locations state at the corresponding levels, is 0, then needs to create child node; The longest-prefix descriptor that upgrades simultaneously Trie node i p_M position is the child node sequence number; If 1, need not operation; Be 2 and 3, then need to create child node, the prefix diffusion, the longest-prefix descriptor that upgrades simultaneously Trie node i p_M position is the child node sequence number;
7) jump to next node, and repeat repeating step 2.
9. the increase method of a kind of route prefix according to claim 8 is characterized in that: add the method for upgrading Trie node at the corresponding levels in the described step 4 and may further comprise the steps:
1) obtains Trie node at the corresponding levels, IP bit section address ip_M, MASK bit section address mask_M, corresponding route table items Rn;
2) the number affect_N of the calculating concrete IP address that mask_M had influence on; The IP address number that affects such as the mask_M of full 0 is 2 M, and the IP address number that complete 1 mask_M has influence on is 2 0=1;
3) from ip_M, circular treatment affect_N IP address, namely ip_M is to ip_M+affect_N;
4) obtaining each pending ip nodes of locations state, is 0, and the longest-prefix descriptor that then will revise this ip position is Rn; Be 1 and 3, then do not process; Be 2, judge that then this mask_M is the longest-prefix in the ip_M network segment, if so, the longest-prefix descriptor of then revising this ip position is Rn, otherwise does not process;
5) cycle-index is enough affect_N time, then carries out next step, and if not, then repeating step 3;
6) corresponding relation with this prefix ip_M and route Rn adds in the alternate prefix descriptor.
10. the increase method of a kind of route prefix according to claim 9 is characterized in that: the method for prefix diffusion may further comprise the steps in the described step 4:
1) obtains child node Tr ie corresponding to father node, prefix ip_M to be spread, and corresponding route table items Rn, and the Prefix Expansion length spread_prefixlen of the accepted father node of this child node;
2) if the length of prefix ip_M to be spread is little and the Prefix Expansion length spread_prefixlen of the accepted father node of this node, withdraw from, need not diffusion;
3) obtain the wide K of step of this node, then affected concrete IP address is 2 KIndividual, from 0 to 2 K-1 circular treatment;
4) obtaining each pending ip nodes of locations state, is 0, and the longest-prefix descriptor that then will revise this ip position is Rn; Be 1 and 3, then do not process; Be 2, judge that then this ip_M is the longest-prefix in the ip network segment, if so, the longest-prefix descriptor of then revising this ip position is Rn, otherwise does not process;
5) Rn is added in the descriptor for subsequent use of each ip and go;
6) cycle-index enough 2 KInferior, then carry out next step, if not, then repeating step 3;
7) the Prefix Expansion length spread_prefixlen that revises the accepted father node of this node is the length of ip_M.
11. the delet method of a route prefix is characterized in that: said method comprising the steps of:
1) obtain IP address to be deleted/MASK address, IP/MASK address bit position begins to point to Far Left, and the Trie tree is pointed to root node;
2) obtain this grade Trie node and go on foot wide M, order is obtained M bit value ip_M in the IP address, and order is obtained M bit value mask_M in the MASK address, and the right, MASK address remainder score value is mask_L;
3) in this grade Trie node, directly find corresponding longest-prefix descriptor with ip_M;
4) if mask_M is not complete 1 coding, illustrate that the prefix back is 0 entirely, need not to continue to process, then the corresponding list item of ip_M in the backup sheet of deletion renewal Trie node at the corresponding levels; If node at the corresponding levels has child node, then oppositely prefix diffusion;
5) if mask_M is complete 1 mask, and mask_L is 0, and explanation is that prefix has arrived the end, and perhaps the back is 0 entirely; Reading ip_M nodes of locations state, is 1, then oppositely prefix diffusion; Be 3, then delete the corresponding list item of ip_M in the prefix table that upgrades Trie node at the corresponding levels; Being 0 and 2, is non-existent situation, deletes unsuccessfully, returns;
6) if mask_M is complete 1 mask, and mask_L is not 0, then in addition child node at the corresponding levels; Read the prefix descriptor, if prefix descriptor index territory is invalid, then prefix to be deleted does not exist, and deletes unsuccessfully, returns;
7) obtain child node, jump to next stage Trie node, repeating step 2.
12. the delet method of a kind of route prefix according to claim 11, it is characterized in that: when Trie node at the corresponding levels is upgraded in the deletion in described step 4 and the step 5, if prefix to be deleted is complete 1, then delete the corresponding list item of ip_M in the prefix table, seeking simultaneously a prefix the longest from descriptor for subsequent use is filled in the prefix table, if there has not been any list item in backing sheet, then prefix table will become invalidly, and its index territory is-1; If prefix to be deleted is not complete 1, the corresponding list item of ip_M in the deletion backing sheet needs to detect the whether longest-prefix of all concrete ip that ip_M affects of this alternate prefix simultaneously.
13. the delet method of a kind of route prefix according to claim 12 is characterized in that: the method that Trie node at the corresponding levels is upgraded in described deletion may further comprise the steps:
1) obtains Trie node at the corresponding levels, IP bit section address ip_M to be deleted, MASK bit section address mask_M;
2) calculate the number affect_N of the concrete IP address that mask_M has influence on;
3) from ip_M, circular treatment affect_N IP address, namely ip_M is to ip_M+affect_N;
4) obtain each pending ip nodes of locations state, if 0,1,3 are not processed; If 2 needs are processed, because this mask_M may appear at the ip position in the prefix table descriptor;
Judge that mask_M is the longest-prefix of ip position in this node prefix table,
If so, then again be longest-prefix of ip searching in the backing sheet descriptor, the ip that is filled in the prefix descriptor is the position, if nothing, it is invalid that the ip position is made as;
If not, then do not process;
5) if cycle-index reaches affect_N time, then carry out next step, otherwise repeating step 3;
6) the corresponding route table items of deletion ip_M in descriptor for subsequent use.
14. the delet method of a kind of route prefix according to claim 13, it is characterized in that: when oppositely prefix spreads in described step 4 and the step 5, if the father node of a child node is deleted, then need simultaneously to delete the prefix diffusion of this father node in byte point.Moreover, father node also needs remaining longest-prefix in its backing sheet is spread to child node.
15. the delet method of a kind of route prefix according to claim 14, it is characterized in that: recall step when described method also comprises deletion, if namely in delete procedure success found prefix to be deleted, and in most end one-level Trie node with the final stage prefix bits from the prefix table of Trie or for subsequent use after the deletion, and do not mean that end; Specifically further comprising the steps of:
1) the Trie tree pointer points to afterbody Trie node;
2) if this grade Trie node has not comprised any one prefix information, then directly this knot removal is fallen; If only remain next prefix information, then this prefix information must be from the father node diffusion, with the position that this diffusion prefix can be write the prefix descriptor of father node, then deletes this node;
3) the Trie tree pointer points to the father node of present node, if father node is empty, explanation is the Trie root node, withdraws from.Otherwise carry out next step;
4) if this node surplus next prefix only is that ip prefix to be deleted is corresponding to the prefix bits section of this section Trie node so certainly.
CN201210432225.5A 2012-11-01 2012-11-01 A kind of process of route prefix, search, increase and delet method Active CN103051543B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210432225.5A CN103051543B (en) 2012-11-01 2012-11-01 A kind of process of route prefix, search, increase and delet method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210432225.5A CN103051543B (en) 2012-11-01 2012-11-01 A kind of process of route prefix, search, increase and delet method

Publications (2)

Publication Number Publication Date
CN103051543A true CN103051543A (en) 2013-04-17
CN103051543B CN103051543B (en) 2015-09-09

Family

ID=48064048

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210432225.5A Active CN103051543B (en) 2012-11-01 2012-11-01 A kind of process of route prefix, search, increase and delet method

Country Status (1)

Country Link
CN (1) CN103051543B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103561133A (en) * 2013-11-19 2014-02-05 中国科学院计算机网络信息中心 IP address ownership information indexing and fast querying method
CN104090942A (en) * 2014-06-30 2014-10-08 中国电子科技集团公司第三十二研究所 Trie search method and device applied to network processor
CN105812258A (en) * 2014-12-31 2016-07-27 北京华为数字技术有限公司 Method and device for data processing
CN106453214A (en) * 2015-08-12 2017-02-22 中国电信股份有限公司 Method, device and system for testing legality of user
CN108322394A (en) * 2018-04-02 2018-07-24 京信通信系统(中国)有限公司 Routing table is established, searched, deleting and Status Change method and apparatus
CN110099078A (en) * 2018-01-29 2019-08-06 阿里巴巴集团控股有限公司 Communication between devices, message synchronization method, apparatus, equipment and storage medium
CN110489516A (en) * 2019-08-15 2019-11-22 厦门铅笔头信息科技有限公司 A method of quickly prefix index is established for massive structured data
CN110995876A (en) * 2019-10-11 2020-04-10 中国科学院计算技术研究所 Method and device for storing and searching IP
CN111131015A (en) * 2019-12-27 2020-05-08 芯启源(南京)半导体科技有限公司 Method for dynamically updating route based on PC-Trie
CN112134805A (en) * 2020-09-23 2020-12-25 中国人民解放军陆军工程大学 Fast route updating circuit structure and updating method based on hardware implementation
CN112235197A (en) * 2020-10-23 2021-01-15 烽火通信科技股份有限公司 Parallel route searching method and system
CN114389989A (en) * 2021-12-24 2022-04-22 锐捷网络股份有限公司 Method and device for processing multistage next hop route

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1489849A (en) * 2001-01-30 2004-04-14 ŵ�������ܱ�Ե·������˾ Method and apparatus for ternary content addressable meomry (TCAM) table management
CN101577662A (en) * 2008-05-05 2009-11-11 华为技术有限公司 Method and device for matching longest prefix based on tree form data structure
CN101827137A (en) * 2010-04-13 2010-09-08 西安邮电学院 Hash table-based and extended memory-based high-performance IPv6 address searching method
CN102307149A (en) * 2011-09-23 2012-01-04 中国科学院计算技术研究所 IP (internet protocol) lookup method and device and route updating method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1489849A (en) * 2001-01-30 2004-04-14 ŵ�������ܱ�Ե·������˾ Method and apparatus for ternary content addressable meomry (TCAM) table management
CN101577662A (en) * 2008-05-05 2009-11-11 华为技术有限公司 Method and device for matching longest prefix based on tree form data structure
CN101827137A (en) * 2010-04-13 2010-09-08 西安邮电学院 Hash table-based and extended memory-based high-performance IPv6 address searching method
CN102307149A (en) * 2011-09-23 2012-01-04 中国科学院计算技术研究所 IP (internet protocol) lookup method and device and route updating method and device

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103561133B (en) * 2013-11-19 2016-08-24 中国科学院计算机网络信息中心 A kind of IP address attribution information index method and method for quickly querying
CN103561133A (en) * 2013-11-19 2014-02-05 中国科学院计算机网络信息中心 IP address ownership information indexing and fast querying method
CN104090942A (en) * 2014-06-30 2014-10-08 中国电子科技集团公司第三十二研究所 Trie search method and device applied to network processor
CN105812258A (en) * 2014-12-31 2016-07-27 北京华为数字技术有限公司 Method and device for data processing
CN105812258B (en) * 2014-12-31 2019-02-12 北京华为数字技术有限公司 A kind of data processing method and device
CN106453214A (en) * 2015-08-12 2017-02-22 中国电信股份有限公司 Method, device and system for testing legality of user
CN110099078A (en) * 2018-01-29 2019-08-06 阿里巴巴集团控股有限公司 Communication between devices, message synchronization method, apparatus, equipment and storage medium
CN108322394B (en) * 2018-04-02 2021-01-01 京信通信系统(中国)有限公司 Routing table establishing, searching, deleting and state changing method and device
CN108322394A (en) * 2018-04-02 2018-07-24 京信通信系统(中国)有限公司 Routing table is established, searched, deleting and Status Change method and apparatus
CN110489516A (en) * 2019-08-15 2019-11-22 厦门铅笔头信息科技有限公司 A method of quickly prefix index is established for massive structured data
CN110995876A (en) * 2019-10-11 2020-04-10 中国科学院计算技术研究所 Method and device for storing and searching IP
CN111131015A (en) * 2019-12-27 2020-05-08 芯启源(南京)半导体科技有限公司 Method for dynamically updating route based on PC-Trie
CN111131015B (en) * 2019-12-27 2021-09-03 芯启源(南京)半导体科技有限公司 Method for dynamically updating route based on PC-Trie
CN112134805A (en) * 2020-09-23 2020-12-25 中国人民解放军陆军工程大学 Fast route updating circuit structure and updating method based on hardware implementation
CN112134805B (en) * 2020-09-23 2022-07-08 中国人民解放军陆军工程大学 Fast route updating circuit structure and updating method based on hardware implementation
CN112235197A (en) * 2020-10-23 2021-01-15 烽火通信科技股份有限公司 Parallel route searching method and system
CN112235197B (en) * 2020-10-23 2022-07-15 烽火通信科技股份有限公司 Parallel route searching method and system
CN114389989A (en) * 2021-12-24 2022-04-22 锐捷网络股份有限公司 Method and device for processing multistage next hop route

Also Published As

Publication number Publication date
CN103051543B (en) 2015-09-09

Similar Documents

Publication Publication Date Title
CN103051543B (en) A kind of process of route prefix, search, increase and delet method
CN101577662B (en) Method and device for matching longest prefix based on tree form data structure
US9077669B2 (en) Efficient lookup methods for ternary content addressable memory and associated devices and systems
JP5529976B2 (en) Systolic array architecture for high-speed IP lookup
US8325721B2 (en) Method for selecting hash function, method for storing and searching routing table and devices thereof
CN101594319B (en) Entry lookup method and entry lookup device
Bando et al. Flashtrie: Hash-based prefix-compressed trie for IP route lookup beyond 100Gbps
US20140188885A1 (en) Utilization and Power Efficient Hashing
Le et al. Scalable tree-based architectures for IPv4/v6 lookup using prefix partitioning
JP5960863B1 (en) SEARCH DEVICE, SEARCH METHOD, PROGRAM, AND RECORDING MEDIUM
JP4995125B2 (en) How to search fixed length data
CN107153707A (en) A kind of Hash table construction method and system for nonvolatile memory
CN108134739B (en) Route searching method and device based on index trie
CN102045412B (en) Method and equipment for carrying out compressed storage on internet protocol version (IPv)6 address prefix
US20130024649A1 (en) Method and device for storing routing table entry
CN102035727A (en) Method and equipment for processing routing
CN106599091B (en) RDF graph structure storage and index method based on key value storage
CN102333036A (en) Method and system for realizing high-speed routing lookup
CN103365991A (en) Method for realizing dictionary memory management of Trie tree based on one-dimensional linear space
CN101277252A (en) Method for traversing multi-branch Trie tree
CN105357247A (en) Multi-dimensional cloud resource interval finding method based on hierarchical cloud peer-to-peer network
CN104780101A (en) FIB (Forward Information Base) table structure in named data networking forwarding plane and retrieval method thereof
CN111459938B (en) Table item processing method, table look-up method and system
CN102984071B (en) Method for organizing routing table of segment address route and method for checking route
CN106302178B (en) Route query method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: GUANGZHOU JIANZHIQIAO NETWORK TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: GUANGZHOU WISCO INFORMATION TECHNOLOGY CO., LTD.

Effective date: 20150804

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20150804

Address after: 510000 building B2, creative building, 162 science Avenue, Science Town, Whampoa District, Guangdong, Guangzhou 1103

Applicant after: Guangzhou Wisco Information Technology Co., Ltd.

Address before: Tianhe District Guangyuan East Road, Guangzhou city of Guangdong Province in 510000 2193 times the new world north tower 1601

Applicant before: Guangzhou Wisco Information Technology Co., Ltd.

C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP03 Change of name, title or address

Address after: 510000, B2, eleventh, 1103, creative building, 162 science Avenue, Luogang District Science Town, Guangdong, Guangzhou

Patentee after: Guangzhou Aipu Road Network Technology Co. Ltd.

Address before: 510000 building B2, creative building, 162 science Avenue, Science Town, Whampoa District, Guangdong, Guangzhou 1103

Patentee before: Guangzhou Wisco Information Technology Co., Ltd.