## 4 Doids
### Detection and Response
#### 4.2.3 Type Decisions for Candidate Nodes  
Let \(Tag=-1\) be the symbol of outlier sample points. Firstly, the outliers caused by hostile environments should be corrected. When the tag value \(Tag_{ji}\) of \(c_{j}\) in \(slot_{t}\) is \(-1\), if \(Feature_{ji}^{link}\) in the sample is in line with Equation (8), that is, if it is not in the one-sided confidence interval of the mean value of link feature, the link between \(n_{i}\) and \(c_{j}\) is regarded as abnormal, and \(Tag_{ji}\) is corrected to 1. \[Feature_{jit}^{link}<\overline{Feature_{link}}-z_{s}\frac{\sigma_{Feature_{link }}}{\sqrt{k\cdot s}} \tag{11}\]  
where \(\sigma_{Feature_{link}}\) is the mean square error of the eigenvalue of the link sample. When the confidence is 95%, \(z_{s}=1.64\), the standard normal distribution table is referenced. Then, the legitimacy of each candidate node is decided based on the sliding time window. As shown in Figure 5, according to the tag value obtained by clustering in the current decision window, Equations (12) and (13) are used to determine whether the node is legitimate or not. \[d_{slot_{i}}=\left\{ \begin{aligned} & 1+\sum\limits_{t=1}^{slot_{i}}e_{t},d_{slot_{i}}<1 \\ & 1,else\end{aligned} \right. \tag{12}\]  
\[e_{t}=\left\{ \begin{aligned} &-e^{-a_{1}(slot_{i}-t+l_{i})},T\;ag=-1\\ & e^{-a_{2}(slot_{i}-t+l_{2})},T\;ag=1\end{aligned} \right. \tag{13}\]  
where \(slot_{i}\) is the \(i\)-th time slot in a decision window, \(e_{t}\) is the decision value of time slot \(t=(1,2\cdots,slot_{i})\) in the current decision window, and the initial value is 1. is the reward and punishment value of time slot. The reward value is positive and the punishment value  
Figure 4: Outlier points detection based on DBSCAN. is negative. If \(d_{slot_{i}}<0\) exists in a decision window, the node is judged to be malicious. Parameters \(\alpha\) and \(l\) can be obtained from the time decay function (14):  
\[N(t)=e^{-\alpha(t+l)} \tag{14}\]  
Assuming that the attenuation function attenuates from \(N_{init}\) and after \(m\) time slots to \(N_{finish}\), equations can be written as follows:  
\[ \begin{cases}e^{-\alpha l}=N_{init}\\ e^{-\alpha(l+m)}=N_{finish}\end{cases}  \tag{15}\]  
The parameters \(\alpha\) and \(l\) can be obtained by solving Equation (15). The selection of \(N_{init}\) and \(m\) depends on the degree of reward and punishment for clustering points or outlier points. For example, when the decision value of candidate node \(c_{1}\) is calculated in the current time slot \(slot_{i}\), if \(Tag_{1i}=-1\), that is, node \(c_{1}\) has potential malicious behavior in \(slot_{i}\), it will be punished. \(N_{init}=0.5\) can be achieved, i.e., the punishment value in \(slot_{i}\) is \(-0.5\), indicating that the potential malicious behavior of node \(c_{1}\) in \(slot_{i}\) reduces its decision value by \(0.5\). The larger \(m\) is, the slower the time function decays, and the slower the penalty value caused by the potential malicious behavior of history decreases. In order to make the punishment before \(m\) time slots have no influence on the decision in the current time slot, let \(N_{finish}=0\). However, let \(N_{finish}=10^{-4}\) to make the formula solvable. When parameters are selected according to Table 1, the change in decision value \(d\) with \(T\)\(ag\) in each time slot of the decision window is shown in Figure 6. It can be seen from the figure that for continuous or periodic attacks, \(d\) will be less than \(0\) after a period of time. Moreover, even if there is an occasional misjudgment on the node sample, the influence on its decision value decreases over time. \begin{table}
\begin{tabular}{c c c c} \hline \hline \(T\)\(ag\) & \(N_{init}\) & \(N_{finish}\) & \(\mathbf{m}\) \\ \hline \(-1\) & \(0.5\) & \(10^{-4}\) & \(30\) \\ \(1\) & \(0.1\) & \(10^{-4}\) & \(10\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameter selection of decision function. Figure 5: Schematic diagram of detection and decision sliding time window.