# Enhancing QoS in Opportunistic Networks Through Direct Communication for Dynamic Routing Challenges
## 3 Proposed Methodology
\[U_{i}=\sum_{k=1}^{3}\omega(k)*v_{i}(k) \tag{1}\]  
The closer a neighborhood node is to the SDL, the less distance will be required to forward a data packet to the destination. A utility function \(U_{i}\) can be computed using Equation (1), in which \(\omega_{k}\) comprises a vector containing the node characteristics, defined as \([\psi,\theta,\delta]\), and \(v\) shows the \(i\)th vehicle with \(k\)th parameter \(\omega\). After calculating \(U_{i}\), a threshold \(T\) is utilized to select the neighbor as the next-hop node. The main problem with both algorithms, i.e., HBRP and AEProplet, is that they are always in the process of finding the optimal neighbor as the next hop to forward the data to the destination and overlook the potential of direct communication in case the selection of the neighbor node takes a longer time. This study suggests direct communication between the source and destination if the aforementioned protocols are stuck in the problem of finding the optimal neighbor node as the next hop. When the next-hop selection time reaches a certain limit, then the node  
Figure 1: Illustration of nodes, line of sight (LoS), predicted position, and distance/angular calculations for routing decision. should employ direct communication, and if the source node finds the optimal neighbor node before exceeding the threshold for next-hop selection time, then it should perform the node-to-node communication as per routine. The proposed methodology is presented in Figure 2. In Figure 2, the network and assumptions of the routing protocols are initialized at the start. After that, the next hop is selected using a predefined utility matrix, such as the HBRP algorithm, or following predefined AEProplet algorithm steps to forward the data to the destination. However, these algorithms get activated after finding a suitable next hop. Since these algorithms fully rely on device-to-device (D2D) communication, there is the possibility of getting stuck waiting for the selection of the suitable next hop. Due to such hindrance, significant degradation in the average energy and overhead ratio can be observed, along with an increase in dead nodes. To tackle such hindrances, we proposed utilizing LoS communication. It is also important to note that if the next hop is selected before the threshold limit, then the existing routing protocols are utilized and no LoS communication is utilized. The purpose of LoS communication is to avoid long delays when existing protocols stall. The rationale for selecting the HBRP and AEProplet algorithms as baseline protocols lies in their representative characteristics, namely their reliance on history-based and context-aware mechanisms. Both schemes forward content or data to the next node using either historical knowledge or various contextual features. These protocols relay data messages to the destination by selecting an appropriate neighboring node, which offers significant benefits for delay-tolerant applications. However, they also present a critical limitation: the risk of becoming stuck when no suitable next-hop neighbor is readily available, leading to excessive time consumption during the forwarding process. This issue could potentially be mitigated if nodes have the ability to communicate directly using a line-of-sight (LoS) connection. The proposed scheme is designed to enable meaningful comparisons by evaluating the impact of LoS-based enhancements under realistic mobility scenarios, in contrast to the existing protocols. Figure 2: Flowchart of proposed hybrid routing model with LoS fallback mechanism.