我正在使用原始 C
在 Linux 中使用 libpcap
开发一个 IEEE802.11
帧解析器程序。我可以轻松解析 RadioTap
和 IEEE802.11
header ,但我找不到封装在 IEEE802.11
MPDU 中的协议(protocol)名称.不幸的是,IEEE802.11
header 中没有任何字段指示封装的协议(protocol)(如 Ethernet
header 中的 protocol
字段)。
有什么解决办法吗?
最佳答案
IEEE802.11
数据包的数据被封装在一个LLC
头中(见here):
An 802.11 frame should contain an LLC header if, and only if, it's a Data frame. The frame type and subtype are part of the Frame Control field in the MAC header; Data is one of the frame type values (the others are Control and Management). The subtype doesn't matter - all Data frames should contain an LLC header, and no other frames should.
LLC
头有两种:3字节,8字节。 IEEE 802.11
使用第二种(参见 here)。其中,LLC
头的最后两个字节相当于Ethernet
协议(protocol)中的Ether Type
字段。例如,此字段的 0x800
表示 IPv4
。
关于c - 如何找出IEEE802.11 Frame中封装的协议(protocol)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42834940/