# DARAL: A Dynamic and Adaptive Routing Algorithm for Wireless Sensor Networks
## 4 Simulation  
This section presents the simulation environment and methodology used to evaluate the behaviour of \(DARAL\) in Smart City scenarios. The simulations have been performed with \(OMNeT++\)[32], a well-known C++ discrete event simulator in the research community. As OMNeT++ is not focused on wireless networks, it is necessary the use of a framework, as inetmanet [33]. \(DARAL\) was implemented for \(OMNeT++\) and it is publicly available in [34]. The network is configured following the Smart City scenario proposal taken from the literature review, using static nodes randomly distributed. As \(DARAL\) is an \(IEEE\) 802.15.4-based routing algorithm, the communication band used is the ISM band of 2.4 GHz using the beaconless mode jointly with the \(IEEE802154 RadioModel\) of inetmanet. Several experiments were carried out tuning the different parameters \(T_{link}\), \(T_{alive}\), \(T_{down}\), \(T_{reconnect}\), \(L_{nodes}\), \(TH_{\text{{{\it{\it{\it{\it{\it{\it{\it{\it{\it{\it{\it{\it{\it{\it{\it{ \it{             }}}}}}}}}}}}}}\) and \(TH_{role}\). During this tune phase, \(T_{reconnect}\) showed a strong influence in the performance of the protocol, affecting both the convergence time and the number of messages sent during the set-up phase. Due to this effect, we have chosen a low value for \(T_{reconnect}\), prioritizing a low convergence time and by extension a low energy consumption over the number of messages sent. Table 1 shows a summary of the most relevant parameters for physical, MAC and network layers jointly with their values. For a better understanding, Appendix B presents a deep explanation of each parameter of \(DARAL\).  
Considering the different possibilities in a Smart City scenario, it is necessary to define different workloads in terms of traffic. There are different possibilities for that, and all of them involve the area size and the number of nodes, so the modification of these parameters makes possible to work with different network densities using the network degree as reference. For this work, three different node degrees (ND) are considered: 5, 10 and 15. The smallest scenario is built in a \(145\times 145\) m and the largest in a \(500\times 500\) m area. The use of this wide area and node degree combinations allows the simulation from sparse networks to highly dense networks. As a result, the simulation covers several network densities and sizes, resulting in a vast results comparison. The different combinations between network size, grade and number of nodes are shown in Table 2. For each experiment configuration, 10 randomly generated scenarios with different random seeds were evaluated. Figure 11 shows a scenario overview, taking random scenarios from the simulations and showing the nodes and their radio range.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Carrier Frequency (GHz) & 2.4 \\ Carrier Sense Sensitivity (dBm) & \(-85\) \\ Transmit Power (mW) & 1.0 \\ \(T_{link}\) (s) & 1.0 \\ \(T_{alive}\) (s) & 600.0 \\ \(T_{down}\) (s) & 5.0 \\ \(T_{reconnect}\) (s) & 2.0 \\ \(T_{ack}\) (s) & 1.5 \\ \(L_{nodes}\) & 50 \\ \(TH_{\text{{{\it{\it{\it{\it{\it{\it{\it{\it{\it{\it{\it{\it{ \it{     \it{       \}}}}}}}  
In order to be able to compare our results with those of \(O\)-\(RPL\), we have used the configuration used by [PERSON] et al. in [7], setting the redundancy constant (\(K\)) to two. This value is used due to the impossibility of simulating low-density scenarios with lower values of \(K\). Thus, the use of the lower possible value is necessary due to the lack of a redundancy constant in \(AODV\) or \(DARAL\) and aiming to develop a fair comparison.