# Enhancing QoS in Opportunistic Networks Through Direct Communication for Dynamic Routing Challenges
## 4 Simulation Environment and Results
### Simulation Results  
Figure 3 illustrates the number of delivered messages in comparison to the threshold values computed by the utility function. At lower threshold values, such as 0.2 to 0.3, fewer messages are delivered. This lower delivery rate can be attributed to the node's instability and its perpendicular distance from the SD line. Additionally, a low prediction capability of the Markov process may contribute to the reduced performance in message delivery. As the threshold values increase from 0.3 to 0.7, the number of delivered messages also rises. This improvement can be attributed to the increased stability of the node, enhanced predictive performance for determining the next-hop location, and the node's proximity to the SD line. Consequently, higher threshold values result in a greater number of delivered messages, as shown in Figure 3.  
It is also important to note that the trends observed in Figures 3-8 result from the utility function described in Equation (1) and its integration with line-of-sight (LoS) communication. The utility function, as presented in Equation (1), is formulated based on several factors, including the node's mobility pattern, stability, direction, and its distance from the source-to-destination path. These parameters collectively influence the selectionof the most suitable next-hop node for data forwarding. The simulation results--evaluated against various threshold values, node counts, message sizes, and mobility models--are directly correlated with key performance indicators such as delivery ratio, number of dead nodes, and average residual energy of the nodes in the network. Figure 4 shows the performance of the proposed methodology in terms of the overhead ratio compared to the threshold. Initially, the overhead ratio increases for threshold values ranging from 0.2 to 0.33 and then decreases until reaching a threshold value of 0.6. The increase in overhead ratio can be attributed to the lower number of delivered messages, which necessitates higher retransmissions of message packets. However, as the threshold  
Figure 4: Overhead ratio under varying threshold values using the proposed model. Figure 3: Number of delivered messages under varying threshold values using proposed model. values increase, the number of delivered messages also rises, ultimately leading to a reduction in message retransmissions and, consequently, a lower overhead ratio. Existing routing protocols in DTNs aim to identify the next suitable node for message forwarding until the message ultimately reaches its destination. Nodes in the network buffer receive data and expend energy during the process of discovering the next hop. However, this discovery process can lead to energy depletion in some nodes--particularly in battery-powered IoT devices--causing them to shut down and become non-functional, or 'dead' nodes. This situation underscores the critical importance of considering the energy status of each node in routing decisions to prevent premature node failure. The proposed routing schemes specifically address this concern by incorporating energy-awareness into the decision-making process. Furthermore, when the next-hop discovery process surpasses predefined thresholds, the proposed schemes explore alternative solutions, such as utilizing LoS communication, to ensure reliable message delivery while preserving node functionality. The number of dead nodes for the proposed scheme (blue-colored solid line), HBRP (red-colored solid line), and AEProplet (black-colored solid line) is shown in Figure 5. Due to the incorporation of LoS communication in the proposed scheme, the number of dead nodes is less than in the existing algorithms, such as HBRP and AEProplet. In existing routing protocols the dead nodes are due to only considering D2D communication and finding the next hop caused by the algorithmic process. The long waiting time in selecting the next hop results in higher energy consumption of the node. In this way, the proposed scheme saves several nodes from experiencing the dead condition.