# CT-RPL: Cluster Tree Based Routing Protocol to Maximize the Lifetime of Internet of Things
## 3 Cluster Tree-Based Routing Protocol
### Cluster Head Selection  
In Game theory, a non cooperative game contains a set of players N, set of actions U to take a decision for each player, and the payoff p is a reward or penalty for each player [57]. Nash equilibrium (NE) is a decision state, when the player reaches the outcome. Each node in the cluster is treated as a set of players in the game. It has a set of actions U such as residual energy, sense, receive, aggregate, transmitting the data from one to other node, and number of times the node is selected as a CH in a cluster. Each player is not only affected by its own actions but, also, gets affected by other player's action. At the beginning of the game, the sensor nodes have the same energy. The energy consumption of the node is computed using the radio energy model. The amount of energy required to transfer \"_s_\" bits of data packets with respect to the distance \"_dis_\" is calculated, and it is given in Equation (9). \[ET_{x}(s,\textit{dis})=s\times E_{dec}+s\times ef_{s}\times dis^{2} \tag{9}\]  
where \(s\), \(dis\), \(E_{dec}\), and \(ef_{s}\) indicate the number of bits, electronic energy in the network node, distance between two nodes, and free space model, respectively. An amount of energy is required to collect the data at each node in the cluster, and it is given in Equation (10). \[ER_{x}(r)=s\times E_{elec} \tag{10}\]  
where \(E_{elec}\) is the electronic energy in the RPL router, and \(r\) is a number of bits. The amount of energy is depleted \(E_{\text{dep}}\) at each node in the cluster, and it is given by:  
\[E_{dep}=E_{sense}+E_{receive}+E_{aggregation}+E_{transmit} \tag{11}\]  
where \(E_{sense}\), \(E_{receive}\), \(E_{aggregation}\), and \(E_{transmit}\) indicate the sensing energy, receiving energy, aggregation energy, and transmission energy, respectively. The number of times a \(C\!M\) node is selected as the \(C\!H\) node in a cluster \(N_{CM_{k,l}}^{CH}\) is given in Equation (12). \[N_{CM_{k,l}}^{CH}=\frac{Number\ of\ times\ CM_{k,l}\ node\ at\ as\ CH}{Total\ number\ of\ round} \tag{12}\]  
where \(k\) and \(l\) indicate kth cluster and lth node in a cluster, and \"\(N\)\" indicates the number of times. The reward value is provided for each \(C\!M\) node on the basis of probability values, and its values are represented in Table 1.  
Each cluster contains \"\(m\)\" number of nodes. Each node calculates the payoff value \(p\big{(}CM_{k,l}\big{)}\). The \(p\big{(}CM_{i,j}\big{)}\) value is a reward or penalty of a particular node action in the game, and its calculation is given in Equation(13). \[p\big{(}CM_{k,l}\big{)}=\ R_{k,l}\times RER(CM_{k,l})-P_{k,l}\times E_{dep}(CM_ {k,l})\ +\ R\big{(}N_{CM_{k,l}}^{CH}\big{)} \tag{13}\]  
where \(R_{k,l}\) is a reward value of the \(l\)th node in a cluster \(k\), \(P_{k,l}\) is a penalty value of \(l\)th node in the cluster \(k\), \(RE(CM_{k,l})\) indicates the residual energy of the \(l\)th node in the cluster \(k\), \(E_{dep}\big{(}CM_{k,l}\big{)}\) indicates the energy depletion ratio (EDR) in the \(l\)th node in the cluster \(k\), and \(\ R\big{(}N_{CM_{k,l}}^{CH}\big{)}\) indicates the reward value for the \(C\!M\) node acting as the \(C\!H\) node in the \(l\)th node in the cluster \"\(k\)\". The reward and penalty values range between 0 and 100. The residual energy ratio (\(RER\)) and energy depletion ratio (EDR) range between 0% and 100%. The initial energy of the node value represents 255, and the dead node value is to be 0. The residual energy is calculated from the proportion between the consumed energy and initial energy. The reward and penalty values are calculated from the RER and EDR that is given in Table 2. \begin{table}
\begin{tabular}{c c} \hline \hline
**Probability Value of \(C\!M\) Node Acting as \(C\!H\) Node \(N_{CM_{k,l}}^{CH}\)** & **Reward \(R\big{(}N_{CM_{k,l}}^{CH}\big{)}\)** \\ \hline
0 & 100 \\
0.2 & 80 \\
0.4 & 60 \\
0.6 & 40 \\
0.8 & 20 \\
1 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Reward value for the cluster member (\(C\!M\)) node acting as the cluster head (\(C\!H\)) node.