WIFI Direct 連線小註解

WIFI Direct 是 WiFi 聯盟所提出的規格, 目的在於讓兩個無線裝置不透過 AP (access point) 就直接溝通. 或曰, 不是有 TDLS 嗎? WIFI 聯盟說了 [1]:

TDLS operates in the background of a Wi-Fi network to optimize performance, while Wi-Fi Direct-certified devices can quickly connect to one another while on the go, even when a Wi-Fi network is unavailable.  Many devices will be certified for both solutions and use them in different situations.

WIFI Direct 不需要 AP 仲介, 也不需要已經建立的網路.首先雙方以 discovery 發現對方.如果有一方講話有人在聽的話, 對話就成立了. 這就是 search-listen 組合, device 1 發出的 probe request 收到了 device 2 的 probe response 的回應.

此後 device 1 開始 formation, 送出 GO negotiation request, 等待 device 回應 GO negotiation response, 如果對方沒有進入 formation 的階段, request 會得到 fail 的結果. 若是能夠正常回應, 這樣就可以準備 GO 了嗎?! 非也, 這裡的 GO 並不是英文 go! go! go! 的那個 go, 而是 group owner 的縮寫.  Device 1 是 client, 而 device 2 是 group owner, 相當於一台 AP 的角色. 所以一個 GO 也可以有很多 clients.

那麼如何決定誰是那麼如何決定誰是 group owner 呢? 方法就是圖中的比大小. Device 1 在送出 request 的時候, 會附上 intent = 3.可惜 device 出的 intent = 3, 既然 10 > 3, 所以 device 2 就當 GO. 要是雙方不巧平手的話,就看雙方誰做莊? 做莊的那個會在 tie-breaker bit 註明, 這個值是隨機的.如果雙方都出王牌 (intent value >= 15), 搶著當 GO, 那麼連線就會失敗.

雙方角色確定之後, 還要有一個 GO negotiation confirm 才算完成 request / response / confirmation 三部曲.這是 Formation 中決定角色的完整步驟. 到了 Formation 的後段, P2P 的 device 要互相鑑別對方 (authentification), 然後 client 要發 association request 和獲得 association response, 這樣才和 GO 完成所有的 standard formation 的工作.

另外一種 formation 叫做 persistent.它可以把 group 中的成員記下來, 後續再連線時,可以直接邀請 (invite) 對方加入 group.Invitation 也分成 3 種, 就是 GO 請 device 加入變成 client, 或是 client 邀請 device 變成 group member (前兩者 invitation request frame = 0), 以及先前 persistent formation 的 GO (一定要有 GO) 和 client 重建當時的連線關係 (invitation request frame = 1).

Persistent invitation 的好處就是不需要複雜的認證,只是做 WSC (WIFI simple configuration). 而 GO 要負責在 invite response 時, 提供這一堆資訊:P2P Group BSSID, Channel List, Operating Channel and Configuration Timeout attributes to indicate the Group BSSID, potential Operating Channels, intended Operating Channel and any GO Configuration Time 讓連線快速恢復上次的狀態.

[ref]

1. http://www.wi-fi.org/knowledge-center/faq/what-difference-between-tdls-and-wi-fi-direct

2. http://www.hughes-systique.com/Portals/0/Uploads/Articles/WFD_Technology_Whitepaper_v_1.7635035318321315728.pdf

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com 標誌

您的留言將使用 WordPress.com 帳號。 登出 /  變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 /  變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 /  變更 )

連結到 %s

%d 位部落客按了讚: