## 4 System Design and Goals
### Modification to Message Intervals and New Message Variables
#### 4.4.5 DRI Function
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Values** \\ \hline Operating system & Ubuntu 22.04.2 \\ \hline Simulator & NS-3 Version 3.34 \\ \hline Simulation area & 1000 \(\times\) 1000 meters \\ \hline Node deployment & Random positioning \\ \hline No. of nodes & 10, 30, 50 and 1000 \\ \hline Simulation time & 1800 s \\ \hline Mobility model & Random Waypoint \\  & Generic energy model \\ \hline \multirow{4}{*}{Energy model} & \(\text{NodeTX current}=\) 0.380 A/380 mA \\  & \(\text{NodeRX\_current}=\) 0.313 A/313 Ma \\  & \(\text{NodePIME\_current}=\) 0.273 A/273 mA \\  & \(\text{NodeSLEEP\_current}=\) 0.033/33 mA \\ \hline Battery model & Linear battery model \\ \hline Transmission range & 60m \\ \hline Mac protocol & IEEE 802.11 \\ \hline Packet size & 512 \\ \hline \multicolumn{3}{c}{**Parameters for MPR Selection [44; 48]**} \\ \hline Battery levels & (1–24\%), (25–49\%), (50–74\%), and (75–100\%) \\ Node degree & (1–14\%), (15–24\%), (25–38\%), and (39–50\%) \\ Mobility speed & Speed: 0–1 m/s, 2-3 m/s, 4-5 m/s, and 6–10 m/s \\ Connection to base station & A value of 1 if a node is connected and 0 if it is not connected \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters. D2D communication requires devices to transmit and receive data, which can drain battery life quickly. Therefore, energy consumption is a critical concern in wireless communication, particularly for battery-powered devices in D2D networks. Energy (E) = Power \(\times\) Time (T), but P = Current (I) \(\times\) Voltage (V); therefore, E = I V T. However, breaking energy into transmission, receiving, idle, and sleep energy gives

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

\[\text{E}_{\text{R}}=\text{I}_{\text{R}}\text{ VT} \tag{3}\]

\[\text{E}_{\text{D}}=\text{I}_{\text{D}}\text{ VT} \tag{4}\]

\[\text{E}_{\text{S}}=\text{I}_{\text{S}}\text{ VT} \tag{5}\]

where IT, IR, ID, and IS are transmission, received, idle and sleep current, respectively, while TI is the sum of the current in all states. Similarly, ET, ER, ED, and ES are transmission, received, idle, and sleep energy. Therefore, to compute the total energy consumed per node while transmitting, receiving, as well as in idle and sleep modes, is carried out by adding Equations (1)-(4). The energy model considered is based on the model reported by relevant studies, including [6,7]. The total current of a node is the sum of the current while receiving, transmitting, or being in idle or sleep mode, which can be expressed as follows:

\[\text{T}\_\text{I}=\text{I}\_\text{T}+\text{I}\_\text{R}+\text{I}\_\text{D}+ \text{I}\_\text{S}. \tag{6}\]

The proposed energy consumption model is obtained by introducing some modifications to the OLSRv2. These modifications minimize energy consumption in the D2D communication routing protocol. Before presenting the proposed energy model, we compute the total time spent by each node transmitting or receiving by considering the known broadcast frequency of HELLO and TC messages for the proposed model, which can be expressed as follows:

\[\text{P}_{\text{1}}=\text{T}_{\text{max}}(1/\text{NH}_{\text{f}}+1/\text{H}_{ \text{M}})+\text{TC}_{\text{m}} \tag{7}\]

\[\text{P}_{\text{2}}=\text{N}_{\text{p}}\text{T}_{\text{max}}\left(1/\text{H}_{ \text{M}}+1/\text{NH}_{\text{f}}\right)+\text{TC}_{\text{M}} \tag{8}\]

where P\({}_{\text{1}}\) is the total seconds spent transmitting data with modified algorithms, P\({}_{\text{2}}\) is the total seconds spent receiving data with modified algorithms, Np is the number of Multi-Layer Point (MPR) nodes, HM is the modified HELLO message frequency, NHf is the new HI message frequency, TCM is the modified TC message frequency, and Tmax is the total time in seconds. The proposed modification allows MPR nodes to simply extend the TTL (time to leave) of the existing TC message if no new node joins the network. OLSRv2 implementation is plagued by enormous packet loss and high processor loads due to the uncontrolled broadcasts of control messages.