## 2 DARP Overview
This algorithm uses three configuration parameters: \(\mathrm{TH}_{\mathrm{baselevel}}\), \(\mathrm{TH}_{\mathrm{role}}\) and \(\mathrm{L}_{\mathrm{request}}\), which greatly characterize the performance of the algorithm. In addition to these parameters, the LQI itself is another key parameter, because it is the representation of the link between a VC and a certain node, and it is vulnerable to interferences in frequency and time domain. In order to avoid these effects, it is possible to apply different methods, e.g., sampling the LQI during a certain time frame, minimizing short-scale effects. Other possibility that does not impact the convergence time is the use of different MAC layers, like the improved MAC proposed by [PERSON] et al. (2016), where they proposed a MCR-SS-CSMA/CA alternative for reducing interferences. Another possibility in this context is the contribution of [PERSON] et al. (2017), where they developed a method for reducing the interferences in hostile industrial environments, which could be also applied in other environments. Once a node receives an association response message from the cluster-head (VC), it sets the \(\mathrm{T}_{\mathrm{link}}\) timer. After expiring, DRSP is executed, by analyzing the different responses from all the VCs in range that have answered with an association response. If the LQI of the answer was beyond \(\mathrm{TH}_{\mathrm{baselevel}}\), the VC is discarded as candidate. Otherwise, the VC becomes a candidate that can be picked up by  
Figure 4: DARP state machine. Figure 3: DARP basic network overview. DRSP_, which is going to look for the response with the best LQI. Upon the best response is selected, then it is compared with TH\({}_{\text{role}}\) and it checks if the number of collected requests exceeds L\({}_{\text{request}}\), thus the node configures itself as VC. If the collected requests do not exceed L\({}_{\text{request}}\), the node compares the best LQI with TH\({}_{\text{role}}\) and if it is higher than this threshold, it configures itself as EN; otherwise it configures itself as VC. If a certain node cannot find a valid cluster-head to connect with it, it sets T\({}_{\text{reconnect}}\) and waits until it expires, to resend another association request. In addition to DRSP, DARAL includes additional parameters to control the density and number of nodes per cluster, e.g., L\({}_{\text{nodes}}\), which is used to decide whether a VC answers with an association request allowing a new node connect the virtual-network or not. Once the node is connected, DARAL sets on different timers, T\({}_{\text{down}}\) is used when a node does not answer to a message, thus, this finishes in its drop from the virtual-network. T\({}_{\text{ack}}\) controls the time frame within a node can answer to a message acknowledging the reception. The configuration parameters and their functions are depicted below:  
* TH\({}_{\text{baselevel}}\): The base level threshold represents the minimum LQI that a link between two nodes can have. If the link is not above this threshold, the connection is discarded. * TH\({}_{\text{role}}\): The role in the network is based on the role threshold. If LQI is above TH\({}_{\text{role}}\), a node connects as EN, otherwise as VC. * L\({}_{\text{nodes}}\): The maximum number of nodes in a virtual network is set by the node limit parameter, balancing the load between different virtual networks. * L\({}_{\text{request}}\): The request limit is a parameter that sets the number of association requests that a certain node can hear before setting its own role to cluster-head. Before the node is connected and DRSP launched, the node can hear different messages from its neighbors. If the association request exceeds this parameter, when DRSP is fired, the node configures itself as cluster-head. * T\({}_{\text{link}}\): The awaiting time for receiving more responses from different VCs is defined by the timer for link evaluation. After expiring the timer, the connection process begins.