Summary of the invention
Embodiments provide a kind of method and the physical machine of measuring network performance, the accuracy that can improve measurement result and the measurement realized overall performance of network.
In view of this, first aspect present invention provides a kind of method measuring network performance, can comprise:
When the application program determining to operate in virtual machine and server carry out data interaction, intercept and capture the packet transmitted in described data exchange process; Described virtual machine operates in the software virtual machine of physical machine pre-installation, and it is outside that described server is positioned at described physical machine;
Encapsulate described packet;
Deep-packet detection DPI is carried out to the described packet encapsulated, obtains testing result;
The network performance in described data exchange process is determined according to described testing result.
In conjunction with first aspect present invention, in the first execution mode of first aspect present invention, can comprise:
Determine that the application program operated in virtual machine carries out data interaction by wireless network card and server.
In conjunction with first aspect present invention, in the second execution mode of first aspect present invention, can comprise:
The packet transmitted in described data exchange process is intercepted and captured by pre-configured packet capturing order.
In conjunction with first aspect present invention, in the 3rd execution mode of first aspect present invention, can comprise:
The content in the described packet encapsulated is read by pre-configured deep packet inspection technical, and by the content in described packet, the information in Open System Interconnection OSI seven layer protocol corresponding to described packet is recombinated, obtain the testing result of the internet protocol address of bandwidth, network delay and described server.
In conjunction with first aspect present invention, the first execution mode of first aspect present invention, the second execution mode of first aspect present invention, the 3rd execution mode of first aspect present invention, in the 4th execution mode of first aspect present invention, can comprise:
Store described packet.
In view of this, second aspect present invention provides a kind of physical machine, can comprise:
First determining unit, for determining to operate in application program in virtual machine and server carries out data interaction; Described virtual machine operates in the software virtual machine of physical machine pre-installation, and it is outside that described server is positioned at described physical machine;
Acquiring unit, for intercepting and capturing the packet transmitted in described data exchange process;
Encapsulation unit, for encapsulating described packet;
Detecting unit, for carrying out deep-packet detection DPI to the described packet encapsulated, obtains testing result;
Second determining unit, for determining the network performance in described data exchange process according to described testing result.
In conjunction with second aspect present invention, in the first execution mode of second aspect present invention, can comprise:
Described first determining unit carries out data interaction specifically for determining the application program operated in virtual machine by wireless network card and server.
In conjunction with second aspect present invention, in the second execution mode of second aspect present invention, can comprise:
Described acquiring unit is specifically for intercepting and capturing by pre-configured packet capturing order the packet transmitted in described data exchange process.
In conjunction with second aspect present invention, in the 3rd execution mode of second aspect present invention, can comprise:
Described detecting unit is specifically for reading the content in the described packet that encapsulated by pre-configured deep packet inspection technical, and by the content in described packet, the information in Open System Interconnection OSI seven layer protocol corresponding to described packet is recombinated, obtain the testing result of the internet protocol address of bandwidth, network delay and described server.
In conjunction with second aspect present invention, the first execution mode of second aspect present invention, the second execution mode of second aspect present invention, the 3rd execution mode of second aspect present invention, in the 4th execution mode of second aspect present invention, can comprise:
Memory cell, for storing described packet.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages: when measuring network performance, network performance is measured by the method for the packet transmitted in intercepted data reciprocal process, on the one hand owing to not causing any response in a network in measuring process, make to measure the result obtained identical with real network environment, improve the accuracy of measurement result; On the other hand by the analysis to packet, achieve the measurement to overall performance of network.
Term " first ", " second ", " the 3rd " " 4th " etc. (if existence) in specification of the present invention and claims and above-mentioned accompanying drawing are for distinguishing similar object, and need not be used for describing specific order or precedence.The embodiments described herein should be appreciated that the data used like this can be exchanged in the appropriate case, so that can be implemented with the order except the content except here diagram or description.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, such as, contain those steps or unit that the process of series of steps or unit, method, system, product or equipment is not necessarily limited to clearly list, but can comprise clearly do not list or for intrinsic other step of these processes, method, product or equipment or unit.
To facilitate understanding of the present embodiment of the invention, the system configuration schematic diagram measuring network performance is introduced in the embodiment of the present invention below.
As shown in Figure 1, under physical machine operates in linux operating system, in physical machine, installed virtual opetrating system simulator (QEMU), Android (Andriod) virtual machine operates in this QEMU, and application program operates in Android (Andriod) virtual machine.
When the application program in Andriod virtual machine carries out data interaction by wireless network card and extraneous server, physical machine walks abreast and uses tcpdump order to intercept and capture the packet transmitted in data exchange process, be dump file by the packet encapsulation of intercepting and capturing, the dump file obtained like this is exactly the packet of application program and extraneous server interaction in Andriod virtual machine simultaneously.
After obtaining dump file, by deep-packet detection (DPI) technology, dump file is analyzed, come Open System Interconnection (OpenSystemInterconnection by the content of read data packet, OSI) information in seven layer protocols is recombinated, the content of the program that is applied.In application layer, obtain domain name system (DomainNameSystem, DNS) Internet protocol (InternetProtocol of server, IP) information such as address, HTML (Hypertext Markup Language) (HyperTextTransferProtocol, HTTP) Delay can be obtained simultaneously, thus obtain the performance of each server, in transport layer, can obtain in data exchange process information such as the setup delays of asking each time of network.By analyzing packet, also just network performance can be determined.
Refer to Fig. 2, the method embodiment measuring network performance in the embodiment of the present invention comprises:
101, when the application program determining to operate in virtual machine and server carry out data interaction, the packet transmitted in this data exchange process is intercepted and captured; This virtual machine operates in the software virtual machine of physical machine pre-installation, and it is outside that this server is positioned at this physical machine;
In the present embodiment, when physical machine determines to operate in the application program in virtual machine and server carries out data interaction, intercept and capture the packet transmitted in this data exchange process.
It should be noted that, the number of above-mentioned server can be one, also can be multiple, and the type of each server can be identical, also can be different.Above-mentioned virtual machine operates in the software virtual machine of physical machine pre-installation, and it is outside that above-mentioned server is positioned at this physical machine.
102, this packet is encapsulated;
After this packet is intercepted and captured, encapsulate this packet.
Can be dump file by this packet encapsulation, the dump file obtained like this be exactly the packet of this application program in virtual machine and extraneous server interaction.
103, deep-packet detection DPI is carried out to this packet encapsulated, obtain testing result;
After this packet is packed, deep-packet detection DPI is carried out to this packet, obtains testing result.
Wherein testing result comprises network delay, also comprises other information.
104, the network performance in this data exchange process is determined according to this testing result.
After obtaining testing result, the network performance in this data exchange process between application program and server can be determined by this testing result.
In the present embodiment, when measuring network performance, network performance is measured by the method for the packet transmitted in intercepted data reciprocal process, on the one hand owing to not causing any response in a network in measuring process, make to measure the result obtained identical with real network environment, improve the accuracy of measurement result; On the other hand by the analysis to packet, achieve the measurement to overall performance of network.
For the ease of understanding, be described in detail the method for the measurement network performance in the embodiment of the present invention below, refer to Fig. 3, another embodiment measuring the method for network performance in the embodiment of the present invention comprises:
201, determine that the application program operated in virtual machine carries out data interaction by wireless network card and server;
In the present embodiment, determine that the application program operated in virtual machine carries out data interaction by wireless network card and server, wherein, this wireless network card can be arranged in virtual machine, this virtual machine operates in the software virtual machine of physical machine pre-installation, and it is outside that this server is positioned at this physical machine.
Wherein, under this physical machine operates in linux operating system, this software virtual machine can be QEMU.The number of above-mentioned server can be one, also can be multiple, and the type of each server can be identical, also can be different.
Further, the data interaction between above-mentioned application program and server, can also adopt additive method, be not limited to wireless network card.
202, intercept and capture by pre-configured packet capturing order the packet transmitted in this data exchange process;
When determining that the application program operated in virtual machine carries out data interaction by wireless network card and server, intercept and capture by pre-configured packet capturing order the packet transmitted in this data exchange process.
Wherein this pre-configured packet capturing order comprises tcpdump order.
203, encapsulate this packet, and store this packet;
After packet is intercepted and captured, be dump file by the packet encapsulation of intercepting and capturing, the dump file obtained like this is exactly the packet of application program in virtual machine and server interaction, after having encapsulated packet, this packet is stored.
Be understandable that, can also be other types by packet encapsulation, be specifically not construed as limiting herein.
204, the content in this packet encapsulated is read by pre-configured deep packet inspection technical, and by the content in this packet, the information in Open System Interconnection OSI seven layer protocol corresponding to this packet is recombinated, obtain the testing result of the internet protocol address of bandwidth, network delay and this server;
After obtaining dump file, analyzed by pre-configured deep packet inspection technical, by the content reading this packet, the information in OSI seven layer protocol is recombinated, the content of the program that is applied.In application layer, obtain the information such as the IP address of dns server, obtain HTTP Delay simultaneously, in transport layer, obtain network delay, the information such as bandwidth.
205, the network performance in this data exchange process is determined according to this testing result.
Obtain bandwidth, behind network delay and IP address, determine the network performance in this data exchange process.
In the present embodiment, when measuring network performance, network performance is measured by the method for the packet transmitted in intercepted data reciprocal process, on the one hand owing to not causing any response in a network in measuring process, make to measure the result obtained identical with real network environment, improve the accuracy of measurement result; On the other hand by the analysis to packet, achieve the measurement to overall performance of network.
Secondly, complete data interaction by wireless network card, by packet capturing order intercepted data bag, improve the selectivity of scheme.
Again, describe the particular content that deep packet inspection technical detects, and packaged packet is stored, make this programme more specifically.
For the ease of understanding, be described with the method for the application scenarios of a reality to the measurement network performance in the embodiment of the present invention below:
Under physical machine operates in Ubuntu12.04 operating system, install QEMU software virtual machine in physical machine, Android virtual machine operates in this software virtual machine, and the Android version simultaneously chosen is 4.2.2, and application program operates in Android virtual machine.When the application program in Android virtual machine carries out data interaction by wireless network card and extraneous server, physical machine walk abreast use tcpdump order to the packet transmitted in network packet header intercept and capture, be dump file by the packet encapsulation of intercepting and capturing simultaneously, by deep packet inspection technical, dump file is analyzed, by the content of read data packet, the information in OSI seven layer protocol is recombinated, obtain testing result, determine the network performance in this data exchange process by testing result.
Introduce the physical machine in the embodiment of the present invention below, refer to Fig. 4, in the embodiment of the present invention, an embodiment of physical machine comprises:
First determining unit 301, for determining to operate in application program in virtual machine and server carries out data interaction; This virtual machine operates in the software virtual machine of physical machine pre-installation, and it is outside that this server is positioned at this physical machine;
Acquiring unit 302, for intercepting and capturing the packet transmitted in this data exchange process;
Encapsulation unit 303, for encapsulating this packet;
Detecting unit 304, for carrying out deep-packet detection DPI to this packet encapsulated, obtains testing result;
Second determining unit 305, for determining the network performance in this data exchange process according to this testing result.
Optionally, the present embodiment also comprises:
Memory cell 306, for storing this packet.
Wherein the first determining unit carries out data interaction specifically for determining the application program operated in virtual machine by wireless network card and server.
Acquiring unit is specifically for intercepting and capturing by pre-configured packet capturing order the packet transmitted in this data exchange process.
Detecting unit is specifically for reading the content in this packet of having encapsulated by pre-configured deep packet inspection technical, and by the content in this packet, the information in Open System Interconnection OSI seven layer protocol corresponding to this packet is recombinated, obtain the testing result of the internet protocol address of bandwidth, network delay and this server.
In the present embodiment, when measuring network performance, network performance is measured by the method for the packet transmitted in intercepted data reciprocal process, on the one hand owing to not causing any response in a network in measuring process, make to measure the result obtained identical with real network environment, improve the accuracy of measurement result; On the other hand by the analysis to packet, achieve the measurement to overall performance of network.
Secondly, complete data interaction by wireless network card, by packet capturing order intercepted data bag, improve the selectivity of scheme.
Again, describe the particular content that deep packet inspection technical detects, and packaged packet is stored, make this programme more specifically.
For the ease of understand, below with the application scenarios of a reality to being described alternately between each unit of physical machine in the present embodiment:
First determining unit 301 determines that the application program operated in virtual machine carries out data interaction by wireless network card and server, wherein, this wireless network card can be arranged in virtual machine, and this virtual machine operates in the software virtual machine of physical machine pre-installation, and it is outside that this server is positioned at this physical machine.Wherein, under this physical machine operates in linux operating system, this software virtual machine can be QEMU.The number of above-mentioned server can be one, also can be multiple, and the type of each server can be identical, also can be different.Further, the data interaction between above-mentioned application program and server, can also adopt additive method, be not limited to wireless network card.When determining that the application program operated in virtual machine carries out data interaction by wireless network card and server, acquiring unit 302 intercepts and captures by pre-configured packet capturing order the packet transmitted in this data exchange process.Wherein this pre-configured packet capturing order comprises tcpdump order.After packet is intercepted and captured, the packet encapsulation of intercepting and capturing is dump file by encapsulation unit 303, and the dump file obtained like this is exactly the packet of application program in virtual machine and server interaction, after having encapsulated packet, this packet is stored.After obtaining dump file, detecting unit 304 is analyzed by pre-configured deep packet inspection technical, is recombinated to the information in OSI seven layer protocol by the content reading this packet, the content of the program that is applied.In application layer, obtain the information such as the IP address of dns server, obtain HTTP Delay simultaneously, in transport layer, obtain network delay, the information such as bandwidth.Obtaining bandwidth, behind network delay and IP address, the second determining unit 305 determines the network performance in this data exchange process.
The embodiment of the present invention also provides a kind of server, as shown in Figure 5, comprising: receiver 401 and processor 402;
Wherein, above-mentioned processor 402, performs for controlling: when the application program determining to operate in virtual machine and server carry out data interaction, intercept and capture the packet transmitted in this data exchange process; This virtual machine operates in the software virtual machine of physical machine pre-installation, and it is outside that this server is positioned at this physical machine; Encapsulate this packet; Deep-packet detection DPI is carried out to this packet encapsulated, obtains testing result; The network performance in this data exchange process is determined according to this testing result.
The present embodiment additionally provides the specific implementation of data interaction, as follows: above-mentioned processor 402, performs: determine that the application program operated in virtual machine carries out data interaction by wireless network card and server specifically for controlling.
The present embodiment additionally provides the specific implementation of intercepted data bag, as follows: above-mentioned processor 402, performs: intercept and capture by pre-configured packet capturing order the packet transmitted in described data exchange process specifically for controlling.
The present embodiment additionally provides the specific implementation of deep-packet detection, as follows: above-mentioned processor 402, perform specifically for controlling: read the content in the described packet encapsulated by pre-configured deep packet inspection technical, and by the content in described packet, the information in Open System Interconnection OSI seven layer protocol corresponding to described packet is recombinated, obtain the testing result of the internet protocol address of bandwidth, network delay and described server.
After packet encapsulation, probably need to be stored, therefore, the present embodiment additionally provides the scheme storing packet, as follows: above-mentioned processor 402, performs: store described packet specifically for controlling.
The embodiment of the present invention also provides a kind of server, refers to Fig. 6, and in the embodiment of the present invention, another embodiment of server comprises:
Fig. 6 is a kind of server architecture schematic diagram that the embodiment of the present invention provides, this server 500 can produce larger difference because of configuration or performance difference, one or more central processing units (centralprocessingunits can be comprised, CPU) 501 (such as, one or more processors) and memory 502, one or more store the storage medium 505 (such as one or more mass memory units) of application program 503 or data 504.Wherein, memory 502 and storage medium 505 can be of short duration storages or store lastingly.The program being stored in storage medium 505 can comprise one or more modules (diagram does not mark), and each module can comprise a series of command operatings in server.Further, central processing unit 501 can be set to communicate with storage medium 505, and server 500 performs a series of command operatings in storage medium 502.
Server 500 can also comprise one or more power supplys 506, one or more wired or wireless network interfaces 507, one or more input/output interfaces 508, and/or, one or more operating system 509, such as WindowsServerTM, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM etc.
Step in above-described embodiment performed by server can based on the server architecture shown in this Fig. 6.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiments that the application provides, should be understood that, disclosed system, apparatus and method, can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
If described integrated unit using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, read-only memory (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), magnetic disc or CD etc. various can be program code stored medium.
The above, above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.