# A Novel RPL Algorithm Based on Chaotic Genetic Algorithm
## 3 RPL-Cga
### Routing Metrics Considered in RPL-CGA  
This paper proposes five representative routing metrics to be used to create a composition metric which will be used in RPL-CGA. Suppose that the node \(c\) has \(n\) candidate parents.  
(1) Queue length (QL)  
QL is the packet queue length of nodes. As shown in Equation (1), \(QL_{\text{max}}\) represents the maximum queue length of all candidate parents. \(QL(i)\) (\(i=1,2,\cdots,n\)) is the packet queue length in the buffer of candidate parent \(i\). It is more inclined to choose the candidate parent (neighbor) with the lowest packet queue length as the preferred parent. Therefore, QL can be used to balance the network load and select the optimum preferred parent (the next hop).  
\[g_{1}(i)=\frac{QL(i)}{QL_{\text{max}}} \tag{1}\]  
(2) End-to-End delay (EED)  
EED is the summation of all link delay. As shown in Equation (2), \(EED_{\text{max}}\) represents the maximum EED of the path from this node via a candidate parent to root. Let \(EED(i)\) (\(i=1,2,\cdots,n\)) indicates the end-to-end delay of one route from a node via its candidate parent \(i\) to root. Here, \(EED(i)\) includes the following two sections: (a) the end-to-end delay of the link between node and its candidate parent \(i\); (b) the end-to-end delay in DIO broadcast by candidate parent \(i\). In addition, if node via candidate parent \(e\) has the minimum \(EED(e)\) among all candidate parents, then \(e\) will be chosen as the preferred parent.  
\[g_{2}(i)=\frac{EED(i)}{EED_{\max}} \tag{2}\]  
(3) Residual energy ratio (RER)  
As shown in Equation (3), \(g_{3}(i)\) (\(i=1,2,\cdots,n\)) represents the residual energy ratio of a candidate parent \(i\). \(E_{initial}(i)\) and \(E_{current}(i)\) represent the maximum initial energy and the current energy of candidate parent \(i\) respectively. Therefore, it is more inclined to choose the candidate parent (neighbor) with the maximum residual energy as the preferred parent to prolong the network lifetime. Although the remaining energy is a concave metric, some transformations of remaining energy are done to make the derived metric (\(g_{3}(i)\) (\(i=1,2,\cdots,n\))) coincide with other metrics in metric range, operator, order relation, isotonicity, monotonicity etc.  
\[g_{3}(i)=1-\frac{E_{current}(i)}{E_{initial}(i)} \tag{4}\]  
Hop number count (HC)  
Hop count is the number of hops between candidate parent and root. As shown in Equation (4), \(HC_{max}\) represents the maximum hop count between a candidate parents and root. \(HC(i)\) (\(i=1,2,\ldots,n\)) represents the number of hops between candidate parent \(i\) and root. In addition, if the candidate parent \(f\) has the minimum \(HC(f)\) among all candidate parents, then \(f\) will be chosen as the preferred parent.  
\[g_{4}(i)=\frac{HC(i)}{HC_{\max}} \tag{5}\]  
ETX (Expected Number of Retransmissions, ETX) represents the expected number of transmissions or retransmissions needed to successfully transmit and acknowledge one packet on the link. As shown in Equation (5), \(ETX_{max}\) represents the maximum ETX of the path from this node through a candidate parent to root. \(ETX(i)\) (\(i=1,2,\cdots,n\)) indicates the ETX from one node via candidate parent \(i\) to root. Here, \(ETX(i)\) includes the following two sections: (a) the ETX of the link between node and its candidate parent \(i\); (b) the ETX in DIO (the DIO message is broadcast by candidate parent \(i\)). In addition, if node via candidate parent \(l\) to root has the smallest \(ETX(l)\) among all candidate parents, then \(l\) will be chosen as the preferred parent.  
\[g_{5}(i)=\frac{ETX(i)}{ETX_{\max}} \tag{6}\]  
In general, every routing metric has a significant impact on routing decisions. Hence, for the sake of choosing the best routes, RPL-CGA should assess all the above proposed routing metrics. Furthermore, the abovementioned five representative routing metrics can easily be proven to be isotonicity and monotonicity. Therefore, all of them are suitable candidate routing metrics to create a composition metric.