Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Wi-Fi Aware を紐解く ~ Apple の公開 API と標準規格から理解する近距...

Avatar for mika mika
September 16, 2026
1

Wi-Fi Aware を紐解く ~ Apple の公開 API と標準規格から理解する近距離 P2P 通信 ~

Avatar for mika

mika

September 16, 2026

Transcript

  1. iOSDC Japan 2026 Track C 15:35~ Wi-Fi Aware を紐解く ~

    Apple の公開 API と標準規格から 理解する近距離 P2P 通信 ~ Mika Ito
  2. Wi-Fi Aware とは 近くのデバイスを、直接‧安全‧⾼速につなぐ P2P Wi-Fi • Wi-Fi Alliance の標準規格(Neighbor

    Awareness Networking / NAN) • 直接接続する:アクセスポイントやインターネットなし • 安全:Wi-Fi レイヤーで認証‧暗号化 • ⾼速:低遅延、⾼帯域通信 4
  3. 近距離デバイス通信を実現する技術との⽐較 • Bluetooth Low Energy を使い、近くの周辺機器を 発⾒‧接続‧通信する Apple のフレームワーク Core

    Bluetooth • 同⼀ LAN やアクセスポイントは不要 • センサー値、状態通知、機器設定などの⼩容量デー タに適する • 省電⼒ • TCP/IP ではなく Bluetooth の通信⽅式を利⽤ 6
  4. 近距離デバイス通信を実現する技術との⽐較 技術 同⼀LAN/AP 通信特性 主な⽤途 Bonjour 必要 発⾒のみ LAN 内サービス検出

    MultipeerConnectivity 不要 中速‧Apple 専⽤P2P Apple 端末間共有 Core Bluetooth 不要 低消費電⼒‧低速 センサー、設定 Wi-Fi Aware 不要 ⾼速‧⼤容量 ファイル、⾳声、映像 7
  5. 使う前に知っておきたい使⽤条件 • iOS‧iPadOS 26以降 • 対応ハードウェアが必要 ◦ iPhone 12 以降

    ◦ iPad (10th generation) 以降 ◦ iPad Air (4th generation) 以降 ◦ iPad Pro 11-inch (3rd generation) 以降 ◦ iPad Pro 12.9-inch (5th generation) 以降 ◦ iPad mini (6th generation) 以降 Wi-Fi Aware | Apple Developer Documentation 10
  6. 登場するフレームワーク名 1. DeviceDiscoveryUI / AccessorySetupKit ◦ ペアリングのためのシステム標準 UI を提供 2.

    WiFiAware ◦ サービスの宣⾔、確認 ◦ 端末が Wi-Fi Aware に対応しているかの確認 3. Network ◦ データパス上の実際のデータ通信 12
  7. 1. 準備 ~サービス名の定義~ • お互いのデバイスの検出し、接続するための識別⼦ • サービス名 + プロトコルの⼆要素で構成 サービス名

    _iosdc-service • ⼀意であること • アルファベット、数字、ハイフ プロトコル _tcp . • TCP or UDP ン • 15⽂字を超えない • (RFC6763, RFC6335 に準拠) 15
  8. 1. 準備 アプリが Wi-Fi Aware を利⽤するための事前準備 • サービス名の定義 • Info.plist,

    Entitlement の設定 ◦ Info.plist にサービス名を記述 ◦ com.apple.developer.wifi-aware の Entitlement を追加 16
  9. 2. 検出‧ペアリング 近くにいる通信相⼿を⾒つけ、ユーザーが接続 を許可。誰と通信するかを決定。 1. Wi-Fi Aware 対応端末か確認 2. 接続候補を

    UI に表⽰ 3. ユーザーが相⼿を選択‧ペアリング ◦ ⼀度ペアリングすれば、その後は毎回 ペアリング UI を出さずに接続できる 17
  10. 3. 接続 ここにサービスを 公開してます! Publishable service ペアリング端末 Listener (Publisher) 接続できる

    サービスはどこ? Subscribable service ペアリング端末 Browser (Subscriber) 22
  11. 3. 接続 Publishable service ペアリング端末 Subscribable service ペアリング端末 Listener (Publisher)

    Browser (Subscriber) 接続要求を受信 エンドポイントを 取得 25
  12. 4. データ通信 ~ 通信プロトコルの決定 ~ • TCP • UDP ◦

    順序保証‧再送あり ◦ 順序保証‧再送なし ◦ 確実に届けたいデータに適する ◦ 低遅延を優先する通信に適する ◦ ファイル‧重要なメッセージなど ◦ ⾳声‧映像 など サービス名 _iosdc-service プロトコル . _tcp or _udp 31
  13. 4. データ通信 ~ パフォーマンスの最適化 ~ • パラメータ1:Performance Mode ◦ •

    デューティサイクル パラメータ2:Traffic Service Class ◦ パケットの優先順位 33
  14. 4. データ通信 ~ パフォーマンスの最適化 ~ 送受信するデータによって、パフォーマンスの最適化を⾏う Performance Mode Traffic Service

    Class 遅延 消費電力 bulk bestEffort / background 大きい 少ない realtime interactiveVideo / interactiveVoice 小さい 多い 34
  15. Wi-Fi Aware アプリ開発 tips • • 例:トランシーバーアプリ(リアルタイム⾳声)を作ってみた!🔊 ◦ 実際の通信の確認には実機が必要 ◦

    Wi-Fi Aware は複数台前提。でも開発は⼀⼈ ◦ 通信距離の最⼤値を知りたいが、広い部屋が必要 解決策 ◦ Wi-Fi Aware に依存しないデバッグ導線 ◦ 実機では無線固有部分だけを確認 ◦ 同僚‧友⼈に協⼒してもらう ▪ 障害物がなければ 25 m~30 m くらいは届いた 38
  16. 少しだけ Android の話 iOS 同⼠のみ検証済みで、Android との接続は未検証 • Android 8.0 (API

    Level 26) から Wi-Fi Aware API を提供 • Android 14 (API Level 34) から Wi-Fi Aware 4.0 のペアリング API を提供 • 同じ標準規格でも、相互接続には細部の合意が必要 • 今回検証できたのは iOS 同⼠のみ 39
  17. 参考⽂献(順不同) • • • • • • • • •

    • • • • • https://developer.apple.com/documentation/wifiaware https://developer.apple.com/jp/videos/play/wwdc2025/228/ https://developer.apple.com/documentation/wifiaware/building-peer-to-peer-apps https://developer.apple.com/documentation/wifiaware/connecting-paired-devices https://developer.apple.com/documentation/wifiaware/adopting-wi-fi-aware https://developer.apple.com/documentation/technotes/tn3111-ios-wifi-api-overview https://developer.apple.com/documentation/multipeerconnectivity https://developer.apple.com/documentation/corebluetooth https://developer.android.com/develop/connectivity/wifi/wifi-aware?hl=ja https://source.android.com/docs/core/connect/wifi-aware?hl=ja https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf https://developer.apple.com/documentation/technotes/tn3151-choosing-the-right-networking -api https://www.apple.com/legal/dma/NCS-March-2026.pdf https://developer.apple.com/forums/thread/790195 41