关于WLAN抓取的是以太网帧的问题

来源:互联网 发布:换发型软件 编辑:程序博客网 时间:2024/05/21 08:47

这几天看计算机网络的时候,就想着抓一下包来随便看看,结果发现了一个以前没有注意的问题:


为什么WLAN(802.11)使用的是Ethernet II的帧??这导致我过去有一种错误的潜意识——以太网是WLAN的下层。而其实他们是对等的协议。

这个问题我花了很久。我觉得什么都不懂而盲目搜索,其实是一种病。过去我就是空想,现在是不动脑只知道搜索。扯远了。

首先,有人说WIFI就是无线以太网,这显然是扯淡了。且不说CSMA/CD和CSMA/CA,二者的帧结构都不一样。

那么这只能是解析的问题。介质中传播的一定是802.11协议的帧而到了电脑端抓包时却变成了Ethernet,这说明要么是网卡要么是OS做了802.11->802.3的处理。

相关问题:

How can I capture raw 802.11 frames, including non-data (management, beacon) frames?

A: That depends on the operating system on which you're running, and on the 802.11 interface on which you're capturing. 
This would probably require that you capture in promiscuous mode or in the mode called "monitor mode" or "RFMON mode". On some platforms, or with some cards, this might require that you capture in monitor mode - promiscuous mode might not be sufficient. If you want to capture traffic on networks other than the one with which you're associated, you will have to capture in monitor mode. 
Not all operating systems support capturing non-data packets and, even on operating systems that do support it, not all drivers, and thus not all interfaces, support it. Even on those that do, monitor mode might not be supported by the operating system or by the drivers for all interfaces.

不过,其实我觉得他说的全是废话……

维基百科上说,windows的NDIS从vista开始支持monitor模式。而一些抓包工具有自己的驱动,可以支持

http://en.wikipedia.org/wiki/Monitor_mode#Operating_system_support

wireshark的官网也提到了“虚假的”以太网帧的问题。他认为这种fake frame是由于网卡或者驱动程序造成的。

https://wiki.wireshark.org/CaptureSetup/WLAN#Link-Layer_.28Radio.29_packet_headers

这个问题已经让对驱动一无所知的我感到非常困难了。

CSDN上有LINUX下对于802.11的抓包,是修改驱动,类似于挂了一个HOOK的样子:

IEEE802.11数据帧在Linux上的抓取

反正,到这里似乎不涉及网卡和驱动是搞不下去了——首先得买一块能进行RFMON模式的网卡(我在linux测试了一下,网卡不能设为monitor模式)。我开始想试试研究一下驱动来着,但是想想有些好笑,一窍不通就想弄一些别人都没解决的问题,还是放弃了。如果这个问题能解决wireshark也不会在我的网卡上连media都识别成Ethernet。

只是花了一天时间,搞成这样,实在有些不甘心。果然还是像我高中的数学老师说的那样,浮于表面不沉下去,永远也找不到真理。



1 0