## 4 Protocol Framework
### Methods
#### 4.4.3 Forwarding and Detection  
When one mobile node \(a\) encounters a mobile node \(b\), and the two nodes have the same tracked nodes, in other words, \(D_{a}\cap D_{b}\
eq\varnothing\) (\(D_{x}\) is the tracking set of node \(x\)). If \(ID_{a}>ID_{b}\), for \(\forall x\in D_{a}\cap D_{b}\) node \(a\) submits a testing request to node \(b\). A testing request \(R_{a}^{x}\) involves \(\{n_{a}^{x},\omega_{a}^{x},t_{a},\text{SIG}_{\text{SK}_{a}}(H(ID_{a}\parallel n _{a}^{x}\parallel\omega_{a}^{x}\parallel t_{a}))\}\), where \(n_{a}^{x}\) represents the total number of samples of tracked node \(x\) whose witness node is node \(a\); \(\omega_{a}^{x}\) represents the cumulative total of the amount of times a specific event that \(S_{x}^{i}=1\) occurs in the \(n_{a}^{x}\) samples of the tracked node \(x\) whose witness node is node \(a\); \(t_{a}\) represents the time in which the detection request is submitted to node \(b\). \(\text{SIG}_{\text{SK}_{a}}(H(ID_{a}\parallel n_{a}^{x}\parallel\omega_{a}^{x} \parallel t_{a})\) denotes encrypting the hash value of the data which performs a concatenation of the ID of node \(a\), the total number of samples of node \(x\), the total number of times an event has occurred that \(S_{x}^{i}=1\), and the time of starting to send the detection request by utilizing the private key of node \(a\) for the sake of implementing integrity verification of the message. In Bernoulli experiment, every measured speed sample is independent, once node \(b\) receives the detection request from node \(a\), the total number of speed samples of the tracked node \(x\) is \(n^{x}\):  
\[n^{x}=n_{a}^{x}+n_{b}^{x} \tag{25}\]  
\(n^{x}\) is the sum of the number of speed samples of the tracked node \(x\) whose witness nodes are node \(a\) and node \(b\), respectively. Let \(\omega^{x}\) represent the cumulative total of the number of times a specific event that \(S_{x}^{i}=1\) occurs in the \(n^{x}\) samples of the tracked node \(x\):  
\[\omega^{x}=\omega_{a}^{x}+\omega_{b}^{x} \tag{26}\]  
Substituting Equations (25) and (26) into Equation (24) we obtain:  
\[Ln=\omega^{x}\times\ln\frac{\alpha_{1}}{\alpha_{0}}+(n^{x}-\omega^{x})\times \ln\frac{1-\alpha_{1}}{1-\alpha_{0}} \tag{27}\]  
Then we apply Equations (25)-(27) in the second stage of the decision process to reformulate the process:  
\(\omega_{a}^{x}+\omega_{b}^{x}\leq\Psi_{0}(n_{a}^{x}+n_{b}^{x})\); The hypothesis \(H_{0}\) is correct and the detection is over;  
\(\omega_{a}^{x}+\omega_{b}^{x}\geq\Psi 1(n_{a}^{x}+n_{b}^{x})\); The hypothesis \(H_{1}\) is correct and the detection is over;  
\(\Psi_{0}\times(n_{a}^{x}+n_{b}^{x})<\omega_{a}^{x}+\omega_{b}^{x}<\Psi 1\times(n_{a}^{x}+n_{b}^{x})\); Continue the detection process with the next sample,where \(\Psi_{0}(n^{x})=\frac{\ln\frac{\tau_{2}^{2}}{q}+(n_{a}^{x}+n_{b}^{x})\times\ln \frac{1-q}{q-1}}{\ln\frac{\mu_{0}^{4}}{\mu_{0}^{4}}-\ln\frac{\mu_{0}^{4}}{\mu_{ 0}^{2}}}\), \(\Psi_{1}(n_{a}^{L})=\frac{\ln\frac{1-x}{q}+(n_{a}^{x}+n_{b}^{x})\times\ln\frac{1- q}{q-1}}{\ln\frac{\mu_{0}^{4}}{\mu_{0}^{4}}-\ln\frac{1-q}{2}}\). To accelerate the speed of detection, an intuition is to maintain one queue for each node in the tracking set, which can hold more than two pieces of corresponding detection information. The more samples are measured, the more accurate the detection, but the longer the queue, the higher the space costs, so making the size of each queue equal to 3 would be meeting demand. As soon as two nodes with the same tracked node meet, for example, node \(a\) meets node \(b\) (if \(ID_{a}>ID_{b}\)), for \(\forall x\in D_{a}\cap D_{b}\), node \(a\) submits a testing request to node \(b\). There is a queue \(Q\) for node \(x\) including three relational detection information in node \(b\), if \(l_{a}^{x}\) already exits, the latest \(l_{a}^{x}\) updates the existing \(l_{a}^{x}\). If \(l_{a}^{x}\) doesn't exit and there is some space available in the queue, then the received \(l_{a}^{x}\) should be written into the queue.