# Data-Driven Packet Loss Estimation for Node Healthy Sensing in Decentralized Cluster
## 4 The PingBasedDown Algorithm
### Decision Model
#### 4.2.2 Leader Determination Module
Thus, we implement PingBasedDown algorithm as a plugin of Akka, and hook this plugin into this product. The AgileController has the ability to automatically restart if it is shut down. The startup process takes about 2 min if restarted. We first construct a cluster of AgileControllers containing several nodes in their simulated production environment. Then we injure failures into some of these nodes with various packet loss rate by the tool named TC of linux operating system. During testing, if one node \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithm** & **Record Size \#1** & **Record Size \#2** & **Record Size \#3** & **Record Size \#4** \\ \hline \hline \multirow{2}{*}{FDFD} & 100 & 500 & 1000 & 2000 \\  & 100 & 500 & 1000 & 2000 \\  & \(n_{1}=100\) & \(n_{1}=1000\) & \(n_{1}=1000\) & \(n_{1}=2000\) \\  & \(n_{2}=1\) & \(n_{2}=1\) & \(n_{2}=10\) & \(n_{2}=10\) \\  & CV & 10 & 30 & 60 & 400 \\  & AV & 10 & 30 & 60 & 400 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Window sizes used by experiment on parameters. Figure 5: Performance of Evaluation model vs. parameters. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithm** & **Threshold \#1** & **Threshold \#2** & **Threshold \#3** & **Threshold \#4** \\ \hline \hline \multirow{2}{*}{FDFD} & \(\phi=0.05\) & \(\phi=0.25\) & \(\phi=0.45\) & \(\phi=1.5\) \\  & EDFD & \(T_{ed}=0.6\) & \(T_{ed}=0.7\) & \(T_{ed}=0.8\) & \(T_{ed}=0.9\) \\  & 2 WFD & \(\alpha=0\) & \(\alpha=10\) ms & \(\alpha=20\) ms & \(\alpha=30\) ms \\  & CV & \(T_{c}=0.6\) & \(T_{c}=1.0\) & \(T_{c}=1.5\) & \(T_{c}=2.0\) \\  & \(T_{safe}=0.6\) & \(T_{safe}=1.0\) & \(T_{safe}=1.5\) & \(T_{safe}=2.0\) \\  & \(T_{alert}=1.5\) & \(T_{alert}=3.0\) & \(T_{alert}=6.0\) & \(T_{alert}=10.0\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Thresholds used by experiment on parameters. is removed by a leader, a log containing the information of this removing action, e.g., who is being removed, is generated. After a relatively long period of time, we collect the logging data and calculate \(\mathcal{R}_{D}\) and \(\overline{\mathcal{R}_{k}}\) of each test. The scenario of our simulated production environment is that, each controller runs in a virtual machine. The hosts of these virtual machines are within the same data center with network bandwidth of 1 Gbps. The average transmission delay is around 400 \(\upmu\)s. The physical jitter of the network latency is low but the garbage collection process in JVM causes extra jitter when measuring the latency. Based on this environment, we set the parameters of PingBasedDown algorithm as follows. The length of records \(N_{w}\) is set to be 30, filter strength \(F_{S}\) is set to be 0.15, latency positioning factor \(L_{pos}\) is set to be 0.2, and the two thresholds \(T_{alert}\), \(T_{safe}\) are set to be 17.0 and 2.0, respectively. During 8 days, we do 15 groups of testing that cover different numbers of nodes, different packet loss rates, different numbers of faulty nodes. To show the benefit of our proposed algorithm, we also provide 6 groups of results with AutoDown algorithm. Table 7 shows the results of this experiment using PingBasedDown algorithm, while Table 8 shows the results using the original AutoDown mechanism provided by Akka. For example, the 7 th row in Table 7 means that, we run this group of test with a cluster with 5 nodes. The 1 st node and the 3 rd node (ordered by \(h(v)\) ascendingly) are injured with packet loss failures, and the packet loss rate is set to 15% and 40%, respectively. The result of this group is that, the detection rate \(\mathcal{R}_{D}\) reaches 61.3% and the mis-kicking rate \(\overline{\mathcal{R}_{k}}\) is 0.0%. Compared with the baseline method, we can see that when the packet loss rate is as low as 15%, the \(\mathcal{R}_{D}\) of AutoDown is less than 9.1%, while that of our algorithm ranges from 44.7% to 54.4%. This indicates that our algorithm can detect nodes with packet loss issues faster than AutoDown.