Wifi网络通道宽度

发布于 2025-01-14 11:34:57 字数 1039 浏览 2 评论 0原文

我尝试获取网络的通道宽度,因此我使用 WlanGetNetworkBssList 检索无线 LAN 接口上无线网络的 BSS 条目列表,但我没有看到任何有关通道宽度的信息。获取通道中心频率以获取使用的通道数量和许多其他信息有点微不足道,但通道宽度似乎是存储在 BSS 条目结构的 IE 数据块中某处的模糊信息。我设法从 HT 和 VHT 操作信息元素中获取有关通道宽度的一些信息,但似乎还不够。我在 Github 上找到了一个 python 包装器,它从扩展信息元素中提取信息,但不清楚从哪一项开始,BSS条目结构的IE数据块可能有更多的IE扩展元素。

例如,我有 5 个不同的 IE 扩展元素:

FF 1A 230108080E00580C2F4EC96FC927DE018F00FAFFFAFFFAFFFAFF
FF 07 24E43F003CFCFF
FF 03 272500
FF 0E 260600FFFF20FFFF40FFFF60FFFF
FF 02 252A

我找到了一些有关 HT操作VHT 操作 信息元素,但没有关于扩展信息元素。

在哪里可以找到 AP 信标帧的这些信息元素的规范?

I try to get the channel width of networks so I'm using WlanGetNetworkBssList to retrieve a list of BSS entries of the wireless networks on a wireless LAN interface but I don't see any information about the channel width. It's kinda trivial to get the channel center frequency to obtain the number of used channel and many other information but the channel width seems to be an obscure information stored somewhere in IE data blob of BSS entry structure. I managed to get some information about the width of the channel from HT and VHT Operation information elements but doesn't seem to be enough. I found on Github a python wrapper that extract info from Extension information element but it's not clear from which one since IE data blob of BSS entry structure might have more IE Extension elements.

For example I have 5 different IE Extension elements:

FF 1A 230108080E00580C2F4EC96FC927DE018F00FAFFFAFFFAFFFAFF
FF 07 24E43F003CFCFF
FF 03 272500
FF 0E 260600FFFF20FFFF40FFFF60FFFF
FF 02 252A

I found some basic information about HT Operation and VHT Operation information elements but nothing about Extension information element.

Where I can find the specifications for these information elements of AP beacon frames?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

像极了他 2025-01-21 11:34:57

在哪里可以找到规格

官方文档:在付费专区后面的 IEEE。

示例: https://standards.ieee.org/ieee/802.11/7028/

我设法从 HT 和 VHT 操作信息元素中获取有关通道宽度的一些信息

不知道在没有元素 61 和 192 的情况下你是如何做到这一点的。在你的屏幕截图中,你只显示了 255 个元素。

例如,我有 5 个不同的 IE 扩展元素

这是正常的,某些元素(如 255)可能会重复出现。
我的元素是:

0, 1, 3, 5, 7, 32, 35, 48, 11, 70, 45, 61, 127, 191, 192, 195, 4 * 255, 3 * 221

例如,255(扩展元素)包含 Wifi 6 (he) 和 Wifi 7 (eht) 的信息:

switch (extid) {
    case EXTID_HECAPABILITIES: // 35
        FuncWlanHECapa(IEID, IELEN, pBeaconframe, &heidx, &bw_he);
        //printf("he idx: %d, %d\n", heidx, bw_he);
        break;
    case EXTID_HEOPERATION: // 36
        break;
    case EXTID_EHTCAPABILITIES: // 108
        FuncWlanEHTCapa(IEID, IELEN, pBeaconframe, &ehtidx, &bw_eht, &iSS);
        break;
    case EXTID_EHTOPERATION: // 106
        break;
    default:
        break;
}

来源: https://github.com/coolshou/wlan/blob/307ffc63ab14887ca7181507397c52692c3e6347/src/wlan.cpp#L1577

前言

不知道为什么,但你的信息元素太少了,而且都是 255使用我的 unifi 接入点和英特尔 wifi 6E卡,我得到了十多个元素。包括61和192。

小心指针运算,很容易偏离1个字节。
但你的元素看起来似乎合理。

关于实现的回答:

ie 的前两个字节始终是元素 ID(1 字节)和数据长度(1 字节)。我的索引操作引用数据,而不是完整的 IE 元素。

通过选择 id 61 (0x3D) 的元素来获取 ht_operations 元素。
以及 ID 为 192 (0xc0) 的 vht_operations 元素。

伪代码:

if ht_operatios.byte[1].bit[2] == false:
    return 20Mhz

vht_channel_width = vht_operations.byte[0].bit[2..3]

if vht_channel_width == 0:
    return 40Mhz
if vht_channel_width == 1:
    return 80Mhz
if vht_channel_width == 2:
    return 160Mhz
if vht_channel_width == 3:
    return 80_plus_80Mhz

Python 示例有点神秘,但本质上它就是这样做的。

Where I can find the specifications

Official docs: At IEEE behind a paywall.

Example: https://standards.ieee.org/ieee/802.11/7028/

I managed to get some information about the width of the channel from HT and VHT Operation information elements

Not sure how you did that without the elements 61 and 192. In your screenshot you only show 255 elements.

For example I have 5 different IE Extension elements

That's normal, some elements (like 255) might appear repeatedly.
My Elements are:

0, 1, 3, 5, 7, 32, 35, 48, 11, 70, 45, 61, 127, 191, 192, 195, 4 * 255, 3 * 221

For example, 255 (Extension elements) contain infos for Wifi 6 (he) and Wifi 7 (eht):

switch (extid) {
    case EXTID_HECAPABILITIES: // 35
        FuncWlanHECapa(IEID, IELEN, pBeaconframe, &heidx, &bw_he);
        //printf("he idx: %d, %d\n", heidx, bw_he);
        break;
    case EXTID_HEOPERATION: // 36
        break;
    case EXTID_EHTCAPABILITIES: // 108
        FuncWlanEHTCapa(IEID, IELEN, pBeaconframe, &ehtidx, &bw_eht, &iSS);
        break;
    case EXTID_EHTOPERATION: // 106
        break;
    default:
        break;
}

Source: https://github.com/coolshou/wlan/blob/307ffc63ab14887ca7181507397c52692c3e6347/src/wlan.cpp#L1577

Foreword

Not sure why, but you have way too few information elements, and all of them are 255. With my unifi access point and an intel wifi 6E card, i get more than ten elements. Including 61 and 192.

Be careful with the pointer arithmetic, it’s easy to be off by 1 byte.
But your elements look plausible.

Answer about the implementation:

First two bytes of ie are always Element ID (1 byte) and length of the data (1 byte). My index operations refer to the data, not the full IE Element.

Get the ht_operations element by picking the one with id 61 (0x3D).
And the vht_operations element with id 192 (0xc0).

Pseudo code:

if ht_operatios.byte[1].bit[2] == false:
    return 20Mhz

vht_channel_width = vht_operations.byte[0].bit[2..3]

if vht_channel_width == 0:
    return 40Mhz
if vht_channel_width == 1:
    return 80Mhz
if vht_channel_width == 2:
    return 160Mhz
if vht_channel_width == 3:
    return 80_plus_80Mhz

The Python example is a little bit cryptic, but essentially it does this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文