CN1949746A - Method for searching route table - Google Patents

Method for searching route table Download PDF

Info

Publication number
CN1949746A
CN1949746A CNA2006100221480A CN200610022148A CN1949746A CN 1949746 A CN1949746 A CN 1949746A CN A2006100221480 A CNA2006100221480 A CN A2006100221480A CN 200610022148 A CN200610022148 A CN 200610022148A CN 1949746 A CN1949746 A CN 1949746A
Authority
CN
China
Prior art keywords
prefix
found
prefix length
route table
routing address
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
CNA2006100221480A
Other languages
Chinese (zh)
Other versions
CN100486227C (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.)
Maipu Communication Technology Co Ltd
Original Assignee
MAIPU(SICHUAN) COMMUNICATION 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 MAIPU(SICHUAN) COMMUNICATION TECHNOLOGY CO LTD filed Critical MAIPU(SICHUAN) COMMUNICATION TECHNOLOGY CO LTD
Priority to CNB2006100221480A priority Critical patent/CN100486227C/en
Publication of CN1949746A publication Critical patent/CN1949746A/en
Application granted granted Critical
Publication of CN100486227C publication Critical patent/CN100486227C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to network communication, especially relating to routing table finding method. And the invention provides a routing table finding method able to be used in fast transfer table updating. And it comprises the steps of: a. determining prefix address and prefix length of a to-be-found routing address; b. as finding routing table, setting matching conditions of: 1. prefix address of routing table term matches with prefi address of to-be-found routing address; 2. prefix length of routing table term matches with prefix length of to-be-found routing address; if according with the two conditions, it is matched routing table term. And the invention has beneficial effects: according to user appointed prefix address and prefix length, finding matched routing term, able to solve the problem that Radix tree finding principle is not applicable and enlarging BSD Radix tree application range.

Description

Method for searching route table
Technical field
The present invention relates to network service, particularly routing table finding method.
Background technology
The life that develops rapidly to us of Internet has brought huge variation, and the thing followed is increasing rapidly of network traffics.Router is the exemplary apparatus that grouping is transmitted to data in network, and routing table is its basis of transmitting packet.When transmitting packet, router need be searched the route table items that can mate according to purpose IP address, thereby definite correct next jumped out mouth.In IP route table, each list item all comprises routing address, and routing address is called prefix again, generally is expressed as P/L, and P represents prefix addresses, i.e. the main frame or the network address; L represents prefix length, i.e. the mask-length of this main frame or the network address.The search procedure of route table items is also referred to as the longest matched and searched process, promptly earlier with destination address to be found, carry out the logical AND operation with the bit of prefix length in the route table items, again prefix addresses in its result and this route table items is mated, select in all occurrences prefix length the longest that.
In the prior art, the Radix of BSD tree is searched because of it efficiently becomes routing table institutional framework relatively more commonly used at present.Generally be purpose IP address at present, utilize the longest prefix match principle, select the most accurate coupling route according to be found to searching of Radix tree route table items.But, in some applications, for example rely on the most accurate coupling route table items and transmitting fast of setting up when this a certain route table items deletion, cause the consumption of cpu resource for fear of the mode that adopts newly-increased quick forwarding-table item, in this time, need in routing table, search alternative current other route that is complementary of waiting to delete the P/L list item that is relied on of transmitting fast.And can not support searching of this kind application to Radix tree route table items in the prior art.Search particulars about BSD radix tree and see " TCP/IP Illustrated Volume 2:TheImplementation ", 18 chapters---Radix sets routing table.
Summary of the invention
Technical problem to be solved by this invention just provides a kind of method for searching route table that can be used for transmitting fast renewal, searches the inapplicable problem of principle to solve existing Radix tree, thereby avoids unnecessary system resource waste.
The present invention solve the technical problem, and the technical scheme of employing is that method for searching route table may further comprise the steps:
A. determine the prefix addresses and the prefix length of routing address to be found;
B. when searching routing table, the setting matching condition is: one, the prefix addresses of the prefix addresses of route table items and routing address to be found is complementary; Two, the prefix length of the prefix length of route table items and routing address to be found is complementary; Meet above-mentioned two route table items that are coupling.
Further be, among the step b, the prefix length of described route table items and the prefix length of routing address to be found are complementary and are meant, in the route table items that satisfies above-mentioned matching condition one, its prefix length is the longest, and is equal to or less than the route table items of the prefix length of routing address to be found.
Concrete is that described step b comprises:
B1. according to the prefix addresses of routing address to be found, search flow process according to the Radix tree, begin to find first leaf node from root node, whether prefix addresses and this leaf node prefix addresses of judging routing address to be found mate, if coupling, then enter step b2, otherwise enter step b4;
Whether b2. more described leaf node prefix length is less than or equal to the prefix length of routing address to be found, if, then determine the route table items of this leaf node for coupling, enter step b5; Otherwise enter step b3;
B3. the leaf node that judges whether to exist the prefix addresses of other and routing address to be found to be complementary; If have, then one by one with the prefix length of these leaf nodes, compare with the prefix length of routing address to be found, determine prefix length the leaf node of the prefix length of approaching routing address to be found be the route table items that is complementary, enter step b5; If no, enter step b4;
B4. according to the longest prefix match algorithm retrospective search that makes progress, determine that the prefix addresses with routing address to be found is complementary, prefix length is the coupling route table items less than first leaf node of the prefix length of routing address to be found;
B5. the route table items of output coupling is searched end.
Further be, among the step b3, the described prefix length leaf node of the prefix length of approaching routing address to be found is meant, the prefix length of this leaf node, the longest in the leaf node that the prefix addresses of all and routing address to be found is complementary, and be equal to or less than the prefix length of routing address to be found.
The invention has the beneficial effects as follows, according to the prefix addresses and the prefix length of user's appointment, search the route table items that all mates with its prefix addresses and prefix length, can solve in some practical application, the Radix tree is searched the inapplicable problem of principle, has enlarged the range of application of BSD Radix tree.
Description of drawings
Fig. 1 is a program flow diagram of the present invention.
Embodiment
Technical scheme of the present invention according to the prefix addresses and the prefix length of routing address to be found, is searched the route table items of Satisfying Matching Conditions, searches flow process and is:
1, at first uses the prefix addresses of routing address to be found after beginning to search,, begin to search from the Radix root node according to Radix tree institutional framework.Use test position decision coupling branch in search procedure, test position is included on the Radix tree in the interior nodes, the prefix addresses of routing address to be found is 0 to walk left subtree with the test bit test, and the prefix addresses of routing address to be found and test bit test are 1 to walk right subtree.Finally can find unique leaf node (route table items) according to such rule;
Find after the route table items, whether prefix addresses and this route table items prefix addresses of determining routing address to be found mate: with the prefix addresses of routing address to be found, carry out the logical AND operation with this route table items prefix length, if the result who obtains is identical with this route table items prefix addresses, representative and this route table items coupling, on the contrary then expression does not match.If the match is successful for prefix addresses, need also to determine whether prefix length satisfies condition:
If I. this route table items prefix length is less than or equal to the prefix length of routing address to be found, then find the coupling route, the output lookup result is searched end.
II. otherwise, also need to judge whether to exist the leaf node of the prefix addresses coupling of other and routing address to be found, these leaf nodes are called as repeat key, their difference is the prefix length difference.If have such leaf node then one by one their prefix length and the prefix length of routing address to be found compared, find that wherein prefix length is the longest, and its prefix length is less than or equal to the leaf node of the prefix length of routing address to be found, as the route table items output that is complementary, search end.
So just need be if the route table items prefix addresses does not match or prefix length does not match according to the longest prefix match algorithm retrospective search that makes progress.
In the trace-back process, find that there is the mask tabulation in interior nodes, the subtree of this interior nodes is described so, might have the route table items that mates with the prefix addresses of routing address to be found.According to such hypothesis, the prefix addresses of routing address to be found and the mask address in the mask tabulation are carried out the logical AND operation, the result who obtains according to Radix tree traversal method compare test position successively, finally can obtain a leaf node again.Determine the prefix addresses of leaf node, whether mate, and the leaf node prefix length is less than or equal to the prefix length of routing address to be found, return the coupling route, search end if two conditions all satisfy with the prefix addresses of routing address to be found; Otherwise continue to use the next mask in the mask tabulation to mate.If the mask address of all mask tabulations does not satisfy condition, continue upwards to recall till root node, finish to search.
Embodiment
At present,, quick forwarding module is set all in forwarding units such as router generally, to improve the message forwarding rate in order to guarantee forward efficiency.Because if new transmit fast to set up need a period of time, during the packet that needs to transmit have only the upper strata CPU of submission to handle, the consumption of system resource is bigger.Therefore transmit fast by initiatively upgrading, saved the time, avoided unnecessary resource waste.After certain the bar route that is relied in the forwarding cache of quick forwarding module is deleted, can be routed to other one by what direct renewal forwarding cache was relied on, thus just need in routing table, search the route table items that can substitute this route,
Suppose to have 3 routes, they comprise successively:
1.0.0.0/8
1.2.0.0/16
1.2.3.0/24
If deletion 1.2.3.0/24 route in the routing table, forwarding module then needs to search routing table fast, after determining that this route table items is deleted, also have any bar route table items to use in the routing table, and will rely on the packet of route 1.2.3.0/24 originally, transmit according to the route table items that newly finds.The route table items that newly finds this time should be to substitute original route 1.2.3.0/24, just searches to be complementary with this prefix addresses 1.2.3.0, and length is less than the route table items of this prefix length 24.
According to lookup method provided by the invention, here it is 1.2.3.0 that prefix addresses is searched in our setting, prefix length is 23, because the prefix length of former prefix addresses is 24, in matching process, route 1.2.3.0/24 can not mate so, so route to be found can be referred to as time accurate route table items, by specified prefix length 23, have only mask-length could mate smaller or equal to 23 route table items.We search prefix addresses and 1.2.3.0 coupling in routing table, prefix length is equal to or less than 23 route table items.Example above using, we import keyword 1.2.3.0/23 when searching, the mask-length here is 23, so in matching process, route 1.2.3.0/24 can not mate, because what search is not the most accurate route table items, could mate so have only mask-length to be equal to or less than 23 route table items.Search the matched rule that prefix length is equal to or less than the route table items of 23 prefix addresses so utilize, will match route 1.2.0.0/16, so quick forwarding module can carry out corresponding forwarding work fast according to lookup result.Program circuit of the present invention is seen Fig. 1.
The renewal that purposes of the present invention is not limited to transmit fast also has some other to use, and as when new route table items of interpolation is more accurate than old list item, needs more the old and new's forwarding cache.Need to find time accurate route table items of forwarding cache dependence so, then they are updated to more accurate route table items and get on.If transmit by traveling through fast, upgrade the forwarding cache that relies on old route table items, then such operating efficiency is lower, transmits the route table items that is relied on fast by direct renewal, and then efficient is higher.Time accurate route that so just need find forwarding cache to rely in routing table, we can quote the forwarding cache of old road by list item by quick indexing originally according to this route, then they were updated to more accurate route table items and got on.Can improve update efficiency greatly like this.

Claims (4)

1. method for searching route table may further comprise the steps:
A. determine the prefix addresses and the prefix length of routing address to be found;
B. when searching routing table, set matching condition and be:, the prefix addresses of route table items and the prefix addresses of routing address to be found be complementary; Two, the prefix length of the prefix length of route table items and routing address to be found is complementary; Meet above-mentioned two route table items that are coupling.
2. according to the described method for searching route table of claim 1, it is characterized in that: among the step b, the prefix length of described route table items and the prefix length of routing address to be found are complementary and are meant, in the route table items that satisfies above-mentioned matching condition one, its prefix length is the longest, and is equal to or less than the route table items of the prefix length of routing address to be found.
3. according to the described method for searching route table of claim 1, it is characterized in that: described step b comprises:
B1. according to the prefix addresses of routing address to be found, search flow process according to the Radix tree, begin to find first leaf node from root node, whether prefix addresses and this leaf node prefix addresses of judging routing address to be found mate, if coupling, then enter step b2, otherwise enter step b4;
Whether b2. more described leaf node prefix length is less than or equal to the prefix length of routing address to be found, if, then determine the route table items of this leaf node for coupling, enter step b5; Otherwise enter step b3;
B3. the leaf node that judges whether to exist the prefix addresses of other and routing address to be found to be complementary; If have, then one by one with the prefix length of these leaf nodes, compare with the prefix length of routing address to be found, determine prefix length the leaf node of the prefix length of approaching routing address to be found be the route table items that is complementary, enter step b5; If no, enter step b4;
B4. according to the longest prefix match algorithm retrospective search that makes progress, determine that the prefix addresses with routing address to be found is complementary, prefix length is the coupling route table items less than first leaf node of the prefix length of routing address to be found;
B5. the route table items of output coupling is searched end.
4. according to the described method for searching route table of claim 3, it is characterized in that: among the step b3, the described prefix length leaf node of the prefix length of approaching routing address to be found is meant, the prefix length of this leaf node, the longest in the leaf node that the prefix addresses of all and routing address to be found is complementary; And be equal to or less than the prefix length of routing address to be found.
CNB2006100221480A 2006-10-31 2006-10-31 Method for searching route table Active CN100486227C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100221480A CN100486227C (en) 2006-10-31 2006-10-31 Method for searching route table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100221480A CN100486227C (en) 2006-10-31 2006-10-31 Method for searching route table

Publications (2)

Publication Number Publication Date
CN1949746A true CN1949746A (en) 2007-04-18
CN100486227C CN100486227C (en) 2009-05-06

Family

ID=38019133

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100221480A Active CN100486227C (en) 2006-10-31 2006-10-31 Method for searching route table

Country Status (1)

Country Link
CN (1) CN100486227C (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010145295A1 (en) * 2009-09-25 2010-12-23 中兴通讯股份有限公司 Method and apparatus for managing a route table
CN101848133B (en) * 2009-03-25 2013-08-07 华为技术有限公司 Prefix matching method, device and system
WO2016061925A1 (en) * 2014-10-22 2016-04-28 中兴通讯股份有限公司 Method, apparatus for maintaining routing table and storage medium
CN105721303A (en) * 2016-03-31 2016-06-29 华为技术有限公司 Routing control method, network device and controller
CN106603414A (en) * 2016-11-17 2017-04-26 上海红阵信息科技有限公司 Routing table fast comparing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1319347C (en) * 2002-10-28 2007-05-30 智邦科技股份有限公司 Routing method and routing system

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101848133B (en) * 2009-03-25 2013-08-07 华为技术有限公司 Prefix matching method, device and system
WO2010145295A1 (en) * 2009-09-25 2010-12-23 中兴通讯股份有限公司 Method and apparatus for managing a route table
CN101692653B (en) * 2009-09-25 2012-04-04 中兴通讯股份有限公司 Management method and management device for routing table
WO2016061925A1 (en) * 2014-10-22 2016-04-28 中兴通讯股份有限公司 Method, apparatus for maintaining routing table and storage medium
CN105721303A (en) * 2016-03-31 2016-06-29 华为技术有限公司 Routing control method, network device and controller
WO2017167028A1 (en) * 2016-03-31 2017-10-05 华为技术有限公司 Routing control method, network device and controller
CN105721303B (en) * 2016-03-31 2018-05-18 华为技术有限公司 A kind of route control method, the network equipment and controller
US10700973B2 (en) 2016-03-31 2020-06-30 Huawei Technologies Co., Ltd. Routing control method, network device, and controller
US11349759B2 (en) 2016-03-31 2022-05-31 Huawei Technologies Co., Ltd. Routing control method, network device, and controller
US11997016B2 (en) 2016-03-31 2024-05-28 Huawei Technologies Co., Ltd. Routing control method, network device, and controller
CN106603414A (en) * 2016-11-17 2017-04-26 上海红阵信息科技有限公司 Routing table fast comparing method
CN106603414B (en) * 2016-11-17 2020-04-10 珠海高凌信息科技股份有限公司 Routing table fast comparison method

Also Published As

Publication number Publication date
CN100486227C (en) 2009-05-06

Similar Documents

Publication Publication Date Title
CN101388030B (en) Database and database processing methods
US7633875B1 (en) Method and system for accelerating route calculation in link state routing protocols
CN1949746A (en) Method for searching route table
CN101605129B (en) URL lookup method for URL filtering system
Lin Distributed algorithms for fully personalized pagerank on large graphs
US8565247B2 (en) Techniques for efficiently updating routing information upon shortest path tree computation
US7894365B2 (en) Method for tracking transmission status of data to entities such as peers in a network
CN1947381A (en) Identifying reverse path forwarding information
CN103092860B (en) Search Hints information generating method and device
CN1889520A (en) Route information update method and network equipment based on OSPF
WO2010066115A1 (en) Method and system for lowering time complexity in short sequences assembly
CN103729427B (en) A kind of flow table conversion method based on self-defined multilevel flow table incremental update
EP2604006A1 (en) Method and apparatus for packet processing and a preprocessor
CN1949776A (en) 4 over 6 tunnel packing and depacking method for extending boundary gateway protocol
CN101916285A (en) Method and device for analyzing internet web page contents
WO2016061925A1 (en) Method, apparatus for maintaining routing table and storage medium
CN102945249A (en) Policy rule matching query tree generating method, matching method and device
CN102045412B (en) Method and equipment for carrying out compressed storage on internet protocol version (IPv)6 address prefix
CN101650730A (en) Method and system for discovering weighted-value frequent-item in data flow
CN101110778A (en) Method for compressing path transmitting table by router
CN108009061B (en) Method for changing node control category in complex network
CN107276916A (en) Interchanger flow table management method based on agreement unaware retransmission technique
CN101039275A (en) Path calculation unit networking and information obtaining method and communication system and related equipment
US7814185B2 (en) Prefix aggregation algorithm for routing coordination protocol in a loosely coupled massively parallel router
WO2016184069A1 (en) Route lookup 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
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: MAIPU COMMUNICATION TECHNOLOGIES CO., LTD.

Free format text: FORMER OWNER: MAIPU(SICHUAN) COMMUNICATION TECHNOLOGY CO.,LTD.

Effective date: 20120215

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

Effective date of registration: 20120215

Address after: 610041 Sichuan city of Chengdu province high tech Zone nine Hing Road No. 16 building, Maipu

Patentee after: Maipu Communication Technologies Co., Ltd.

Address before: 610041 Sichuan city of Chengdu province high tech Zone nine Hing Road No. 16 building, Maipu

Patentee before: Maipu(Sichuan) Communication Technology Co.,Ltd.