# CoAR: Congestion-Aware Routing Protocol for Low Power and Lossy Networks for IoT Applications
## 4 Proposed Congestion-Aware RPL
### Congestion-Aware Objective Function (CoA-OF)  
As explained earlier, a single routing metric is not enough to achieve the application requirements; hence, the CoA-OF combines multiple routing metrics to address the congestion problem caused by unbalanced parent selection. CoA-OF uses TOPSIS which selects the best alternative based on the shortest distance from the positive ideal solution and the furthest distance from the negative ideal solution. Positive ideal solution has two criteria that are maximum benefit (for positive criteria) and minimum cost (for negative criteria), whereas negative ideal solution has a maximum cost (for positive criteria) and minimum benefit (for negative criteria). Shortly, based on the available criteria, the positive ideal solution comprises of all the best values whereas the negative ideal solution contains all the worst values. Let us consider a node has a set of \(m\) candidate parent \(P\) = {\(p_{i}\), \(i\) = 1, 2, 3,..., \(m\)} with a set of \(n\) multiple routing metrics \(R\) = {\(r_{j}\), \(j\) = 1, 2, 3,..., \(n\)} for each parent. The weight vector \(W\) = {\(w_{j}\), \(j\) = 1, 2, 3,..., \(n\)} is composed of the individual weights (importance) for each routing metrics. Then, the congestion-aware parent selection problem can be represented by an evaluation (decision) matrix consisting of \(m\) alternatives (parents) and \(n\) criteria (routing metrics). To determine the most appropriate parent, three metrics (\(ETX\), \(QU\) and \(RE\)) are considered as the parent selection criteria. In general, the criteria are classified into two types that are benefit and cost. The benefit criterion means that the higher value is better, whereas the cost criterion is the opposite. The TOPSIS process is carried out as the first steps by constructing an evaluation matrix \(M\) = \(m\)\(\times\)\(n\) as follows:  
\[M= \begin{array}{cccc}&r_{1}&r_{2}&\cdots&r_{n}\\ &p_{1}&\left(\begin{array}{cccc}z_{11}&z_{12}&\cdots&z_{1n}\\ z_{21}&z_{22}&\cdots&z_{2n}\\ \vdots&\vdots&\cdots&\vdots\\ z_{m1}&z_{m2}&\cdots&z_{mn}\end{array}\right)\\ \end{array}  \tag{6}\]  
where, \(p_{m}\) are possible \(m\) parents (alternatives) among which decision makers (node) have to choose and \(r_{n}\) represents the desired \(n\) metrics (criteria) with which alternative's performance is measured. \(z_{ij}\) is the value of \(i^{th}\) alternative with respect to \(j^{th}\) criteria, for all \(i=1\), \(2\), \(3\),..., \(m\) and \(j=1\), \(2\), \(3\),..., \(n\). For our proposal, we have (\(n=1\), \(2\), \(3\)) i.e., \(r_{1}=QUI\), \(r_{2}=ETX\) and \(r_{3}=RE\). The following remaining steps should be considered for generating the routing score among the candidate parents. **Step 1. **: Normalize the decision matrix using the transformation formula: the normalized value \(x_{ij}\) is calculated as in Equation (7). \[x_{ij}=\frac{z_{ij}}{\sqrt{\sum\limits_{j=1}^{n}\left(z_{ij}\right)^{2}}},\;j =1,2,3;\;i=1,2,\ldots,m \tag{7}\]  
Consequently, with this normalization, each criterion has the same unit scale. When the unit is varied for different routing metrics, for instance, some metric is measured in seconds, while other is measured in joule etc., the influence of some metrics may be neglected; therefore, it is necessary to normalize it, and hence, the normalized matrix \(x_{ij}\) is obtained. **Step 2. **: Calculate the weighted normalized decision matrix: the weighted normalized value is calculated as in Equation (8). \[V_{ij}=w_{j}\times x_{ij},\;j=1,2,3;\;i=1,2,\ldots,m \tag{8}\]  
where, \(w_{j}\) denotes the weight of routing metrics \(j\) for all \(j=1\), \(2\), \(3\) satisfying \(\sum_{j=1}^{3}w_{j}=1\). It is well known that the weights of criteria in decision-making problem do not have the same mean and not all of them have the same significance. Therefore, in our proposal, we use the standard deviation method [34] to obtain the weights of the criteria. This method determines the weights of metrics in terms of their standard deviations as in Equation (9).