The content of the invention
The embodiment of the present invention provides a kind of method and test device of applied in network performance test, can solve IP testers not
The Each point in time that packet loss occurs and corresponding packet loss number can be obtained, so that when to equipment under test positioning problems, is brought very
The problem of big inconvenience.
To reach above-mentioned purpose, the embodiment of the present invention adopts the following technical scheme that:
In a first aspect, the embodiment of the present invention provides a kind of test device, including:
Adjustment unit, for the first passage to be sent the speed of data packet by port speed in the first preset time
Gradually reduce to zero, and the speed that second channel is synchronously sent to data packet is progressively improved to the port speed by zero, wherein
It is the port speed that the first passage, which sends the sum of the speed of data packet and speed of second channel transmission data packet,;
Statistic unit, the transmitting terminal for counting the first passage in first preset time send the number of data packet
Amount and the quantity of the receiving terminal received data packet of the first passage;
Alarm Unit, when the transmitting terminal of the first passage of statistic unit statistics sends quantity and the institute of data packet
State statistic unit statistics the first passage receiving terminal received data packet quantity it is unequal when, send warning information and life
Into log recording.
With reference to first aspect, in the first possible implementation of first aspect, institute that the Alarm Unit is sent
Stating warning information includes packet loss quantity and the temporal information of packet loss occurs, and the packet loss quantity is the receiving terminal of the first passage
The transmitting terminal of the quantity of received data packet and the first passage sends the difference between the quantity of data packet, the generation packet loss
Temporal information include stopping sending data packet with the first passage at the time of first passage starts to send data packet
Moment.
With reference to first aspect or first aspect the first possible implementation, second in first aspect be possible
In implementation, the frame structure of the data packet includes being used for the differentiation mark for distinguishing the first passage and the second channel
Know.
With reference to first aspect or first aspect any possible implementation, the third in first aspect be possible
In implementation, the first passage and second channel is each independently transmitted and received data packet.
With reference to first aspect or first aspect any possible implementation, the 4th kind in first aspect be possible
In implementation, the adjustment unit, is additionally operable to the speed of second channel transmission data packet in the second preset time
Gradually reduced by port speed to zero, and the speed that first passage is synchronously sent to data packet is progressively improved to the port by zero
Speed;
The statistic unit, the transmitting terminal for being additionally operable to count the second channel in second preset time send data
The quantity of bag and the quantity of the receiving terminal received data packet of the second channel;
The Alarm Unit, the transmitting terminal of the second channel for being counted when the statistic unit send data packet
When quantity and the unequal quantity of the receiving terminal received data packet of the second channel of statistic unit statistics, alarm is sent
Information simultaneously generates log recording.
Second aspect, the embodiment of the present invention provide a kind of method of applied in network performance test, including:
The speed that the first passage is sent to data packet in the first preset time is gradually reduced to zero by port speed,
And the speed that second channel is synchronously sent to data packet is progressively improved to the port speed by zero, wherein the first passage is sent out
It is the port speed to send the sum of the speed of data packet and speed of second channel transmission data packet;
The transmitting terminal for counting the first passage in first preset time sends the quantity and described first of data packet
The quantity of the receiving terminal received data packet of passage;
When the transmitting terminal of the first passage sends the quantity of data packet data are received with the receiving terminal of the first passage
When the quantity of bag is unequal, sends warning information and generate log recording.
With reference to second aspect, in the first possible implementation of second aspect, the warning information includes packet loss
Quantity and occur packet loss temporal information, the packet loss quantity for the first passage receiving terminal received data packet quantity with
The transmitting terminal of the first passage sends the difference between the quantity of data packet, and the temporal information that packet loss occurs includes described
At the time of first passage stops sending data packet at the time of starting to send data packet with the first passage.
With reference to the possible implementation of the first of second aspect or second aspect, second in second aspect is possible
In implementation, the frame structure of the data packet includes being used for the differentiation mark for distinguishing the first passage and the second channel
Know.
It is possible with reference to second aspect or any possible implementation of second aspect, the third in second aspect
In implementation, the first passage and second channel is each independently transmitted and received data packet.
With reference to second aspect or any possible implementation of second aspect, the 4th kind in second aspect is possible
In implementation, number is received with the receiving terminal of the first passage when the transmitting terminal of the first passage sends the quantity of data packet
When unequal according to the quantity of bag, it is described send warning information and generate log recording after, the method further includes:
The speed that the second channel is sent to data packet in the second preset time is gradually reduced to zero by port speed,
And the speed that first passage is synchronously sent to data packet is progressively improved to the port speed by zero;
The transmitting terminal for counting the second channel in second preset time sends the quantity and described second of data packet
The quantity of the receiving terminal received data packet of passage;
When the transmitting terminal of the second channel sends the quantity of data packet data are received with the receiving terminal of the second channel
When the quantity of bag is unequal, sends warning information and generate log recording.
The method and test device of a kind of applied in network performance test provided in an embodiment of the present invention, with the prior art, testing
Device is unable to the specific packet loss number of real-time statistics and is compared with packet loss time point, sets two flows in the present invention in test device
Transceiver channel, counts the data packet number that a passage sends and receives in preset time, if quantity is unequal, test dress
Put and send alarm and generate log recording.Because two passes are set, it is possible to allow a passage to suspend transceiving data bag, and
The packet loss information in the passage and packet loss time point are obtained, and at the same time, another passage continues to test, and such two are logical
Road is used alternatingly, without interrupt test, it is possible to packet loss information and the packet loss time point of equipment under test are got in real time, it is convenient
Tester positions the problem of equipment under test.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained all other without making creative work
Embodiment, belongs to the scope of protection of the invention.
The embodiment of the present invention provides a kind of test device 10, as shown in Figure 1, the test device 10 includes:
Adjustment unit 11, for the first passage to be sent to the speed of data packet in the first preset time by port speed
Rate is gradually reduced to zero, and the speed that second channel is synchronously sent to data packet is progressively improved to the port speed by zero, its
Described in first passage send speed and the second channel of data packet and send the sum of speed of data packet as port speed
Rate;
Wherein, the port speed is the port that test device 10 is connected by test device 10 with equipment under test, to quilt
Measurement equipment sends the speed of data packet;The port speed can be by user setting, and port speed is kept not during the test
Become.
Statistic unit 12, the transmitting terminal for counting the first passage in first preset time send data packet
Quantity and the quantity of the receiving terminal received data packet of the first passage;
Alarm Unit 13, the transmitting terminal of the first passage for being counted when the statistic unit 12 send data packet
When quantity and the unequal quantity of the receiving terminal received data packet of the first passage of the statistic unit 12 statistics, announcement is sent
Alert information simultaneously generates log recording.
Wherein, the warning information that the Alarm Unit 13 is sent includes packet loss quantity and the time letter of packet loss occurs
Breath, the packet loss quantity are sent out for the quantity of the receiving terminal received data packet of the first passage and the transmitting terminal of the first passage
Go out the difference between the quantity of data packet, the temporal information that packet loss occurs starts to send data packet including the first passage
At the time of with the first passage stop send data packet at the time of.The frame structure of the data packet includes being used to distinguish described
The distinguishing identifier of first passage and the second channel.The first passage and the second channel it is each independently transmitted and receive
Data packet.
Further, the adjustment unit 11, is additionally operable in the second preset time the second channel sending data
The speed of bag is gradually reduced to zero by port speed, and the speed that first passage is synchronously sent to data packet is progressively improved extremely by zero
The port speed;
The statistic unit 12, the transmitting terminal for being additionally operable to count the second channel in second preset time send number
According to the quantity and the quantity of the receiving terminal received data packet of the second channel of bag;
The Alarm Unit 13, the transmitting terminal of the second channel for being counted when the statistic unit 12 send data
When the quantity of bag and the unequal quantity of the receiving terminal received data packet of the second channel of the statistic unit 12 statistics, hair
Go out warning information and generate log recording.
In the embodiment of the present invention, test device 10 includes two passes, and current channel is counted in preset time and is sent
With the data packet number of reception, if quantity is unequal, test device 10 sends alarm and generates log recording.Because set two
Bar passage, it is possible to allow a passage to suspend transceiving data bag, and obtain the packet loss information in the passage and packet loss time
Point, and at the same time, another passage continues to test, and such two passes are used alternatingly, without interrupt test, it is possible in real time
Packet loss information and the packet loss time point of equipment under test are got, each of generation packet loss cannot be obtained in the prior art by solving
Time point and corresponding packet loss number, when to equipment under test positioning problems, the problem of bringing very big inconvenience.It is above-mentioned by solving
Technical problem, can facilitate tester to position the problem of equipment under test.
The embodiment of the present invention provides a kind of method of applied in network performance test, is performed by test device, for the network equipment,
Such as interchanger, router, fire wall etc. are tested, first passage and second channel are included at least in the test device,
As shown in Fig. 2, the described method includes:
201st, test device in the first preset time by first passage send data packet speed by port speed progressively
Zero is reduced to, and the speed that second channel is synchronously sent to data packet is progressively improved to port speed by zero.
Wherein, first passage sends the speed of data packet and second channel sends the sum of speed of data packet as port speed
Rate.The port speed is the port that test device is connected by test device with equipment under test, and data are sent to equipment under test
The speed of bag;The port speed can be by user setting, and port speed remains unchanged during the test.
202nd, test device counts the transmitting terminal of first passage in the first preset time and sends the quantity and first of data packet
The quantity of the receiving terminal received data packet of passage.
203rd, when the transmitting terminal of first passage sends the quantity of data packet and the receiving terminal received data packet of first passage
When quantity is unequal, test device sends warning information and generates log recording.
Wherein, warning information includes packet loss quantity and the temporal information of packet loss occurs, and packet loss quantity connects for first passage
The quantity of receiving end received data packet and the transmitting terminal of first passage send the difference between the quantity of data packet, occur packet loss when
Between information including first passage start send data packet at the time of with the first passage stop send data packet at the time of.Data
The frame structure of bag includes being used for the distinguishing identifier for distinguishing first passage and second channel.First passage and second channel are each only
It is vertical to send and receive data packet.
It should be noted that after test device sends warning information and generates log recording, test device is pre- second
If the speed that second channel is sent to data packet in the time is gradually reduced to zero by port speed, and is synchronously sent first passage
The speed of data packet is progressively improved to the port speed by zero;Then the transmitting terminal of second channel in the second preset time is counted
Send the quantity of data packet and the quantity of the receiving terminal received data packet of second channel;When the transmitting terminal of second channel sends data
When the quantity of bag and the unequal quantity of the receiving terminal received data packet of second channel, send warning information and generate daily record note
Record.
In the embodiment of the present invention, test device includes two passes, in preset time count current channel send and
The data packet number of reception, if quantity is unequal, test device sends alarm and generates log recording.Because two are set to lead to
Road, it is possible to allow a passage to suspend transceiving data bag, and obtain the packet loss information in the passage and packet loss time point, and
At the same time, another passage continues to test, and such two passes are used alternatingly, without interrupt test, it is possible to obtains in real time
Packet loss information and packet loss time point to equipment under test, solve each time that cannot be obtained packet loss occurs in the prior art
Point and corresponding packet loss number, when to equipment under test positioning problems, the problem of bringing very big inconvenience.By solving above-mentioned technology
Problem, can facilitate tester to position the problem of equipment under test.
The embodiment of the present invention provides a kind of method of applied in network performance test, and for testing device, which mainly uses
Tested in network equipments such as interchanger, router, fire walls, as shown in figure 3, test device and equipment under test are with data
Line is connected, and the passage of two flow transceiving data bags is set in test device:Passage A and passage B.First passage can be logical
Road A or passage B, the embodiment of the present invention is by taking first passage is passage A as an example.Data packet transmitting terminal is sent respectively by two passes
Two kinds of data packets of A and B, receiving terminal receive two kinds of data packets respectively, and data packet A and data packet B transmitting procedures are separate.Such as figure
Shown in 4, the described method includes:
301st, test device resets the data of all registers.
Wherein, when test device proceeds by equipment performance test, it is necessary to by the zeros data of all registers, to protect
Demonstrate,prove the accuracy of test process data record.
302nd, test device sends and receives data packet.
Optionally, equipment performance test is carried out in test device, when starting to give out a contract for a project, number can only be sent by wall scroll traffic channel
According to bag, data packet can first be sent by a flow in Software for Design default channel A and passage B, user can also be passed through
Manually select in passage A and passage B flow and first send data packet.
Wherein, test device has a set of R-T unit, in the data packet A and data packet B of transmission, in the structure of data packet
In add mark for differentiation, in received data packet, the mark of the data packet of receiving is judged, then by number
Corresponding receiving terminal is sent to according to bag.
For example, as shown in figure 5, in the embodiment of the present invention, test device is added by software in the frame structure of data packet
The flag 1,0 of data packet A and data packet B is distinguished, that is, belongs to the data packet A of passage A, adds mark 1 in the frame structure;Belong to
The data packet B of passage B, adds mark 0 in the frame structure.As shown in fig. 6, test device is in received data packet, according to data
Bag mark, receives respectively.
Optionally, test device can also increase a set of R-T unit, and different data are sent by two sets of R-T units
Bag, for distinguishing the data packet received and dispatched in passage A and passage B.
It should be noted that test device has register in the data packet transmitting terminal and receiving terminal of two passages, it is right respectively
The data packet sent and received is counted.The speed that test device sends data packet is the port speed set, and port is survey
The port being connected with equipment under test is put in trial assembly.User can be configured port speed, and port speed during the test
Remain unchanged.
303rd, test device is after starting to send data packet, delay time Tchk.
Wherein, test device starts to send data packet, after elapsed time Tchk, judges the passage of currently transmitted data packet,
Perform step 304.Tchk is the time interval for the automatic decision service aisle that test device is set, and can be set manually by user
Put.
304th, test device determines the passage of currently transmitted data packet.
Wherein, test device can judge the passage of currently transmitted data packet by currently transmitted type of data packet.
It should be noted that in the embodiment of the present invention, the passage of the currently transmitted data packet determined with test device is logical
Exemplified by road A.
305th, test device reduces the speed that passage A sends data packet, and increase passage B sends the speed of data packet.
Wherein, after judging the passage of currently transmitted data packet for passage A in test device, pass through software and reduce passage A hairs
The speed of data packet is sent, while increases the speed that passage B sends data packet.
It should be noted that test device is changing the process of passage A and passage B transmission packet rates by software
In, the sum of speed that two passages send data packet is the transmission packet rate of test device port, and test device port
Packet rate is sent to remain unchanged.
306th, test device judges whether the speed that passage A sends and receives data packet A is zero, if passage A sends and connects
The speed for receiving data packet A is zero, then performs step 308;Otherwise, step 307 is performed.
307th, test device delay t2.
Wherein, after test device is by Software for Design delay t2, step 306 is repeated.
308th, after test device delay t1, the data of passage A transmitting terminals and receiving terminal register are read, and calculate transmission number
According to the difference DELTA A of bag A number of A and received data packet.
Wherein, test device judges whether the speed that passage A sends and receives data packet A is zero, if passage A send and
The speed of received data packet A is zero, then the t1 that is delayed is needed, to receive data packet all in transmitting procedure as far as possible.Survey
The number that have recorded in passage A transmitting terminals and receiving terminal register and send and receive data packet A is put in trial assembly.Reading register
Data after, calculate send A number of data packet A and received data packet difference DELTA A.
It should be noted that user by the actual state of equipment under test, can set the size of t1.
309th, test device judges whether Δ A is zero, if Δ A is not zero, performs step 310;Otherwise, step is performed
311。
Wherein, test device judges whether Δ A is zero, if Δ A is not zero, passage A sends data packet A and receives data
It is unequal to wrap A number, performs step 310;If Δ A is zero, passage A sends data packet A and A number of received data packet is equal,
Perform step 311.
310th, test device sends warning information and generates log recording.
Wherein, after test device judges that passage A transmission data packet A and A number of received data packet are unequal, alarm is sent,
Warning information includes alarm time and Δ A.The embodiment of the present invention does not limit the implementation that test device alerts, Ke Yishi
Any implementation well-known to those skilled in the art.Meanwhile warning information is generated log recording by test device, to survey
Examination personnel check.
311st, test device resets passage A transmitting terminals and receiving terminal register.
Wherein, test device resets passage A transmitting terminals and receiving terminal register, so as in subsequent cycle respectively to sending and
The data packet of reception is counted.
312nd, test device delay time Tchk.
313rd, test device determines the passage of currently transmitted data packet.
It should be noted that in the embodiment of the present invention, test device includes A and B two passes, it is determined that it is currently transmitted
The passage of data packet is passage B.
314th, test device reduces the speed that passage B sends data packet, and increase passage A sends the speed of data packet.
315th, test device judges whether the speed that passage B sends and receives data packet B is zero, if passage B sends and connects
The speed for receiving data packet B is zero, then performs step 317;Otherwise, step 316 is performed.
316th, test device delay t2.
317th, after test device delay t1, the data of passage B transmitting terminals and receiving terminal register are read, and calculate transmission number
According to the difference DELTA B of bag B number of B and received data packet.
318th, test device judges whether Δ B is zero, if Δ B is not zero, performs step 319;Otherwise, step is performed
320。
319th, test device sends warning information and generates log recording.
320th, test device resets passage B transmitting terminals and receiving terminal register.
It should be noted that at process of the step 314 to step 320 data processing, with step 305 to step 311 data
The process of reason is identical.
Wherein, after test device resets passage B transmitting terminals and receiving terminal register, start timing, perform step 303,
After delay time Tchk, into subsequent cycle, register starts to count again.
In the embodiment of the present invention, test device includes two passes, and current channel is counted in preset time and sends and connects
The data packet number of receipts, if quantity is unequal, test device sends alarm and generates log recording.Because two are set to lead to
Road, it is possible to allow a passage to suspend transceiving data bag, and obtain the packet loss information in the passage and packet loss time point, and
At the same time, another passage continues to test, and such two passes are used alternatingly, without interrupt test, it is possible to obtains in real time
Packet loss information and packet loss time point to equipment under test, solve each time that cannot be obtained packet loss occurs in the prior art
Point and corresponding packet loss number, when to equipment under test positioning problems, the problem of bringing very big inconvenience.By solving above-mentioned technology
Problem, can facilitate tester to position the problem of equipment under test.
The embodiment of the present invention provides a kind of test device 40, as shown in fig. 7, the test device 40 includes:Processor 41,
Memory 42, port 43 and bus 44.
Processor 41, memory 42, port 43 are connected with each other by bus 44;Bus 44 can be Peripheral Component Interconnect mark
It is accurate(Peripheral component interconnect, abbreviation PCI)Bus or expanding the industrial standard structure(extended
Industry standard architecture, abbreviation EISA)Bus etc..The bus can be divided into address bus, data
Bus, controlling bus etc..For ease of representing, only represented in Fig. 7 with a thick line, it is not intended that an only bus or one kind
The bus of type.
Memory 42, for storing program.Specifically, program can include program code, and said program code includes meter
Calculation machine operational order.Memory 42 may include high-speed random access memory(Random access memory, abbreviation RAM)
Memory, it is also possible to further include nonvolatile memory(non-volatile memory), a for example, at least disk storage
Device.
Port 43, for connecting equipment under test, carries out data transmission test device 40 and equipment under test.
Processor 41 performs the program that memory 42 is stored, and is used for realization network performance provided in an embodiment of the present invention and surveys
The method of examination, including:
Processor 41 in the first preset time by the first passage send data packet speed by port speed progressively
Zero is reduced to, and the speed that second channel is synchronously sent to data packet is progressively improved to the port speed by zero, wherein described
It is the port speed that first passage, which sends the sum of the speed of data packet and speed of second channel transmission data packet,;
The transmitting terminal that the processor 41 counts the first passage in first preset time sends the number of data packet
Amount and the quantity of the receiving terminal received data packet of the first passage;
When the transmitting terminal of the first passage sends the quantity of data packet data are received with the receiving terminal of the first passage
When the quantity of bag is unequal, the processor 41 sends warning information and generates log recording.
Port speed in the embodiment of the present invention sends data packet by port 43 for test device 40 to equipment under test
Speed.
Wherein, the warning information includes packet loss quantity and the temporal information of packet loss occurs, and the packet loss quantity is described
The quantity of the receiving terminal received data packet of first passage and the transmitting terminal of the first passage are sent between the quantity of data packet
Difference, it is described occur packet loss temporal information include the first passage start send data packet at the time of and the first passage
At the time of stopping sending data packet.The frame structure of the data packet includes leading to for distinguishing the first passage and described second
The distinguishing identifier in road.The first passage and second channel is each independently transmitted and received data packet.
Further, the processor 41 in the second preset time by the second channel send data packet speed by
Port speed is gradually reduced to zero, and the speed that first passage is synchronously sent to data packet is progressively improved to port speed by zero
Rate;
The transmitting terminal that the processor 41 counts the second channel in second preset time sends the number of data packet
Amount and the quantity of the receiving terminal received data packet of the second channel;
When the transmitting terminal of the second channel sends the quantity of data packet data are received with the receiving terminal of the second channel
When the quantity of bag is unequal, the processor 41 sends warning information and generates log recording.
Above-mentioned processor 41 can be general processor, including central processing unit(Central Processing
Unit, abbreviation CPU), network processing unit(Network Processor, abbreviation NP)Deng;It can also be digital signal processor
(DSP), application-specific integrated circuit(ASIC), ready-made programmable gate array(FPGA)Or other programmable logic device.
In the embodiment of the present invention, test device 40 includes two passes, and current channel is counted in preset time and is sent
With the data packet number of reception, if quantity is unequal, test device 40 sends alarm and generates log recording.Because set two
Bar passage, it is possible to allow a passage to suspend transceiving data bag, and obtain the packet loss information in the passage and packet loss time
Point, and at the same time, another passage continues to test, and such two passes are used alternatingly, without interrupt test, it is possible in real time
Packet loss information and the packet loss time point of equipment under test are got, each of generation packet loss cannot be obtained in the prior art by solving
Time point and corresponding packet loss number, when to equipment under test positioning problems, the problem of bringing very big inconvenience.It is above-mentioned by solving
Technical problem, can facilitate tester to position the problem of equipment under test.
A kind of test device provided in an embodiment of the present invention can realize the embodiment of the method for above-mentioned offer, and concrete function is real
Referring now to the explanation in embodiment of the method, details are not described herein.A kind of applied in network performance test provided in an embodiment of the present invention
Method and test device can be adapted for applied in network performance test, but be not limited only to this.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.It is real especially for equipment
For applying example, since it is substantially similar to embodiment of the method, so describing fairly simple, related part is referring to embodiment of the method
Part explanation.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer read/write memory medium
In, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory(Read-Only Memory, ROM)Or random access memory(Random Access
Memory, RAM)Deng.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any
Those familiar with the art the invention discloses technical scope in, the change or replacement that can readily occur in, all should
It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to scope of the claims.