3.1.3 Initialization

When a higher layer is ready to advertise, it passes Advertisement data to the protocol, including Display Name, Peer ID, Role, and optional Metadata IE content, which all come from the application.

To establish a successful wireless connection, the higher layer MUST specify the same Peer ID value across proximate devices. If a Peer ID value is not provided, the higher layer MUST create a Peer ID. Cross-platform applications MUST encode the alternateIdentities property as defined in [MSDN-PF.AlternateIdentities] as their Peer ID value.

The application MUST specify one of the following values for the application level role:

Role

Description

Peer

Peer role applications can discover other peer role applications. However, a peer role application MUST only connect to one other peer role application at any time.

Host

Host role applications can discover client role applications. Host role applications MAY connect to multiple client role applications at the same time.

Client

Client role applications can discover host role applications. Client role applications MUST only connect to one host role application at a time.

Implementations MUST support the peer role and SHOULD support the host and client roles.<3>

A higher layer can trigger the search for proximate devices which causes Probe Requests to be sent to the devices. To reply, a device returns a Probe Response containing the advertisement IEs which SHOULD be sent by the protocol layer to the higher layer.

After a higher layer selects a proximate device, the protocol establishes a connection with that device.  At that time, the protocol MUST prepare the Connection data.

Next, the higher-layer for the device receives and accepts the incoming connection request.  As a result, the device sends its Connection data back to the initiator.

At this point, both devices have requested a connection with each other. The devices create an L2 connection by using the WFP2P pairing procedure and create a PSK (for details of the negotiation, see section 3.2.5). The devices establish an L3 connection based on the values specified in the Connection data.

After an L3 connection is established, the protocol confirms the connection using the Handshake data which is part of the AppWFDAcceptHeader (see section 2.2.1). The protocol uses the PSK to create a Session ID, which is the first 8 bytes of the PSK. The exchange is bi-directional with one side sending information as part of the AppWFDAcceptHeader (see section 2.2.1).