# A Secure Opportunistic Network with Efficient Routing for Enhanced Efficiency and Sustainability
## 7 Performance Evaluation
### Simulation Results
#### 7.2.2 Layer 2 Simulation Results  
1. **Varying the number of messages:** increase the number of messages from 1462 to 6146 to 17,191.  
In this scenario, the behavior of the routing protocols under heavy load is studied: 17,191 messages each with size between 500 KB and 1 MB. Figure 10 shows that increasing the number of messages in the network will increase the number of dropped messages in the buffer and thus decrease the delivery probability. The proposed algorithm ensures the best delivery probability, while the number of messages increases. Figure 11 shows that when the number of messages increases from 1462 to 6146, the overhead ratio decreases from 14.54 to 7.46 (case number of copies = 0). Note that the Spray and Wait algorithm has a less overhead ratio. Beyond this point, when the number of messages increases from 6146 to 17,191, the algorithm approximately maintains the same overhead and has less overhead than the Spray and Wait algorithm. Figure 12 shows that increasing the number of messages will lead to a slight increase in the latency from 6704 s (1462 messages) to 7418 s (6146 messages). However, increasing the number of messages to 17,191 will decrease the latency to 4608. The fact that increasing the number of messages leads to decreasing the latency is because increasing the number of messages will increase the number of messages dropped in the buffer. This is because the buffer has to accept new messages, and thus, the messages cannot traverse several hops without being dropped and only messages with a destination near the source will be delivered, and thus, the latency decreases.  
Figure 11: Overhead ratio with respect to the number of messages.  
Figure 12: Latency with respect to the number of messages.  
Figure 13: Delivery probability with respect to the number of users.  
Figure 16: Delivery probability with respect to the transmission speed.  
Figure 17: Overhead ratio with respect to the transmission speed.  
**Varying the buffer size:** decrease the buffer size from 20 to 10 to 5 MB.  
This scenario studies the effect of decreasing the buffer size in a situation in which the mobile device has limited memory capability. Decreasing the buffer size will decrease the number of messages carried by each node; this will consequently decrease the delivery probability. This is demonstrated in Figure 19, where the delivery probability decreases, while the buffer size decreases. However, the proposed routing algorithm maintains high delivery probability with respect to other algorithms. Figure 20 shows that the overhead decreases, while the buffer size decreases. The proposed algorithm shows acceptable overhead when compared to other algorithms. Figure 21 shows that decreasing the buffer size leads to a decrease in the delay; this is because the buffer will drop more packets when  
* **WiFi-Direct scenario:** transmission speed 5 MB/s, transmission range 30 m, and buffer size 20 MB.  
This scenario replaces the Bluetooth radio interface with a WiFi-Direct interface having the above-mentioned characteristics. As shown in Figure 26, in this scenario, the proposed algorithm gets a high delivery probability (0.959), and it is the highest among the other algorithms. Figure 27 shows that the proposed algorithm overhead ratio is low (between 26 and 30). Figure 28 shows that the proposed algorithm has the lowest latency among other algorithms (between 1477 and 1616). This scenario shows how the proposed algorithm maintains its highest delivery probability with the development of network interfaces. Notice that we obtain a significant improvement in latency.  
Figure 23: Overhead ratio with respect to the number of copies.  
Figure 24: Latency with respect to the number of copies.  
Figure 26: Delivery probability WiFi-Direct case.  
Figure 27: Overhead ratio WiFi-Direct case.