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

标签 request wifi broadcast ssid probe

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

我试图找到这种行为背后的原因的解释,但没有找到任何解释,除了应该广播隐藏的网络以便电话连接到它们,但即使这样也不是真的,而且大多数广播的是可见的。

另一种行为是 iPhone,它似乎只广播它们所连接的网络,没有别的。 (没有网络 -> 没有 SSID)。

我试过把接口(interface)放在不同的 channel ,结果在广播网络上有所不同,但设备中保存的绝大多数仍然没有广播。

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

最佳答案

您似乎假设电话会永久地对每个已知网络进行探测请求。

情况并非如此 - 不仅适用于电话,而且一般而言。引用 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.



所以这完全取决于应用程序/操作系统,如果
  • 电话 STA 进行主动扫描,发送探测请求,
  • 或者只是坐在那里听信标(或什么都不做)。

  • 在我的内存中 - 我已经有几年没有工作/查看 Android 代码了,所以它可能会发生变化 - Android 不会进行主动扫描,因此不会向已知 SSID 发送探测请求,除非你在Wi-Fi 网络设置屏幕。它只会听信标。

    这背后有一些 Wi-Fi 802.11 设计原理:
  • STA应该是移动的。毕竟,如果你不搬离
    有时,使用 Wi-Fi 没有多大意义(营销除外)
    或懒惰,当然智能手机改变了这一点),你可能会
    好接好线。
  • ...如果您是移动设备,则认为您在移动设备上运行是合理的
    电池,
  • 所以你想节省电池生命周期:所以你宁愿做被动
    扫描监听信标而不是主动扫描发送探针
    请求,因为这使用较少的功率。

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

    因此,它完全依赖于 STA 的操作系统堆栈/应用程序 1/仅监听信标/2 为每个已知 AP 主动发送探测请求 3/发送广播探测请求,并且如果它以连续方式这样做,或定期,或取决于它是否处于已知状态(例如屏幕打开,用户进入 Wi-Fi 网络设置屏幕)。

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

    *:

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

    编辑:

    在编程方面:

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

    2/...或者你只是对你的观察感到惊讶,并寻找解释。在这种令人惊讶的结果的情况下,不用说:直接去wireshark检查你的程序观察(如果你的程序是一个数据包嗅探器)或行为(如果你的程序是一个客户端/服务器/层XYZ协议(protocol)实现)。

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

    摘自“802.11 无线网络:权威指南,第 2 版”,作者:Matthew S. Gast(“IEEE 802.11 工作组成员,并担任 802.11 Task Group M 主席。Wi-Fi 联盟无线网络管理主席营销任务组,他正在领导对节能、性能优化以及定位和定时服务的认证要求的调查”——来自他的出版商简历)。我可以强烈推荐的一本书。

    页。 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 无线 LAN 基础”,第 5 章“移动性”。

    第 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 页“确定漫游位置”:

    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 页上的其他有趣内容,“抢先式 AP 发现”。

    关于request - 手机在捕获 Wi-Fi 探测请求时不会发送所有存储的 ssid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36264440/

    相关文章:

    python - 尝试为 track.getSimilar 调用 last.fm Rest api,在 python 中无法理解响应

    laravel - 在中间件中修改请求?

    ios - 使用ASIHTTPRequest下载多个文件

    wifi - 3G/4G点对点网络用于偏远地区的长途通信?

    Arduino 的 iOS 远程控制

    android - 在 RecyclerView 中按项目从网络加载数据

    linux - recvfrom(2) 收到两次 UDP 广播,但 tcpdump(8) 只收到一次

    c# - 如何动态获取本地 IP 广播地址 C#

    C# 无法使用 UdpClient 接收 WOL 包

    Android 8.0 Oreo wifi 列表未获取