CN100490440C - A method for implementing external route calculation for router - Google Patents
A method for implementing external route calculation for router Download PDFInfo
- Publication number
- CN100490440C CN100490440C CNB031230512A CN03123051A CN100490440C CN 100490440 C CN100490440 C CN 100490440C CN B031230512 A CNB031230512 A CN B031230512A CN 03123051 A CN03123051 A CN 03123051A CN 100490440 C CN100490440 C CN 100490440C
- Authority
- CN
- China
- Prior art keywords
- array
- lsa
- address
- forwarding
- item
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Abstract
This invention discloses a method for realizing outer route computation of a router which declares an array in the router and sets array items of forwarding-address storing the fifth or the seventh LSA, next hop and route distance route information. If the router needs to compute outer route according to a certain LSA, it looks for the related array items in the array according to the forwarding-address in the said LSA and to get related information from said array directly and compute said outer route if so, otherwise it looks for the related next hop and the route distance information set in the array item and to compute the outer route. It can get the related information only by looking for array with little information to increase efficiency of computing outer routes.
Description
Technical field
(Open Shortest Path First OSPF), relates to the outside route Calculation Method of a kind of realization router or rather to the present invention relates to the network link status Routing Protocol.
Background technology
OSPF is the agreement that a kind of employing link-state algorithm (SPF) is selected optimum route, each router generates own link-state information on every side, form LSA (Links StateAdvertisement, LSA), all LSA propagate in network-wide basis, and each router calculates routing iinformation according to its all LSA that receive.
Autonomous system based on ospf protocol is connected with outside route system if desired, then need the Autonomous System Boundary Router, AS Boundary Router (ASBR) in the autonomous system to introduce outside route, be exactly that ASBR in the autonomous system introduces the route that other agreements produce in this router specifically, generate and describe the LSA of this autonomous system to this outside route system route.This autonomous system is if normal areas, and that then the ASBR in the autonomous system generates is the 5th class LSA, if be that (NOT SO STUB AREA, NSSA), that then the ASBR in the autonomous system generates is the 7th class LSA in non-root node zone.All comprise destination address, mask and the ASBR of certain bar route in the interface IP address (forwarding_address) of ASBR, the outside route system information such as distance among the 5th class and the 7th class LSA to this destination address.But the forwarding_address that is filled among the 5th class and the 7th class LSA is different: the ASBR in the autonomous system is when generating the 5th class LSA, if the route that is introduced into is moved at the shared network segment, then must fill in the interface IP address of corresponding A SBR in the outside route system among the forwarding_address of the 5th class LSA, be 0.0.0.0 otherwise fill out; When generating the 7th class LSA, need to fill in the interface IP address of some ospf domains of this ASBR among the forwarding_address.
Autonomous system is with after outside route system is connected, if certain router-A in the autonomous system need be connected with certain the router B in the outside route system, then router-A obtains the LSA relevant with router B from the ASBR of autonomous system, and according to the route of the information calculations among this LSA to this router.This LSA may be the 5th class LSA, also may be the 7th class LSA, because the forwarding_address among the 5th class LSA may be sky, therefore when calculating, need at first the forwarding_address among the LSA to be judged, when forwarding_address is sky, do not calculate route by it, otherwise, ASBR in the autonomous system need find OSPF route between router-A and the ASBR according to the address information among the forwarding_address from routing table, and router-A is routed to distance between the ASBR that this forwarding_address identifies by this, suppose that this route is R, router-A is X by R to the distance of ASBR, and entrained ASBR is Y to the range information of router B among this LSA, then router-A is X+Y to the distance of router B, and next jumping of router-A is next jumping of route R.
This shows, router is carrying out route when calculating the 5th class or the 7th class LSA, to each forwarding_address is not empty LSA, all will search routing table according to the address information among the forwarding_address and determine next jumping and the corresponding distance of this router to ASBR.This lookup method has following problem:
1) along with the increase of network, the 5th class that ASBR generates or the number of the 7th class LSA can be increasing, even may reach more than the hundreds of thousands bar, the 5th class or the 7th class LSA that need router to calculate also can be very many, also may have up to a million routes in the routing table, therefore a router calculates the routing table that each LSA needs to travel through complexity like this when calculating outside route, and this amount of calculation will be very big.
2) if former thereby need router to recomputate all routes because of network oscillation etc., and route added in the routing table, then want the expensive time, if at this moment there is message to need to transmit, and there is not this corresponding route in the routing table, then this message can only be dropped, thereby has influence on message forwarding.
3) in actual networking, the ASBR that introduces outside route can be not a lot, corresponding forwarding_address can be not a lot of yet, therefore the forwarding_address information that has among a lot of LSA is identical, and router is when calculating every route, all according to the traversal of the forwarding_address among LSA routing table, must have like this is to repeat to search next jumping and corresponding distance according to identical forwarding_address information many times.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of realization the 5th class and the 7th class LSA route Calculation Method, make router when calculating outside route by forwarding_address, can find corresponding next jumping and range information apace, and avoid in routing table, repeating to search route according to identical forwarding_address.
For reaching above purpose, technical scheme of the present invention is achieved in that the outside route Calculation Method of a kind of realization router, calculates outside route according to the 5th class or the 7th class LSA, and this method may further comprise the steps:
A. array of statement in router is provided for preserving IP address, next jumping of this forwarding_address correspondence and the array item of route distance information of the forwarding_address of LSA in this array;
B. router obtains the corresponding LSA of this outside route, judge that this LSA is the 5th class LSA or the 7th class LSA, if the 5th class LSA, judge then whether the forwarding_address among the 5th class LSA is empty, if be sky, then process ends, otherwise, enter next step, if the 7th class LSA then directly enters next step;
C. router searches according to forwarding_address whether its corresponding array item is arranged in the array, if have, then from this array item, obtain corresponding next jumping and route distance information, otherwise, from routing table, find next jumping and the route distance information of this LSA according to forwarding_address, the IP address of this next jumping and route distance information and forwarding_address is stored in the array item;
D. router is according to the outside route of the information calculations among this next jumping, route distance and the LSA.
Among the described step a, the number that the array item in the array is set is less than 10, and is provided with one is used for identifying the subscript that this array has been used the array item number in array.
Described target initial value down is set to 0.
Described step c is after finding next jumping and route distance information from routing table, judge whether the array item of having time according to the subscript of array, if have, then this next jumping and route distance information and forwarding_address are stored in the array item, and the subscript of array added 1, otherwise, from array, select an array item, next jumping and route distance information and forwarding_address are stored in this array item.
Among the described step a, LSA number identification item is set in array item, this identification item identifies the number of that calculated and corresponding with this array item LSA, among the described step c, after being stored in next jumping and route distance information and forwarding_address in the empty array item, the LSA number in the array item is added 1; If there is not free array item in the array, stored information in the array item of LSA minimum number then, and the LSA number in this array item is set to 1.
The inventive method is by declaring array in router, in the time of will calculating outside route according to forwarding_address for the first time, in the array item that next jumping of obtaining from routing table according to forwarding_address and range information are kept at array, next time is when calculating outside route according to this forwarding_address again, by the traversal array, from array, obtain next jumping and range information, make router when calculating outside route according to same forwarding_address, can only when calculating for the first time, from routing table, obtain information, when calculating, all the other only need from array, obtain this information, reduce the number of times of router traversal routing table, improved the efficient of calculating the 5th class or the 7th class LSA route greatly.And when network oscillation, router can calculate route soon, thereby can not have influence on forwarding of data.In this array, introduce the number of the LSA that uses forwarding_address, and the more pairing array item of forwarding_address is used in reservation in this array, guarantee that the array item in the array is fewer, can improve the efficient that router is searched array.
Description of drawings
Fig. 1 is the flow chart that router-A connects router B in the embodiment of the invention.
Embodiment
Below in conjunction with drawings and the specific embodiments the inventive method is described in further detail.
At first set forth core concept of the present invention: the present invention program at router when calculating outside route, the situation that has interface IP address information among the forwarding_address of employed the 5th class or the 7th class LSA, calculate array of statement in the router of outside route at needs, this array has a plurality of array items, preserve the concrete IP address of a forwarding_address in each array item, next jumping and respective distance that router finds from routing table according to this forwarding_address, and this router employed the 5th class of this forwarding_address information or the number of the 7th class LSA, i.e. LSA number identification item of comprising when calculating outside route.Router directly obtains relevant next jumping and respective distance information from this array when calculating outside route.
Based on above-mentioned thought, the process that is connected with router B in the outside route system with the router-A in the autonomous system is an example below, and the present invention program is elaborated.The process that router-A is connected with router B is referring to Fig. 1, corresponding following steps:
A. array of router-A statement is provided with a plurality of array items in this array, and array index is set to have used the number of array item in the expression array.
Preserve next jumping and the respective distance that this router finds from routing table according to a forwarding_address information in the array item, and this router employed the 5th class of this forwarding_address information or number of the 7th class LSA of comprising when calculating outside route.
This array item can be set according to the number of ASBR in the autonomous system, and in order to improve the speed of searching array, generally array item is set in 10.
B. router-A judges whether to need to calculate outside route, if desired, then enters next step, otherwise, return step b.
C. router-A obtains the LSA of corresponding router B from the native system ASBR relevant with this outside route system, judge that this LSA is the 5th class LSA or the 7th class LSA, if the 5th class LSA, whether the forwarding_address that then judges the 5th class LSA is empty, if be empty, process ends then, otherwise, next step entered; If the 7th class LSA then directly enters next step.
D. router-A if there be not the array item corresponding with this forwarding_address in the array, then enters next step according to the traversal of the forwarding_address among LSA array; Otherwise, from this array item, directly obtain next jumping and the range information of this forwarding_address, according to the route of this information calculations router-A, will use the number of the LSA of this forwarding_address to add 1 in this array item, and return step b to router B.
E. obtain relevant next jumping and range information according to forwarding_address traversal routing table, and judge in the array whether free array item according to the subscript of array, if have, the concrete IP address information of next jumping that then will obtain and range information and forwarding_address is kept in the array item of array, to use the number of the LSA of this forwarding_address to add 1 in this array item, subscript with array adds 1 simultaneously, and returns step b; If do not have, then travel through this array once more, find the minimum array item of LSA number sign in this array, next jumping that usefulness had before been obtained and range information are replaced the content in this array item, and reset the number sign of LSA in this array item, return step b at last.
The LSA that the foregoing description generates at ASBR the present invention is that the implementation process of the 5th class or the 7th class LSA has been done comparatively detailed explanation, and the LSA that generates with ASBR is that the 7th class LSA is an example below, with a specific embodiment the present invention program is explained.
The zone of supposing certain OSPF equipment place is the NSSA zone, 100,000 article of the 7th class LSA arranged in this OSPF equipment, but the ASBR that produces this 100,000 article of the 7th class LSA has only 5, the 7th class LSA that an ASBR wherein produces is minimum, has only 1, simultaneously, existing route is 100,000 in the routing table.In such OSPF equipment, forwarding_address has only 5 altogether.
If a router in this OSPF equipment need calculate and an outside route that ASBR is relevant, then this router is declared an array M earlier, according to the situation of this OSPF equipment, 4 array items can be set in this array.The following X that is designated as of this array M, the initial value of X is 0, maximum is 4.
This router obtains needed the 7th class LSA from this ASBR after, according to the traversal of the forwarding_address among the 7th class LSA array, at this moment the subscript X of array is 0, array item wherein all is empty, therefore need search routing table according to forwarding_address, obtain corresponding next jumping and range information, and it is kept in the array item of array, to use the number of the LSA of this forwarding_address to add 1 in this array item, and the subscript X of this array is added 1.
Later on when calculating other the 7th class LSA route, at first travel through array, if had in the array with the 7th class LSA in the corresponding array item of forwarding_address, then directly from this array item, obtain information, and will use the number of the LSA of this forwarding_address to add 1 in this array item; If in the array not with the 7th class LSA in the corresponding array item of forwarding_address, then need in routing table, to find corresponding next jumping and range information according to forwarding_address, and whether the subscript of judging array is less than 4, if less than 4, also free array item then is described, in this array item, preserve corresponding information, and the subscript of array added 1, otherwise, travel through array once more, number according to the LSA that preserves in the array item finds the array item that uses minimum forwarding_address correspondence, what present embodiment found is the array item that only used forwarding_address correspondence once, preserves corresponding information in this array item.
In the above-mentioned relevant embodiment of OSPF equipment, when router calculates 100,000 article of the 7th class LSA, only need search the routing table of 5 200,000 route scales, calculate for remaining 199995 times and only need search the relevant information that an array with 4 array items just can obtain forwarding_address, this must improve the efficient of calculating the 7th class LSA route greatly.Can improve the efficient of calculating the 5th class LSA route equally with such method.
Claims (5)
1, the outside route Calculation Method of a kind of realization router is calculated outside route according to the 5th class or the 7th class LSA LSA, it is characterized in that this method may further comprise the steps:
A. array of statement in router is provided for preserving IP address, next jumping of this forwarding_address correspondence and the array item of route distance information of the interface IP address forwarding_address of LSA in this array;
B. router obtains the corresponding LSA of this outside route, judge that this LSA is the 5th class LSA or the 7th class LSA, if the 5th class LSA, judge then whether the forwarding_address among the 5th class LSA is empty, if be sky, then process ends, otherwise, enter next step, if the 7th class LSA then directly enters next step;
C. router searches according to forwarding_address whether its corresponding array item is arranged in the array, if have, then from this array item, obtain corresponding next jumping and route distance information, otherwise, from routing table, find next jumping and the route distance information of this LSA according to forwarding_address, the IP address of this next jumping and route distance information and forwarding_address is stored in the array item;
D. router is according to the outside route of the information calculations among this next jumping, route distance and the LSA.
2, method according to claim 1 is characterized in that among the described step a that the number that the array item in the array is set is less than 10, and is provided with one is used for identifying the subscript that this array has been used the array item number in array.
3, method according to claim 2 is characterized in that, described target initial value down is set to 0.
4, method according to claim 2, it is characterized in that, described step c is after finding next jumping and route distance information from routing table, judge whether the array item of having time according to the subscript of array, if have, then this next jumping and route distance information and forwarding_address are stored in the array item, and the subscript of array added 1, otherwise, from array, select an array item, next jumping and route distance information and forwarding_address are stored in this array item.
5, method according to claim 4, it is characterized in that among the described step a, LSA number identification item is set in array item, this identification item identifies the number of that calculated and corresponding with this array item LSA, among the described step c, after being stored in next jumping and route distance information and forwarding_address in the empty array item, the LSA number in the array item is added 1; If there is not free array item in the array, stored information in the array item of LSA minimum number then, and the LSA number in this array item is set to 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB031230512A CN100490440C (en) | 2003-04-29 | 2003-04-29 | A method for implementing external route calculation for router |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB031230512A CN100490440C (en) | 2003-04-29 | 2003-04-29 | A method for implementing external route calculation for router |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1543160A CN1543160A (en) | 2004-11-03 |
CN100490440C true CN100490440C (en) | 2009-05-20 |
Family
ID=34321195
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB031230512A Expired - Fee Related CN100490440C (en) | 2003-04-29 | 2003-04-29 | A method for implementing external route calculation for router |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100490440C (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100384126C (en) * | 2005-12-24 | 2008-04-23 | 华为技术有限公司 | Link station information transmission method based on multi-interface route equipment |
CN100591040C (en) * | 2006-06-26 | 2010-02-17 | 华为技术有限公司 | Method and system for calculating routing of directly connecting broadcasting link |
CN102316005B (en) * | 2010-07-05 | 2014-03-19 | 杭州华三通信技术有限公司 | Method for updating OSPF (open shortest path first) route and OSPF router |
CN102035739B (en) * | 2010-12-14 | 2012-05-30 | 北京星网锐捷网络技术有限公司 | Notification method and device for interface address and routing equipment |
CN103501271B (en) * | 2013-09-18 | 2017-01-18 | 杭州华三通信技术有限公司 | Election method and device of LSA conversion device |
-
2003
- 2003-04-29 CN CNB031230512A patent/CN100490440C/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN1543160A (en) | 2004-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101965715B (en) | Tie-Breaking in Shortest Path Determination | |
EP2371094B1 (en) | Method and communication apparatus for generating summarised network topology parameters | |
CN103370908B (en) | For finding system and the method for the point-to-multipoint label switch paths across multiple territories | |
CN102057637B (en) | Routing-based proximity for communication networks | |
CN101272393B (en) | Routing computing method and network node based on link condition routing protocol | |
US20070086358A1 (en) | Directed acyclic graph computation by orienting shortest path links and alternate path links obtained from shortest path computation | |
CN100428736C (en) | Topology method of one-time route computing to realize hierarchical route | |
CN101753462B (en) | Method and device for realizing multi-next-hop routes | |
CN108768856A (en) | A kind of route processing method and device | |
KR20150030644A (en) | Tie-breaking in shortest path determination | |
CN101483610A (en) | Route updating method for link state routing protocol | |
CN103078796B (en) | A kind of route computing method and equipment | |
Ben-Ameur et al. | Routing strategies for IP networks | |
CN104580165A (en) | Cooperative caching method in intelligence cooperative network | |
US7457286B2 (en) | Accelerating the shortest path problem | |
CN105637807A (en) | Method, controller, forwarding device, and network system for forwarding packets | |
CN101778041A (en) | Method, device and network equipment for path selection | |
CN113904985B (en) | Segment list acquisition method, message forwarding method, device and electronic equipment | |
CN100490440C (en) | A method for implementing external route calculation for router | |
CN103532861A (en) | Intra-domain dynamic multipath generating method based on generating tree | |
Riedl | A versatile genetic algorithm for network planning | |
US20080117892A1 (en) | Method for Iterative Routing with the Aid of a Path-Dependent Routing Metric | |
Xiao et al. | Dynamic update of shortest path tree in OSPF | |
CN100518382C (en) | Shortest path searching method and device under multi-restraint conditions in automatic switching optical network | |
Garcia-Luna-Aceves et al. | Area-based, loop-free internet routing |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090520 Termination date: 20150429 |
|
EXPY | Termination of patent right or utility model |