# A Hybrid Trust Model against Insider Packet Drop Attacks in Wireless Sensor Networks
## 3 Motivation of the Proposed Work
### Design of the New Trust Model  
#### 4.2.1 New Trust Model  
Properties against Inside Packet Drop Attacks  
The new trust model must have the following two properties:  
* Property 1: As the number of consecutive failures grows, we increase the trust-decreasing rate. Thus, while we observe consecutive failures, we give a larger penalty for a new failure than the previous failures, because as the size of consecutive failures grows, our confidence that the consecutive failures are occurring due to attacks also grows. This property not only helps to quickly detect an attacker dropping packets consecutively but also forces a rational inside attacker to stop launching as many consecutive drops in the fear of being caught by the trust model. * Property 2: Given two nodes B and C, where node A trusts B more than C based on the same number of their past behaviors, if both B and C are generating the same number of consecutive failures, A loses C's trust more than B's trust. For example, consider the following case. B behaved 40 times well and behaved 20 times badly, and node C behaved 20 times well and behaved 40 times badly. Now both [PERSON] and C are misbehaving 5 times consecutively. Intuitively, it is reasonable to lower [PERSON]'s trust further than B, because [PERSON]'s past behaviors are worse than node B. This property will work against grayhole attacks and on-off attacks. Design of New Trust Function  
We designed a new trust function based on the number of consecutive failures. Every trust model decreases a certain amount of trust value when a failure occurs. We considered the decreased amount of trust value as a penalty for the failure. We first designed a penalty function \(PT(n)\) that determines how much we should lower the trust value of a node that generates \(n\) consecutive failures. By using \(PT(n)\), given \(n\) consecutive failures, the new trust function \(T(n)\) was formulated as:  
\[T(n)=T(0)-PT(n) \tag{6}\]  
where \(T(0)\) is the initial trust value of the evaluated node generating \(n\) consecutive failures at the evaluating node. Thus, when an evaluated node is generating \(n\) consecutive failures (\(n\geq 1\)), we measure its trust value by using \(T(n)\) by deducting a certain amount of penalty \(PT(n)\) from \(T(0)\) which is its trust value just before it generates \(n\) consecutive failures. We now explain how to determine the penalty for \(n\) consecutive failures. Consider \(n\) consecutive failures f\({}_{1}\)f\({}_{2}\)... f\({}_{1}\)... f\({}_{n}\) whose \(i\)-th failure occurs at time \(t=i\,(1\leq i\leq n)\). When \(t=1\), there is only one failure f\({}_{1}\) and we assign \(\alpha\) as a penalty to the single failure f\({}_{1}\). Thus, \(PT\) (1) = \(\alpha\). When \(t=2\), another failure f\({}_{2}\) occurs. Therefore, we assign \(\alpha\) to the single failure f\({}_{2}\). In addition, since we observe double failures f\({}_{1}\)f\({}_{2}\) at \(t=2\), we give an extra penalty to f\({}_{1}\)f\({}_{2}\). The probability that two consecutive failures occur is \(P[f]^{2}\) and our confidence that they should not occur is \(1-P[f]^{2}\). Since we give \(\alpha\) as the penalty to a single failure when we have a confidence of \(1-P[f]\), by multiplying \(\alpha\) by the ratio of confidence, we can get the penalty to the double failure as \(\alpha\times(1-P[f]^{2})/(1-P[f])\). Then, the total penalty to the two consecutive failures \(PT(2)\) is \(2\alpha+\alpha\times(1-P[f]^{2})/(1-P[f])\) where \(2\alpha\) is the penalty for two single failures and \(\alpha\times(1-P[f]^{2})/(1-P[f])\) is the penalty for one double failure. By this approach, to get \(PT\) (\(n\)) we first must find all _unit failures_, such as single failure, double failure, triple failure, and \(n\)-tuple failure within \(n\) consecutive failures. Given \(n\) consecutive failures, there are \(n\) single failures, \(n-1\) double failures, \(n-2\) triple failures... and one \(n\)-tuple failure.