Phone 在捕获 Wi-Fi 探测请求时不发送所有存储的 ssid

Phone doesn't send all stored ssids while capturing Wi-Fi probe wequests

我用 scapy 构建了一个脚本来捕获 monitornig wi-fi 接口中的探测请求。 我成功捕获了请求以及其中包含的一些 SSID。但是大多数存储在 phone 中的网络都不会被广播。 并且没有明确的模式说明为什么会发生这种情况。有些 phone 根本不广播 ssid。

我试图找到这种行为背后原因的解释,但没有找到任何解释,除了应该广播隐藏网络以便 phone 连接到它们,但是即便如此也不是真的,而且大部分播出的都是可见的。

另一个行为是 iPhone,它似乎只广播它们所连接的网络,除此之外别无其他。 (无网络 -> 无 SSID)。

我试过把界面放到各个频道里,在播放的网络上效果不一样,但绝大多数保存在设备里的还是没有播放。

这背后有什么原因吗?或者一种强制设备广播它们的方法?

您似乎假设 phone 会永久地对每个已知网络发出探测请求。

不是这种情况 - 不仅是 phone,而且是一般情况。引用 Wi-Fi 联盟[*]:

What are passive and active scanning?

The reason for client scanning is to determine a suitable AP to which the client may [emphasis mine] need to roam now or in the future. A client can use two scanning methods: active and passive. During an active scan, the client radio transmits a probe request and listens for a probe response from an AP [emphasis mine]. With a passive scan, the client radio listens on each channel for beacons[emphasis mine again] sent periodically by an AP. A passive scan generally takes more time, since the client must listen and wait for a beacon versus actively probing to find an AP. Another limitation with a passive scan is that if the client does not wait long enough on a channel, then the client may miss an AP beacon.

所以这完全 application/OS 取决于 if

  • phone STA 进行主动扫描,发送探测请求,

  • 或者只是坐在那儿听信标(或者什么都不做)。

在我的记忆中 - 我已经有几年没有 worked/looked Android 代码了,所以它可能有变化 - Android 将 不会 进行主动扫描,因此 不会 向已知的 SSID 发送探测请求,除非 你在 Wi-Fi 网络中设定画面。它只会听信标。

这背后有一些 Wi-Fi 802.11 设计原理:

  • STA 应该是移动的。毕竟,如果你不从 有时,使用 Wi-Fi 没有多大意义(营销除外 或懒惰,当然聪明 phones 改变了这一点),你可能 好的。

  • ...如果您是移动设备,则有理由认为您 运行 电池,

  • 所以你想节省电池寿命:所以你宁愿做被动 扫描监听信标而不是主动扫描发送探测 请求,因为这样使用更少的功率。

当您是 STA 时,这种节能替代功能的想法在 802.11 设计中传播到所有其他地方,隐藏在地毯下。

所以它完全 OS stack/application 依赖于 STA 1/ 只听信标 /2 主动为每个已知的 AP 发送探测请求 3/ 发送广播探测请求,以及它是否以连续方式或周期性方式这样做,或者取决于它是否处于已知状态(例如屏幕打开,用户进入 Wi-Fi 网络设置屏幕)。

现在可能还有一些其他的考虑因素,比如一些地区法规要求您首先收听信标以决定您是否可以使用某些频道。不过重点在上面

*:

http://www.wi-fi.org/knowledge-center/faq/what-are-passive-and-active-scanning

编辑:

编程方面:

1/ 您似乎遇到的是 IOP(互操作性)问题,因为您期望 STA 在扫描主动与被动以及涉及的探测请求方面有特定的行为,而这并不是它在真实情况下的工作方式世界。根据您的应用程序最终主要目标,这可能是设计中的缺陷 - 或者只是一个小麻烦。您可能希望将自己限制在某些特定设备的品牌上,或者尝试涵盖所有情况,这会产生开发成本。

2/ ...或者您只是对自己的观察感到惊讶,并寻求解释。在这种令人惊讶的结果的情况下,不用说:直接去 wireshark 检查您的程序观察(如果您的程序是数据包嗅探器)或行为(如果您的程序是 client/server/layer XYZ 协议实现)。

关于主动与被动扫描和节能的 802.11 策略:

来自“802.11 无线网络:权威指南,第 2 版”,作者 Matthew S. Gast("member of the IEEE 802.11 working group, and serves as chair of 802.11 Task Group M. As chair of the Wi-Fi Alliance's Wireless Network Management marketing task group, he is leading the investigation of certification requirements for power saving, performance optimization, and location and timing services" - 来自他的出版商简介)。我强烈推荐的一本书。

页。 171:

ScanType (active or passive)

Active scanning uses the transmission of Probe Request frames to identify networks in the area. Passive scanning saves battery power by listening for Beacon frames.

页。 172:

Passive Scanning

Passive scanning saves battery power because it does not require transmitting. In passive scanning, a station moves to each channel on the channel list and waits for Beacon frames.

另外,有点老了(2003 年),但是这些人知道他们关于网络的知识。关于扫描策略:

来自思科“802.11 无线局域网基础知识”,第 5 章 "mobility"。

第 153 页:

Roaming Algorithms

The mechanism to determine when to roam is not defined by the IEEE 802.11 specification and is, therefore, left to vendors to implement. [...] The fact that the algorithms are left to vendor implementation provide vendors an opportunity to differentiate themselves by creating new and better performing algorithms than their competitors. Roaming algorithms become a vendor’s “secret sauce,” and as a result are kept confidential.

第 154 页"Determining Where to Roam":

There is no ideal technique for scanning. Passive scanning has the benefit of not requiring the client to transmit probe requests but runs the risk of potentially missing an AP because it might not receive a beacon during the scanning duration. Active scanning has the benefit of actively seeking out APs to associate to but requires the client to actively transmit probes. Depending on the implementation for the 802.11 client, one might be better suited than the other. For example, many embedded systems use passive scanning as the preferred method [emphasis mine] [...]

第 155 页上的其他有趣内容,"Preemptive AP Discovery"。