## 3 A Routing Protocol Based on Energy and Link Quality (REL)
### Link Quality Estimation  
Links in WSN communications are typically unreliable, as they often experience fluctuations in quality and weak connectivity. The unreliability of the link is partly due to the use of low-power radios, which have been shown to be very sensitive to noise, interference, and multipath distortion [28]. In this context, the efficiency of the route selection scheme of a routing protocol depends on the accuracy of the LQE (Link Quality Estimator) to increase the protocol reliability [29]. As mentioned earlier, the link quality is usually measured as a single value, such as RSSI or LQI. However, a single LQE value only represents a snapshot at a specific point in time and does not supply any additional information about the remaining energy, hop count and end-to-end link quality. The route discovery process must rely on the LQE by means of cross-layer information. In this scenario, nodes must be able to perceive the network conditions, estimate the end-to-end link quality, and have some knowledge of the remaining energy of their neighbors node. They also estimate the number of hops required for each possible path, before they can reach the destination node. Following this approach, nodes must dynamically plan and adapt the routing selection process and perform appropriate decisions for assuring QoS and energy-efficiency for IoT applications. When analyzing a single link, REL relies on LQI, which is a metric provided by the physical layer of the IEEE 802.15.4 standard. LQI ranges from 0 (worst) to 255 (best) and is calculated on the basis of RSSI, SNR (Signal-Noise-Ratio) or a combination of both metrics. [PERSON] _et al_. [11] show the importance of LQI, and how it can improve the reliability of a single-hop link, where it compares the use of RSSI and LQI. As result, it study found that LQI outperforms RSSI when a correlation is made between the LDR (Link Delivery Ratio) and PER (Packet Error Rate) results [11]. However, LQI provides a value for the neighboring nodes link quality (not end-to-end). Thus, to increase the reliability of the route discovery process, we need novel techniques to evaluate and collect information about the end-to-end link quality without increasing the signaling overhead. Figure 1 shows the importance of route selection based on cross-layer information and the role of _Weaklinks_ in the end-to-end link quality estimation. In Figure 1, the numbers close to the edges represent the LQI values and nodes S and D are the source and destination nodes, respectively. REL proposes the use of _WeakLinks_, which is a counter for the worst links along a path. In specific terms, if the LQI for a given link is less than _LQI\({}_{th}\)_ (LQI threshold), the link is considered weak and the _WeakLinks_ counter is incremented. The _WeakLinks_ is incorporated into the RREQ and RREP messages, and then updated at each hop during the route discovery process. Upon receiving a RREQ or RREP message, a node updates its LQI value. Following this, it must calculate whether the LQI is lower than _LQI\({}_{th}\)_, and update the _WeakLinks_ if necessary. Figure 1: End-to-end link quality estimation. Let us assume \(LQI_{th}\) = 170, and according to Figure 1 the route selection process that chooses the path with the lowest number of hops, will select node C as the next hop. However, this node has a lower link quality, which will cause packet losses. On the other hand, a route selection that only uses link quality for the next hop, will select node A as the next hop. However, there are bad links along the remaining path, which can also cause packet loss and uneven usage of scarce network resources. Finally, when the _WeakLinks_ metric is analyzed, it can be seen that node A has _WeakLinks_ = 2, node C has _WeakLinks_ = 2 and node E has _WeakLinks_ = 0. Thus, when the links are analyzed and selected from the perspective of end-to-end link quality, the most reliable path is through node E. This route is able to provide higher reliability for data delivery.