# Utilising Acknowledge for the Trust in Wireless Sensor Networks
## 4 The Proposed Technique
### Description of the Proposed Technique
The node that discovers that its downstream node does not send the MEM produces the MDM in the opposite direction of the detected misbehaving sensor toward the source or destination node. It is then sent to the source through the trusted route after the destination node has received the MDM. When an MDM is received, each node that receives it will adversely modify the trust value of the accused node; the detecting node will also add the found node ID to its ignored node list. 4.2. Mathematical Framework  
Due to the broadcasting properties of the wireless networks, a node may collect data about the packet-forwarding behavior of its neighbors, snooping all received MAC layer frames and storing packet delivery statistics. Based on Bayesian statistics and Beta distribution, the trust value, t, and Treatment Ratio (r) value signed to a node can be defined as follows: let L indicate the total number of packets transmitted correctly. In addition,let N indicate the total number of packets sent for transmitting by the sensor up to the present time. \[\text{t}=\frac{\text{L}}{\text{N}}\ (1) \tag{1}\]  
\[\text{r}=1-\frac{\sqrt{12\ \text{L}\ (\text{N}-\text{L})}}{(\text{N}+1)\text{N}} \tag{2}\]  
The Worthiness (W) value associated with a pair (t, c) is calculated by mapping the trust value, t, and the Treatment Ratio value, r, into a single value to facilitate trust-based decision-making [19]. \[\text{W}(\text{t},\text{r})=1-\frac{\sqrt{(\text{t}-1)^{2}+\ \text{c}^{2}(\text{ r}-1)^{2}}}{\sqrt{1+\text{c}^{2}}} \tag{3}\]  
where c is a parameter that determines the relative importance of the trust value (t) vs. the Treatment Ratio value (r). The \"default\" value of worthiness is defined as:  
\[\text{W}_{\text{def}}=\text{W}(0.5,0) \tag{4}\]  
\(\text{W}_{\text{def}}\) Value, in this case, is the worthiness value assigned to a node with trust and confidence values are t and r = 0, respectively; we consider this as the initial threshold for worthiness. The sensor is considered trustworthy when the worthiness of a sensor exceeds \(\text{W}_{\text{def}}\); otherwise, the sensor is viewed as untrustworthy. The notion of worthiness is generalized to the notion of viewpoint (V), which incorporates worthiness values information from non-neighbors nodes. Let denotes the viewpoint that node (i) has for node (k). If i and k are neighbors, the viewpoint equals the worthiness value, \(\text{W}_{\text{i,k}}\) that node (i) has for node (k). If nodes i and k are not neighbors, the viewpoint, \(\text{V}_{\text{i,k}}\) is computed as follow (Figure 1):  
\[\text{W}_{\text{i,k}}=\ \text{W}_{\text{i,x1}}.\text{W}_{\text{x1,x2}}.\text{W}_{ \text{x2,k}} \tag{5}\]  
Thus, the viewpoint can be defined as:  
\[\text{V}_{\text{lk}}=\left\{ \begin{array}{c}\text{W}_{\text{ik}}\ \text{if i and k are neighbors,}\\ \text{max}_{\text{p}\in\text{P}_{\text{ik}}}\text{W}_{\text{ik}}\ \text{P}_{\text{ik}}\
eq\phi\,\\ \text{W}_{\text{def}}\ \text{otherwise,}\end{array} \right. \tag{6}\]  
where Pik is the set of paths between sensors i and k. \(\
abla\) is the average of (V) over the watching windows. Figure 1: Example of viewpoint calculation for non-neighbors i and k.  
To execute the routing decision, we may now apply a viewpoint metric to it or create a Multi-Trust level method, depending on the task's sensitivity to be executed to maintain a balance between traffic and energy in the WSNs. To compute the t, r, w, \(\overline{\
abla}\) values, two counters (L-counter, N-counter), and two timers are defined. In the first-timer, t\({}_{\text{DLL}}^{\text{ack}}\), timeout interval is assigned a value that is greater than the maximum round-trip time (RTT) between two neighbor nodes. The second timer, t\({}_{\text{TCP}}^{\text{ack}}\), the timeout interval is set to a value based on the network diameter. To update L-counter and N-counter, the following approach is applied:  
* When sensor (i) sends a packet (p) to node (j), the N-counter (i) is incremented by one, and the timers are initiated.