WiFi Peer to Peer (P2P) Mode

https://www.ti.com/lit/ug/swru576/swru576.pdf?ts=1664085584867

2 Peer to Peer (P2P) Mode

The purpose of P2P is to establish a direct WLAN connection between two devices without involving a router or AP for its operation. The P2P is known in Android devices as Wi-Fi Direct and can be operated from the Wi-Fi menu. Usually, the P2P role exists concurrently with the WLAN station role, which causes Android devices to operate in a WLAN multi-role state.

P2P is a WLAN role that typically has a short lifespan, in contrast to station or AP WLAN roles that exist from the moment that they are started until they are explicitly terminated by the user. The P2P role is mainly used by a Miracast function in Android OS, for example, for mirroring the Android smartphone screen on other device, such as a smart TV or smart phone that has a WLAN module and supports Miracast functionality.

P2P may exist in three states: device, client, and GO. P2P functionality, after a connection, is similar to the WLAN station and AP functionality. However, P2P has supplementary functional behaviors that distinguish it from a standard station and AP operation, and allows different services to be used. P2P also has its own power save behavior that allows an additional battery.

2.1 P2P Device

A P2P device is a Wi-Fi certified device that is compliant with the Wi-Fi P2P specification. When P2P is enabled, either by enabling the Wi-Fi Direct or the Miracast function, it starts in device state. This state is used for discovering other P2P devices for further connection by looking for specific services such as printers or smart TVs. The P2P connection is established while P2P is in a device state. After connection, the P2P device operates as client or GO depending on a decision taken during the negotiation process between two P2P devices. The P2P connection process consists of three steps: searching, negotiation, and group formation.

 2.1.1 Searching Phase

During a searching phase, the P2P device discovers any device that supports P2P functionality and is discovered by other P2P devices for further connection. If P2P functionality is used by some specific application, such as Miracast, only devices that support Miracast capabilities appear in the list of devices for connection. Such filtering is possible because of a service discovery function in P2P devices. The P2P device does not have a static operating channel in which it can be detected. Thus, the search phase consists of two phases: scan and listen. During the scan phase, the P2P devices scan all WLAN channels on both 2.4 GHz and 5 GHz (if 5 GHz is supported), and wait for responses from devices that support P2P functionality. During the listen phase, the P2P devices stay on specific channels called social channels. The P2P device remains in the listen state for a time period that permits detection. P2P detection during the search phase is statistical and depends on a proper combination of the scan and the listen phases. When P2P devices are detected, they appear in the P2P devices list.

2.1.2 Negotiation

After detecting P2P devices, establishing a connection is possible. In most cases, the process of establishing connection consists of two steps: selecting a target device from the list of devices on one P2P device and allowing this device connection on the second P2P device. The order of initiation does not have an impact on the role assigned after connection. In some cases, such as mirroring device display using a Miracast connection, the connection establishment only requires the selection of the target device on the source device. When the connection process has been invoked, the first phase toward connection is negotiation about which device operates as GO in this connection by using a value between 0 and 15 that is usually predefined on each device. The device with a higher value operates as GO and the other device operates as client.

2.1.3 Group Formation

In this phase, the Wi-Fi connection is established. During the negotiation phase, one of the P2P devices is selected as GO. This GO device starts to transmit beacons on the operational channel and waits for the connection from the second P2P device. The second P2P device knows the GO operational channel from the search phase, which allows it to start the connection immediately after the negotiation phase. The connection process is similar to the standard WPS connection process, which consists of two phases: creating a security key and a connection using this key, as with WPA2-PSK authentication. When the connection has been established, the devices operates similarly to a regular Wi-Fi station and AP, while having additional P2P functionality and the power save capabilities, if needed.

2.2 P2P Client

Once the device has become a client as a result of the negotiation, it acts like a standard Wi-Fi station. An additional P2P device cannot be connected to it. The P2P client is subject to the GO instructions, such as starting a power save period. The client device may terminate the P2P connection similarly to the GO device and return to the device state, while the GO device, if only connected to this client, continues to operate as GO for the predefined period of typically two minutes. When the devices wish to re-establish connection, they must complete the whole process staring from negotiation, WPS provisioning, and WPA2 connection. However, if the P2P devices have a special P2P “persistent” capability, they can omit the long WPS section and immediately use WPA2-PSK authentication for the connection.

2.3 P2P GO

The device that became group owner (GO) during the negotiation phase preceding the connection is a coordinator of the group. It has the special capabilities of P2P and the standard capabilities of an AP. It permits connection of additional P2P devices, as well as the connection of legacy Wi-Fi stations, such as laptops, smartphones, and so forth; if they know the pre-shared security key for connection. Connecting additional P2P devices to the GO is possible by joining the group, not by negotiation, as this device already behaves as the GO and does not change its role during this connection.

Because the GO behaves like an AP and must transmit beacons periodically, it is mostly in the active state, which requires a higher current consumption. However, unlike the limitation of the AP in entering power save mode, the GO can invoke the power-save mode once or periodically, which leads to power saving. Usually, devices that use a battery for operation tend to become a client during P2P connection, for battery-saving considerations.

The lifetime of the GO, and P2P in general, is until one of the peers terminates the connection. When a peer initiates a disconnect, the second peer also stops operation of the P2P device.

2.4 P2P Commands

The following section details the basic p2p commands for discovery, connection, peer management, authorization, and miscellaneous commands. The subsections also indicate the P2P command details and events generated using the execution of the commands.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值