16

What is the main difference between the WiFi aware and WiFi P2P technologies?

Using WiFi P2P you can establish a connection between two or more nearby devices without the need of common network. But the android docs spec also that

Wi-Fi Aware capabilities enable devices running Android 8.0 (API level 26) and higher to discover and connect directly to each other without any other type of connectivity between them.

What is the difference between them?

Themelis
  • 4,048
  • 2
  • 21
  • 45
  • Based on the android docs, with wifi aware, you can send data (lightweight only! max of 255 bytes) between the devices *during service discovery phase*. Unlike in wifi p2p, you have to perform some kind of auth (pbc, passkey, etc.) first and then open a socket before you can send data between the devices. – bmdelacruz Oct 14 '18 at 08:39
  • @bmdelacruz maybe post this an an answer? – CybeX Dec 21 '18 at 14:46
  • Well for starters is it the correct answer? And why the author commented instead of answering? @bmdelacruz – Themelis Dec 21 '18 at 14:58

3 Answers3

11

Based on the Android docs, with Wi-Fi Aware, you can send data (lightweight only! max of 255 bytes) between the devices during service discovery phase and when needed, you may open a connection between the devices to send larger data. With Wi-Fi peer-to-peer, you have to perform some kind of authentication first and then open a socket before you can send data between the devices.

Here are the portions of the Wi-Fi aware overview where I got these information:

The Wi-Fi Aware APIs let apps perform the following operations:

  • Discover other devices: [...] After the subscriber discovers a publisher, the subscriber can either send a short message or establish a network connection with the discovered device.
  • Create a network connection: After two devices have discovered each other [...] they can create a bi-directional Wi-Fi Aware network connection without an access point.

Note: Messages are generally used for lightweight messaging, as they might not be delivered (or be delivered out-of-order or more than once) and are limited to about 255 bytes in length.

Additionally, with Wi-Fi Aware, developers have a choice between the methods createNetworkSpecifierOpen() and createNetworkSpecifierPassphrase() of the DiscoverySession class to open unencrypted or encrypted connections, respectively, between the devices.

With Wi-Fi peer to peer, developers have no other choices other than the WifiP2PManager.connect() method. Calling it will trigger a dialog box (Push Button Configuration) on the device being connected to and that dialog box will only appear when two devices connects to each other for the first time.

By the way... modifying the WpsInfo of a WifiP2pConfig is useless; it will always use the Push Button Configuration option. I tested it on the devices I have (Asus ZC520TL-Nougat, Asus ZE551ML-Marshmallow, Huawei Y5-Marshmallow, and Huawei T1-KitKat). The PBC dialog appeared even if the wifip2pconfig.wps.setup is not equal to WpsInfo.PBC. Feel free correct me if this isn't true for all devices because it might just be an OEM thing.

For more information visit Wi-Fi peer-to-peer overview.

bmdelacruz
  • 2,366
  • 1
  • 19
  • 26
  • 1
    There are few ways to work around P2P connection limitations - for example by using P2P DNS-SD to advertise the PSK, to create the equivalent of an 'open' network. – Costin Manolache Dec 23 '18 at 06:39
  • Where do you got the info that "modifying the WpsInfo of a WifiP2pConfig is useless; it will always use the Push Button Configuration option"? – xuiqzy Feb 15 '20 at 20:13
  • I tested it on the devices i have (asus w nougat, asus w marshmallow, huawei w marshmallow, and a huawei w lollipop). The PBC dialog appeared even if the `wifip2pconfig.wps.setup` is not equal to `WpsInfo.PBC`. Feel free correct me if it isn't true for all devices because it might just be an OEM thing. – bmdelacruz Feb 15 '20 at 20:36
  • So what would be the allowed frequency of sending up to 255 bytes without any connection? – Sazzad Hissain Khan Jun 01 '22 at 18:45
5

WiFi Aware is significantly faster at establishing a connection.

The discovery stage is much more flexible: you can add your own information (255 bytes) to your service announcements and exchange short messages (255 bytes) with other peers without needing to establish a connection.

However, all the connections in WiFi Aware are one-to-one. A device can only have a very limited number of simultaneous connections (two, in the case of the Pixel 2).

For comparison, WiFi P2P works more similarly to an automatic Hotspot: the devices negotiate among themselves which of them will create a WiFi network, and afterwards other devices can join in. If you manage to get the WiFi SSID/password, it is possible to join the network manually.

My understanding is that WiFi P2P has worse performance in terms of battery (at least in the case of the central node).

Felipe Erias
  • 86
  • 1
  • 3
  • Is the faster connection meant to be the discovery or is a real connection for transferring data established faster than with WiFi Direct (P2P)? If yes, do you know why? – xuiqzy Feb 15 '20 at 20:16
4

From https://www.wi-fi.org/knowledge-center/faq/what-is-the-relationship-between-wi-fi-aware-and-wi-fi-direct:

Wi-Fi Aware is a similar peer-to-peer connectivity technology to Wi-Fi Direct. However, while Wi-Fi Direct requires a centralized coordinator, called a Group Owner, Wi-Fi Aware creates decentralized, dynamic peer-to-peer connections. Many applications, such as Miracast and direct printer connections, work well with Wi-Fi Direct. Wi-Fi Aware is positioned to provide peer-to-peer connectivity in highly mobile environments, where devices join or leave in a less deterministic manner. Whether it's professionals at a crowded conference to find each other or strangers on a subway momentarily joining a multi-player game, Wi-Fi Aware connections seamlessly adapt to changing environment and usage conditions.

Yong
  • 1,529
  • 12
  • 21