## 4 System Design and Goals
### Modification to Message Intervals and New Message Variables
#### 4.4.5 DRI Function
```
Begin:Require: NodeStatus > NS1  Ensure: Appropriate NodeStatus & % Two-hop Nodes \(NS_{h}\leftarrow\) the highest node's status \(NS_{i}\leftarrow\) the lowest node's status \(NS_{c}\) (i) \(\leftarrow\) the present status of node \(i\) \(WL_{i}\leftarrow\) willingness of node \(i\)  Obtain NS\({}_{c}\) (i) \(IN_{S_{i}}\) (i) \(IN_{L}\) = WILL \(NEVER\rightarrow\) //Bad  Else if NS\({}_{c}\) (i) = 2 \(WL_{i}\) = WILL LOW \(\rightarrow\) //Good  Else if NS\({}_{c}\) (i) = 3 \(WL_{i}\) = WILL DEFAULT \(\rightarrow\) //Better  Else \(WL_{i}\) = WILL HIGH \(\rightarrow\) //Best  End if Return Willingness level
```

**Algorithm 6**MPR Wilingness Process

## 5 Network Model

### Mobility Scenario

A node's mobility in a D2D communication network can be modeled based on two primary parameters: speed and pause time. Mobility in any wireless network setting leads to alterations in topology, heightened routing overhead, and increased link failure rates. The most used mobility model for evaluating wireless networks is the random waypoint (RWP) model, as it is easy to implement in simulation environments and widely used by researchers. Mobile nodes select a destination randomly and move at a speed ranging from zero to the maximum speed in meters per second towards the chosen destination. They then pause for a particular duration before continuing the same process. Before initiating our simulation, nodes' lowest and highest speeds were defined to simulate real-world scenarios. The zero mobility metric is used to deploy nodes in static scenarios, while different mobility speeds of nodes are considered for non-static scenarios. Our proposed routing technique considered both scenarios in the simulation. The mobility speeds considered are as follows: 0-1 m/s, 2-3 m/s, 4-5 m/s, and 6-10 m/s [48]. ### Battery Model

Battery energy models provide current and voltage to the components of wireless devices, including Radio Interfaces (RI), Central Processing Units (CPUs), and Memory Sets (MS). In addition, these models are used to predict and analyze the remaining battery capacity of nodes. The overall energy consumption per cycle is presented below:\[\text{Cycle}_{\text{E}}=\text{TX}_{\text{E}}+\text{CPU}_{\text{E}}+\text{DC}_{ \text{E}}+\text{BAT}_{\text{E}} \tag{1}\]

In our proposed routing scheme, a linear battery energy model is configured in each node for the estimation of residual battery energy using (1), where TXE, CPUE, DCE, and BATE represent the energy consumed by the transceiver, central processing unit, DC converter, and battery energy efficiency loss, respectively. To account for various nodes' statuses, namely best, better, good, and bad, which return as a single value of 1, 2, 3, and 4, respectively, in OLSRv2 Hello and Topology Control (TC) messages, we configured different battery lives for nodes, as presented in Table 1.

### Energy Consumption Model

The D2D communication networks evaluated in this paper were modeled by a graph G (V, E), comprising two sets: V (nodes) and E (arcs). The arcs depict the wireless radio range between sets of wireless devices. When nodes A1 and A2 \(\in\) V are neighboring nodes with symmetric connections with each other, then direct communication is possible. However, suppose the connection between the nodes is asymmetric or the nodes are not within the range of each other due to mobility, for example, then in that case, intermediate nodes are employed for communication using routing protocols. The network is formed through the independent broadcast of Hello and TC messages by nodes in the NS-3 simulator, as shown in Figure 13.