CN1866881A - Method for carrying out test on router - Google Patents

Method for carrying out test on router Download PDF

Info

Publication number
CN1866881A
CN1866881A CN 200510089085 CN200510089085A CN1866881A CN 1866881 A CN1866881 A CN 1866881A CN 200510089085 CN200510089085 CN 200510089085 CN 200510089085 A CN200510089085 A CN 200510089085A CN 1866881 A CN1866881 A CN 1866881A
Authority
CN
China
Prior art keywords
route
router
test
update message
bgp
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 200510089085
Other languages
Chinese (zh)
Other versions
CN100446480C (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 Technologies 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 CNB2005100890856A priority Critical patent/CN100446480C/en
Publication of CN1866881A publication Critical patent/CN1866881A/en
Application granted granted Critical
Publication of CN100446480C publication Critical patent/CN100446480C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a router checking metohd, which comprises the following steps: getting the route relative to checked router and property information; packing the information for BGP Update message; checking checked router based on packed message; the invention can add, cancel and shock the true route from network.

Description

The method that router is tested
Technical field
The present invention relates to the communications field, relate in particular to a kind of method that router is tested.
Background technology
When router moves on the net, usually because the route bar number that needs to handle much breaks down.Therefore need test failed router.
When failed router is tested, need representation environment at that time as far as possible, the most important be exactly to router add online true route when going wrong (when just router moves on network, mutual route between each router.), these routes can obtain by the route display command from router.
BGP (Border Gateway Protocol; Border Gateway Protocol) be that Internet goes up one of most important Routing Protocol, it is the unique Routing Protocol that adopts between the present autonomous system, therefore, person " BGP Is The Heart Of Internet " (BGP is the heart of network) is arranged.BGP has experienced different developing stage, and its function is also constantly being strengthened along with the growth of Internet and enlarged.Initial release BGP1 from 1989, develop into the latest edition BGP4 that began to develop in 1993, its function is from the routing function between initial basic autonomous system, to polymerization, group, reflection, alliance, decay, capability advertisement, multi-protocols expansion, functions such as route refresh, we can say that the development of BGP closely following the development of Internet, the BGP number of routes on the Internet also is increased to about 100,000 of calendar year 2001 from few bar number in 1989, and the number of autonomous system also was increased to about 9000 in calendar year 2001.Therefore the BGP function powerful and whether healthy and strong be the important indicator of checking core router.
For test router, disposition for a large amount of BGP routes, often need the use test instrument to add a large amount of true routes, observe the processing of router then, thereby judge whether router is correct for the processing of the route that receives for these a large amount of routes to router.
And want test router upward how to be forwarded on other BGP Session sometimes for the route that receives at certain BGP Session (bgp session).Generally, router is that routed encapsulation with same alike result becomes a BGP Update message (BGP route updating packet) to transmit time other BGP Session with routing forwarding.
By foregoing description as can be seen,, especially carry out large numbers of route tests, need add the different true route of a large amount of attributes to test router for router is tested.
The technical scheme of prior art related to the present invention is by existing testing tool and DUT (Device Under Test; Equipment under test) set up BGP Session after, utilize the function of the interpolation route that testing tool provides, manually add online every true route and association attributes, send to described DUT then.
By the technical scheme of above-mentioned prior art as can be seen, existing testing tool can only manually add online every true route and association attributes, therefore can not satisfy the situation of the true route of adding a large amount of different attributes quickly and easily, there is the too high defective of human cost, if add the true route of 200,000 different attributes that obtain from network, it almost is unpractical using present mode.
Summary of the invention
In view of above-mentioned existing in prior technology problem, the purpose of this invention is to provide a kind of method that router is tested, by this method, can add, cancel, shake the true route that obtains from network to router very fast, thereby realize router is tested.
The objective of the invention is to be achieved through the following technical solutions:
A kind of method that router is tested provided by the invention comprises:
A, obtain route relevant and attribute information, and it is packaged into BGP routing update BGP Update message with test router;
B, based on the message after the described encapsulation, described test router is tested.
Wherein, described steps A specifically comprises:
A1, obtain the routing table file that the relevant routing iinformation according to test router generates;
A2, when described routing table file is effective, read described routing table file line by line, and, obtain the route and the attribute information of every row the line character string parsing of whenever advancing;
A3, described relevant route of obtaining and attribute information are packaged into BGP Update message.
Wherein, described steps A 1 specifically comprises:
A11, use to show that on router the order of route gets access to the routing iinformation of test router;
A12, the described routing iinformation that gets access to is generated the routing table file.
Wherein, described steps A 3 specifically comprises:
A31, add or the needs of route withdrawal, described relevant route of obtaining and attribute information are packaged into the BGP Update message that adds route or cancel route according to the test route.
Wherein, when needs carried out route oscillation to test router, described steps A 3 specifically comprised:
A32, the described relevant route of obtaining and attribute information are packaged into the BGP Update message that adds route, and described message is preserved; And
A33, described relevant route of obtaining and attribute information are packaged into the BGP Update message of cancelling route, and described message is preserved.
Wherein said method also comprises:
Set up the bgp session BGP Session between testing tool and tested router.
Wherein, described step B specifically comprises:
B1, based on the BGP Session that testing tool and test router are set up, the BGP Update message after the described encapsulation is sent to test router;
B2, described test router are handled its relevant route accordingly according to the BGP Update message that receives;
B3, according to the treatment situation that described tested router carries out, check whether described tested router normal.
Wherein, described step B2 specifically comprises:
B21, described test router add processing according to the BGP Update message that receives to its relevant route; Or,
B22, described test router are cancelled processing according to the BGP Update message that receives to its relevant route.
Wherein, when needs carried out the route oscillation test to test router, described step B specifically comprised:
B4, based on the BGP Session that testing tool and test router are set up, the BGP Update message after the described preservation is alternately sent to test router;
B5, described test router are handled its relevant route accordingly according to the BGP Update message that alternately receives;
B6, according to the treatment situation that described tested router carries out, check whether the route oscillation of described tested router normal.
Wherein, described step B5 specifically comprises:
B51, described test router replace the interpolation of acceptance test instrument transmission or the BGPUpdate message of cancelling route, when receiving the BGP Update message of described interpolation route, then its relevant route are added processing accordingly; When receiving described BGP Update message of cancelling route, then its relevant route is cancelled processing accordingly.
As seen from the above technical solution provided by the invention, the present invention at first obtains route relevant with test router and attribute information, and it is packaged into BGP Update message; Based on the message after the described encapsulation, described test router is tested then.By this method, can add, cancel, shake the true route that obtains from network to router very fast, router is tested.
Description of drawings
Fig. 1 is the flow chart of first embodiment provided by the invention;
Fig. 2 is the flow chart of second embodiment provided by the invention.
Embodiment
Main thought of the present invention is: the problem that can not satisfy the true route of adding a large amount of different attributes quickly and easily at existing testing tool, route and relevant routing property have been proposed from existing routing table file, to read, be packaged into BGP Update message, on the basis of setting up BGP Session between testing tool and the test router, send to test router, thereby make test router add or cancel these routes.Add or cancel in the process of described route at test router, can check whether described router is correct to the processing of the route in the BGP Update message that receives, thereby reach purpose the router test.
Core of the present invention is: at first obtain route relevant with test router and attribute information, and it is packaged into BGP Update message; Based on the message after the described encapsulation, described test router is tested then.
First embodiment provided by the invention as shown in Figure 1, comprising:
Step 101, obtain the routing table file that the relevant routing iinformation according to test router generates.
When router moves on the net, usually because the route bar number that needs to handle much goes wrong.In order to find out the reason that failed router breaks down, need representation environment at that time as much as possible, that is to say and to add online true route when going wrong to described failed router, these routes can obtain by the route display command from router, the present invention duplicates the described true routing iinformation that obtains, and is saved in the routing table file.Therefore can generate the routing table file according to the relevant routing iinformation of test router.
Step 102, when described routing table file is effective, read described routing table file line by line, and, obtain the relevant route and the attribute information of the every row of test router the line character string parsing of whenever advancing.
Illustrate the specific implementation process of step 102 below:
At first obtain, and be saved in routing iinformation following substantially (only having shown 2 routes here) in the routing table file by the route display command on the router:
Network NextHop MED LocPrf PrefVal?Path/Ogn
*>i?110.1.24.244/30 22.1.8.2 100 0 4230?14571?44?15201?
*>i?110.1.24.248/30 22.1.8.2 100 0 4230?14571?44?15202?
Read first walking along the street then by information, obtain character string:
“*>i?110.1.24.244/30 22.1.8.2 100 0 4230?14571?44?15201?”;
Secondly to the first line character string parsing of advancing, obtain the relevant route and the attribute information of this row:
In this line character string, read route prefix (Network) and be " 110.1.24.244/30 ":
The NEXT_HOP attribute (NextHop) that reads route at the remainder of this line character string is " 22.1.8.2 ";
The MULTI_EXIT_DISC attribute (MED) that reads route at the remainder of this line character string is " 100 ";
The LOCAL_PREF attribute (LocPrf) that reads route at the remainder of this line character string is 0;
The as_path attribute (Path) that reads route at the remainder of this line character string is " 4,230 14,571 44 15201 ";
The ORIGIN attribute (Org) that reads route at the remainder of this line character string for "? ", expression is Incomplete.
Read each follow-up row information, step is identical, up to the end of file.
Step 103, with described every walking along the street of obtaining by and attribute information be packaged into the BGP Update message (every walking along the street that is to say that by forming a BGP Update message together with association attributes the routing section of each the BGP Update message that generates all includes only a route here) that adds route or cancel route.
Step 104, set up the BGP Session between testing tool and DUT (tested router).
Testing tool must be set up BGP Session with DUT, can send the BGP message to DUT on the basis of this BGP Session.
Step 105, based on the BGP Session that testing tool and test router are set up, the BGP Update message after the described encapsulation is sent to test router.
Step 106, described test router are handled its relevant route accordingly according to the BGP Update message that receives.
The BGP Update message that receives when described test router is when adding the message of route, then its relevant route is added processing; The BGP Update message that receives when described test router is when cancelling the message of route, then its relevant route is cancelled processing.
Step 107, according to the treatment situation that described tested router carries out, check whether described test router normal.
According to user's request, when needing for a long time test router to be carried out route oscillation, the BGP Update message of the interpolation route that the route that reads from the routing table file and association attributes can be packaged into, and the BGPUpdate message of cancelling route that the route that will read from the routing table file and association attributes are packaged into is preserved, alternately send BGP Update message that adds route and the BGP Update message of cancelling route, just can on test router, realize route oscillation.
Shake the situation of test at router, second embodiment provided by the invention specifically comprises:
Step 201, obtain the routing table file that the relevant routing iinformation according to test router generates.
When router moves on the net, usually because the route bar number that needs to handle much goes wrong.In order to find out the reason that failed router breaks down, need representation environment at that time as much as possible, that is to say and to add online true route when going wrong to described failed router, these routes can obtain by the route display command from router, and are saved in the routing table file.Therefore can obtain routing table file according to the relevant routing iinformation generation of test router.
Step 202, when described routing table file is effective, read described routing table file line by line, and, obtain the relevant route and the attribute information of the every row of test router the line character string parsing of whenever advancing.
Step 102 among the specific descriptions and first embodiment is identical, is not described in detail.
The attribute information of the relevant route that step 203, basis are obtained is packaged into BGP Update message with described every walking along the street of obtaining by reaching attribute information.Specifically comprise:
Described relevant route of obtaining and attribute information are packaged into the BGP Update message that adds route, and described message is preserved; And, described relevant route of obtaining and attribute information are packaged into the BGP Update message of cancelling route, and described message is preserved.
Step 204, set up the BGP Session between testing tool and DUT (tested router).
Testing tool must be set up BGP Session with DUT, can send the BGP message to DUT on the basis of this BGP Session.
Step 205, the BGP Session that sets up based on testing tool and test router alternately send to test router with described interpolation route and the BGP Update message of cancelling route.
Step 206, described test router are handled its relevant route with the BGP Update message of cancelling route accordingly according to the interpolation route that alternately receives.
Described test router replaces the interpolation route of acceptance test instrument transmission or the BGPUpdate message of cancelling route, when receiving the BGP Update message of described interpolation route, then its relevant route is added processing accordingly; When receiving described BGP Update message of cancelling route, then its relevant route is cancelled processing accordingly.
Step 207, according to the treatment situation that described tested router carries out, check whether the route oscillation of described tested router normal.
By the specific embodiments of the invention described above as can be seen, the present invention by will be from the routing table file lead path by and routing property, be packaged into BGP Update message, send these BGP Update messages then to test router, thereby triggering router adds, cancels, shake these routes, router is tested.By the present invention, can add, cancel, shake the true route that obtains from network to router very fast, router is tested.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.

Claims (10)

1, a kind of method that router is tested is characterized in that, comprising:
A, obtain route relevant and attribute information, and it is packaged into BGP routing update BGP Update message with test router;
B, based on the message after the described encapsulation, described test router is tested.
2, method according to claim 1 is characterized in that, described steps A specifically comprises:
A1, obtain the routing table file that the relevant routing iinformation according to test router generates;
A2, when described routing table file is effective, read described routing table file line by line, and, obtain the route and the attribute information of every row the line character string parsing of whenever advancing;
A3, described relevant route of obtaining and attribute information are packaged into BGP Update message.
3, method according to claim 2 is characterized in that, described steps A 1 specifically comprises:
A11, use to show that on router the order of route gets access to the routing iinformation of test router;
A12, the described routing iinformation that gets access to is generated the routing table file.
4, method according to claim 2 is characterized in that, described steps A 3 specifically comprises:
A31, add or the needs of route withdrawal, described relevant route of obtaining and attribute information are packaged into the BGP Update message that adds route or cancel route according to the test route.
5, method according to claim 2 is characterized in that, when needs carried out route oscillation to test router, described steps A 3 specifically comprised:
A32, the described relevant route of obtaining and attribute information are packaged into the BGP Update message that adds route, and described message is preserved; And
A33, described relevant route of obtaining and attribute information are packaged into the BGP Update message of cancelling route, and described message is preserved.
6, according to claim 3,4 or 5 described methods, it is characterized in that, also comprise:
Set up the bgp session BGP Session between testing tool and tested router.
7, method according to claim 6 is characterized in that, described step B specifically comprises:
B1, based on the BGP Session that testing tool and test router are set up, the BGP Update message after the described encapsulation is sent to test router;
B2, described test router are handled its relevant route accordingly according to the BGP Update message that receives;
B3, according to the treatment situation that described tested router carries out, check whether described tested router normal.
8, method according to claim 7 is characterized in that, described step B2 specifically comprises:
B21, described test router add processing according to the BGP Update message that receives to its relevant route; Or,
B22, described test router are cancelled processing according to the BGP Update message that receives to its relevant route.
9, method according to claim 6 is characterized in that, when needs carried out the route oscillation test to test router, described step B specifically comprised:
B4, based on the BGP Session that testing tool and test router are set up, the BGP Update message after the described preservation is alternately sent to test router;
B5, described test router are handled its relevant route accordingly according to the BGP Update message that alternately receives;
B6, according to the treatment situation that described tested router carries out, check whether the route oscillation of described tested router normal.
10, method according to claim 9 is characterized in that, described step B5 specifically comprises:
B51, described test router replace the interpolation of acceptance test instrument transmission or the BGPUpdate message of cancelling route, when receiving the BGP Update message of described interpolation route, then its relevant route are added processing accordingly; When receiving described BGP Update message of cancelling route, then its relevant route is cancelled processing accordingly.
CNB2005100890856A 2005-08-05 2005-08-05 Method for carrying out test on router Expired - Fee Related CN100446480C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100890856A CN100446480C (en) 2005-08-05 2005-08-05 Method for carrying out test on router

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100890856A CN100446480C (en) 2005-08-05 2005-08-05 Method for carrying out test on router

Publications (2)

Publication Number Publication Date
CN1866881A true CN1866881A (en) 2006-11-22
CN100446480C CN100446480C (en) 2008-12-24

Family

ID=37425771

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100890856A Expired - Fee Related CN100446480C (en) 2005-08-05 2005-08-05 Method for carrying out test on router

Country Status (1)

Country Link
CN (1) CN100446480C (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103873311A (en) * 2012-12-11 2014-06-18 中国移动通信集团公司 Method for testing router forwarding information base capacity and system thereof
CN104486158A (en) * 2014-12-17 2015-04-01 上海斐讯数据通信技术有限公司 Method and device for testing configuration parameters of router

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6728214B1 (en) * 1999-07-28 2004-04-27 Lucent Technologies Inc. Testing of network routers under given routing protocols
EP1367750A1 (en) * 2002-05-30 2003-12-03 Agilent Technologies, Inc. - a Delaware corporation - Testing network communications

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103873311A (en) * 2012-12-11 2014-06-18 中国移动通信集团公司 Method for testing router forwarding information base capacity and system thereof
CN103873311B (en) * 2012-12-11 2017-05-31 中国移动通信集团公司 A kind of method of testing and system for router forwarding information table capacity
CN104486158A (en) * 2014-12-17 2015-04-01 上海斐讯数据通信技术有限公司 Method and device for testing configuration parameters of router
CN104486158B (en) * 2014-12-17 2019-07-02 上海斐讯数据通信技术有限公司 The test method and device of configuration of routers parameter

Also Published As

Publication number Publication date
CN100446480C (en) 2008-12-24

Similar Documents

Publication Publication Date Title
CN1279731C (en) Communication stream mould grouping filter and filtering method
CN1299541A (en) Traffic routing in small wireless data net works
CN1773965A (en) Route selecting method and apparatus using return routability procedure
CN1520123A (en) Answering method to address inquire and program and appts. thereof, and address notifying method, program and appts.
CN1625869A (en) Dynamic routing in packet-switching multilayer communication networks
CN101068206A (en) Grouping exchange, network node, packet exchanging structure and data packet routing method
CN1728725A (en) Change the adaptive method of redistributing node address according to wireless network capacitance
CN1802638A (en) Routing hints
CN1578272A (en) Packet forwarding device equipped with statistics collection device and statistics collection method
CN1744534A (en) Message mirroring method and network equipment with message mirroring function
CN1581192A (en) Method and system for electronic mail sensitive to delivering time
CN1581818A (en) Method for supporting multi-port virtual LAN by multi-protocol label swtich
CN1848792A (en) Method for realizing cross-mixed network multi-protocol tag exchange virtual special network
CN101060494A (en) A route selection method, system and router
CN101030943A (en) Method for transmitting message and route
CN1496154A (en) Mobile communication control system and method, ruting device, server and data structure
CN1777118A (en) Illegal machine connection position defining device and method thereof
CN1855872A (en) Communication method and system between mixed network VPN stations across different autonomous systems
CN1946061A (en) Method and device for fast processing message
CN101047571A (en) Method and system for transmitting test route
CN1852261A (en) Method for maintenance of neighbor entry
CN1866881A (en) Method for carrying out test on router
DE602005002730D1 (en) METHOD AND DEVICE FOR PROVIDING ADDRESS MANAGEMENT IN A MOBILE NETWORK WITH A FLAT STRUCTURE
CN1863135A (en) Path selecting method of regulating link cost
CN1946064A (en) Message repeat 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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20081224

Termination date: 20120805