# Context-Aware Trust and Reputation Routing Protocol for Opportunistic IoT Networks
## 4 Performance Evaluation  
We have evaluated our proposed CATR routing protocol for OppiIoT using an Opportunistic Network Environment (ONE) simulator [5] and compared its performance against that of the Epidemic [6], BTRES [7], and PPHB+ [8] protocols, chosen as the benchmark, in terms of the following performance metrics:  
* Average latency: This is the amount of time a message needs to travel across the network to reach its intended destination. It is computed as the time difference between creating and delivering messages. * Message drop rate: This is the rate at which messages are lost during data transmission. The smaller the number of dropped packets, the higher the efficiency of the model. * Overhead ratio: This is the proportion of additional communication or computational resources consumed apart from the essential data transmission requirements. A routing model having less amount of overhead is considered as efficient. * Hop count average: This is the mean number of nodes the message passes through between the sender and destination nodes. A decreased hop count corresponds to an increased efficiency. * Message delivery probability: This is the probability of receiving the message accurately at the destination node. A routing model with a higher message delivery probability is considered efficient. The weights for evaluating the metrics Beta Trust Degree, Encounter Frequency, Packet Forwarding Degree, Recent Contact Degree, and Contact Durability Degree were determined through extensive simulations conducted using the ONE simulator. By systematically varying the weight values of these parameters, we optimized the configuration to achieve the best delivery probability. Four parameters are modified during our evaluations: number of nodes: {66, 96, 126, 156, 186}; time to live (TTL): {300, 350, 400, 450, 500} min; message generation interval: {5-15, 15-25, 25-35, 35-45, 45-55} s; and buffer space: {5, 10, 15, 20, 25, 20, 25} MB. Also, the general parameters used in our simulations comprise 96 mobile nodes split into 6 groups: 1 group of vehicles with 30 nodes, 3 groups of terms with 2 nodes each, and 2 groups of pedestrians with 30 nodes each. With a buffer size of 10 MB, each pedestrian node moves between 0.5 and 1.5 m per second. With a buffer capacity of 50 MB, the tram group's nodes move at a pace of 7-10 m/s. The speed of car group nodes is 2.7-13.9 m/s, each having a buffer size of 10 MB. Each node generates a message within an interval of 25 to 35 s of size 500 KB to 1 MB and 300 min TTL (time to live) for the message. The other simulation parameters are represented in Table 3.  
Based on the aforementioned performance metrics, our model's effectiveness compared to that of the chosen benchmark models, is assessed. We have tested the proposed model using the real CRAWDAD dataset Cambridge/haggle (29 May 2009) [20]. The simulation results are captured in Figures 2-11. Figure 2 shows the effects of the variations in the average latency as the number of nodes increases from 66 to 186. There is a decrease in average latency as the number of nodes rises because more and more nodes become available in the network. With an increase in the number of nodes, it is observed that CATR outperforms the Epidemic, BTRES, and PPHB+ protocols by 24%, 25%, and 13%, respectively, in terms of average latency. Figure 3 shows how an increase in TTL from 300 to 500 min affects the average latency. When a message's TTL value rises, that message can remain in the nodes' buffer for an extended period of time, lowering the message's average latency. As can be observed, in terms of the average latency on increasing the TTL, our proposed CATR protocol performs better than the Epidemic, BTRES, and PPHB+ protocols by 8%, 18%, and 6%, respectively. A node can keep the data packets for a longer period of time when the buffer size is increased from 5 MB to 25 MB, which ultimately results in an increase in latency.