# Opportunistic Network Algorithms for Internet Traffic Offloading in Music Festival Scenarios
## 5 Evaluation
### Test Data
#### 5.2.2 Wi-Fi Direct Trace  
The Wi-Fi Direct trace was designed taking into consideration the protocol's transfer speed, its radius in a dense crowd environment, and a 7-client limit per mobile access point for Android phones. It implements the following constraints, which will be later motivated by a Wi-Fi Direct analysis:  
* Only nodes moving away from their community will play the role of access point (AP) or group owner (GO);
* Once a node is reunited with its community, it stops being an AP;
* to preserve their battery, AP nodes will alternate between being on and off for intervals of 5 min;
* A node can connect to an AP for 1 min;
* A node cannot connect to the same AP twice in a row;
* The rest of the nodes also exchange data via Bluetooth. In a real-life scenario, a node could detect that it is moving away from its community by employing the following logic: among its Bluetooth peers, the number of friends is less than a certain threshold. As a node moves further away, its friends will no longer be within  
Figure 5: Contact duration distribution for the Bluetooth trace. Figure 6: Node behavior example. reach. This will trigger the node to switch from Bluetooth to Wi-Fi Direct and become an AP for the other nodes. We have chosen to emulate this behavior due to the limited area of the simulation. The grid in the Wi-Fi Direct trace is 30 \(\times\) 20 m\({}^{2}\), while the Wi-Fi Direct radius has been set at a maximum of 30 m. Hence, an AP node will cover the entire space. If we were to allow all the nodes to form Wi-Fi Direct groups in such a restricted area, our results would not be relevant. The end goal was to see what happens in a less interconnected environment. The Wi-Fi Direct architecture, built upon the infrastructure mode defined by the IEEE 802.11 standard, specifies two roles: a P2P group owner (similar to the role of an AP in a classic infrastructure) and a P2P client, which can act as a legacy station and become a client to an AP/GO, while simultaneously playing the role of a GO. The terms AP and GO will be used interchangeably, as they both refer to the same concept. P2P groups can be regarded as Wi-Fi infrastructure networks. The standard way of establishing a group is comprised of multiple stages:  
* The P2P devices perform a classic Wi-Fi scan, which may lead to discovering other Wi-Fi networks and P2P groups;
* A process called device discovery happens afterward; the devices alternate between two states for randomly distributed periods: search state and listen state; during the search state, a device sends probe requests on channels 1, 6, and 11 in the 2.4 Ghz frequency band; in the listen state, a device will listen for probe requests and then send probe responses;
* GO negotiation will be initiated after two devices have discovered each other; the GO will be elected as a result of a three-way handshake, after which the devices will exchange their GO intent values. Should all the nodes be Wi-Fi Direct-enabled, they would perform the device discovery process, negotiate group ownership and form a highly interconnected network, a scenario we would like to avoid. Consequently, we propose that a moving node can create a P2P group by sending beacon frames on an individual channel, making its network discoverable by other devices. Legacy clients who perform a Wi-Fi scan can connect to a P2P GO, provided that they implement the required security mechanisms. This way, legacy devices see the P2P group owner as a traditional AP [26]. Both Bluetooth and Wi-Fi Direct traces had the same input parameters shown in Table 2. The output parameters for the Wi-Fi Direct trace, taking into consideration the transfer speed, are presented in Table 4.  
Figure 7, which shows the contact duration distribution for the Wi-Fi Direct trace, displays a trend very similar to the one in Figure 5, the only exception being that there are more long contacts than short-lived contacts. This observation can be explained by the behavior of AP nodes, which aim to preserve battery life.