如何找出IEEE802.11 Frame中封装的协议?
How to find out encapsulated protocol inside IEEE802.11 Frame?
我正在开发一个 IEEE802.11
帧解析器程序,在 Linux 中使用 libpcap
和原始 C
。我可以很容易地解析 RadioTap
和 IEEE802.11
headers 但我找不到封装在 IEEE802.11
MPDU 中的协议名称。不幸的是,IEEE802.11
header 中没有任何字段指示封装的协议(如 Ethernet
header 中的 protocol
字段)。
有什么解决办法吗?
对于封装数据的802.11
帧,headertype/subtype会在0x20
和0x2F
之间(虽然帧通常是0x20
(数据)或 0x28
(QoS-Data))。将有一个 5 字节的 SNAP header,其中包含有效载荷的类型(如 this answer 中所述)。如果 OID(SNAP 的前三个字节 header)是 0x000000
,那么接下来的两个字节是以太网类型。
对于 EAPoL (source),以太网类型将为 0x888e
。这是您要检查以了解封装协议的字段(0x0800
用于 IP,0x0806
用于 ARP 等)。
这是一篇关于以太网类型以及如何使用它们过滤某些协议的很好的 Cisco 文档:http://www.cisco.com/c/en/us/td/docs/ios/12_2/ibm/vol1/command/reference/fibm_r1/br1fethc.pdf。
这是一份关于无线嗅探器跟踪的很好的 Cisco 文档,其中包括 802.11
type/subtype 字段的描述:https://supportforums.cisco.com/document/52391/80211-frames-starter-guide-learn-wireless-sniffer-traces.
IEEE802.11
个数据包的数据封装在一个LLC
header中(参见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
header:3字节,8字节。 IEEE 802.11
使用第二个(参见 here)。在那一个中,LLC
header 的最后两个字节相当于 Ethernet
协议中的 Ether Type
字段。因此,此字段的 0x800
表示例如 IPv4
。
我正在开发一个 IEEE802.11
帧解析器程序,在 Linux 中使用 libpcap
和原始 C
。我可以很容易地解析 RadioTap
和 IEEE802.11
headers 但我找不到封装在 IEEE802.11
MPDU 中的协议名称。不幸的是,IEEE802.11
header 中没有任何字段指示封装的协议(如 Ethernet
header 中的 protocol
字段)。
有什么解决办法吗?
对于封装数据的802.11
帧,headertype/subtype会在0x20
和0x2F
之间(虽然帧通常是0x20
(数据)或 0x28
(QoS-Data))。将有一个 5 字节的 SNAP header,其中包含有效载荷的类型(如 this answer 中所述)。如果 OID(SNAP 的前三个字节 header)是 0x000000
,那么接下来的两个字节是以太网类型。
对于 EAPoL (source),以太网类型将为 0x888e
。这是您要检查以了解封装协议的字段(0x0800
用于 IP,0x0806
用于 ARP 等)。
这是一篇关于以太网类型以及如何使用它们过滤某些协议的很好的 Cisco 文档:http://www.cisco.com/c/en/us/td/docs/ios/12_2/ibm/vol1/command/reference/fibm_r1/br1fethc.pdf。
这是一份关于无线嗅探器跟踪的很好的 Cisco 文档,其中包括 802.11
type/subtype 字段的描述:https://supportforums.cisco.com/document/52391/80211-frames-starter-guide-learn-wireless-sniffer-traces.
IEEE802.11
个数据包的数据封装在一个LLC
header中(参见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
header:3字节,8字节。 IEEE 802.11
使用第二个(参见 here)。在那一个中,LLC
header 的最后两个字节相当于 Ethernet
协议中的 Ether Type
字段。因此,此字段的 0x800
表示例如 IPv4
。