CN101286935A - Route searching method based on IP address scope - Google Patents

Route searching method based on IP address scope Download PDF

Info

Publication number
CN101286935A
CN101286935A CNA2008100946802A CN200810094680A CN101286935A CN 101286935 A CN101286935 A CN 101286935A CN A2008100946802 A CNA2008100946802 A CN A2008100946802A CN 200810094680 A CN200810094680 A CN 200810094680A CN 101286935 A CN101286935 A CN 101286935A
Authority
CN
China
Prior art keywords
prefix
route
route prefix
address
searching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA2008100946802A
Other languages
Chinese (zh)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNA2008100946802A priority Critical patent/CN101286935A/en
Publication of CN101286935A publication Critical patent/CN101286935A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to a routing lookup method based on range of an IP address, which comprises the following steps: subsets of route prefix are divided by levels according to the inclusion relation of the route prefix in a routing table; specific lookup is carried out in the range of a determined subset of the next level of route prefix included in the upper level of route prefix according to the receiving destination IP address from high to low level by level until a corresponding subset of the next level of route prefix is empty and takes a next hop port corresponding to the route prefix determined at last as a lookup result. The method of the invention adopts level division and specific lookup level by level, only has the prefix information of the destination route and no pre-calculation, reduces the range of lookup space, can reduce the complexity of data space and lookup time and be good for the realization of the process.

Description

A kind of method for searching route based on IP address range
Technical field
The present invention relates to data communication, be specifically related to a kind of method for searching route based on IP address range.
Background technology
Along with the fast development of Internet, the interface rate that is used for the interconnected core router of backbone network has reached 2.5Gbps to 10Gbps.This rate requirement core router can be transmitted millions of to up to ten million above groupings each second.The essential step of packet forward is searched routing table exactly, and therefore the algorithm of IP address search fast is the key that realizes that high-speed packet is transmitted.
The IP address search need realize that longest path is by prefix matching.In recent years, the researcher has proposed multiple route querying algorithm and has searched performance with raising.Prior art discloses the method for multiple IP route querying.Can be classified as following two classes according to its processing mode at disclosed method for searching route: the 1) method 2 of the searching) IP address range of representing by the route prefix method of searching by the string of binary characters of route prefix correspondence to the route prefix.
In first kind method, route prefix is to represent by the mask of route prefix.Every adds the route prefix Pj that route prefix length constitutes by the IP address, can be expressed as such as " 0100 * * *" the binary bits string of form, wherein the highest several is by the mask of IP address and route prefix length and 01 string that gets, and is that 0 position is remembered entirely and is * from mask, ends up to lowest order.Each purpose IP address by the IP bag of router can be expressed as binary Bit String such as " 01001010 ".In these class methods, the coupling in the route querying is meant that promptly the Bit String when binary Bit String of destination address representative and route prefix representative is complementary, by " *" potential energy of expression mates " 0 " and " 1 " simultaneously, optimum Match promptly be meant in the Bit String of all couplings, have longest path by prefix length-promptly comprise minimum " *"-that coupling.
In first kind method, disclosed technical method has binary system trie tree, path compression trie tree (Path-Compressed Trie) Sklower[21], multiple-limb Trie tree (Multi-bit Trie) and relevant optimization method Srinivasan[22]..
In second class methods, route prefix is to represent with the scope of route prefix.Every adds the route prefix Pj that route prefix length constitutes by the IP address, all representing the continuous IP address range of IP address space the preceding paragraph, therefore Pj is expressed as by a closed interval and two the tuple ([Pj.Start that numerical value is formed, Pj.End], Pj.length) Pj.Start wherein, Pj.End represents the starting point and the end point of this IP address range respectively, and Pj.length represents the route prefix length of this route prefix.A point on the IP address space is all being represented in the purpose IP address of the IP datagram of each process router.In these class methods, the coupling of route searching result is meant that promptly the point when destination address representative falls in the interval that certain two tuple represents, optimum Match promptly is meant and has longest path that route prefix by prefix length in two tuples of all couplings.
In second class methods, disclosed technical method have that Butler Lampson proposes in [23] first press route prefix range retrieval algorithm and a series of at its improved method.Because may exist inclusion relation between the route prefix, these inclusion relations are to be produced by the network application of reality, as many caves (Multi-homed) main frame, or load balancing etc.Need to calculate in advance in [23] and preservation information is finished longest path by prefix matching, if the minizone that the purpose route prefix is cut apart on address space, each basic interval is designated as I k(k>0, k Z) is so to each I kAll need to precompute the longest coupling route prefix that falls into this interval datagram.A route prefix example collection as shown in Figure 1 needs by the direction of arrow shown in shown in Figure 2, calculates to find in advance to comprise basic interval I kLongest path by prefix matching, to avoid recalling when searching.Computing information not only means the more memory space of needs in advance, means that simultaneously this method is longer at the initial time of routing table reconstruction.
Summary of the invention
The technical issues that need to address of the present invention are how a kind of method for searching route based on IP address range is provided, and do not need computing information in advance, and can reduce the routing table entry of searching, and improve and search the time.
Above-mentioned technical problem of the present invention solves like this, and a kind of method for searching route based on IP address range is provided, and may further comprise the steps:
1.1) divide the route prefix subclass by different level by route prefix inclusion relation in the routing table;
1.2) according to receive purpose IP address successively in determining following one deck route prefix subclass scope that the upper strata route prefix comprises, accurately search from high to low under correspondence one deck route prefix subclass be combined into sky and with last route prefix of determining corresponding next jump port as lookup result.
According to method for searching route provided by the invention, thisly divide the route prefix subclass by different level by the route prefix inclusion relation, be not only a kind of rule, but a kind of CIDR that is applicable to is selected the universal method of cidr address structure, is applicable to that not only IPv6 is equally applicable to IPv4.
According to method for searching route provided by the invention, the present invention's searching in the set of sub-route prefix is accurately to search, and can use the existing very ripe algorithm of searching, and includes, but are not limited to Hash lookup, binary chop etc.
According to method for searching route provided by the invention, this method for searching route can adopt the Data Structures of following type as the set of expression route prefix, described step 1.1) is the initialization foundation of this Data Structures, described type includes, but are not limited to balanced tree, comprise B tree and B+ tree, Adelson-Velskii-Landis tree etc.
A kind of method for searching route provided by the invention based on IP address range, dividing the route prefix subclass by different level by the route prefix inclusion relation accurately searches then step by step, with the existing IP method for searching route of searching according to address realm, of the present invention have a following advantage: 1) owing to do not need precomputation information, the thought of dividing makes only deposits the purpose route prefix information that exists in the routing table in the data structure, the redundant information that does not have route prefix expansion or other factors to cause.Its space complexity is O (N).2) this method adopts by route prefix and comprises level accurately searching step by step simultaneously, search at each and not only can find once coupling, and for the more accurate search volume scope that provides is provided next time, therefore in the process of searching reduce and understand spatial dimension, promptly reduce the routing table entry of searching, shortened the time of searching.3) no precomputation process has reduced initialization time.4) design philosophy of the implicit recurrence of this method, the programming when being convenient to implement.
Description of drawings
Further the present invention is described in detail below in conjunction with the drawings and specific embodiments.
Fig. 1 is that a kind of route prefix scope of routing table example is represented.
Fig. 2 is the precomputation example that needs the common route prefix scope lookup method of precomputation information.
Fig. 3 is the data structure that the initialization procedure of routing table example shown in Figure 2 is set up.
Fig. 4 is the search procedure of certain purpose IP on the data structure of the foundation of routing table example shown in Figure 3.
Embodiment
At first, basis of the present invention is described:
1) comprises route prefix and involved route prefix: for the route prefix in the cidr address structure, with a shape as [IP address/route prefix length] to representing, the route prefix that each is such has been represented the continuous address realm of IP address space the preceding paragraph.Make p i(i>0, i ∈ Z) is designated as route prefix i, Set (p i) be designated as the IP address range that route prefix i is comprised, if Set ( p i ) ⋐ Set ( p j ) , P so jThen be defined as p iComprise route prefix, p iBe defined as p jInvolved route prefix.
2) m layer route prefix: if Set ( p a ) ⋐ Set ( p b ) , Set ( p b ) ⋐ Set ( p c ) , ... Set ( p m ) ⋐ Set ( p n ) (a<b<c<...<m<n) satisfy simultaneously, and inclusion relation is transmitted certain route prefix p i(" i≤n) residing backward position is m to a in comprising chain, then defines p iBe m layer route prefix.
Second step illustrated the inventive method, specifically comprised:
Step 0: initialization
Set default route for route prefix length is 0 route prefix, divide default route into the 1st layer of route prefix set.
Step 0.1
The route prefix that is not routed prefix length non-0 with all the other all comprises route prefix, puts the 2nd layer of route prefix set under.
Step 0.2
The initial value that m is set is 2, and the initial value of i is 1.
For the route prefix p in the set of m (m>0, m ∈ Z) layer route prefix i(i>0, i ∈ Z) finds only to be comprised by it and not by (i.e. m+3...) all route prefix of comprising of layer route prefix are placed into these route prefix by p for m+1, m+2 below the m layer iThe m+1 layer route prefix set of next layer index field index in.
I adds 1, repeating step 0.2.
M adds 1, repeating step 0.2.
Step 1:
The initial value that m is set is 1.
To the purpose IP address that each router is received, search in the route prefix set of m layer.If a certain route prefix p on the coupling in this route prefix set i(i>0, i ∈ Z) writes down current optimum Match route prefix p i
Step 2:
Check p iNext layer index field, if p iNext layer index field be empty, then finish to search, current optimum Match route prefix is returned as the route prefix of long coupling.If non-NULL, then according to next layer index field index arrives by p iThe following one deck route prefix set that comprises, the m value adds 1; Jump to step 1.
At last, describe the present invention in conjunction with specific embodiments in detail:
The key of choosing of embodiment is to select the suitable data structure to represent the set of each layer route prefix, searches the insertion deletion action efficiently to provide.The author provides an embodiment that uses height-balance (the height balance) balanced tree B tree at this.
(1) initialization-basic data structure method for building up
Adopt the basic data structure of B tree as the set of expression route prefix.Common B tree key assignments two word territories have been increased, a beginning end mark, represent that this key assignments represents the starting point or the end point of address realm, next layer index field is pointed to the sub-Btree that following one deck route prefix set that the route prefix represented by this address realm comprises is formed.Simultaneously the insertion of Btree is searched and make suitable modification, improved Btree inserts and searches and will return that value of the maximum slightly littler than keyword.
According to routing table example as shown in Figure 1, by prefix 1, prefix 2, the step that prefix 3 is inserted is explained the data structure of how setting up as shown in Figure 3.
1) the route prefix is sorted to big from little according to its route prefix length, the result of ordering is { prefix 1, prefix 2, prefix 3, prefix 4, prefix 5, prefix 6, prefix 7, prefix 8}.
2) create a new B tree, Btree A.
3) prefix 1 is changed into address realm and represent, the start address value of prefix 1 is inserted Btree A as B tree key assignments, mark remembers that this key assignments is the beginning of an address realm.
4) end address value of prefix 1 is inserted Btree A as B tree key assignments, this key assignments of mark is the end of an address realm.
5) prefix 2 is changed into address realm and represent, the start address value of prefix 2 is searched in Btree A as keyword, improved Btree searches and will return that value of the maximum slightly littler than keyword, at this moment, returns the key assignments of the start address value structure of prefix 1.
6) check next layer index field of returning key assignments, check the beginning trailer field of key assignments.
Learn it is the beginning of an address realm by the key assignments that returns, so create a new B tree, Btree B.
7) will return the pointer of next layer index field assignment Btree B of key assignments.
8) prefix 2 is changed into address realm and represent, the start address value of prefix 2 is inserted Btree B as B tree key assignments, mark remembers that this key assignments is the beginning of an address realm.
9) end address value of prefix 2 is inserted Btree B as B tree key assignments, this key assignments of mark is the end of an address realm.
10) prefix 3 is changed into address realm and represent, the start address value of prefix 3 is searched in Btree A as keyword, at this moment, return the key assignments of the start address value structure of prefix 1.
11) check next the layer index field non-NULL that returns key assignments, jump to Btree B by next layer index field.
12) the start address value of prefix 3 is searched in Btree B as keyword, at this moment, returns the key assignments of the start address value structure of prefix 2
13) checking that next layer index field of returning key assignments is sky, check the beginning trailer field of key assignments, is a beginning key assignments, so create a new B tree, Btree C.
14) next the layer index field assignment that will return key assignments is the pointer of Btree C.
15) prefix 3 is changed into address realm and represent, the start address value of prefix 3 is inserted Btree C as B tree key assignments, this key assignments of mark is the beginning of an address realm.
16) end address value of prefix 3 is inserted Btree C as B tree key assignments, this key assignments of mark is the end of an address realm.
As shown in Figure 3, set up SET layering route prefix subclass by this insertion process: Btree A, Btree B, Btree C, Btree D and Btree E.
(2) route querying process
As shown in Figure 4, below one be longest path by the purpose IP address of prefix matching with prefix 4 be example, illustrate that this is implemented in the layering route prefix subclass of having set up: the concrete search procedure among Btree A, Btree B, Btree C, Btree D and the Btree E.
1) in the 0th layer route prefix B tree Btree A, purpose IP and prefix 1 coupling (in Fig. 4, showing) with black box.
2) next layer index by prefix 1 jumps to Btree B, and noting current optimum Match is prefix 1.
3) prefix 2 on the purpose IP coupling in Btree B, upgrading current optimum Match is prefix 2.
4) next layer index redirect Btree C by prefix 2,
5) prefix 3 on the purpose IP coupling in route prefix B tree Btree C, upgrading current optimum Match is prefix 3.
6) index by prefix 3 jumps to Btree D.
7) prefix 4 on the purpose IP coupling in route prefix B tree Btree D, upgrading current optimum Match is prefix 4.Because prefix 4 does not have the next stage index, search end, return next jumping port numbers of optimum Match prefix 4.

Claims (7)

1, a kind of method for searching route based on IP address range is characterized in that, may further comprise the steps:
1.1) divide the route prefix subclass by different level by route prefix inclusion relation in the routing table;
1.2) according to receive purpose IP address successively in determining following one deck route prefix subclass scope that the upper strata route prefix comprises, accurately search from high to low under correspondence one deck route prefix subclass be combined into sky and with last route prefix of determining corresponding next jump port as lookup result.
According to the described method for searching route of claim 1, it is characterized in that 2, described IP address is the IPv4 address.
According to the described method for searching route of claim 1, it is characterized in that 3, described IP address is the IPv6 address.
According to the described method for searching route of claim 1, it is characterized in that 4, this method for searching route adopts the Data Structures of balanced tree as the set of expression route prefix, described step 1.1) be the initialization foundation of this Data Structures.
According to the described method for searching route of claim 4, it is characterized in that 5, described balanced tree is B tree, B+ tree or Adelson-Velskii-Landis tree.
6, according to the described method for searching route of claim 1, it is characterized in that described step 1.2) in accurately search the employing Hash lookup.
7, according to the described method for searching route of claim 1, it is characterized in that described step 1.2) in accurately search the employing binary chop.
CNA2008100946802A 2008-05-07 2008-05-07 Route searching method based on IP address scope Pending CN101286935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008100946802A CN101286935A (en) 2008-05-07 2008-05-07 Route searching method based on IP address scope

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008100946802A CN101286935A (en) 2008-05-07 2008-05-07 Route searching method based on IP address scope

Publications (1)

Publication Number Publication Date
CN101286935A true CN101286935A (en) 2008-10-15

Family

ID=40058914

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008100946802A Pending CN101286935A (en) 2008-05-07 2008-05-07 Route searching method based on IP address scope

Country Status (1)

Country Link
CN (1) CN101286935A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101795304A (en) * 2010-03-12 2010-08-04 中国电力科学研究院 Method for boosting search of IPv6 address space in digital transformer substation
CN101938503A (en) * 2009-09-27 2011-01-05 北京暴风网际科技有限公司 System and method for selecting opposite terminals in point-to-point network
CN104426770A (en) * 2013-09-09 2015-03-18 中兴通讯股份有限公司 Routing lookup method, routing lookup device and method for constructing B-Tree tree structure
WO2015192742A1 (en) * 2014-06-20 2015-12-23 华为技术有限公司 Lookup device, lookup method and configuration method
WO2017000893A1 (en) * 2015-06-30 2017-01-05 杭州华三通信技术有限公司 Ip routing lookup
WO2017000892A1 (en) * 2015-06-30 2017-01-05 杭州华三通信技术有限公司 Ip routing lookup
CN107154899A (en) * 2017-03-23 2017-09-12 广东顺德中山大学卡内基梅隆大学国际联合研究院 A kind of system that IP routes are searched with suffix index
CN110071871A (en) * 2019-03-13 2019-07-30 国家计算机网络与信息安全管理中心 A kind of large model pool ip address matching process
CN112187743A (en) * 2020-09-14 2021-01-05 北京云杉世纪网络科技有限公司 Network policy matching method and system based on IP address longest prefix
CN113343034A (en) * 2021-06-08 2021-09-03 湖南大学 IP searching method, system and storage medium

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938503A (en) * 2009-09-27 2011-01-05 北京暴风网际科技有限公司 System and method for selecting opposite terminals in point-to-point network
CN101938503B (en) * 2009-09-27 2013-03-20 北京暴风科技股份有限公司 System and method for selecting opposite terminals in point-to-point network
CN101795304A (en) * 2010-03-12 2010-08-04 中国电力科学研究院 Method for boosting search of IPv6 address space in digital transformer substation
CN104426770A (en) * 2013-09-09 2015-03-18 中兴通讯股份有限公司 Routing lookup method, routing lookup device and method for constructing B-Tree tree structure
CN105227468B (en) * 2014-06-20 2019-01-08 华为技术有限公司 A kind of lookup device, lookup method and configuration method
CN105227468A (en) * 2014-06-20 2016-01-06 华为技术有限公司 One searches device, lookup method and collocation method
WO2015192742A1 (en) * 2014-06-20 2015-12-23 华为技术有限公司 Lookup device, lookup method and configuration method
WO2017000893A1 (en) * 2015-06-30 2017-01-05 杭州华三通信技术有限公司 Ip routing lookup
WO2017000892A1 (en) * 2015-06-30 2017-01-05 杭州华三通信技术有限公司 Ip routing lookup
CN107154899A (en) * 2017-03-23 2017-09-12 广东顺德中山大学卡内基梅隆大学国际联合研究院 A kind of system that IP routes are searched with suffix index
CN107154899B (en) * 2017-03-23 2021-01-08 广东顺德中山大学卡内基梅隆大学国际联合研究院 System for searching IP route by suffix index
CN110071871A (en) * 2019-03-13 2019-07-30 国家计算机网络与信息安全管理中心 A kind of large model pool ip address matching process
CN112187743A (en) * 2020-09-14 2021-01-05 北京云杉世纪网络科技有限公司 Network policy matching method and system based on IP address longest prefix
CN113343034A (en) * 2021-06-08 2021-09-03 湖南大学 IP searching method, system and storage medium

Similar Documents

Publication Publication Date Title
CN101286935A (en) Route searching method based on IP address scope
CN102484610B (en) Routing table construction method and device and routing table lookup method and device
US6564211B1 (en) Fast flexible search engine for longest prefix match
CN100465947C (en) Method and device for producing and using improved tree-shape bit map data structure
US8385343B2 (en) Method and apparatus for searching IP address
CN103514201B (en) Method and device for querying data in non-relational database
CN100445999C (en) Data storaging and searching method
Le et al. Scalable tree-based architectures for IPv4/v6 lookup using prefix partitioning
CN1504912A (en) Performance and memory bandwidth utilization for tree searches using tree fragmentation
CN102333036B (en) Method and system for realizing high-speed routing lookup
CN105119834B (en) A kind of source address destination address joint lookup method based on compound trie tree constructions
CN102405622A (en) Methods and devices for binary tree construction, compression and lookup
EP2544414A1 (en) Method and device for storing routing table entry
CN103051543A (en) Route prefix processing, lookup, adding and deleting method
CN102045412B (en) Method and equipment for carrying out compressed storage on internet protocol version (IPv)6 address prefix
CN101241499B (en) Patricia tree rapid lookup method in high memory access wide
CN105141525A (en) IPv6 routing lookup method and IPv6 routing lookup device
EP1063827A2 (en) Method for address lookup
CN103107945A (en) System and method of quick searching Internet protocol version 6 (IPV6) route
CN101277252A (en) Method for traversing multi-branch Trie tree
CN100578943C (en) Optimized Huffman decoding method and device
CN100476824C (en) Method and system for storing element and method and system for searching element
CN114884877A (en) IPv6 route searching method combining hash table and HOT
KR100999408B1 (en) Method for searching an ??? using hash tree
Hsieh et al. A classified multisuffix trie for IP lookup and update

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20081015