## 4 System Design and Goals
### Modification to Message Intervals and New Message Variables
#### 4.4.5 DRI Function
However, enforcing listening periods before and between message broadcasts will reduce the frequency of usage of the radio transmitter since nodes that transmit HELLO messages and fail to receive a timely response (due to

Figure 13: Deployment of nodes in NS-3 simulator via Python visualizer. ongoing DB chores mode) will simply drop into listening mode. The reduced usage of the radio transmitter increases the energy available to the D2D nodes since transmitting consumes more energy than receiving. Therefore, using Equations (7) and (8), the new energy model that calculates the total energy consumed by nodes at a specific time is given as

\[E_{Total}=\alpha\frac{T_{1}V}{N}\sum_{i=1}^{3}P_{i}N*T_{max} \tag{9}\]

where \(i=1\), \(2\), \(3\), \(P_{3}\) is the packet transmission rate, \(V\) is the node's voltage power, \(\alpha\) is the inefficiency factor for various nodes [25], \(N\) is the number of nodes, and \(T_{1}\) is the sum of the default current [49]. The proposed message sequence is designed to decongest OLSRv2 message broadcasts and enhance information base maintenance. ### Routing Overhead Model

Routing overhead in the D2D routing protocol refers to control data, messages, or operational resources necessary for the protocol to establish, share, and maintain routes in the network [50]. It constitutes additional data traffic created by the routing protocol to establish, share, and maintain routes within a network. These overheads include periodic Hello messages to establish and maintain neighbor relationships, Multiple-Interface Declaration (MID) and Host Network Association (HNA) messages, as well as the exchange of TC messages to disseminate up-to-date information about network topology [42]. The proposed routing scheme modified the sequence of OLSRv2's HELLO, HELLO, and TC messages with a new sequence that interweaves HELLO and TC messages with three database (DB) chores and LISTEN states. This algorithm modifies the frequency of Hello and TC messages in the conventional OLSRv2, thereby changing the duration and frequency of control messages. Therefore, the new equation for a periodic control message (PCM) is given as follows:

\[\text{E}_{\text{T}}=\text{I}_{\text{T}}\text{ VT} \tag{2}\]0

where \(MP_{m}\) is the modified Periodic Message Interval, and \(F_{i}\) is the routing Control Overhead Impulse factor, and \(N\) is the number of nodes. Using Equation (10) with the modifications, the total routing overhead for the proposed routing protocol as a result of periodic control messages is given as follows:

\[PCM=\left\{ \begin{array}{ll}\frac{F_{i}N}{P_{3}MP_{m}},&Hello=5n,\ MP_{m}=10n,\ and\ TC=18n\\ 0&Otherwise\end{array} \right. \tag{11}\]

where \(n\) is the number of times the messages are repeated. The modified total routing control overhead for the nodes in a network using the proposed routing protocol is presented in the equation below:

\[CO_{r}=\ P_{h}^{l}\ (MP_{m})Np(MP_{m})+\frac{\left[\frac{U^{m}}{MP_{m}}\right]}{ \frac{U^{m}}{MP_{m}}}+\frac{F_{i}N}{P_{3}MP_{m}} \tag{12}\]

where \(UC_{t}\) is the triggered update control message, \(U^{m}\) is the update message, \(P_{m}\) is the Periodic Message Interval, \(\left[\ \right]\) is the ceiling operator, and \(P_{h}^{l}\) is the likelihood (probability) that the uplink state remains unchanged and does not switch to the downlink state during the \(h\) hops. ## 6 Simulation Setup

This section elucidates the implementation of the improved OLSRv2 in the well-known network simulator NS-3 and evaluates the performance of the proposed routing technique using the modified algorithms. In the proposed routing techniques, each node uses a number of models to configure and measure different parameters required for various tasks, such as sending, receiving, and relaying. Each model is responsible for extractingreal-time parameter values corresponding to its associated metric (e.g., energy, mobility, and node degree).