Thursday 25 July 2013

Part 2: P2P states

Run wpa_supplicant and wpa_cli in STA1 in another terminal.Similarly run wpa_supplicant and wpa_cli in STA2 also. (please refer to this link )

To discover other P2P devices, use p2p_find command.


Now, state machine enters scan and find phase. (find phase alternates between listen and search state.)




Scan phase

In scan phase all supported channels are scanned. It can either be an active scan or a passive scan. It sends probe requests in channel 1 to 11 or listens to beacon from channel 1 to 11.


Find phase:

1. Listen state

A P2P device that is not in a P2P group may use listen state to become discoverable.

  • In listen state P2P device dwells on listen channel (configured in p2p.conf => p2p_listen_channel=1 to configure listen channel as 1) for at least a contiguous period of 500ms every 5 seconds.
  •  Listens for probe requests and shall only respond to probe requests that contain P2P IE.
  • If probe request contains WPS IE with device type attribute, it  shall only respond if device type is same as it's primary and secondary device type.
Duration of each listen state shall be a random number 'T' such that,
Max discoverable Interval value > T > Min discoverable Interval value

Following is a P2P IE in probe request frame:


Group Limit field is 0 indicates that additional P2P connections are supported.
1 indicates that no further connections are allowed.

WPS IE in the same probe request:


2. Search State:

Alternates between channels 1,6 and 11. Sends probe request in one channel and listens for probe response from the same channel.

Find state is a combination of listen and search states.






4 comments:

  1. Hi Ramapriya,
    thanks for the informative blog. Could you please introduce the software you use to grab the frames?
    Thanks!

    Qiuye

    ReplyDelete
    Replies
    1. These frames are captured using wireshark

      Delete
  2. Thanks Ramapriya. I am wondering, if there is a way to set Miracast to work only at 5GHz? If yes, how can I configure it? Thanks!

    ReplyDelete
    Replies
    1. In wiFi settings, you can choose wiFi frequency band to 5GHz to set Miracast to use only that frequency.

      Delete