# Opportunistic Network Algorithms for Internet Traffic Offloading in Music Festival Scenarios
## 4 An Opportunistic Routing Protocol for a Festival Scenario
The centerpiece idea is that we prioritize nodes with higher centrality values or nodes that have more common friends with the destination, giving them more message copies to spread on their own, whilst we give just one copy of the message to the other nodes. In other words, we combine the two versions of the spray phase of the algorithm Spray-and-Wait (SW) [4]. We perform the binary version (give away half of the copies) for nodes that are likely to spread the message over a bigger area (high-centrality nodes) or for nodes that are more socially connected to the destination (more friends in common). With regard to the rest of the nodes, they receive only one copy (as in the source version of Spray-and-Wait) and proceed to the wait phase. The wait phase implies forwarding the message only to the destination node. We have designed two different algorithms based on these observations: Social Spray-and-Wait 1 (SSW1) and Social Spray-and-Wait 2 (SSW2). The former has a more strict forwarding decision: a node gives away half of a message's copies if the encountered node has superior values for centrality or the number of common friends. This prevents a node from forwarding half of the number of copies to another node that is too similar to itself. To overcome this potential issue, a centrality threshold was introduced in SSW2. We present the two proposed solutions in Algorithms 1 and 2. ```
Node node, encounteredNode;  Message m; ifm.copies == 1 then  return false; ifnode does not contains message mthen ifnode.centrality \(>\) encounteredNode.centrality \(||\) node.commonFriends[m.dest] \(>\) encounteredNode.commonFriends[m.dest] then  encountered node keeps m.copies/2;  node receives m.copies/2; else  encountered node keeps m.copies - 1;  node receives 1 message copy;  end if return true;
```  
**Algorithm 1**SSW1 forwarding. ```
Node node, encounteredNode;  Message m; ifm.copies == 1 then  return false; ifnode does not contains message mthen  centralityDiff = abs(node.centrality - encounteredNode.centrality); ifnode.centrality \(>\) encounteredNode.centrality \(||\) node.commonFriends[m.dest] \(>\) encounteredNode.commonFriends[m.dest] then  encountered node keeps m.copies/2;  node receives m.copies/2; else ifcentralityDiff \(<\) CENTRALITY_THRESHOLD then  encountered node keeps m.copies/2;  node receives m.copies/2; else  encountered node keeps m.copies - 1;  node receives 1 message copy;  end if return true;
```  
**Algorithm 2**SSW2 forwarding. It should be noted here that, although in Section 5 we evaluate the viability of Bluetooth and Wi-Fi Direct as means of communication in a festival scenario, they have certain limitations that would need to be addressed. The main issue is that, in normal functioning and most cases, both protocols require pairing, which would not be easily done in a large scenario. Furthermore, high congestion may be caused by many devices communicating wirelessly at the same time, as shown in [23]. However, the solution we envision would also include a component that can allow a node to actively communicate on a wireless interface only at certain times, as we have shown in [24]. This would reduce the congestion and the observed node density. Furthermore, such a scenario would benefit from other orthogonal solutions, such as having edge nodes that could take some of the load, or other similar devices. This is an interesting topic and something that we intend to further pursue in the future.