ios 什么是 AWDL(Apple 无线直连)?它是如何工作的?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19587701/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is AWDL (Apple Wireless Direct Link) and how does it work?
提问by Adam
I'm trying to find out what AWDL is. On iOS, if you use Apple's peer-to-peer networking over BlueTooth, it seems Apple creates a new Network Interface "awdl0" to implement (I guess) IP-over-BT.
我试图找出 AWDL 是什么。在 iOS 上,如果您通过蓝牙使用 Apple 的点对点网络,Apple 似乎创建了一个新的网络接口“awdl0”来实现(我猜)IP-over-BT。
But I can't find any docs on this tech, or this interface, how it behaves, things we must / must not do with it, etc. Google comes up blank :(.
但是我找不到任何关于这项技术的文档,或者这个界面,它的行为方式,我们必须/不能用它做的事情等等。谷歌出现空白:(。
In particular, I believeit means "established a BT connection, and I'm running an IP bridge over the top, and you can use this to communicate peer-to-peer". Apple's own system libraries have bugs where this bridge isn't setup quickly enough, and if you send data too soon, it appears to get dropped by the OS. So ... if I can query this awdl0, I hope to check "are you ready yet?" and delay P2P messages until the OS is happy.
特别是,我认为这意味着“建立了 BT 连接,并且我在顶部运行了一个 IP 网桥,您可以使用它进行点对点通信”。Apple 自己的系统库存在此桥接设置不够快的错误,如果您过早发送数据,它似乎会被操作系统丢弃。所以......如果我可以查询这个awdl0,我希望检查“你准备好了吗?” 并延迟 P2P 消息,直到操作系统满意为止。
UPDATE
更新
More info: I can get pairs of iOS devices to create awdl0 connections to each other - but they never get created to OS X machines, whether BT and Bonjour are on or not, whether the devices are paired or not.
更多信息:我可以让成对的 iOS 设备相互创建 awdl0 连接 - 但它们永远不会被创建到 OS X 机器上,无论 BT 和 Bonjour 是否打开,无论设备是否配对。
Some background:
一些背景:
In iOS5, Apple permanently disabled the Bluetooth parts of Bonjour/Peer-to-peer networking, and published a technote instructing everyone to use DNS-SD if they wanted to keep using Bluetooth as a transport between iOS devices. This is fine, but it means you mustuse DNS-SD if you want high-performance BT, and you want it reliable.
在 iOS5 中,Apple 永久禁用了 Bonjour/点对点网络的蓝牙部分,并发布了一份技术说明,指导每个人如果想继续使用蓝牙作为 iOS 设备之间的传输,就使用 DNS-SD。这很好,但这意味着如果你想要高性能的 BT 并且你想要它可靠,你必须使用 DNS-SD。
(GameKit sometimesworks fine, but we often see terrible performance in real-world scenarios, e.g. crowded public places - which goes away if you use DNS-SD)
(GameKit有时运行良好,但我们经常在现实场景中看到糟糕的性能,例如拥挤的公共场所 - 如果您使用 DNS-SD,这种情况就会消失)
DNS-SD protocol doesn't include info to tell you what the hardware is using. But it does tell you the Network Interfaces (which is how I know we're running on awdl0)
DNS-SD 协议不包含告诉您硬件正在使用什么的信息。但它确实会告诉您网络接口(这就是我知道我们在 awdl0 上运行的方式)
DNS-SD is awesome, and we have high-speed, low latency connections peer-to-peer between iOS devices - all the stuff that GameKit promises but often fails to deliver whenever there's more than a few wifi/BT devices in range.
DNS-SD 很棒,我们在 iOS 设备之间建立了高速、低延迟的点对点连接——GameKit 承诺的所有东西,但当范围内有多个 wifi/BT 设备时,通常无法交付。
回答by bzz
AWDL recently caught a lot of attention when it caused Wi-Fi issues in iOS 8 and OS X Yosemite devices.
AWDL 最近在 iOS 8 和 OS X Yosemite 设备中引起 Wi-Fi 问题时引起了很多关注。
What is AWDL?AWDL (Apple Wireless Direct Link) is a low latency/high speed WiFi peer-to peer-connection Apple uses for everywhere you'd expect: AirDrop, GameKit (which also uses Bluetooth), AirPlay, and perhaps elsewhere. It works using its own dedicated network interface, typically “awdl0".
什么是AWDL?AWDL(Apple 无线直连)是一种低延迟/高速 WiFi 点对点连接,Apple 用于您期望的任何地方:AirDrop、GameKit(也使用蓝牙)、AirPlay 以及其他地方。它使用自己的专用网络接口工作,通常是“awdl0”。
While some services, like Instant HotSpot, Bluetooth Tethering (of course), and GameKit advertise their services over Bluetooth SDP, Apple decided to advertise AirDrop over WiFi and inadvertently destroyed WiFi performance for millions of Yosemite and iOS 8 users.
虽然一些服务,如 Instant HotSpot、蓝牙网络共享(当然)和 GameKit 通过蓝牙 SDP 宣传他们的服务,但 Apple 决定通过 WiFi 宣传 AirDrop 并无意中破坏了数百万优胜美地和 iOS 8 用户的 WiFi 性能。
How does AWDL work?Since the iPhone 4, the iOS kernels have had multiple WiFi interfaces to 1 WiFi Broadcom hardware chip.
AWDL 是如何工作的?从 iPhone 4 开始,iOS 内核就有多个 WiFi 接口连接到 1 个 WiFi Broadcom 硬件芯片。
en0?—?primary WiFi interface ap1?—?access point interface used for WiFi tethering awdl0?—?Apple Wireless Direct Link interface (since iOS 7?)
en0?—?主 WiFi 接口 ap1?—?用于 WiFi 网络共享的接入点接口 awdl0?—?Apple Wireless Direct Link 接口(自 iOS 7 起?)
By having multiple interfaces, Apple is able to have your standard WiFi connection on en0, while still broadcasting, browsing, and resolving peer to peer connections on awdl0 (just not well).
通过拥有多个接口,Apple 能够在 en0 上建立标准的 WiFi 连接,同时仍然在 awdl0 上广播、浏览和解析对等连接(只是不太好)。
回答by milan
I'd like to provide a more precise answer as to howthe protocol works internally. I quote part of the abstract of this paper.
我想提供一个更精确的答案,如何协议的内部工作。我引用了抽象的一部分本文。
In short, each AWDL node announces a sequence of Availability Windows (AWs) indicating its readiness to communicate with other AWDL nodes. An elected master node synchronizes these sequences. Outside the AWs, nodes can tune their Wi-Fi radio to a different channel to communicate with an access point, or could turn it off to save energy.
简而言之,每个 AWDL 节点都会宣布一系列可用性窗口 (AW),表明它已准备好与其他 AWDL 节点进行通信。An elected master node synchronizes these sequences. 在 AW 之外,节点可以将其 Wi-Fi 无线电调谐到不同的频道以与接入点通信,或者可以将其关闭以节省能源。
From a user perspective, AWDL allows a device remain connected to an infrastructure-based Wi-Fi network and communicate with AWDL peers "at the same time" by quickly hopping between the channels of the two networks (AWDL uses fixed social channels 6, 44, and 149). In contrast to the previous answer, we found that current versions of AWDL work fairly well and channel hopping only induces a small overhead.
从用户的角度来看,AWDL 允许设备保持连接到基于基础设施的 Wi-Fi 网络,并通过在两个网络的通道之间快速跳转(AWDL 使用固定的社交通道 6、44 , 和 149)。与之前的答案相反,我们发现当前版本的 AWDL 工作得相当好,并且信道跳频只会引起很小的开销。
Disclaimer: I'm co-author of this paperand we retrieved this information by means of reverse engineering. If you are interested in the details, please read the paper and have a look at the Wireshark dissector(published soon).
免责声明:我的合着者提出,我们通过逆向工程的方式获取这些信息。如果您对详细信息感兴趣,请阅读论文并查看Wireshark 解剖器(即将发布)。