Summary of the invention
Embodiments of the invention provide a kind of method and testing apparatus of applied in network performance test, can solve IP tester and can not obtain each time point and corresponding packet loss number that packet loss occurs, thus when to equipment under test positioning problems, bring the problem of very big inconvenience.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, embodiments of the invention provide a kind of testing apparatus, comprising:
Adjustment unit, speed for described first passage being sent packet in the first Preset Time is progressively reduced to zero by port speed, and synchronous speed second channel being sent packet is progressively increased to described port speed by zero, the speed sum that the speed of wherein said first passage transmission packet and described second channel send packet is described port speed;
Statistic unit, the receiving terminal of quantity and described first passage that the transmitting terminal for adding up described first passage in described first Preset Time sends packet receives the quantity of packet;
Alarm Unit, when the quantity that the receiving terminal that the transmitting terminal of the described first passage that described statistic unit is added up sends the described first passage that the quantity of packet and described statistic unit are added up receives packet is unequal, sends warning information and generates log recording.
In conjunction with first aspect, in the first possible implementation of first aspect, the described warning information that described Alarm Unit sends comprises packet loss quantity and the temporal information of packet loss occurs, described packet loss quantity is the difference that the receiving terminal of described first passage receives between quantity that the quantity of packet and the transmitting terminal of described first passage send packet, and the temporal information of described generation packet loss comprises described first passage and starts to send the moment that moment of packet and described first passage stop sending packet.
In conjunction with the first possible implementation of first aspect or first aspect, in the implementation that the second of first aspect is possible, the frame structure of described packet comprises the distinguishing identifier for distinguishing described first passage and described second channel.
In conjunction with any one possible implementation of first aspect or first aspect, in the third possible implementation of first aspect, described first passage and described second channel independently transmit and receive data bag separately.
In conjunction with any one possible implementation of first aspect or first aspect, in the 4th kind of possible implementation of first aspect, described adjustment unit, speed also for described second channel being sent packet in the second Preset Time is progressively reduced to zero by port speed, and synchronous speed first passage being sent packet is progressively increased to described port speed by zero;
Described statistic unit, the receiving terminal of quantity and described second channel that the transmitting terminal also for adding up described second channel in described second Preset Time sends packet receives the quantity of packet;
Described Alarm Unit, the receiving terminal that transmitting terminal for the described second channel when described statistic unit statistics sends the described second channel that the quantity of packet and described statistic unit are added up receive the quantity of packet unequal time, send warning information and generate log recording.
Second aspect, embodiments of the invention provide a kind of method of applied in network performance test, comprising:
The speed described first passage being sent packet in the first Preset Time is progressively reduced to zero by port speed, and synchronous speed second channel being sent packet is progressively increased to described port speed by zero, the speed sum that the speed of wherein said first passage transmission packet and described second channel send packet is described port speed;
The receiving terminal of quantity and described first passage that the transmitting terminal adding up described first passage in described first Preset Time sends packet receives the quantity of packet;
When the quantity that the receiving terminal of quantity and described first passage that the transmitting terminal of described first passage sends packet receives packet is unequal, sends warning information and generate log recording.
In conjunction with second aspect, in the first possible implementation of second aspect, described warning information comprises packet loss quantity and the temporal information of packet loss occurs, described packet loss quantity is the difference that the receiving terminal of described first passage receives between quantity that the quantity of packet and the transmitting terminal of described first passage send packet, and the temporal information of described generation packet loss comprises described first passage and starts to send the moment that moment of packet and described first passage stop sending packet.
In conjunction with the first possible implementation of second aspect or second aspect, in the implementation that the second of second aspect is possible, the frame structure of described packet comprises the distinguishing identifier for distinguishing described first passage and described second channel.
In conjunction with any one possible implementation of second aspect or second aspect, in the third possible implementation of second aspect, described first passage and described second channel independently transmit and receive data bag separately.
In conjunction with any one possible implementation of second aspect or second aspect, in the 4th kind of possible implementation of second aspect, when the quantity that the receiving terminal of quantity and described first passage that the transmitting terminal of described first passage sends packet receives packet is unequal, warning information is sent and after generating log recording, described method also comprises described:
The speed described second channel being sent packet in the second Preset Time is progressively reduced to zero by port speed, and synchronous speed first passage being sent packet is progressively increased to described port speed by zero;
The receiving terminal of quantity and described second channel that the transmitting terminal adding up described second channel in described second Preset Time sends packet receives the quantity of packet;
When the quantity that the receiving terminal of quantity and described second channel that the transmitting terminal of described second channel sends packet receives packet is unequal, sends warning information and generate log recording.
The method of a kind of applied in network performance test that the embodiment of the present invention provides and testing apparatus, with prior art, testing apparatus can not the concrete packet loss number of real-time statistics be compared with packet loss time point, two flow transceiver channels are set in the present invention in testing apparatus, the data packet number that a passage sends and receives is added up in Preset Time, if quantity is unequal, testing apparatus sends alarm and generates log recording.Because arrange two passes, so a passage can be allowed to suspend transceiving data bag, and the packet loss information obtained in this passage and packet loss time point, and meanwhile, another passage continues test, and such two passes is used alternatingly, without interrupt test, just can Real-time Obtaining to the packet loss information of equipment under test and packet loss time point, facilitate tester to the positioning problems of equipment under test.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of testing apparatus 10, and as shown in Figure 1, described testing apparatus 10 comprises:
Adjustment unit 11, speed for described first passage being sent packet in the first Preset Time is progressively reduced to zero by port speed, and synchronous speed second channel being sent packet is progressively increased to described port speed by zero, the speed sum that the speed of wherein said first passage transmission packet and described second channel send packet is described port speed;
Wherein, described port speed is the port that testing apparatus 10 is connected with equipment under test by testing apparatus 10, sends the speed of packet to equipment under test; Described port speed can be arranged by user, remains unchanged in test process middle port speed.
Statistic unit 12, the receiving terminal of quantity and described first passage that the transmitting terminal for adding up described first passage in described first Preset Time sends packet receives the quantity of packet;
Alarm Unit 13, the receiving terminal of the described first passage added up for the quantity and described statistic unit 12 that send packet when the transmitting terminal of the described first passage that described statistic unit 12 is added up receive the quantity of packet unequal time, send warning information and generate log recording.
Wherein, the described warning information that described Alarm Unit 13 sends comprises packet loss quantity and the temporal information of packet loss occurs, described packet loss quantity is the difference that the receiving terminal of described first passage receives between quantity that the quantity of packet and the transmitting terminal of described first passage send packet, and the temporal information of described generation packet loss comprises described first passage and starts to send the moment that moment of packet and described first passage stop sending packet.The frame structure of described packet comprises the distinguishing identifier for distinguishing described first passage and described second channel.Described first passage and described second channel independently transmit and receive data bag separately.
Further, described adjustment unit 11, the speed also for described second channel being sent packet in the second Preset Time is progressively reduced to zero by port speed, and synchronous speed first passage being sent packet is progressively increased to described port speed by zero;
Described statistic unit 12, the receiving terminal of quantity and described second channel that the transmitting terminal also for adding up described second channel in described second Preset Time sends packet receives the quantity of packet;
Described Alarm Unit 13, the receiving terminal of the described second channel added up for the quantity and described statistic unit 12 that send packet when the transmitting terminal of the described second channel that described statistic unit 12 is added up receive the quantity of packet unequal time, send warning information and generate log recording.
In the embodiment of the present invention, testing apparatus 10 comprises two passes, and in Preset Time, add up the data packet number that current channel sends and receives, if quantity is unequal, testing apparatus 10 sends alarm and generates log recording.Because arrange two passes, so a passage can be allowed to suspend transceiving data bag, and the packet loss information obtained in this passage and packet loss time point, and meanwhile, another passage continues test, such two passes is used alternatingly, without interrupt test, just can Real-time Obtaining to the packet loss information of equipment under test and packet loss time point, solve in prior art each time point and corresponding packet loss number that can not obtain and packet loss occurs, when to equipment under test positioning problems, bring the problem of very big inconvenience.By solving the problems of the technologies described above, tester can be facilitated the positioning problems of equipment under test.
The embodiment of the present invention provides a kind of method of applied in network performance test, is performed by testing apparatus, for the network equipment, such as switch, router, fire compartment wall etc. are tested, at least comprise first passage and second channel in described testing apparatus, as shown in Figure 2, described method comprises:
201, the speed that first passage is sent packet by testing apparatus in the first Preset Time is progressively reduced to zero by port speed, and synchronous speed second channel being sent packet is progressively increased to port speed by zero.
Wherein, first passage sends the speed sum that the speed of packet and second channel send packet is port speed.Described port speed is the port that testing apparatus is connected with equipment under test by testing apparatus, sends the speed of packet to equipment under test; Described port speed can be arranged by user, remains unchanged in test process middle port speed.
The receiving terminal of quantity and first passage that the transmitting terminal that 202, first passage in the first Preset Time added up by testing apparatus sends packet receives the quantity of packet.
203, when the quantity that the receiving terminal of quantity and first passage that the transmitting terminal of first passage sends packet receives packet is unequal, testing apparatus sends warning information and generates log recording.
Wherein, warning information comprises packet loss quantity and the temporal information of packet loss occurs, packet loss quantity is the difference that the receiving terminal of first passage receives between quantity that the quantity of packet and the transmitting terminal of first passage send packet, and the temporal information that packet loss occurs comprises first passage and starts to send the moment that moment of packet and described first passage stop sending packet.The frame structure of packet comprises the distinguishing identifier for distinguishing first passage and second channel.First passage and second channel independently transmit and receive data bag separately.
It should be noted that, after testing apparatus sends warning information and generates log recording, the speed that second channel is sent packet by testing apparatus in the second Preset Time is progressively reduced to zero by port speed, and synchronous speed first passage being sent packet is progressively increased to described port speed by zero; The receiving terminal of quantity and second channel that the transmitting terminal then adding up second channel in the second Preset Time sends packet receives the quantity of packet; When the quantity that the receiving terminal of quantity and second channel that the transmitting terminal of second channel sends packet receives packet is unequal, sends warning information and generate log recording.
In the embodiment of the present invention, testing apparatus comprises two passes, and in Preset Time, add up the data packet number that current channel sends and receives, if quantity is unequal, testing apparatus sends alarm and generates log recording.Because arrange two passes, so a passage can be allowed to suspend transceiving data bag, and the packet loss information obtained in this passage and packet loss time point, and meanwhile, another passage continues test, such two passes is used alternatingly, without interrupt test, just can Real-time Obtaining to the packet loss information of equipment under test and packet loss time point, solve in prior art each time point and corresponding packet loss number that can not obtain and packet loss occurs, when to equipment under test positioning problems, bring the problem of very big inconvenience.By solving the problems of the technologies described above, tester can be facilitated the positioning problems of equipment under test.
The embodiment of the present invention provides a kind of method of applied in network performance test, for testing apparatus, this testing apparatus is mainly used in testing network equipments such as switch, router, fire compartment walls, as shown in Figure 3, testing apparatus is connected with data wire with equipment under test, arranges the passage of two flow transceiving data bags: passage A and channel B in testing apparatus.First passage can be passage A or channel B, and the embodiment of the present invention take first passage as passage A is example.Packet Generation end sends A and B two kinds of packets respectively by two passes, and receiving terminal receives two kinds of packets respectively, packet A and packet B transmitting procedure separate.As shown in Figure 4, described method comprises:
301, testing apparatus resets the data of all registers.
Wherein, when testing apparatus starts to carry out equipment performance test, need the zeros data of all registers, to ensure the accuracy of test process data record.
302, testing apparatus transmits and receive data bag.
Optionally, equipment performance test is carried out at testing apparatus, when starting to give out a contract for a project, packet can only be sent by wall scroll traffic channel, first packet can be sent by the flow of in Software for Design default channel A and channel B, also first packet can be sent by a flow in the manual selector channel A of user and channel B.
Wherein, testing apparatus has a set of R-T unit, when the packet A sent and packet B, the mark for distinguishing is added in the structure of packet, when receiving packet, to judge the mark of packet accepted, then by Packet Generation to corresponding receiving terminal.
Such as, as shown in Figure 5, in the embodiment of the present invention, testing apparatus adds the flag 1,0 distinguishing packet A and packet B in the frame structure of packet by software, namely belong to the packet A of passage A, add inlet identity 1 in the frame structure; Belong to the packet B of channel B, add inlet identity 0 in the frame structure.As shown in Figure 6, testing apparatus, when receiving packet, according to package identification, receives respectively.
Optionally, testing apparatus can also increase a set of R-T unit, sends different packets, be used for distinguishing the packet received and dispatched in passage A and channel B by two cover R-T units.
It should be noted that, testing apparatus has register at the Packet Generation end of two passages and receiving terminal, counts respectively to the packet sent and receive.The speed that testing apparatus sends packet is the port speed arranged, and port is the port that testing apparatus is connected with equipment under test.User can be arranged port speed, and remains unchanged in test process middle port speed.
303, testing apparatus is after starting to send packet, delay time Tchk.
Wherein, testing apparatus starts to send packet, after elapsed time Tchk, judges the passage of current transmission packet, performs step 304.Tchk is the time interval of the automatic decision service aisle that testing apparatus is arranged, and manually can be arranged by user.
304, the passage of current transmission packet determined by testing apparatus.
Wherein, testing apparatus can judge the passage of current transmission packet by the type of data packet of current transmission.
It should be noted that, in the embodiment of the present invention, the passage of the current transmission packet determined for testing apparatus is passage A.
305, testing apparatus reduces the speed that passage A sends packet, increases the speed that channel B sends packet.
Wherein, after testing apparatus judges that the passage of current transmission packet is passage A, reduce by software the speed that passage A sends packet, increase the speed that channel B sends packet simultaneously.
It should be noted that, testing apparatus is sending in the process of packet rate by software change passage A and channel B, the speed sum of two passages transmission packets is the transmission packet rate of testing apparatus port, and the transmission packet rate of testing apparatus port remains unchanged.
306, testing apparatus judge passage A transmit and receive data bag A speed whether be zero, if passage A transmit and receive data bag A speed be zero, then perform step 308; Otherwise, perform step 307.
307, testing apparatus time delay t2.
Wherein, after testing apparatus passes through Software for Design time delay t2, repeated execution of steps 306.
308, after testing apparatus time delay t1, the data of fetch channel A transmitting terminal and receiving terminal register, and calculate the difference DELTA A sending packet A and receive packet A number.
Wherein, testing apparatus judge passage A transmit and receive data bag A speed whether be zero, if passage A transmit and receive data bag A speed be zero, then need time delay t1, to receive packets all in transmitting procedure as far as possible.Testing apparatus have recorded the number of the bag A that transmits and receive data in passage A transmitting terminal and receiving terminal register.After the data reading register, calculate the difference DELTA A sending packet A and receive packet A number.
It should be noted that, user by the actual state of equipment under test, can arrange the size of t1.
309, testing apparatus judges whether Δ A is zero, if Δ A is non-vanishing, then performs step 310; Otherwise, perform step 311.
Wherein, testing apparatus judges whether Δ A is zero, if Δ A is non-vanishing, then passage A sends packet A and receive packet A number unequal, performs step 310; If Δ A is zero, then passage A sends packet A and receives packet A number equal, performs step 311.
310, testing apparatus sends warning information and generates log recording.
Wherein, after testing apparatus judges that passage A transmission packet A and reception packet A number are unequal, send alarm, warning information comprises alarm time and Δ A.The implementation of the embodiment of the present invention to testing apparatus alarm does not limit, and can be any implementation well-known to those skilled in the art.Meanwhile, warning information is generated log recording by testing apparatus, so that tester checks.
311, testing apparatus resets passage A transmitting terminal and receiving terminal register.
Wherein, testing apparatus resets passage A transmitting terminal and receiving terminal register, to count the packet sent and receive respectively in next circulation.
312, testing apparatus delay time Tchk.
313, the passage of current transmission packet determined by testing apparatus.
It should be noted that, in the embodiment of the present invention, testing apparatus comprises A and B two passes, then the passage of the current transmission packet determined is channel B.
314, testing apparatus reduces the speed that channel B sends packet, increases the speed that passage A sends packet.
315, testing apparatus judge channel B transmit and receive data bag B speed whether be zero, if channel B transmit and receive data bag B speed be zero, then perform step 317; Otherwise, perform step 316.
316, testing apparatus time delay t2.
317, after testing apparatus time delay t1, the data of fetch channel B transmitting terminal and receiving terminal register, and calculate the difference DELTA B sending packet B and receive packet B number.
318, testing apparatus judges whether Δ B is zero, if Δ B is non-vanishing, then performs step 319; Otherwise, perform step 320.
319, testing apparatus sends warning information and generates log recording.
320, testing apparatus resets channel B transmitting terminal and receiving terminal register.
It should be noted that, step 314 is to the process of step 320 data processing, identical to the process of step 311 data processing with step 305.
Wherein, after testing apparatus resets channel B transmitting terminal and receiving terminal register, start timing, perform step 303, after delay time Tchk, enter next circulation, register starts again to count.
In the embodiment of the present invention, testing apparatus comprises two passes, and in Preset Time, add up the data packet number that current channel sends and receives, if quantity is unequal, testing apparatus sends alarm and generates log recording.Because arrange two passes, so a passage can be allowed to suspend transceiving data bag, and the packet loss information obtained in this passage and packet loss time point, and meanwhile, another passage continues test, such two passes is used alternatingly, without interrupt test, just can Real-time Obtaining to the packet loss information of equipment under test and packet loss time point, solve in prior art each time point and corresponding packet loss number that can not obtain and packet loss occurs, when to equipment under test positioning problems, bring the problem of very big inconvenience.By solving the problems of the technologies described above, tester can be facilitated the positioning problems of equipment under test.
The embodiment of the present invention provides a kind of testing apparatus 40, and as shown in Figure 7, described testing apparatus 40 comprises: processor 41, memory 42, port 43 and bus 44.
Processor 41, memory 42, port 43 are interconnected by bus 44; Bus 44 can be Peripheral Component Interconnect standard (peripheral component interconnect is called for short PCI) bus or EISA (extended industry standard architecture is called for short EISA) bus etc.Described bus can be divided into address bus, data/address bus, control bus etc.For ease of representing, only representing with a thick line in Fig. 7, but not representing the bus only having a bus or a type.
Memory 42, for depositing program.Particularly, program can comprise program code, and described program code comprises computer-managed instruction.Memory 42 may comprise high-speed random access memory (random access memory is called for short RAM) memory, still may comprise nonvolatile memory (non-volatile memory), such as at least one magnetic disc store.
Port 43, for connecting equipment under test, makes testing apparatus 40 and equipment under test carry out transfer of data.
The program that processor 41 execute store 42 is deposited, for realizing the method for the applied in network performance test that the embodiment of the present invention provides, comprising:
The speed that described first passage sends packet is progressively reduced to zero by port speed by processor 41 in the first Preset Time, and synchronous speed second channel being sent packet is progressively increased to described port speed by zero, the speed sum that the speed of wherein said first passage transmission packet and described second channel send packet is described port speed;
The receiving terminal of quantity and described first passage that the transmitting terminal that described first passage in described first Preset Time added up by described processor 41 sends packet receives the quantity of packet;
When the quantity that the receiving terminal of quantity and described first passage that the transmitting terminal of described first passage sends packet receives packet is unequal, described processor 41 sends warning information and generates log recording.
Port speed in the embodiment of the present invention is testing apparatus 40 sends packet to equipment under test speed by port 43.
Wherein, described warning information comprises packet loss quantity and the temporal information of packet loss occurs, described packet loss quantity is the difference that the receiving terminal of described first passage receives between quantity that the quantity of packet and the transmitting terminal of described first passage send packet, and the temporal information of described generation packet loss comprises described first passage and starts to send the moment that moment of packet and described first passage stop sending packet.The frame structure of described packet comprises the distinguishing identifier for distinguishing described first passage and described second channel.Described first passage and described second channel independently transmit and receive data bag separately.
Further, the speed that described second channel sends packet is progressively reduced to zero by port speed by described processor 41 in the second Preset Time, and synchronous speed first passage being sent packet is progressively increased to described port speed by zero;
The receiving terminal of quantity and described second channel that the transmitting terminal that described second channel in described second Preset Time added up by described processor 41 sends packet receives the quantity of packet;
When the quantity that the receiving terminal of quantity and described second channel that the transmitting terminal of described second channel sends packet receives packet is unequal, described processor 41 sends warning information and generates log recording.
Above-mentioned processor 41 can be general processor, comprises central processing unit (Central Processing Unit is called for short CPU), network processing unit (Network Processor is called for short NP) etc.; Can also be digital signal processor (DSP), application-specific integrated circuit (ASIC) (ASIC), ready-made programmable gate array (FPGA) or other programmable logic devices.
In the embodiment of the present invention, testing apparatus 40 comprises two passes, and in Preset Time, add up the data packet number that current channel sends and receives, if quantity is unequal, testing apparatus 40 sends alarm and generates log recording.Because arrange two passes, so a passage can be allowed to suspend transceiving data bag, and the packet loss information obtained in this passage and packet loss time point, and meanwhile, another passage continues test, such two passes is used alternatingly, without interrupt test, just can Real-time Obtaining to the packet loss information of equipment under test and packet loss time point, solve in prior art each time point and corresponding packet loss number that can not obtain and packet loss occurs, when to equipment under test positioning problems, bring the problem of very big inconvenience.By solving the problems of the technologies described above, tester can be facilitated the positioning problems of equipment under test.
A kind of testing apparatus that the embodiment of the present invention provides can realize the above-mentioned embodiment of the method provided, and concrete function realizes the explanation referred in embodiment of the method, does not repeat them here.The method of a kind of applied in network performance test that the embodiment of the present invention provides and testing apparatus go for applied in network performance test, but are not limited only to this.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, between each embodiment identical similar part mutually see, what each embodiment stressed is the difference with other embodiments.Especially, for apparatus embodiments, because it is substantially similar to embodiment of the method, so describe fairly simple, relevant part illustrates see the part of embodiment of the method.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the change 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.