Summary of the invention
The object of the invention is to overcome above-mentioned shortcoming of the prior art, there is provided one can length in unlimited time, do not realize to limited capacity amount in real time, efficient packet capturing, and intuitive display, can be applied on the equipment of any band Ethernet interface, so that realize the debugging of WIFI equipment and monitoring, implementation is easy, and application cost is cheap, and range of application realizes the system and method for network packet crawl comparatively widely based on embedded radio equipment.
In order to realize above-mentioned object, of the present invention based on embedded radio equipment realize network packet capture system there is following formation:
Described system comprises embedded radio equipment and the packet of embedded radio equipment described in being connected by Ethernet captures analytical equipment, described embedded radio equipment comprises the packet radio transceiver module be linked in sequence successively, packet radio replication module, first Ethernet driver module and the first Ethernet network interface, described packet captures analytical equipment and comprises the second Ethernet network interface be linked in sequence successively, second Ethernet driver module, handling module and parsing display module, the second Ethernet network interface described in the first described Ethernet network interface is connected by Ethernet.
Should realize in the system of network packet crawl based on embedded radio equipment, described parsing display module is for resolving and graphic software platform module.
Should realize in the system of network packet crawl based on embedded radio equipment, described packet captures analytical equipment and also comprises memory module, and described memory module connects described handling module respectively and resolves display module.
Should realize in the system of network packet crawl based on embedded radio equipment, it is PC that described packet captures analytical equipment.
Should realize in the system of network packet crawl based on embedded radio equipment, described packet radio transceiver module is promiscuous mode radio receiving transmitting module.
Should realize in the system of network packet crawl based on embedded radio equipment, the first described Ethernet network interface and the second Ethernet network interface are promiscuous mode Ethernet network interface.
The present invention also provides a kind of method realizing the crawl of embedded radio device network packet based on described system, and the method comprises the following steps:
(1) the packet radio transceiver module described in is by packet radio replication module extremely described for the Packet Generation of its wireless receiving and dispatching;
(2) the packet radio replication module described in copies the packet of acquisition, and by the Packet Generation that copies to the first described Ethernet driver module;
(3) obtained packet is sent to through the first described Ethernet network interface and Ethernet the second Ethernet network interface that described packet captures analytical equipment by the first Ethernet driver module described in;
(4) obtained packet is sent to described handling module through the second described Ethernet driver module by the second Ethernet network interface described in;
(5) handling module described in captures packet, and by captured Packet Generation to described parsing display module;
(6) packet of parsing display module to described crawl described in is resolved, and shows analysis result.
This realizes in the method for embedded radio device network packet crawl, and described parsing display module is for resolving and graphic software platform module, and described step (6) specifically comprises the following steps:
(61) parsing described in and graphic software platform module resolve the packet captured;
(62) parsing described in and graphic software platform module graphically show analysis result.
This realizes in the method for embedded radio device network packet crawl, and described parsing and graphic software platform module resolve the packet captured, and are specially: described parsing and graphic software platform module resolve the packet captured according to 802.11 types.
This realizes in the method for embedded radio device network packet crawl, described packet captures analytical equipment and also comprises memory module, described memory module connects described handling module respectively and resolves display module, and described step (5) specifically comprises the following steps:
(51) handling module described in captures packet, and captured Packet Generation to described memory module is stored as packet capturing file;
(52) the packet capturing file described in the parsing display module described in reads from described memory module.
This realizes in the method for embedded radio device network packet crawl, and described step (51) specifically comprises the following steps:
(51-1) handling module described in captures packet;
(51-2) handling module described in is filtered captured packet according to the condition preset;
(51-3) Packet Generation after filtration to described memory module is stored as packet capturing file by the handling module described in.
Have employed the system and method realizing network packet crawl based on embedded radio equipment of this invention, because its system comprises embedded radio equipment and packet crawl analytical equipment, described embedded radio equipment comprises the packet radio transceiver module be linked in sequence successively, packet radio replication module, first Ethernet driver module and the first Ethernet network interface, described packet captures analytical equipment and comprises the second Ethernet network interface be linked in sequence successively, second Ethernet driver module, handling module and parsing display module, and the first described Ethernet network interface connected by Ethernet described in the second Ethernet network interface.Thus be able to the packet being copied acquisition by packet radio replication module, and the packet sequence copied is sent to described handling module by the first Ethernet driver module, the first Ethernet network interface, Ethernet, the second Ethernet network interface and the second Ethernet driver module; Packet is captured again by handling module, and after being resolved by the packet of parsing display module to described crawl, display analysis result.So can Ethernet be utilized, length in unlimited time, not limited capacity amount the packet of embedded radio equipment is carried out in real time, efficiently packet capturing, and intuitively show, can be applied on the equipment of any band Ethernet interface, so that the debugging realized WIFI equipment and monitoring, and the system and method realizing network packet crawl based on embedded radio equipment of the present invention, the structure of its system is simple, with low cost, the application mode of its method is easy, and range of application is also comparatively extensive.
Embodiment
In order to more clearly understand technology contents of the present invention, describe in detail especially exemplified by following examples.
Referring to shown in Fig. 1, is the structural representation realizing the system that network packet captures based on embedded radio equipment of the present invention.
In one embodiment, described system comprises embedded radio equipment and the packet of embedded radio equipment described in being connected by Ethernet captures analytical equipment, described embedded radio equipment comprises the packet radio transceiver module be linked in sequence successively, packet radio replication module, first Ethernet driver module and the first Ethernet network interface, described packet captures analytical equipment and comprises the second Ethernet network interface be linked in sequence successively, second Ethernet driver module, handling module and parsing display module, the second Ethernet network interface described in the first described Ethernet network interface is connected by Ethernet.Wherein, it can be PC that described packet captures analytical equipment, and described packet radio transceiver module is the radio receiving transmitting module working in promiscuous mode, the first described Ethernet network interface and the second Ethernet network interface are the Ethernet network interface working in promiscuous mode.
Realize the method for embedded radio device network packet crawl based on the system described in this execution mode, as shown in Figure 2, comprise the following steps:
(1) the packet radio transceiver module described in is by packet radio replication module extremely described for the Packet Generation of its wireless receiving and dispatching;
(2) the packet radio replication module described in copies the packet of acquisition, and by the Packet Generation that copies to the first described Ethernet driver module;
(3) obtained packet is sent to through the first described Ethernet network interface and Ethernet the second Ethernet network interface that described packet captures analytical equipment by the first Ethernet driver module described in;
(4) obtained packet is sent to described handling module through the second described Ethernet driver module by the second Ethernet network interface described in;
(5) handling module described in captures packet, and by captured Packet Generation to described parsing display module;
(6) packet of parsing display module to described crawl described in is resolved, and shows analysis result.
In one more preferably execution mode, described parsing display module is for resolving and graphic software platform module.Then described step (6) specifically comprises the following steps:
(61) parsing described in and graphic software platform module resolve the packet captured;
(62) parsing described in and graphic software platform module graphically show analysis result.
In a kind of further preferred embodiment, the parsing in described step (61) and graphic software platform module resolve the packet captured, and are specially: described parsing and graphic software platform module resolve the packet captured according to 802.11 types.
Further preferred embodiment in, described packet captures analytical equipment and also comprises memory module, and described memory module connects described handling module respectively and resolves display module.
Realize in the method for embedded radio device network packet crawl based on this further preferred embodiment described system, described step (5) specifically comprises the following steps:
(51) handling module described in captures packet, and captured Packet Generation to described memory module is stored as packet capturing file;
(52) the packet capturing file described in the parsing display module described in reads from described memory module.
In preferred execution mode, described step (51) specifically comprises the following steps:
(51-1) handling module described in captures packet;
(51-2) handling module described in is filtered captured packet according to the condition preset;
(51-3) Packet Generation after filtration to described memory module is stored as packet capturing file by the handling module described in.
In actual applications, of the present invention is sent from Ethernet interface by the driving of Ethernet interface by the packet radio received and send being copied portion in embedded radio equipment, the network interface of equipment passes through the Ethernet interface of the direct-connected PC of netting twine, can (windows system be WinPcap by WinPcap/Libcap on PC, Linux system is Libcap) kit storage, or utilize the tool software storages such as Wireshark deposit packet radio form or directly show.
Realize catching the packet radio of transmitting-receiving by a kind of simple method, have software work amount little, little to the performance impact of equipment, packet capturing is real-time, efficiently.And store and be presented on PC, the tool software taking full advantage of PC enriches, and graphical interfaces is directly perceived, the advantage that hardware resource (CPU is fast, and internal memory and hard drive space are enough large) is limited hardly, is convenient to study and debugging WIFI agreement.
In use procedure of the present invention, after the wireless packet capturing of WIFI opening of device, wireless packet capturing starts.Whole packet capturing process can be divided into following steps.
(1) wireless module often receives or sends a bag, all sends into wireless replication module;
(2) copy package, calls Ethernet and drives transmission copy package;
(3) Ethernet drives and copy package is sent to equipment Ethernet interface;
(4) equipment Ethernet interface sends bag arrives PC Ethernet interface by ethernet line;
(5), after Ethernet interface receives bag, the driver module process of pc ethernet mouth is entered;
(6) bag is delivered to packet capturing module by the driver module of pc ethernet mouth;
(7) packet capturing module will send into graphic software platform module after Packet capturing, resolve and show packet capturing content, or by step (8) process;
(8) bag of catching is saved as the file (subsequent packet adds within this document) of specific format;
(9) open file, resolve and show bag content.
For follow-up packet radio, constantly can repeat step (1) to (9), until stop packet capturing.
Wherein, when radio receiving transmitting module being set to promiscuous mode (or claiming monitoring mode), all packet radios of current WIFI equipment place channel can being caught, all communications packet of catching between other WIFI equipment can also be monitored by this function.
In step (5), the Ethernet interface of PC will be arranged to promiscuous mode before treatment, is convenient to receive all bags received from Ethernet interface.Can filter bag in step (7) or (8), choose the type of interested bag.Resolving Packet type when wrapping to resolve by 802.11 types, is not resolve bag content by ethernet type.And step (6), (7), can (windows system be WinPcap by WinPcap/Libcap in (8) and (9), Linux system is Libcap) store, or utilize the tool software storages such as Wireshark deposit packet radio form or directly show, the development of software on PC can be saved.Namely a small amount of development can be had in PC side or utilize existing popular tool software that it goes without doing that exploitation gets final product practical function.
Below for embedded Linux operating system and C language, describe its specific implementation process, runic is the code content needing increase compared to prior art:
---in wireless receiving and dispatching bag module
Key point of the present invention is:
1) portion is copied to the wireless original packet of transmitting-receiving, do not affect the normal operation of original agreement.
2) bag copied is driven by Ethernet interface and directly sends, not by protocol stack, and ultrahigh in efficiency.
3), when using wireshark packet catcher (or other packet catcher) store or show on PC, be 802.11 types by the typing interpretation of bag, instead of the type Ethernet of Ethernet interface packet capturing usually.
4) the packet capturing requirement without packet loss in high-throughput situation can be met.The highest 802.11n of current WIFI agreement medium-rate is optimally, throughput peak is 300Mbps instantaneously, current gigabit Ethernet mouth is very general, because 1000Mbps is much larger than 300Mbps, even if so when radio throughput reaches desirable peak,, the phenomenon of congestion packet loss can not be there is in Ethernet interface passage completely enough use.If the Ethernet interface flank speed of WIFI equipment itself only has 100,000,000, according to the application of 802.11n in actual environment, because there is interference more or less, goodput is difficult to more than 90Mbps, so 100-M network Ethernet is also enough used in most cases.
Have employed the system and method realizing network packet crawl based on embedded radio equipment of this invention, because its system comprises embedded radio equipment and packet crawl analytical equipment, described embedded radio equipment comprises the packet radio transceiver module be linked in sequence successively, packet radio replication module, first Ethernet driver module and the first Ethernet network interface, described packet captures analytical equipment and comprises the second Ethernet network interface be linked in sequence successively, second Ethernet driver module, handling module and parsing display module, and the first described Ethernet network interface connected by Ethernet described in the second Ethernet network interface.Thus be able to the packet being copied acquisition by packet radio replication module, and the packet sequence copied is sent to described handling module by the first Ethernet driver module, the first Ethernet network interface, Ethernet, the second Ethernet network interface and the second Ethernet driver module; Packet is captured again by handling module, and after being resolved by the packet of parsing display module to described crawl, display analysis result.So can Ethernet be utilized, length in unlimited time, not limited capacity amount the packet of embedded radio equipment is carried out in real time, efficiently packet capturing, and intuitively show, can be applied on the equipment of any band Ethernet interface, so that the debugging realized WIFI equipment and monitoring, and the system and method realizing network packet crawl based on embedded radio equipment of the present invention, the structure of its system is simple, with low cost, the application mode of its method is easy, and range of application is also comparatively extensive.
In this description, the present invention is described with reference to its specific embodiment.But, still can make various amendment and conversion obviously and not deviate from the spirit and scope of the present invention.Therefore, specification and accompanying drawing are regarded in an illustrative, rather than a restrictive.