# mDARAL: A Multi-Radio Version for the DARAL Routing Algorithm
## 4 Simulation Testbed  
The present section describes the simulation environment used for the performance analysis of _mDARAL_, considering different scenarios and conditions. In order to simulate _mDARAL_, a widely used simulator like _OMNeT++_[30] has been used. _OMNeT++_ is an event simulator, which is not specifically focused on WSN. Therefore, the well-known communication framework inetmanet [31] has been used. In order to use inetmanet properly, it has been necessary to modify the physical layer, notification board and battery modules, allowing the use of a second radio in the same module. These changes allow the detection of the radio status (sending, receiving, sleeping, disconnected) for each module. Figure 4: Message flow for channel migration. (**a**) normal flow; (**b**) flow with errors. The changes do not provide any special functionality, but they are necessary to operate the simulation model successfully. It is also necessary to remark that _OMNeT++_ does not provide an efficient utility to simulate multi-channel energy detection and the cost of doing it manually dramatically impacts the performance of the simulator. Due to this issue, this work has fired the channel migration through a timer, and it has selected the channel to migrate randomly from a set of channels, which has covered the 15 channels of _IEEE 802.15.4_, excluding the CC and the current LC. _mDARAL_ is publicly available in [24]. Based on [1], a Smart City scenario proposal has been developed for the simulations carried out in the present work. The nodes for this Smart City scenario have been randomly distributed. The communication band chosen for these experiments has been the ISM 2.4 GHz from the _IEEE802154 RadioModel_ of inetmanet, using its beaconless mode. Due to the multi-radio nature of this study and to the single-radio model implementation available in inetmanet and _OMNeT++_, it has been necessary to create a new multi-radio version of the radio and the _Medium Access Control (MAC)_ sub-modules under the NIC (Network Interface Card) module. * NIC Module: This module contains all the layers related to the _IEEE 802.15.4_, MAC and PHY (Physical) layers, and a queue module, which manages the packets received from upper layers. Now, the NIC module contains two of each sub-modules and an additional sub-module to evaluate and assign the packets from the upper layer to a certain radio, as it is shown in Figure 5b. * MAC Module: In order to allow tasks like channel change, connection and disconnection required by the new protocol, the MAC module has been modified to receive requests from upper layers. This change allows the sending of _IEEE 802.15.4_ primitives to change the channel or the radio state. Thus, as the current MAC module in the inetmanet does not include all the _IEEE 802.15.4_ primitives, it has been necessary to include them. Figure 5: (a) single-radio NIC module; (b) multi-radio NIC module. Additionally to the changes in these modules, some noise generator nodes have been added. These nodes generate noise in the form of messages in order to increase the traffic in the channels. The nodes are not recognised by any VC in the network, so they are not connected to the network focus of our study. From these nodes, 50% are fixed in their positions and the other 50% are mobile nodes, which change their positions every 30 s at a fixed speed of 1 m/s. Several experiments were carried out using the recommended configuration suggested in [5]. For simulation purposes, a timer (\(channel\,AliveTime\)) has been used, which defines the time channel migration for a sub-network, firing the channel migration process, and a parameter defining the number of nodes generating noise (numNoisyNodes), as a percentage of the number of total nodes present in the network. All the parameters related to the simulations are shown in Table 1 jointly with their values. Appendix A describes in detail the new parameters and messages of \(mDARAL\).