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

Method for carrying out test on router Download PDF

Info

Publication number
CN100446480C
CN100446480C CNB2005100890856A CN200510089085A CN100446480C CN 100446480 C CN100446480 C CN 100446480C CN B2005100890856 A CNB2005100890856 A CN B2005100890856A CN 200510089085 A CN200510089085 A CN 200510089085A CN 100446480 C CN100446480 C CN 100446480C
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.)
Expired - Fee Related
Application number
CNB2005100890856A
Other languages
Chinese (zh)
Other versions
CN1866881A (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

Abstract

The present invention relates to a method for carrying out a test on a router, which has the core that firstly, a route and attribute information relevant to a tested router are obtained and encapsulated into BGP Update messages; then, the tested router is tested on the basis of the encapsulated messages. A real route obtained from a network can be rapidly added, cancelled and shocked towards the router by the method for carrying out a test on a router for carrying out a test on the router.

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;
AB, set up the bgp session BGP Session between testing tool and the described 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, 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?441?5202?
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 (9)

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;
AB, set up the bgp session BGP Session between testing tool and the described 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 or 4 described methods, it 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.
7, method according to claim 6 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.
8, method according to claim 5 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.
9, method according to claim 8 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 CN1866881A (en) 2006-11-22
CN100446480C true 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)

Families Citing this family (2)

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

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1462132A (en) * 2002-05-30 2003-12-17 安捷伦科技有限公司 Testing network communication
US6728214B1 (en) * 1999-07-28 2004-04-27 Lucent Technologies Inc. Testing of network routers under given routing protocols

Patent Citations (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
CN1462132A (en) * 2002-05-30 2003-12-17 安捷伦科技有限公司 Testing network communication

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
IPv4路由器设备测试技术. 田辉等.电信网络技术,第2004卷第8期. 2004
IPv4路由器设备测试技术. 田辉等.电信网络技术,第2004卷第8期. 2004 *
路由器的测试. 魏亮.电信科学,第2001卷第7期. 2001
路由器的测试. 魏亮.电信科学,第2001卷第7期. 2001 *

Also Published As

Publication number Publication date
CN1866881A (en) 2006-11-22

Similar Documents

Publication Publication Date Title
CA2931515C (en) Multi-domain source routed forwarding based on collaborating network controllers
CN105141434B (en) The fault detection method and device of business chain
US6597703B1 (en) System, device, and method for reducing multicast forwarding states in a multicast communication system
US20080144587A1 (en) Deletion of routes of routing tables of a wireless mesh network
CN100542143C (en) Graceful Restart method, designated intermediate system, neighbor router and radio network
US8750092B2 (en) Packet transmission device
CN101394354A (en) Method for avoiding neighbourhood oscillation of intermediate system and an intermediate system
US20120163197A1 (en) Routing validation
WO2007089428A1 (en) End-to-end service quality using source-routed probes
CN102761493B (en) Multicast routing item updating method and device of multilink transparent internet
CN107347032A (en) Message forwarding method and device
CN105743687B (en) Method and device for judging node fault
CN107547346A (en) A kind of message transmitting method and device
CN100446480C (en) Method for carrying out test on router
US8072907B2 (en) Method and system to restart IS-IS when LSP wraps
CN106713130A (en) Routing table updating method, EVPN control equipment and EVPN system
CN106559339A (en) A kind of message processing method and device
CN108259335A (en) Path detection method and apparatus
US6952740B1 (en) Apparatus and method of maintaining a route table
US7646729B2 (en) Method and apparatus for determination of network topology
CN105656781B (en) A kind of transmission method and the network equipment of link state data packet
ES2264094T3 (en) PROCEDURE AND TEST SYSTEM OF A ROUTING EQUIPMENT.
WO2016177112A1 (en) Method and device for implementing link state message refresh
JP5170778B2 (en) BGP fault location estimation method and apparatus
JPWO2006073066A1 (en) Communication apparatus, routing method and program

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