# Multi-Path Data Distribution Mechanism Based on RPL for Energy Consumption and Time Delay
## 3 Adaptive Multipath Traffic Loading Based on RPL, AMTL-RPL
### Energy Balance Based on the RPL
#### 3.1.2 The Metric Definition of Energy Balance
Furthermore, we compared these measurement standards based on the RPL protocol. There were 100 nodes in the tests and each node has the same initial energy. We converted the energy into 100 units for simplification. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Measurement** & **Maximum** & **Minimum** & **Average** \\ \hline Range & 98.6920 & 96.3815 & 97.5278 \\ Average Deviation & 40.4198 & 9.3249 & 26.5953 \\ Standard Deviation & 28.7187 & 9.3249 & 28.5178 \\ ED & \(1.4985\times 10^{4}\) & \(3.9625\times 10^{3}\) & \(8.6994\times 10^{4}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of several discrete degree metrics. Figure 4: Distribution of values. According to the RPL protocol, the preferred parent node needs to be selected first. For each possible parent node (that is, where the rank of the neighbor is smaller than its own), a node will take the following steps:  
Step 1: Calculate the measurement set of the bottleneck nodes (range (R), average deviation (AD), standard deviation (SD) and energy of dispersion (ED)) through the parent nodes broadcast. This will send all the traffic to that parent node and save the minimum value (Line 4);  
Step 2: Calculate the own lifetime and make sure it will not become another new bottleneck node if chosen as the father node (Line 5);  
Step 3: Remove the traffic that arrives at that parent node and test other nodes. Make sure all the parent nodes have been tested before making the decision (Line 10);  
Step 4: Select the preferred parent nodes. The node maximizes the lifetime of the bottleneck with the minimum lifetime (Line 6, 7, 8). An outline is listed in Algorithm 1. ```
0: The sender node a; the candidate parent set of a, parent(a); the bottleneck set, C; and its number \(N\)
0: the preferred parent of a Initialization\(min\_MD\) = 100,000;
1. for\(b\in parent(a)\)
2. \(\alpha_{a,b}=1\) // test every parent of a
3. Obtain all bottleneck nodes' residue energy, \(E_{\textit{res}}(c_{i})\), \(c_{i}\in C\), \(i=1\cdots N\)
4. Compute \(E(C)=\sum_{i=1}^{N}E_{\textit{res}}(c_{i})/N\), \(D(C)=\sum_{i=1}^{N}\left(E_{\textit{res}}(c_{i})-E(C)\right)^{2}\), \(\omega_{i}=\frac{1/(q_{i}-E(C))^{2}}{1/D(C)}\), then obtain the range \(R=\max\{E_{\textit{res}}(C)\}-\min\{E_{\textit{res}}(C)\}\), the average deviation \(AD=\sum_{i=1}^{N}\left|E_{\textit{res}}(c_{i})-E(C)\right|/N\), the standard deviation \(SD=\sqrt{D(C)}\), and our metric \(ED=\sum_{i=1}^{n}\omega_{i}\cdot(E_{\textit{res}}(c_{i}))^{2}\)) // compute the range, average deviation, standard deviation, and our metric of the bottleneck set C
5. If\(min\_MD\) > R (or AD, SD, ED) then
6. \(min\_MD\) = R (or AD, SD, ED);
7. preferred_parent = b;
8. // select the current optimal parent
9. end
10. \(\alpha_{A,B}=0\) // continue to test the next parent
11. end
```  
**Algorithm 1** Evaluation of different metrics based on RPL protocol  
The above algorithm is used to choose preferred parent nodes based on single-path circumstances. We should set min_MD to be as large as possible to guarantee that the value will not be smaller than the ED value under real circumstances. When the first node has used up its energy, the experiment stops and records the bottleneck nodes' energy. We achieved the average value through 1000 cycles; the results are in Table 3. \begin{table}
\begin{tabular}{c c c c} \hline
**Measurement** & **Maximum** & **Minimum** & **Average** \\ \hline Range & 71.0600 & 69.9184 & 71.0588 \\ Average Deviation & 27.7367 & 6.1617 & 27.7151 \\ Standard Deviation & 28.8025 & 6.1617 & 28.8007 \\ ED & \(1.0438\times 10^{5}\) & 574.5076 & 678.3107 \\ \hline \end{tabular}
\end{table} 
Table 3: The comparison results for several dispersion degrees. The evaluation verifies that the ED can evaluate well the degree of imbalance of a network node's energy consumption.