# An Energy Efficient Routing Approach for Cloud-Assisted Green Industrial IoT Networks
## 5 Proposed Energy Efficient and Reliable Routing Approach
### The Routing Metrics and RAROF Design
Moreover, we have used Tmote Sky nodes using CC2420, whose Tx and Rx consume almost similar energy per unit time. Besides, to represent the quality of link (\(\omega\)), we condition the ETX metric. ETX is a reliability metric and indicates the expected number of transmissions that a node required for successful data packet delivery to the destination. Suppose \(l_{i\to j}\) is the link between two nodes \(i\) and \(j\), then \(lq(i,j)\) represents the ETX metric in a path connecting node \(v_{i}\) to node \(v_{j}\) in \(\mathbb{R}\). Therefore, the link quality metric, \(lq\), is an additive when it adds ETX of each link in the path to the destination node as follows:  
\[lq(Rp(v_{i},v_{j}))\ =\ \left\{ \begin{array}{ll}lq(v_{i},v_{i+1})+lq(v_{i+1},v_{i +2})+lq(v_{i+2},v_{i+3})+\ldots+lq(v_{i+m},v_{j})&if\ \varphi(Rp,v_{i+1})\
eq NULL\\ lq(v_{i},v_{j})&if\ \varphi(Rp,v_{i+1})\ =\ NULL\end{array} \right. \tag{6}\]  
The link quality increases as the value of \(lq\) decreases, so the metric value near one indicates the optimum communication link. Consequently, the best \(lq\) metric helps in the optimal path selection, which eventually contributes to prolonging the network lifetime. The advantage of using this metric during the RPL route selection process is to avoid links with poor communication quality. In our proposal, at each node, the \(lq\) metric is measured as in Equation (7). \[lq(v_{i})\ =\ \alpha\times lq_{old}+(1-\alpha)\times lq_{recnt} \tag{7}\]  
where \(lq_{old}\) is the prior average ETX for a node and stores this value in its routing table, \(lq_{recnt}\) is the recent measured ETX, which can be obtained as in Equation (8), and \(\alpha\) is the learning ratio such that \(0<\alpha<1\). We have set \(\alpha\ =\ 0.9\), according to the Contiki RPL for the better smoothing effect. \[lq_{recnt}\ =\ \frac{1}{d_{i\to j}\times d_{j\to i}} \tag{8}\]  
where \(d_{i\to j}\) is the probability that the data packet successfully delivered to the recipient node and \(d_{j\to i}\) is the probability that the acknowledgment is successfully received by the sender node. The other metric used in our proposal is the resource availability, \(R_{av}\), which indicates the available resource in terms of the buffer capacity availability in the node. To this end, we have mapped \(R_{av}\) with the binary parameters 0 and 1, as shown in Equation (9), which indicates either the resource in a node is available or not. \[R_{av}(v_{i})\ =\ \left\{ \begin{array}{c}1\ if\left(1-\frac{R_{av}(v_{i})}{ l_{buf}(v_{i})}\right)^{2}<\tau^{th}\\ 0\ otherwise\end{array} \right. \tag{9}\]  
where \(B_{av}\) is the available buffer space of a node and \(T_{buf}\) is the total buffer size of node \(i\). \(\tau^{th}\) is a predefined buffer threshold. For our experiment, we use a static threshold and set to 85% of the total size of the queue of a node. When the buffer utilization of a node is higher than the threshold \(\tau^{th}\), the resource availability set to zero, and the RAROF ignores such nodes during the route selection process. Now, the proposed RAROF dynamically select the routing path based on the routing metrics defined above. Like the default RPL, in this implementation, RAROF performs globally throughout the network. In the RPL scope, a node construct the routing path to the DODAG root by selecting the preferred parent from the candidate parent set. Let assume that for each node \(v_{i}\in V\ (i\ =\ 1,2,3,\ldots,n)\), \(NB(i)\subseteq V\) is the subset of all eligible neighbor nodes that can communicate with each other. Each node \(i\) maintains its neighbor table and adds a new node \(j\in NB(i)\), only if there is space in the table to store. Afterward, each node \(v_{i}\in V\) creates a candidate parent set \(Cp(v_{i})\ =\ \{p_{1},p_{2},p_{3},\ldots,p_{n}\}\) from its neighbor table, from which a node chooses its next-hop toward the DODAG root, i.e., preferred parent \(Pp(v_{i})\) and establishing the routing path to forward the data packets.