29
Linux Wireless Linux Wireless Wi-Fi Peer-to-Peer on Linux Johannes Berg [email protected] Intel Corporation November 2010

Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux WirelessLinux Wireless

Wi-Fi Peer-to-Peer on Linux

Johannes [email protected]

Intel Corporation

November 2010

Page 2: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Introduction – P2P vs. Wi-Fi Direct?

• Wi-Fi Peer-to-Peer (P2P): technology, technical specification

• Wi-Fi Direct: marketing and certification

Linux: use P2P term, certification is not upstream’s job

2 / 29 Linux Wireless

Page 3: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Introduction – Use cases

3 / 29 Linux Wireless

Page 4: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Introduction – Use cases

4 / 29 Linux Wireless

Page 5: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Introduction – Use cases

5 / 29 Linux Wireless

Page 6: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Introduction – Use cases

6 / 29 Linux Wireless

Page 7: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Introduction – Specification

Current draft is v1.0.16, available for members and for sale, builtusing

• vendor-specific primitives in IEEE 802.11

• WPA2

• Wi-Fi Simple Configuration

7 / 29 Linux Wireless

Page 8: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Introduction – Specificationsome terminology

• P2P Group

• P2P Device

• P2P Group Owner (GO)

• P2P Client

• “legacy” device

8 / 29 Linux Wireless

Page 9: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Technical overviewDevice discovery

• for speed: only on social channels 1, 6, 11

• probe request/response mechanism

• search: device scans (on social channels)

• listen: device listens for probe requests

9 / 29 Linux Wireless

Page 10: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Technical overviewGroup formation

• GO negotiation

• provisioning (WSC)

• autonomous P2P group

10 / 29 Linux Wireless

Page 11: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Technical overviewInvitation

• ask a P2P device to join an existing group

• invitation could be by GO

• device may invite another device into the group it is part of

• also used to invoke persistent group

11 / 29 Linux Wireless

Page 12: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Technical overviewSome details

• Group’s SSID: “DIRECT-XY[postfix]”

• P2P wildcard: “DIRECT-”

• GO appears as AP to legacy devices

• P2P IEs convey name, device capabilities

• enhanced powersave (for GO)

12 / 29 Linux Wireless

Page 13: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

ImplementationOverview

cfg80211 API

driver

mac80211

cfg80211

wpa_supplicant

Wifi/P2P controller

driver

D-Bus API

D-Bus API

nl80211

13 / 29 Linux Wireless

Page 14: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

ImplementationDrivers

mac80211

• must support AP and STA modes

• must receive probe requests

cfg80211

• must also support cfg80211 APIs

14 / 29 Linux Wireless

Page 15: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Implementationcfg80211/nl80211

• remain on channel

• management frame RX/TX

• WIP: P2P listen/search offload

• WIP: off-channel management frame TX/RX

15 / 29 Linux Wireless

Page 16: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Implementationkernel summary

• ability to insert IEs into e.g. probe requests

• off-channel for various use cases

• ability to hand certain frames to userspace for processing(e.g. probe request, action frames)

• implemented in mac80211, available to full-MAC drivers viacfg80211

• special APIs for optimisation

16 / 29 Linux Wireless

Page 17: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Implementationwpa_supplicant

• handles the entire P2P protocol

• provides primitives for all P2P operations

• provides service registration APIs

• provides APIs over D-Bus (WIP)

17 / 29 Linux Wireless

Page 18: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Implementation

cfg80211 API

driver

mac80211

cfg80211

wpa_supplicant

Wifi/P2P controller

driver

D-Bus API

D-Bus API

nl80211

18 / 29 Linux Wireless

Page 19: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Usage

What do we have now?

• primitives to create connections

• ability to advertise services

• ability to be discovered (when in find or listen state)

19 / 29 Linux Wireless

Page 20: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Usage

But ... we can’t actually use it from most applications.

• many applications controlling one wpa_supplicant?

• or even running their own instance of it?

• which determines P2P device name and similar properties?

• which runs DHCP client/server and manages network?

20 / 29 Linux Wireless

Page 21: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Application APIs – Overview

Applications are more concerned with

• enabling/disabling P2P

• registering a service (if offering one)

• UI to find/select a peer

• connections with peers

• releasing those connections

21 / 29 Linux Wireless

Page 22: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Application APIs – Problems

Such things could be implemented by applications with theprimitives, but

• code duplication between apps

• could lead to conflicts between different P2P usages

• could lead to conflicts between P2P and “internet connection”

• could run into HW limitations

22 / 29 Linux Wireless

Page 23: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Application APIs – Consequence

As a consequence, management component needed:

• context aware between concurrent P2P usages

• can arbitrate concurrent P2P usages

• can make decisions about which primitives to use

23 / 29 Linux Wireless

Page 24: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Application APIs – Consequence

Management component closely coupled with connection manager

• single entity controlling wireless

• aware of all usage of a given device

• may need to be aware of P2P’s enterprise managementfeatures

• could also manage multiple devices (if available)

24 / 29 Linux Wireless

Page 25: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Application APIs – Consequence

However: multiple connection managers exist

• NetworkManager (Gnome, KDE, ...)

• ConnMan

• FlimFlam

• Wicd?

• ...?

25 / 29 Linux Wireless

Page 26: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Application APIs – Proposed solution

• common, stable D-Bus API

• could become freedesktop.org specification

• implemented by connection manager or another middle layer

• applications can be independent of connection manager

• easily usable from many languages

26 / 29 Linux Wireless

Page 27: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Questions?

27 / 29 Linux Wireless

Page 28: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

References

• Wi-Fi Peer-to-Peer (P2P) Technical Specification (DraftVersion 1.0.16)

• http://wireless.kernel.org/

28 / 29 Linux Wireless

Page 29: Wi-Fi Peer-to-Peer on Linux...Linux Wireless Introduction – Specification Current draft is v1.0.16, available for members and for sale, built using ‹ vendor-specific primitives

Linux Wireless

Backupwpa_supplicant P2P primitives

• p2p_find

• p2p_stop_find

• p2p_connect

• p2p_listen

• p2p_group_remove

• p2p_group_add

• p2p_prov_disc

• p2p_get_passphrase

• p2p_serv_disc_req

• p2p_serv_disc_cancel_req

• p2p_serv_disc_resp

• p2p_service_update

• p2p_serv_disc_external

• p2p_service_flush

• p2p_service_add

• p2p_service_del

• p2p_reject

• p2p_invite

• p2p_peers

• p2p_peer

• p2p_set

• p2p_flush

• p2p_presence_req

• p2p_ext_listen29 / 29 Linux Wireless