CN1314760A - Method for recovering internal storage of IP search - Google Patents

Method for recovering internal storage of IP search Download PDF

Info

Publication number
CN1314760A
CN1314760A CN 00102567 CN00102567A CN1314760A CN 1314760 A CN1314760 A CN 1314760A CN 00102567 CN00102567 CN 00102567 CN 00102567 A CN00102567 A CN 00102567A CN 1314760 A CN1314760 A CN 1314760A
Authority
CN
China
Prior art keywords
node
prefix
array
counts device
present
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
CN 00102567
Other languages
Chinese (zh)
Other versions
CN1136709C (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.)
Huawei Digital Technologies Chengdu Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB001025678A priority Critical patent/CN1136709C/en
Publication of CN1314760A publication Critical patent/CN1314760A/en
Application granted granted Critical
Publication of CN1136709C publication Critical patent/CN1136709C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Fast IP search method or longed prefix matching method is an important part of routing method. On the basis of "prefix expanding method" , the present invention process the idea of "note counter" to solve the problem that idle note internal storage is difficult to recover while some routing item in deleted and has excellent effect.

Description

A kind of method for recovering internal storage that IP searches
The present invention relates to a kind of IP lookup method of on network router, realizing, relate in particular to the method for recovering internal storage of IP in searching.
The present invention carries out on the basis of " expanding the prefix method " (hereinafter to be referred as the CPE method), the CPE method is a kind of fast searching method that is proposed by Srinivasan, the paper name is called " Faster IP Lookups using Controlled Prefix Expansion ", come from proc.ACM sigmetrics ' 98 conf., madison, WI, the 1-11 page or leaf.Method is utilized the time complexity of the thought minimizing method of segmentation compression, makes seek rate increase greatly, according to different configurations, can search between 3~32 steps and finish, and simply introduces the CPE method below.
Since adopting CIDR (CIDR) agreement in 1993, the IP route just comprises two parts<IP prefix, the length of prefix>and, the length range of prefix is between 0~32.For each input bag, IP searches the IP prefix sets that engine need find out coupling, and finds out the prefix of long coupling from the prefix sets of coupling.The indicated address of prefix of long coupling is exactly the address of next jumping of finding out.About CIDR, in detail visible RFC1519 Classless Inter-Domain Routing (CEIR): an AddressAssignment and Aggregation Strategy.V.Fuller, T.Li, J.Yu , ﹠amp; K.Varadhan.September 1993 and RFC1817 CIDR and ClassfulRouting.Y.Rekhter.August 1995.
Rule in the routing table can be expressed as the form of prefix, and the length of prefix changes between 8 and 32, and the IP lookup method is promptly found out the prefix of long coupling, because the diversity of prefix length is a key factor that causes the lookup method time complexity high.For the prefix maximum length is W, (NetBSD is a kind of Unix operating system of standard to NetBSD, this operating system has realized the ICP/IP protocol stack, wherein comprise the realization that IP searches) in the method complexity of binary tree be O (W), (L<W), then the method complexity will be reduced to O (L) if the prefix maximum length is reduced to L.Obviously, the maximum length of minimizing prefix will improve the speed of method.The basic thought of control prefix extending method is to increase the step-length of method by the diversity that reduces prefix length, thereby has reduced the complexity of method, reaches the purpose of searching fast.
Any prefix can be extended for the prefix sets of designated length, as for prefix 10 *, can be extended for length and be 4 prefix sets { 1000 *, 1001 *, 1010 *, 1011 *, by expanding the length of prefix to appointment, length that can the normalization prefix, thus reduced the diversity of prefix length.Expanding the prefix method can be divided into what expanding the normalized prefix length in back, and the length of each grade prefix is the same, just can find other node of this level by array indexing.
Expand prefix tries tree 32 grades of 1 original bit tree boil down to 3 level structures as a result, search number of times and shorten to 3 times, the time complexity of method is O (3).Thereby reach the purpose of searching fast.Suppose P5=0 *, P1=10 *, P2=111 *, P3=11001 *, P4=1 *, P6=1000 *, P7=100000 *, P8=1000000 *, the structure that then typically expands prefix trees as shown in Figure 1.
But in the CPE method, the CPE method is behind route entry of deletion, if there is not other prefix to exist in the node array at route entry place, need to reclaim the memory headroom of node array, if promptly all following prefixes of this node and node are all deleted, then need this node and this all nodes below node are carried out the internal memory recovery.How whether the prefix in the decision node deletes that to finish be a problem, and the CPE method is discussed to this problem, and common way is to carry out traversing operation.Traversing operation will take a large amount of internal memory operation time, and revise when frequent, need a large amount of internal memories, and this occasion at high speed router is unpractical.
Purpose of the present invention is exactly that the internal memory that will solve deletion route entry in the CPE method reclaims problem, reduces the internal memory operation time, reduces taking of internal memory.
In order to realize above purpose, the present invention proposes a kind of method for recovering internal storage, it is characterized in that may further comprise the steps: establish a node counts device for each node array; When inserting in the downstream node array of present node array or present node array and during the deletion prefix, the node counts device is corresponding to add one or subtract one; And when the node counts device is zero, reclaim this node array with and the shared internal memory of downstream node array.
The present invention is specially adapted to the CPE method, but those of ordinary skill in the art can use principle of the present invention in other the method easily.
In addition, method of the present invention can also make simultaneously with other method and be used for further improving the CPE method, for example, can be optimized the CPE method with the LeafPush method earlier, and then use the present invention.Method perhaps of the present invention can be used separately.
From above method as can be seen, when prefix was inserted into a node, the node counts device of the upstream node of this node and this node added one, and when prefix during from a knot removal, the node counts device of the upstream node of this node and this node subtracts one.If the counter of a node is kept to zero, then can delete this node and following node.Reclaim problem with regard to perfect internal memory when having solved knot removal like this.
Below with reference to accompanying drawings the present invention is carried out more detailed description, in the accompanying drawing:
Fig. 1 is the typical structure that expands prefix trees in the CPE method;
Fig. 2 is the insertion flow chart that adopts the prefix of node counts device realization according to the present invention;
Fig. 3 is the deletion flow chart that adopts the prefix of node counts device realization according to the present invention.
The insertion flow chart that adopts the prefix of node counts device realization according to the present invention is described below with reference to Fig. 2.At first node counts device of the present invention is described.In the present invention, the node counts device is preserved the information that prefix was inserted and deleted to each node array, in the present invention, corresponding each node array has a node counts device, for the pairing node node counts of P1 device can be placed on forward and backward and other position of node array.Be placed under the situation of other position, needing the index value between each counter and the corresponding node array.In a preferred embodiment, before the node counts device is placed on the node array.In the present invention, the node counts device is used for writing down the prefix item that inserts and delete, rather than is used for being recorded in the insertion and the deletion number of times of present node.Promptly have only and insert and deletion causes the increase of prefix item or just cause the increase or the minimizing of counter when reducing, if insert and deletion just causes the change of node array and do not cause the increase or the minimizing of prefix item, then the node counts device does not change.In the present invention, insert in the present node array and during the deletion prefix, the node counts device is corresponding to add one and subtract one.Insert and during the deletion prefix in the downstream of present node array array, the node counts device adds one and subtract one accordingly.When insertion of present node array upstream and deletion prefix, the node counts device is constant.When the node counts device is zero, can delete this node, promptly can reclaim the internal memory of node array.
Describe in accordance with a preferred embodiment of the present invention according to Fig. 2 below, insert the operational flowchart of prefix.Flow process is carried out initialization in square frame 201 beginnings to system.Under the situation of Fig. 1, for node 11 is set a counter C11, for node 21 is set counter C21, for node 22 is set counter C22, for node 31 is set counter C31, principle according to counter of the present invention, the initial value of setting each counter is respectively C11=8 (below 8 prefix P1-P8 are arranged), C21=3 (3 prefix P6 being arranged, P7 and P8), C22=2 (two prefix P2 are arranged, and P3) and C31=2 (two prefix P7 and P8 are arranged).It should be noted that here and described initialization, in the reality, do not need each flow process to begin all to need to carry out initialization for the convenience of describing.Only need be in system begin to carry out initialization.The beginning of later on each flow process only needs the result of last time is carried out as initial value.Then, flow process arrives square frame 202.At square frame 202, get the prefix that needs insertion, for example, suppose that the prefix that will insert is P9=1001*.Then, flow process arrives square frame 203, judges this prefix at this and belongs to node 21, so flow process then arrives square frame 204, at this, because node 21 is present nodes, its upstream node is a node 11, so all add 1 for node counts device C21 and C11.Afterwards, flow process is inserted prefix P9 and end at square frame 205.Can insert with the method for the prior art that any those of ordinary skill in the art was familiar with at square frame 205, for example carry out like this: earlier P9 is extended for 10010 with CPE *With 10011 *, then find 10010 and 10011 position, and write P9.
In other cases, increase the increase that prefix can cause node, at this moment, needing to distribute new node also is that new node increases the node counts device.For example, if the prefix that obtains adding at square frame 202 is 010 *, then will judge prefix and can not put into any existing node at square frame 203, thus newly-built for example node 23, and for this node distribute a counter C23 and for this counter setting initial value be 0.After arriving square frame 204, all add 1 for counter C23 and C11.Inserting this prefix and flow process at last finishes.In a preferred embodiment, the internal memory length scale of distributing for a node is 2 n, wherein n is node place other length of level.For example under the situation of Fig. 1, if distribute one at partial node, the internal memory length of then being distributed is 2 3=8, because partial length is 5-2=3.In like manner, the node size of the third level of distribution is 2 7-5=4.
The deletion flow chart that adopts the prefix of node counts device realization according to the present invention is described below with reference to Fig. 3.
The flow process of Fig. 3 is then got the prefix that needs deletion at square frame 302 in square frame 301 beginning, and for example, needing the prefix of deletion is p8, then judges P8 and is the node C31 the third level, and delete this prefix P8.Then the counter C31 of this node is subtracted one at square frame 303, judging this counter at square frame 304 is not 0, then arrive square frame 306 and judge whether to arrive afterbody node counts device, the result who judges this moment finds partial node 21 also the counter C21 of this node to be subtracted 1 for not so flow process proceeds to square frame 303.Then, this flow process is again by square frame 306 and 303.In current cyclic process, arrive zero without any a node counts device, so need not delete any one node.If then also want deletion of node P7, then the counter C31 of node 31 becomes 0 in this process, so will discharge internal memory in the array of square frame 305 deletion of node 31.
In the embodiments of figure 3, flow process is to subtract 1 back to each interdependent node counter just to judge that then whether it is 0, and then handle accordingly at once.In other embodiments, flow process can be changed into all counters that will be correlated with earlier and all subtract 1, node counts device from minimum one-level begins to judge whether counter is 0 then, if running into first is not 0 just can withdraw from circulation, because be not that senior node counts device can not be 0 under 0 the situation at rudimentary node counts device.For example under the situation of Fig. 1, be not that counter C21 and C11 do not affirm can be 0, so can directly withdraw from circulation under 0 the situation at counter C31.

Claims (4)

1, the method for recovering internal storage in a kind of IP route querying is characterized in that may further comprise the steps:
Establish a node counts device for each node array;
When inserting in the downstream node array of present node array or present node array and during the deletion prefix, the node counts device is corresponding to add one or subtract one; And
When the node counts device is zero, reclaim this node array with and the shared internal memory of downstream node array.
2, the method for claim 1 is characterized in that also comprising:
When the prefix of inserting can not be put into existing node, storage allocation was to be used to increase the step of new node.
3, method as claimed in claim 2 is characterized in that:
The step that increases new node comprises that setting the size of node that increases is 2 nInferior step, wherein n is the length of node place level.
4, as each described method of claim 1,2 or 3, it is characterized in that:
The step of setting the node counts device to node comprises the step that the node counts device is set in the beginning of node array.
CNB001025678A 2000-03-21 2000-03-21 Method for recovering internal storage of IP search Expired - Fee Related CN1136709C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB001025678A CN1136709C (en) 2000-03-21 2000-03-21 Method for recovering internal storage of IP search

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB001025678A CN1136709C (en) 2000-03-21 2000-03-21 Method for recovering internal storage of IP search

Publications (2)

Publication Number Publication Date
CN1314760A true CN1314760A (en) 2001-09-26
CN1136709C CN1136709C (en) 2004-01-28

Family

ID=4576477

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB001025678A Expired - Fee Related CN1136709C (en) 2000-03-21 2000-03-21 Method for recovering internal storage of IP search

Country Status (1)

Country Link
CN (1) CN1136709C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114287127A (en) * 2020-07-27 2022-04-05 华为技术有限公司 Filter array, mobile terminal and equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114287127A (en) * 2020-07-27 2022-04-05 华为技术有限公司 Filter array, mobile terminal and equipment
CN114287127B (en) * 2020-07-27 2023-10-31 华为技术有限公司 Filtering array, mobile terminal and equipment

Also Published As

Publication number Publication date
CN1136709C (en) 2004-01-28

Similar Documents

Publication Publication Date Title
AU2003214223B2 (en) Longest prefix matching using tree bitmap data structures
CN101026576B (en) Pattern matching method and device for processing fragmented message string giving consideration to matching strategy
US6625612B1 (en) Deterministic search algorithm
US20020147721A1 (en) Compact data structures for pipelined message forwarding lookups
CN101655861B (en) Hashing method based on double-counting bloom filter and hashing device
CN101009660B (en) Universal method and device for processing the match of the segmented message mode
CN102117278A (en) Linked list create method and system and data search method and system
CN101072178A (en) Switching system routing table management method
CN102405623B (en) Method and device for storing routing table entry
CN110399348A (en) File deletes method, apparatus, system and computer readable storage medium again
EP1063827A2 (en) Method for address lookup
CN108322394A (en) Routing table is established, searched, deleting and Status Change method and apparatus
CN101136875A (en) Multimedia files synchronous playback method in instant communication software
CN101692653B (en) Management method and management device for routing table
CN107248939B (en) Network flow high-speed correlation method based on hash memory
US7398278B2 (en) Prefix processing technique for faster IP routing
CN1136709C (en) Method for recovering internal storage of IP search
CN106603610A (en) Data acquisition method and apparatus
Kijkanjanarat et al. Fast IP lookups using a two-trie data structure
CN102185756A (en) TCAM (Ternary Content Addressable Memory) shared storage method and device
CN101945139A (en) Method for storing and looking up IPv6 address and relevant equipment
CN112702268B (en) Method and device for configuring forwarding table item
CN1466312A (en) Control method for connecting network based on proxy mode in network equipment
CN1148929C (en) Quick modification method for IP search
US20050102428A1 (en) Memory management for ternary CAMs and the like

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: HUAWEI DIGITAL TECHNOLOGY CO.

Free format text: FORMER OWNER: HUAWEI TECHNOLOGY CO., LTD.

Effective date: 20091023

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

Effective date of registration: 20091023

Address after: No. 3, information road, Haidian District, Beijing

Patentee after: Huawei Digit Technology Co., Ltd.

Address before: Shenzhen province HUAWEI science and Technology Park Guangdong branch User Service Center Building

Patentee before: Huawei Technologies Co., Ltd.

C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20040128

Termination date: 20120321