CN104468190A - Wifi data package capturing method and device and intelligent terminal - Google Patents

Wifi data package capturing method and device and intelligent terminal Download PDF

Info

Publication number
CN104468190A
CN104468190A CN201410609863.9A CN201410609863A CN104468190A CN 104468190 A CN104468190 A CN 104468190A CN 201410609863 A CN201410609863 A CN 201410609863A CN 104468190 A CN104468190 A CN 104468190A
Authority
CN
China
Prior art keywords
wifi data
file
data
acquisition interface
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410609863.9A
Other languages
Chinese (zh)
Other versions
CN104468190B (en
Inventor
孙子智
郑斌
刘强
杨川庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201410609863.9A priority Critical patent/CN104468190B/en
Publication of CN104468190A publication Critical patent/CN104468190A/en
Application granted granted Critical
Publication of CN104468190B publication Critical patent/CN104468190B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a wifi data package capturing method and device and an intelligent terminal. The method comprises the steps that wifi data transmitted in a driving layer are collected, wherein the wifi data comprise the received wifi data and/or sent wifi data; the collected wifi data are cached to be MAC frames corresponding to the 802.11MAC protocol; the cached MAC frames form at least one file of the set format according to the transfer timing. Accordingly, the wifi data transmitted by the intelligent terminal in the specific network environment are stored in the file with the set format, the data package capturing scheme can be utilized for accurately and completely capturing data packets no matter whether the intelligent terminal is in the original network environment or not, and a worker does not need to go to the site to enable the network environment to reappear by means of equipment such as a router. Meanwhile, the wifi data can be completely collected by being collected in the wifi driving layer.

Description

A kind of wifi data packet snapping method, device and intelligent terminal
Technical field
The present invention relates to communication technical field, particularly relate to a kind of wifi data packet snapping method, device and intelligent terminal.
Background technology
Existing a kind of method to intelligent terminal network transmission data analysis utilizes packet catcher to capture intercepted data bag, and by determining produced problem in Internet Transmission to the parsing of this packet.
But, for the intelligent terminal that network environment often changes, its transmitted data on network be obtained and acquire a certain degree of difficulty.This is because the kernel of intelligent terminal and application daily record can not preserve all data in network transmission process, rely on if simple the mode of the kernel capturing intelligent terminal and application daily record to capture packet, Internet Transmission situation can not be analyzed very accurately.Therefore, can only be gone in this used network environment of intelligent terminal institute by staff, utilize existing packet catcher to carry out the crawl of transmitted data on network.
But for comparatively complicated network environment, or the comparatively remote network environment that cannot arrive, staff's collection carrying out packet of being in the action acquires a certain degree of difficulty, and therefore, this packet capturing detection mode is infeasible.
Therefore, in view of the restriction of network environment, need badly and find a kind of scheme can evading above-mentioned defect.
Summary of the invention
The embodiment of the present invention provides a kind of wifi data packet snapping method, device and intelligent terminal, in order to solve the problem can only carrying out network environment reproduction and then execution packet capturing operation in order to realize packet capturing detection existed in prior art.
The embodiment of the present invention is by the following technical solutions:
A kind of wifi data packet snapping method, described method comprises:
Gather the wifi data driving and transmit in layer, wherein, described wifi data comprise the wifi data of reception and/or the wifi data of transmission;
Be mac frame corresponding to 802.11MAC agreement by the wifi data buffer storage collected;
According to transmission time sequence, all mac frames of buffer memory are formed the file of at least one setting form.
Embodiments provide a kind of packet snapping method, gather the wifi data driving and transmit in layer, wherein, described wifi data comprise the wifi data of reception and the wifi data of transmission; Be mac frame corresponding to 802.11MAC agreement by the wifi data buffer storage collected according to transmission time sequence; All mac frames of buffer memory are formed the file of at least one setting form.Thus, the file format that the wifi data transmitted in particular network environment by intelligent terminal all can identify with packet catcher, resolve preserves, so that no matter this intelligent terminal whether be in before network environment in, the packet snapping method that technical scheme involved in the present invention can be utilized to provide carries out accurately complete packet capturing operation, and does not need staff to be in the action (in network environment) by the network environment before the equipment reproductions such as router.Meanwhile, technical solution of the present invention, by driving the collection carrying out data in layer at wifi, can realize the complete collection of wifi data.
A kind of wifi data packet capturing device, described device comprises:
Collecting unit, for gathering the wifi data driving and transmit in layer, wherein, described wifi data comprise the wifi data of reception and/or the wifi data of transmission;
Buffer unit, the wifi data buffer storage for being collected by collecting unit is mac frame corresponding to 802.11MAC agreement;
Group bag unit, for forming the file of at least one setting form by all mac frames of buffer unit buffer memory according to transmission time sequence.
Embodiments provide a kind of packet capturing device, collecting unit collection drives the wifi data transmitted in layer, and wherein, described wifi data comprise the wifi data of reception and the wifi data of transmission; Then, buffer unit is mac frame corresponding to 802.11MAC agreement according to the wifi data buffer storage that collecting unit collects by transmission time sequence; Finally, the file that all mac frames of buffer unit buffer memory are formed at least one setting form by bag unit is organized.Thus, the file format of the setting form that the wifi data that intelligent terminal transmits by this packet capturing device in particular network environment all can identify with packet catcher preserves, so that no matter this intelligent terminal whether be in before network environment in, packet capturing device involved in the present invention can be utilized to carry out accurately complete packet capturing operation, and do not need staff to be in the action (in network environment) by the network environment before the equipment reproductions such as router.Meanwhile, driven the collection carrying out data in layer by packet capturing device of the present invention at wifi, the complete collection of wifi data can be realized.
A kind of intelligent terminal, comprises described packet capturing device.
Embodiments provide a kind of intelligent terminal, comprise a kind of packet capturing device, this packet capturing device collection drives the wifi data transmitted in layer, and wherein, described wifi data comprise the wifi data of reception and the wifi data of transmission; Then, be mac frame corresponding to 802.11MAC agreement by the wifi data buffer storage collected according to transmission time sequence; Finally, all mac frames of buffer memory are formed the file of at least one setting form.Thus, the file of the setting form that the wifi data transmitted in particular network environment by intelligent terminal all can identify with packet catcher preserves, so that no matter this intelligent terminal whether be in before network environment in, the packet capturing device that intelligent terminal of the present invention can be utilized to comprise carries out accurately complete packet capturing operation, and does not need staff to be in the action (in network environment) by the network environment before the equipment reproductions such as router.Meanwhile, the packet capturing device comprised by intelligent terminal of the present invention drives the collection carrying out data in layer at wifi, can realize the complete collection of wifi data.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly introduced, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The schematic flow sheet of a kind of wifi data packet snapping method that Fig. 1 provides for the embodiment of the present invention one;
Fig. 2 is the transmission paths of wifi data in two transmission directions of intelligent terminal inside;
The structural representation of a kind of wifi data packet capturing device that Fig. 3 provides for the embodiment of the present invention two;
The structural representation of the another kind of wifi data packet capturing device that Fig. 4 provides for the embodiment of the present invention two.
Embodiment
In order to make the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, the present invention is described in further detail, and 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.
In embodiments of the present invention, in order to accurate packet capturing in packet capturing process can be realized, and avoid carrying out packet capturing operation in network environment, embodiments provide a kind of wifi data packet snapping method, gather the wifi data driving and transmit in layer, wherein, described wifi data comprise the wifi data of reception and the wifi data of transmission; Be mac frame corresponding to 802.11MAC agreement by the wifi data buffer storage collected according to transmission time sequence; All mac frames of buffer memory are formed the file of at least one setting form.Thus, the file of the setting form that the wifi data transmitted in particular network environment by intelligent terminal all can identify with packet catcher preserves, so that no matter this intelligent terminal whether be in before network environment in, packet capturing scheme involved in the present invention can be utilized to carry out accurately complete packet capturing operation, and do not need staff to be in the action (in network environment) by the network environment before the equipment reproductions such as router.Meanwhile, driven the collection carrying out data in layer by packet capturing scheme of the present invention at wifi, the complete collection of wifi data can be realized.
With specific embodiment, technical scheme of the present invention is described in detail below, the present invention includes but be not limited to following examples.
Embodiment one:
As shown in Figure 1, be the schematic flow sheet of a kind of wifi data packet snapping method that the embodiment of the present invention one provides, the method is applied in the intelligent terminal of Android system, mainly comprises the following steps unit:
Step 11: gather the wifi data driving and transmit in layer, wherein, described wifi data comprise the wifi data of reception and/or the wifi data of transmission.
Wherein, can gather from acquisition interface according to transmission time sequence order during collection, when there to be the wifi data of the wifi data of reception and transmission simultaneously, owing to the time being the same, therefore, can order gather successively in no particular order.
At terminal inner, specific to the path of wifi transfer of data, driving primarily of being positioned at the wifi driving layer the forward process carrying out data, as shown in Figure 2, comprising the transmission path of two transmission directions:
Transmit path: when sending wifi data, transmission path is: wifi data are sent by radio-frequency antenna after finally being processed by firmware layer by application layer → protocol layer → driving layer → firmware layer.
RX path: when receiving wifi data, first, firmware layer receives the wifi data of sending by radio-frequency antenna, transmission path is: firmware layer → driving layer → protocol layer → application layer.
Generally, include, but are not limited to from the data frame type of the wifi data driving layer to collect: the types such as control frame, management frames, Frame.Particularly, in this step 11, owing to driving the packet of layer closest to air-data bag, best embody the actual conditions of air-data bag, and, the easiest management frames required for test problems to be distinguished.Therefore, be gather wifi data from the driving layer of kernel, and the object that the present invention obtains wifi data is by obtaining wifi data, utilizes third party software accurately to locate wifi and connects institute's produced problem.Therefore, in this step 11, only can gather management frames required for the present invention from driving layer and process.
Preferably, wifi data can be gathered from the transmission acquisition interface driven layer and reception acquisition interface respectively;
Wherein, described transmission acquisition interface can be the interface driving layer in transmit path, for obtaining the wifi data sent from this interface; Receiving acquisition interface can be the interface driving layer in RX path, for obtaining the wifi data received from this interface.
But, for driving for layer in transmission path, may can gather wifi data by a more than interface, the corresponding different interface structure of different system platform and type, therefore, for high-pass platform, when gathering wifi data, only selecting one respectively for obtaining the interface of wifi data at transmit path and RX path, sending acquisition interface and can select limHandle80211Frames interface, receive acquisition interface and can select WDA_TxPacket interface.
In the transmitting procedure of wifi data, if by way of transmit path, then be positioned at and drive the MAC protocol of layer can add corresponding control information for these wifi data, such as: frame head, postamble etc. are for the information of controls transfer destination address, and the form of mac frame corresponding to final composition 802.11MAC agreement is sent to firmware layer carries out processing (this process is generally considered as the process that initial data frame changes mac frame corresponding to 802.11MAC agreement into).In like manner, by way of RX path, then in the accurate situation of transmission, be positioned at and drive the MAC protocol of layer can remove corresponding control information for these wifi data, form the data frame format that the protocol layer in kernel identifies, and be sent to protocol layer (this process is generally considered as the process that mac frame corresponding to 802.11MAC agreement is converted to initial data frame).In view of the foregoing, being likely initial data frame sending acquisition interface or receiving the data frame format of wifi data that acquisition interface gathers, is also likely mac frame that the 802.11MAC agreement after conversion is corresponding.
Therefore, in order to can be convenient to the wifi data of the different pieces of information frame format collected have for process, before gathering the multiple wifi data driving in layer and transmit, described method also comprises:
Detect the type of described transmission acquisition interface and reception acquisition interface respectively.
Preferably, detection scheme involved in the present invention can specifically comprise:
The first step: obtain the wifi data sending acquisition interface and receive acquisition interface respectively;
Second step: data frame format corresponding with 802.11MAC agreement respectively for the data frame format of the wifi data got is compared, if coupling, then determining described transmission acquisition interface or receiving the type of acquisition interface is interface type corresponding to 802.11MAC agreement; Otherwise, determining described transmission acquisition interface or receiving the type of acquisition interface is interface type corresponding to non-802.11MAC agreement, and the interface type corresponding according to the non-802.11MAC agreement determined determines the frame head of wifi data composition needed for mac frame that gather from this interface.
Step 12: be mac frame corresponding to 802.11MAC agreement by the wifi data buffer storage collected.
Particularly, suppose that the t1 moment finds to send the wifi data 1 that acquisition interface has transmission, then gather the wifi data 1 sending acquisition interface, the t2 moment finds that receiving acquisition interface has the wifi data 2 sent out and receive, then gather the wifi data 2 receiving acquisition interface, the t3 moment finds the wifi data 3 still having reception for receiving acquisition interface, then gather the wifi data 3 receiving acquisition interface, successively according to time sequencing, and be mac frame corresponding to 802.11MAC agreement by each wifi data collected according to transmission time sequence buffer memory.
Preferably, in the process of carrying out buffer memory, if the wifi data the collected Frame that to be non-802.11MAC agreement corresponding, then corresponding according to 802.11MAC agreement data frame format is that these wifi data add frame head, is combined into the mac frame that 802.11MAC agreement is corresponding; According to transmission time sequence, the mac frame combined and the mac frame collected are carried out order buffer.
Particularly, owing to having carried out type detection to transmission acquisition interface and reception acquisition interface in advance, therefore, before collection wifi data, just having understood will from sending acquisition interface and the data frame format receiving the wifi data that acquisition interface collects, whether be that these data carry out frame format conversion process, and the frame head for needing the wifi data of carrying out frame format conversion process to add.If the interface gathering wifi data has been defined as the interface under data frame format corresponding to 802.11MAC agreement when detecting, so, just need not the wifi data that this acquisition interface place gathers be processed; Otherwise, need all wifi data point reuse data frame formats for this acquisition interface place gathers, be specifically described with following example:
Data frame format corresponding to existing 802.11MAC agreement, for shown in table 1, comprises Preamble, PLCP, MAC, User Data and CRC five parts;
Preamble PLCP MAC User Data CRC
Table 1
Wherein, Preamble layer is lead flag, identifies 802.11 agreements for receiving equipment (various terminal, server etc. send, receive the equipment of wifi data); PLCP layer (that is: Physical layer convergence protocol) maps ATM cell to the specification of physical medium, comprises the protocol parameter of some physical layers.MAC layer process be frame data, the form of MAC layer is for shown in table 2 particularly, comprise MAC head (MAC header), frame (Frame Body) and verification territory (FCS) three parts;
Table 2
Wherein, MAC head can specifically comprise not only: frame control domain (Frame Control) (but also concrete containing type territory and subtype field, the type of representative data frame), duration/mark (Duration/ID), address field (Address) (specifically comprising again: destination address, source address, receiving terminal address and transmitting terminal address etc.), sequence control domain (Sequence Control), service quality control (QoS Control); The information that frame comprises has all differences according to the content of Frame, type, is mainly used in encapsulating initial data frame, and length is 0-2312 byte; Verification territory comprises 32 cyclic redundancy codes.
And if from the wifi data initial data frame that transmission acquisition interface or reception acquisition interface collect, then this initial data frame general does not comprise sufficient address territory, the form of real mac frame can not be formed.Therefore, the mode by adding the fields such as address field (mode of being compared by initial data frame and mac frame is determined) for initial data frame is needed to form mac frame, this adding procedure can be carried out before buffer memory, also directly can add when collection, the present invention does not limit the concrete execution sequential that this interpolation operates, two kinds of modes.
It should be noted that, according to transmission time sequence, the mac frame combined and the mac frame collected are carried out order buffer, wherein, these mac frames can be buffered in default structure, in arbitrary idling-resource of i.e. data space, avoid directly carrying out Pcap combination of files and the loss of data that causes of the misoperation that may cause.
Step 13: all mac frames of buffer memory are formed at least one Pcap file according to transmission time sequence.
Particularly, calculate the frame length of each mac frame of buffer memory, and be that each mac frame adds data packet head according to the frame length calculated, composition packet, further, the packet of composition is added in the file of at least one setting form of include file head, and preserves.
Wherein, the packet that the file of each setting form comprises arranges according to transmission time sequence, and the file of at least one setting form described arranges according to transmission time sequence.
Preferably, the file of described setting form is Pcap file.
First, the file format of Pcap file is simply introduced.
The file format of Pcap file, for shown in table 3, mainly comprises: the data of packet header+packet 1 of file header (Pcap Header), packet 1, the data of the packet header+packet 2 of packet 2 ... the data of the packet header+packet n of packet n.
Wherein, for Pcap file, file header is all configuration fixed value, is generally made up of 24 bytes, specifically comprises: the Magic be made up of 4 bytes, is used for the beginning of identification document; The Major be made up of 2 bytes is the version number that current file is main; The Minor be made up of 2 bytes is the version number that current file is secondary; The ThisZone be made up of 4 bytes, is the standard time of locality, entirely can gets zero; The SigFigs be made up of 4 bytes, is the precision of timestamp, entirely can gets zero; The SnapLen be made up of 4 bytes, represents maximum memory length; The LinkType be made up of 4 bytes is Linktype, and these 4 bytes are most important.
And for each packet after file header, the packet header of each packet is made up of 16 bytes, specifically comprise: the Timestamp be made up of 4 bytes, for timestamp is high-order, be accurate to second; The Timestamp be made up of 4 bytes, is timestamp low level, is accurate to microsecond; The Caplen be made up of 4 bytes is the length of active data area, the data frame length of the wifi data namely collected; The Len be made up of 4 bytes is off-line data length: the length of actual data frame in network, is generally not more than Caplen, in most cases equal with Caplen numerical value.
Table 3
Owing to each wifi data collected being saved as mac frame corresponding to 802.11MAC agreement in step 12, in this step, because Pcap file has above-mentioned call format, and the data in the packet that each mac frame preserved is equivalent in Pcap file, therefore, need, for the packet header of each mac frame interpolation packet, to form packet (data of the packet header+packet of packet) complete one by one.But, for the packet header of each packet, it is related with the length of the data of this packet to be added (size of the mac frame namely preserved), particularly, byte-sized shared by the data of each packet, determines the content in the packet header of this packet.Because, for a Pcap file, configuration in the packet header of its each packet comprised is all identical substantially, and uniquely unlike the Caplen of the data frame length of expression wifi data, the value of this parameter can reflect the length of the data of this packet intuitively.
When packaging to n the mac frame preserved, first can add the packet header of packet to each mac frame, then for adding a file header with n packet of acquisition order arrangement, form a Pcap file; Or first for adding a file header with n mac frame of acquisition order arrangement, then be respectively the packet header that each mac frame adds packet, form a Pcap file.Above-mentioned two kinds of modes, carry out brief description for the packet header of first adding packet below.
Preferably, at least one Pcap file, the quantity of the packet that each Pcap file comprises is equal or not etc.
Suppose, in the embodiment of the present invention, the file header of Pcap file and the part packet header of packet configure as follows:
File header:
Magic:0xD4 0xC3 0xB2 0xA1
Major:0x02 0x00
Minor:0x04 0x00
ThisZone:0x00 0x00 0x00 0x00
SigFigs:0x00 0x00 0x00 0x00
SnapLen:0xFF 0xFF 0x00 0x00 // this place's maximum storage length can be changed
LinkType:0x69 0x00 0x00 0x00 // 802.11 mac frame (fixing)
The packet header of packet:
Timestamp:0x00 0x00 0x00 0x00 // be set to full 0 herein
Timestamp:0x00 0x00 0x00 0x00 // be set to full 0 herein
Caplen: the length of the unknown //mac frame, needs to carry out calculating and setting different value according to each frame
Len: the length of the unknown //mac frame, needs to carry out calculating and setting different value according to each frame
Wherein, a timestamp high position and timestamp low level all can according to 1,2,3 ... the order of n is numbered, or is configured according to the time of reality.The present invention does not specifically limit this, as long as can embody between packet is carry out sorting according to transmission time sequence.
It can thus be appreciated that, for a complete Pcap file, its file header is determined, the partial parameters in the packet header of each packet is also determined, the data of packet are the content of the mac frame of preservation, therefore, for each packet, the length that only need calculate each mac frame can determine the value of Caplen and Len.And then improve the content of Pcap file, form a complete Pcap file.
For two mac frames:
First mac frame: 0xD4 0x00 0x00 0x00 0x24 0xE2 0x71 0x46 0xD30x40 0x00 0x00 0x00 0x00 (length of Frame is 14 bytes)
Second mac frame: 0xD4 0x00 0x02 0x00 0x38 0x83 0x45 0x9B 0xA70x56 0x00 0x00 0x00 0x00 (length of Frame is 14 bytes)
The file header of Pcap file: 0xD4 0xC3 0xB2 0xA1 0x02 0x00 0x04 0x00 0x00 0x000x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0x00 0x00 0x69 0x00 0x00 0x00
Packet header for the packet 1 of first mac frame: 0x48 0x20 0x67 0x53 0x9C 0x1C0x00 0x00 0x0E 0x00 0x00 0x00 0x0E 0x00 0x00 0x00
Packet header for the packet 2 of second mac frame: 0x48 0x20 0x67 0x53 0x9C 0x1C0x00 0x00 0x0E 0x00 0x00 0x00 0x0E 0x00 0x00 0x00
Length due to the Frame of two mac frames is 14 bytes, be then 0x0E 0x00 0x00 0x00 in the value of 9th ~ 12 byte position in the packet header of packet, represent that the length of the data of this packet is 14 bytes, after adding the packet header of file header and packet, form following Pcap file, as shown in table 4 below, wherein, each behavior 16 bytes, the file header of this Pcap file of slanted bar line Regional Representative, the packet header of grid spaces representative data bag 1, back is the data of packet 1 without fill area; Net region is the packet header of packet 2, and back is the data of packet 2 without fill area.
Table 4
By above-mentioned group of bag scheme, first the wifi data collected are saved as mac frame corresponding to 802.11 agreements, then the length of each mac frame is calculated, for each mac frame adds the packet header of packet, composition is by multiple packets of acquisition order arrangement, finally, by adding the file header of the Pcap file preset for this data packet group, composition Pcap file.And can form multiple Pcap file according to the quantity of the packet collected successively according to transmission time sequence, in multiple Pcap files of formation, the quantity of the packet that each Pcap file comprises is equal or not etc.Thus, the file of the setting form that the wifi data transmitted in particular network environment by intelligent terminal all can identify with packet catcher preserves, so that no matter this intelligent terminal whether be in before network environment in, packet capturing scheme involved in the present invention can be utilized to carry out accurately complete packet capturing operation, and do not need staff to be in the action (in network environment) by the network environment before the equipment reproductions such as router.Meanwhile, driven the collection carrying out data in layer by packet capturing scheme of the present invention at wifi, the complete collection of wifi data can be realized.
Belong to same inventive concept based on above-mentioned wifi data packet snapping method, the embodiment of the present invention two additionally provides a kind of wifi data packet capturing device.
Embodiment two:
As shown in Figure 3, for the structural representation of a kind of wifi data packet capturing device that the embodiment of the present invention two provides, this packet capturing device can be integrated in the kernel of intelligent terminal, also can as hanging on intelligent terminal outside a kind of self-contained unit structure, and the Main functional units of this packet capturing device comprises:
Collecting unit 21, for gathering the wifi data driving and transmit in layer, wherein, described wifi data comprise the wifi data of reception and/or the wifi data of transmission.
Buffer unit 22, for wifi data that collecting unit is collected respectively buffer memory be mac frame corresponding to 802.11MAC agreement.
Group bag unit 23, for forming the file of at least one setting form by all mac frames of buffer unit buffer memory according to transmission time sequence.
Preferably, the file of this setting form is can by the file of arbitrary packet catcher identification, parsing, such as: Pcap file.
As shown in Figure 4, described device also comprises:
Detecting unit 24, for before gathering the wifi data driving and transmit in layer, detects the type of described transmission acquisition interface and reception acquisition interface respectively.
Preferably, described detecting unit 24, specifically for: obtain the wifi data sending acquisition interface and receive acquisition interface respectively; Compared by data frame format corresponding with 802.11MAC agreement respectively for the data frame format of the wifi data got, if coupling, then determining described transmission acquisition interface or receiving the type of acquisition interface is interface type corresponding to 802.11MAC agreement; Otherwise determining described transmission acquisition interface or receiving the type of acquisition interface is interface type corresponding to non-802.11MAC agreement, and determines this transmission acquisition interface or receive the frame head of wifi data composition needed for mac frame of acquisition interface.
Preferably, buffer unit 22, specifically for: detecting unit detect described transmission acquisition interface or receive the type of acquisition interface be interface type corresponding to non-802.11MAC agreement time, the data frame format corresponding according to 802.11MAC agreement is that these wifi data add the described frame head determined, is combined into the mac frame that 802.11MAC agreement is corresponding; By the mac frame of composition with the mac frame that collects according to transmission time sequence buffer memory.
Preferably, described group of bag unit 23, specifically for:
Calculate the frame length of each mac frame of buffer memory, and be that each mac frame adds data packet head according to the frame length calculated, composition packet;
The packet of composition is added in the file of at least one setting form of include file head, and preserves;
Wherein, the packet that the file of each setting form comprises arranges according to transmission time sequence, and the file of at least one setting form described arranges according to transmission time sequence.
Preferably, in the file of at least one setting form described, the quantity of the packet that the file of each setting form comprises is equal or not etc.
Preferably, described collecting unit gathers wifi data from the transmission acquisition interface driven layer and reception acquisition interface respectively; Described transmission acquisition interface is limHandle80211Frames interface, and described reception acquisition interface is WDA_TxPacket interface.
Embodiment three:
The embodiment of the present invention additionally provides a kind of intelligent terminal, comprises the packet capturing device of the wifi data involved by above-described embodiment, and in addition, this intelligent terminal also comprises: the construction units such as kernel, driver module, radio-frequency module and display screen.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (13)

1. a wifi data packet snapping method, is characterized in that, described method comprises:
Gather the wifi data driving and transmit in layer, wherein, described wifi data comprise the wifi data of reception and/or the wifi data of transmission;
Be mac frame corresponding to 802.11MAC agreement by the wifi data buffer storage collected;
According to transmission time sequence, all mac frames of buffer memory are formed the file of at least one setting form.
2. the method for claim 1, is characterized in that, the file of described setting form is Pcap file.
3. method as claimed in claim 2, is characterized in that, described wifi data are respectively from the transmission acquisition interface driven layer and the collection of reception acquisition interface;
Before gathering the wifi data driving and transmit in layer, described method also comprises:
Obtain the wifi data sending acquisition interface and receive acquisition interface respectively;
Compared by data frame format corresponding with 802.11MAC agreement respectively for the data frame format of the wifi data got, if coupling, then determining described transmission acquisition interface or receiving the type of acquisition interface is interface type corresponding to 802.11MAC agreement; Otherwise determining described transmission acquisition interface or receiving the type of acquisition interface is interface type corresponding to non-802.11MAC agreement, and determines this transmission acquisition interface or receive the frame head of wifi data composition needed for mac frame of acquisition interface.
4. method as claimed in claim 3, is characterized in that, described the wifi data collected is saved as mac frame corresponding to 802.11MAC agreement, specifically comprises:
When determining described transmission acquisition interface or receive the type of acquisition interface to be interface type corresponding to non-802.11MAC agreement, the data frame format corresponding according to 802.11MAC agreement is that the wifi data that this transmission acquisition interface or reception acquisition interface collect add the described frame head determined, the mac frame that composition 802.11MAC agreement is corresponding;
By the mac frame of composition and the mac frame buffer memory collected.
5. the method for claim 1, is characterized in that, the described file according to transmission time sequence, all mac frames of buffer memory being formed at least one setting form, specifically comprises:
Calculate the frame length of each mac frame of buffer memory, and be that each mac frame adds data packet head according to the frame length calculated, composition packet;
The packet of composition is added into the file of at least one setting form of include file head, and preserves;
Wherein, the packet that the file of described setting form comprises arranges according to transmission time sequence, and the file of at least one setting form described arranges according to transmission time sequence.
6. method as claimed in claim 5, is characterized in that, in the file of at least one setting form described, the quantity of the packet that the file of each setting form comprises is equal or not etc.
7. a wifi data packet capturing device, is characterized in that, described device comprises:
Collecting unit, for gathering the wifi data driving and transmit in layer, wherein, described wifi data comprise the wifi data of reception and the wifi data of transmission;
Buffer unit, the wifi data buffer storage for being collected by collecting unit is mac frame corresponding to 802.11MAC agreement;
Group bag unit, for forming the file of at least one setting form by all mac frames of buffer unit buffer memory according to transmission time sequence.
8. device as claimed in claim 7, it is characterized in that, the file of described setting form is Pcap file.
9. device as claimed in claim 8, is characterized in that, described collecting unit gathers wifi data from the transmission acquisition interface driven layer and reception acquisition interface respectively;
Described device also comprises:
Detecting unit, for obtaining the wifi data sending acquisition interface and receive acquisition interface respectively, data frame format corresponding with 802.11MAC agreement respectively for the data frame format of the wifi data got is compared, if coupling, then determining described transmission acquisition interface or receiving the type of acquisition interface is interface type corresponding to 802.11MAC agreement; Otherwise determining described transmission acquisition interface or receiving the type of acquisition interface is interface type corresponding to non-802.11MAC agreement, and determines this transmission acquisition interface or receive the frame head of wifi data composition needed for mac frame of acquisition interface.
10. device as claimed in claim 9, is characterized in that, buffer unit, specifically for:
Detecting unit detect described transmission acquisition interface or receive the type of acquisition interface be interface type corresponding to non-802.11MAC agreement time, the data frame format corresponding according to 802.11MAC agreement is that these wifi data add the described frame head determined, is combined into the mac frame that 802.11MAC agreement is corresponding;
By the mac frame of composition and the mac frame buffer memory collected.
11. devices as claimed in claim 7, is characterized in that, described group of bag unit, specifically for:
Calculate the frame length of each mac frame of buffer memory, and be that each mac frame adds data packet head according to the frame length calculated, composition packet;
The packet of composition is added in the file of at least one setting form of include file head, and preserves;
Wherein, the packet that the file of each setting form comprises arranges according to transmission time sequence, and the file of at least one setting form described arranges according to transmission time sequence.
12. devices as claimed in claim 11, is characterized in that, in the file of at least one setting form described, the quantity of the packet that the file of each setting form comprises is equal or not etc.
13. 1 kinds of intelligent terminals, is characterized in that, comprise the arbitrary described packet capturing device of claim 7 ~ 12.
CN201410609863.9A 2014-11-03 2014-11-03 A kind of wifi data packet snapping method, device and intelligent terminal Active CN104468190B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410609863.9A CN104468190B (en) 2014-11-03 2014-11-03 A kind of wifi data packet snapping method, device and intelligent terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410609863.9A CN104468190B (en) 2014-11-03 2014-11-03 A kind of wifi data packet snapping method, device and intelligent terminal

Publications (2)

Publication Number Publication Date
CN104468190A true CN104468190A (en) 2015-03-25
CN104468190B CN104468190B (en) 2018-12-25

Family

ID=52913601

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410609863.9A Active CN104468190B (en) 2014-11-03 2014-11-03 A kind of wifi data packet snapping method, device and intelligent terminal

Country Status (1)

Country Link
CN (1) CN104468190B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472640A (en) * 2015-11-13 2016-04-06 上海熙菱信息技术有限公司 WiFi information collection method and system
CN107306291A (en) * 2016-04-22 2017-10-31 中兴通讯股份有限公司 A kind of terminal operation method and device
CN110113771A (en) * 2019-03-22 2019-08-09 深圳市飞比电子科技有限公司 Data processing method, device, gateway and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040019690A1 (en) * 2000-08-17 2004-01-29 Cardno Andrew John Data transfer system and method
CN101426000A (en) * 2007-10-30 2009-05-06 北京启明星辰信息技术有限公司 General protocol parsing method and system
CN102202062A (en) * 2011-06-03 2011-09-28 苏州九州安华信息安全技术有限公司 Method and apparatus for realizing access control
CN103259699A (en) * 2013-05-28 2013-08-21 华为技术有限公司 Test method, test system, client-side and server-side
CN103716777A (en) * 2013-12-18 2014-04-09 厦门市美亚柏科信息股份有限公司 Wireless terminal MAC address acquisition method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040019690A1 (en) * 2000-08-17 2004-01-29 Cardno Andrew John Data transfer system and method
CN101426000A (en) * 2007-10-30 2009-05-06 北京启明星辰信息技术有限公司 General protocol parsing method and system
CN102202062A (en) * 2011-06-03 2011-09-28 苏州九州安华信息安全技术有限公司 Method and apparatus for realizing access control
CN103259699A (en) * 2013-05-28 2013-08-21 华为技术有限公司 Test method, test system, client-side and server-side
CN103716777A (en) * 2013-12-18 2014-04-09 厦门市美亚柏科信息股份有限公司 Wireless terminal MAC address acquisition method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472640A (en) * 2015-11-13 2016-04-06 上海熙菱信息技术有限公司 WiFi information collection method and system
CN107306291A (en) * 2016-04-22 2017-10-31 中兴通讯股份有限公司 A kind of terminal operation method and device
CN107306291B (en) * 2016-04-22 2021-04-06 中兴通讯股份有限公司 Terminal operation method and device
CN110113771A (en) * 2019-03-22 2019-08-09 深圳市飞比电子科技有限公司 Data processing method, device, gateway and storage medium

Also Published As

Publication number Publication date
CN104468190B (en) 2018-12-25

Similar Documents

Publication Publication Date Title
CN102377650B (en) Data transmission processing method, device and system
CN103338475B (en) The method of testing of WAP (wireless access point) and device, test terminal
CN101877659B (en) Method, device and system for monitoring packet loss
JP7030797B2 (en) Network management information receiving method, receiving device and storage medium
CN102857354B (en) Alarm information reporting method, apparatus and system
EP3005660A1 (en) Data aggregation
CN101986648A (en) Negotiation method, device and network device of TCP option
CN102035694A (en) Link detection device and method
CN104717150A (en) Exchange device and packet loss method
CN106658756A (en) Method and device for recognizing connection between terminal device and hotspot
US7933953B2 (en) Dual processing system capable of ensuring real-time processing in protocol conformance test
CN107979506A (en) Flow obtains and high in the clouds display systems, method, apparatus and equipment
CN104022956A (en) Method and device for data message processing in location/ID separation protocol network
CN105827473A (en) Method and device for network quality evaluation
CN110213756A (en) A kind of data transmission method, device and its relevant device
CN104468190A (en) Wifi data package capturing method and device and intelligent terminal
CN104486217B (en) The message forwarding method and equipment of across a network
US11032184B2 (en) Method and device for collecting traffic flow value of BGP community attribute or BGP extended community attribute
WO2015196636A1 (en) Packet collection method and system, network device and network management centre
CN110248379A (en) The performance test methods and device of base station in WLAN
CN106385432A (en) Big data based insect disease monitoring and early warning system
CN110581792B (en) Message transmission method and device
CN103458431B (en) The playback system of multipoint acquisition and cross-layer
CN102647347B (en) Realize based on the processing method of flow connected and system
CN110166518B (en) Session information transmission method, device, storage medium and electronic device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant