A kind of loop network link convergence time or recovery time test macro
Technical field
The present invention relates to the network communications technology, particularly a kind of convergence time of loop network link or recovery time measuring technology.
Background technology
MPLS (Multi Protocol Label Switching) is the abbreviation of multiprotocol label switching, so-called multi-protocols are meant the multiple network layer protocol that MPLS supports, IP (Internet Protocol for example, Internet protocol), IPv6 (Internet Protocol Version 6, the Next Generation Internet agreement), IPX (InternetworkPacket Exchange, packet exchange between net) etc.; And compatibility comprises ATM (AsynchronousTransfer Mode; Asynchronous transfer mode), frame relay, Ethernet, PPP (Peer-Peer Protocol, end-to-end protocol) etc. are in interior multiple link-layer technologies.Label is as identifier, and is only effective on physical connection, and local significance is promptly only arranged, be used for affiliated FEC (the ForwardingEquivalence Class of grouping of unique identification, forwarding equivalence class), label is generally 4 bytes, and what IP network was comparatively commonly used is purpose IP address field.Being grouped in the MPLS network of identical FEC will obtain identical processing, be exactly a FEC as all messages to same destination address.So-called label exchange adds label to message exactly, transmits according to label value.
The MPLS technology mainly is according to LDP (Label Distribution Protocol, tag distribution protocol) carries out label distribution and control, by the IGP that moves in the core looped network (Interior Gateway Protocol, Interior Gateway Protocol) agreement is set up LSP (Label Switched Path, label switched path is used for the passage that label packet is transmitted) tunnel.
Fig. 1 is the basic networking structure schematic diagram of MPLS, CE (Customer Equipment wherein, subscriber equipment) for using equipment, PE (Provider Equipment, operator's equipment) node is a service access equipment, P is an intermediate equipment, in network shown in Figure 1, PE2 equipment initiatively upstream sends the label mapping (being exactly that FEC and label are bundled one to one) of FEC, P equipment equally upstream sends after the label of this FEC is replaced with own distributed labels, has therefore just formed the LSP of data forwarding for this FEC.If have data flow to send to this FEC, then can transmit successively along LSP passage shown in Figure 1 in the PE1 side.The PE1 network equipment of Web portal is stamped label, and the equipment on the LSP passage carries out follow-up forwarding behavior according to this label value.
As shown in Figure 2, be typical ethernet ring network topological structure schematic diagram, comprise main control device (Master is used for the preferred unit of whole looped network State Control) and slave unit, main control device comprises master port (PrimaryPort) and from port (Secondary Port).As shown in Figure 2, loop blocking-up and link-recovery all concentrate on the main control device S1 and carry out, under normal circumstances, main control device S1 is changed to forwarding (FORWARDING) state with master port, be used to transmit data message, to be changed to obstruction (BLOCK) state from port, can not be used to transmit data message, to avoid the generation of double-layer loop in the whole looped network.When ethernet ring network bar link breaks down, interrupt such as the primary link Link1 between S4 and the S5, S4 and S5 can recognize the situation of link down and announce and give main control device at this moment, after main control device is received this information, to change the FORWARDING state into from the BLOCK state of port, finish the inner hand-off process of switch, be backup link Link2:S3-S2-S1-S6-S5 thereby the link between S4 and the S5 switched from primary link Link1:S4-S5.Link-recovery is operated equally, when reverting to normal condition as the primary link that interrupts between S4 and S5, S4 and S5 can recognize the information of link-recovery, send announcement to main control device, main control device will place the BLOCK state from port after receiving announcement, thereby the link between S4 and the S5 is returned to primary link Link1 from backup link Link2, so finish fault detect and switching.
Looped network is finished the required convergence time of link switchover when link failure, and looped network switches required recovery time behind link-recovery again, it is the major parameter of sign looped network constringency performance, whether the service quality that the quality of looped network constringency performance is directly connected to network application can be guaranteed, and therefore the test to the looped network constringency performance also is necessary.
Summary of the invention
The embodiment of the invention provide a kind of loop network link convergence time or recovery time test macro, in order to realize looped network convergence time or the test of recovery time.
A kind of loop network link convergence time test macro comprises:
Test data generation module, be arranged on first equipment in the described looped network, be used for when receiving first triggering signal of link convergence performance between test first equipment and second equipment, begin by the primary link between first equipment and second equipment, set speed with first and send first test packet that total amount is the first setting quantity to second equipment;
The test control appliance, connect described first equipment and second equipment respectively, be used for when carrying out the link convergence time test, send described first triggering signal to first equipment, and after the test link constringency performance begins first when setting duration and arriving, control described primary link and be in off-state;
Looped network is switched control module, is arranged on the main control device in the described looped network, is used for after described primary link is disconnected, and the link of controlling between described first equipment and second equipment is switched to backup link from primary link;
Testing data processing module, be arranged on described second equipment, be used for process at the test link constringency performance, primary link before switch and switch after backup link receive described first test packet respectively, and determine that the convergence time of link between first equipment and second equipment is: first sets the difference that received quantity that quantity deducts first test packet obtains sets the merchant who obtains after the speed divided by first.
Preferable, described test data generation module specifically comprises:
First parameter receives submodule, is used to obtain first IP address of equipment, and receives the first setting speed, the first setting quantity and second IP address of equipment of described test control appliance input;
Send submodule, be used for when receiving described first triggering signal, according to described first IP address of equipment and second IP address of equipment, with Internet protocol IP form packaged source address is that first IP address of equipment, destination address are first test packet of second IP address of equipment, and sets speed and first according to described first and set the quantity transmission.
Described testing data processing module specifically comprises:
Second parameter receives submodule, is used to receive first IP address of equipment and the first setting quantity of described test control appliance input;
Test packet receives submodule, is used for according to described first IP address of equipment, and the reception sources address is first test packet of first IP address of equipment, and determines the received quantity of first test packet;
Convergence time is determined subelement, is used for determining the convergence time of link between first equipment and second equipment;
The convergence time output sub-module is used to the convergence time of link between first equipment of exporting and second equipment.
Further, described testing data processing module also comprises: convergence time reports submodule, is used for described convergence time is reported described test control appliance.
A kind of loop network link test macro recovery time comprises:
Test data generation module, be arranged on first equipment in the described looped network, be used for when receiving second triggering signal of link-recovery performance between test first equipment and second equipment, begin by the backup link between first equipment and second equipment, set speed with second and send second test packet that total amount is the second setting quantity to second equipment;
Testing control module, connect described first equipment and second equipment respectively, when being used to begin carry out the link-recovery time test, send described second triggering signal to first equipment, and second duration of the setting after the test link restorability begins is controlled described primary link and is reverted to connection status from off-state when arriving;
Looped network is switched control module, is arranged on the main control device in the described looped network, is used for after described primary link reverts to connection status, and the link of controlling between described first equipment and second equipment reverts to primary link from backup link;
Testing data processing module, be arranged on described second equipment, be used in test link restorability process, backup link before recover and recover after primary link receive described second test packet respectively, and determine that be the recovery time of link between first equipment and second equipment: second sets the difference that received quantity that quantity deducts second test packet obtains sets the merchant who obtains after the speed divided by second.
Preferable, described test data generation module specifically comprises:
First parameter receives submodule, is used to obtain first IP address of equipment, and receives the second setting speed, the second setting quantity and second IP address of equipment of described test control appliance input;
Send submodule, be used for when receiving described second triggering signal, according to described first IP address of equipment and second IP address of equipment, with Internet protocol IP form packaged source address is that first IP address of equipment, destination address are second test packet of second IP address of equipment, and sets speed and second according to described second and set the quantity transmission.
Described testing data processing module specifically comprises:
Second parameter receives submodule, is used to receive first IP address of equipment and the second setting quantity of described test control appliance input;
Test packet receives submodule, is used for according to described first IP address of equipment, and the reception sources address is second test packet of first IP address of equipment, and determines the received quantity of second test packet;
Convergence time is determined subelement, is used for determining the recovery time of link between first equipment and second equipment;
The convergence time output sub-module is used to recovery time of link between first equipment of exporting and second equipment.
Further, described testing data processing module also comprises: convergence time reports submodule, is used for reporting the test control appliance described recovery time.
In the embodiment of the invention, only need the control appliance that can sign in on first equipment and second equipment, remote computer for example, just can control the looped network performance test, and on second equipment according to quantity forwarded, received quantity and the transmission rate of test packet, obtain the convergence time of looped network easily, go forward side by side recovery time on a pacing test ring network chain road, need not generate test packet by other testers, also not need the support of other test macros, save the device resource cost greatly.
Description of drawings
Fig. 1 is existing multiple label switching technology principle schematic;
Fig. 2 is existing ring network fault monitoring and switching principle schematic diagram;
The loop network link convergence time that Fig. 3 provides for the embodiment of the invention and recovery time the test system structure schematic diagram;
In loop network link convergence time that Fig. 4 provides for the embodiment of the invention and the recovery time test macro, a kind of concrete structure schematic diagram of test data generation module and processing module;
Fig. 5 is a kind of test packet structural representation in the embodiment of the invention.
Embodiment
The schematic diagram of a kind of loop network link convergence time test system structure that provides for the embodiment of the invention, the link convergence performance is an example between first equipment and second equipment to test, utilize a test control appliance to login first equipment by the direct connection of serial ports or by the Internet, first equipment of controlling sends the test packet of setting quantity and triggers test to second equipment to set speed, and in test process the Link State between control first equipment and second equipment, link between first equipment and second equipment is switched between primary link and backup link, primary link Link1 between first equipment and second equipment is switched to backup link Link2, the test packet that such first equipment sends can be lost because of link failure, thereby second equipment is according to the quantity forwarded of test packet, received quantity and transmission rate can conveniently be determined link opening time, the i.e. convergence time of link between first equipment and second equipment.
Describe the specific implementation of above-mentioned testing mechanism below in detail, as shown in Figure 3, the loop network link convergence time test macro that the embodiment of the invention provides comprises:
Test data generation module 301, be arranged on first equipment in the looped network, be used for when receiving first triggering signal of link convergence performance between test first equipment and second equipment, beginning is set speed with first and is sent first test packet that total amount is the first setting quantity to second equipment with by primary link;
Test control appliance 302, connect first equipment and second equipment respectively, be used for when carrying out the link convergence time test, sending first triggering signal to first equipment, and after the test link constringency performance begins first when setting duration and arriving, the control primary link is in off-state;
Looped network is switched control module 303, is arranged on the main control device in the looped network, is used for after primary link is disconnected, and the link of controlling between first equipment and second equipment is switched to backup link from primary link;
Testing data processing module 304, be arranged on second equipment, be used for process at the test link constringency performance, backup link after switching preceding primary link and switching receives first test packet respectively, and the convergence time of determining link between first equipment and second equipment is: first sets the difference that received quantity that quantity deducts first test packet obtains sets the merchant who obtains after the speed divided by first, and concrete computing formula is as follows:
T=(CS-CR)/Rate
Wherein: T is a convergence time, and unit is generally millisecond (ms); CS is the setting quantity forwarded of first test packet, and CR is the received quantity of first test packet that receives of second equipment, and Rate is the transmission rate of first test packet.Preferable, can be set to 1000/second by Rate, result of calculation is unit with the millisecond exactly directly like this.
In test process, it is test control appliance 302 that test is started to control what make usefulness, test control appliance 302 can disconnect by the link of means such as corresponding interface disabling being controlled between first equipment and second equipment, perhaps reopens corresponding port link-recovery is connected.Can sign in on first equipment by test control appliance 302, to send the needed second device address information of first test packet, the first setting quantity and first transmission rate and be set in the test data generation module 301, test data generation module 301 generates first test packet according to the parameter information that is provided with and sends.Test control appliance 302 can be according to the test of setting-up time trigger link convergence time, and administrative staff also can be by the test etc. of trigger link convergence time at any time of test control appliance 302.The triggering method of test desired parameters setting and test is well known to those skilled in the art, and no longer describes in detail here.
Further,, then test control appliance 302 and can further in test data generation module 301, relevant parameter be set if continue the restorability of link between test first equipment and second equipment, and the test of trigger link recovery time, concrete:
Test data generation module 301, when receiving second triggering signal of link-recovery performance between test first equipment and second equipment, beginning is set speed with second and is sent second test packet that total amount is the second setting quantity to second equipment with by backup link;
Testing control module when beginning to carry out the link-recovery time test, sends second triggering signal to first equipment, and second duration of the setting after the test link restorability begins is when arriving, and the control primary link reverts to connection status from off-state;
Looped network is switched control module 303, and after primary link reverted to connection status, the link of controlling between first equipment and second equipment returned to primary link from backup link;
Testing data processing module 304, in test link restorability process, backup link before recover and recover after primary link receive second test packet respectively, and determine that be the recovery time of link between first equipment and second equipment: second sets the difference that received quantity that quantity deducts second test packet obtains sets the merchant who obtains after the speed divided by second.
The test philosophy of the test philosophy of link-recovery time and link convergence time is identical, wherein: the first setting quantity and second is set quantity and can be equated, the first setting speed and second is set speed can equate that the form of first test packet and second test packet also can be identical.
In the above-described embodiments, only need the control appliance that can sign in on first equipment and second equipment, remote computer for example, just can control the looped network performance test, and on second equipment according to quantity forwarded, received quantity and the transmission rate of test packet, obtain the convergence time and the recovery time of looped network easily, need not other testers generate test packets, do not need the support of other test macros yet, saved the device resource cost greatly.And second equipment can further report test result the test control appliance, makes things convenient for the comparative analysis of test result.
If use the looped network of MPLS switching technology, the embodiment of the invention is according to IP protocol encapsulation test packet, thereby the restriction that the method for testing that the embodiment of the invention is provided can not received concrete agreement has better generality.Based on this, as shown in Figure 4, in the preferred embodiment of the present invention, if the test link constringency performance, test data generation module 301 can specifically comprise:
First parameter receives submodule 3011, is used to obtain first IP address of equipment, and the second setting speed, second of acceptance test control appliance 302 inputs is set the quantity and second IP address of equipment;
Send submodule 3012, be used for when receiving second triggering signal, according to first IP address of equipment, second IP address of equipment, with Internet protocol IP form packaged source address is that first IP address of equipment, destination address are second test packet of second IP address of equipment, and sets speed and second according to second and set the quantity transmission.
Testing data processing module 304 specifically comprises:
Second parameter receives submodule 3041, and first IP address of equipment and first that is used for 302 inputs of acceptance test control appliance is set quantity;
Test packet receives submodule 3042, is used for according to first IP address of equipment, and the reception sources address is first test packet of first IP address of equipment, and determines the received quantity of first test packet;
Convergence time is determined submodule 3043, is used for determining the convergence time of link between first equipment and second equipment;
Convergence time output sub-module 3044 is used to the convergence time of link between first equipment of exporting and second equipment.
If desired test result is reported test control appliance 302, then testing data processing module 304 also further comprises: convergence time reports submodule 3045, is used for convergence time is reported test control appliance 302.
If further also need test link recovery time, then in the test data generation module 301, first parameter receives submodule 3011, also is used for second of acceptance test control appliance input and sets speed and second and set quantity; And transmission submodule 3012, also be used for when receiving described second triggering signal, according to first IP address of equipment and second IP address of equipment, with Internet protocol IP form packaged source address is that first IP address of equipment, destination address are second test packet of second IP address of equipment, and sets speed and second according to second and set the quantity transmission.
And, in the testing data processing module 304:
Second parameter receives submodule 3041, and first IP address of equipment and second that also is used for 302 inputs of acceptance test control appliance is set quantity;
Test packet receives submodule 3042, also is used for according to first IP address of equipment, and the reception sources address is second test packet of first IP address of equipment, and determines the received quantity of second test packet;
Convergence time is determined submodule 3043, also is used for determining the recovery time of link between first equipment and second equipment;
Convergence time output sub-module 3044 also is used to recovery time of link between first equipment of exporting and second equipment.
If desired test result is reported test control appliance 302, then convergence time reports submodule 3045, also is used for reporting test control appliance 302 recovery time.
In the embodiment of the invention, test control appliance 302 passes through serial ports or Internet connection first equipment, and can further sign in to the enterprising line parameter setting of second equipment by the link between first equipment and second equipment.
According to the test macro that the embodiment of the invention provides, can realize test, and use IP protocol encapsulation test packet link convergence time and recovery time between the different looped network equipment, can not be subjected to the restriction of the employed concrete agreement of looped network user.
In the embodiment of the invention, test result can comprise: send the message number, receive message number, convergence time or the information such as result of calculation of recovery time in the local output of second equipment.Also can be transferred to the test control appliance, output test result by the test control appliance.
In the embodiment of the invention, test control appliance 302 can carry out the parameter setting by command line interface CLI " SendPacKet[srcIP src_ip|desIP des_ip|vrf vrf_name|rate rate|length len|times n|...] ", wherein: srcIP src_ip is the source IP address of test packet, desIPdes_ip is the purpose IP address of test packet, vrf vrf_name is the vrf interface that sends test packet, raterate is a transmission rate, length len is a message length, and times n is for sending the quantity of message.These parameter informations are to be used for test data generation module 301 structure test packets to use, test data generation module 301 is realized by the ip protocol layer and the link layer of the network equipment, ip protocol layer is earlier according to IP protocol encapsulation test packet, message format as shown in Figure 5, comprise source IP address, information such as purpose IP address are transferred to the IP test packet link layer packaging link layer header of the network equipment then, be packaged source MAC Address and target MAC (Media Access Control) address, and then send the message of structure according to the speed of appointment.The out of Memory that carries in the test packet for example version number, header length, COS etc. is set as required, wherein 16 is test packet for identification information is used to identify this message, those skilled in the art specifically set as required, describe in detail no longer one by one here.
In the embodiment of the invention, test control appliance 302 can be carried out the connection and the disconnection of the physical link state in the shutdown/no shutdown order control looped network by the order line cli interface, by following command line interface CLI:monitor[src IP src_ip|des IP des_ip|vrf vrf_name], the second monitoring of equipment test packet etc. is set, specific implementation is well known to those skilled in the art, and is elaborated no longer one by one here.
Obviously, those skilled in the art can carry out various changes and modification to the embodiment of the invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.