An Effective Exponential-Based Trust and Reputation Evaluation System in Wireless Sensor Networks

Wireless sensor networks (WSNs) are vulnerable to many security threats from compromised nodes, and because the WSNs are resource-constrained, the traditional security methods cannot be used to resist the internal attacks from compromised nodes. The trust and reputation evaluation system is the most effective security mechanisms to protect WSNs from internal attacks. The exponential-based trust and reputation evaluation system (ETRES) is proposed for WSNs’ node trust and reputation evaluation. ETRES is used to observe the nodes’ behavior, and exponential distribution is applied to represent the distribution of nodes’ trust. The trust of the node is used to look for reliable nodes to transmit data and weaken malicious attacks within the wireless sensor networks. More significantly, the entropy theory is used to measure the uncertainty of direct trust values in this paper. Indirect trust is introduced to strengthen interaction information when the uncertainty of direct trust is enough high. It can not only reduce the computing power of nodes but also prolong the lifetime of the network. In addition, the confidence factor is redefined, which can dynamically adjust the node trust value to weaken the harmful effects of the compromised nodes. The simulation results show that the proposed system can more effectively defend the internal attack than the beta-based trust and reputation evaluation system (RFSN) and the binomial-based trust management System (BTMS). The proposed method can be used to strengthen network security by selecting reliable nodes. What is more, the information trust and energy are prone to integrate into ETRES.


I. INTRODUCTION
Wireless sensor networks (WSNs) are multi-hop selforganizing distributed sensor network, which consists of hundreds of tiny sensor nodes with sensing capabilities. Commonly, sensor nodes are deployed randomly in unattended areas and terrible environments to perform various complex tasks [1], [2]. WSNs have the ability to acquire process and transmit data and play a significant role in various fields. Such as battlefield surveillance [3], the smart city [4]- [7], healthcare monitoring, intrusion detection, emergency response [8], [9], etc. Unfortunately, the network is more prone to be attacked due to wireless characteristics of WSNs [10], [11]. For example, lack of central authority, distributed cooperation mechanisms, etc. In some cases, the The associate editor coordinating the review of this manuscript and approving it for publication was Iztok Humar. compromised nodes are converted to the legitimated nodes by capturing normal nodes' cryptographic keys [12]. It can bring enormous damage to the network. In addition, once the legitimated nodes become the compromised nodes, the availability and integrity of the network may be damaged by intercepting, deleting, or inserting information in the network.
Information security is designed to protect information systems or information resources from various types of attacks. In WSNs, attacks can be divided into two categories: internal attacks and external attacks. The current literature shows that the internal attack of the wireless sensor network is far more harmful than the external attack [13]- [15]. In fact, although the security mechanism of authentication and protocol can resist external attack effectively, it has little effect on internal attacks [16]. Internal attacks are launched by misbehaving nodes or selfish nodes in WSNs. By the selfish nodes, we mean that it refuses to service requests to VOLUME 7, 2019 This work is licensed under a Creative Commons Attribution 3.0 License. For more information, see http://creativecommons.org/licenses/by/3.0/ save energy. Although selfish nodes cannot launch an attack on WSNs actively, they may give rise to a great disaster to the Internet. Therefore, it is necessary to establish an effective scheme to solve these problems. At present, the trust management system is an effective way to resist internal attacks. Trust is a multidisciplinary concept, which is characterized by uncertainty and by contextual independent [17]. Trust is also derived from the social science and inherited from human behavior [18], [19]. Inspired by the related literature [20]- [22], we consider that trust is the belief level of an entity that another entity may perform its tasks as expected. If the node is more prone to transmit the received packet continually, it is regarded to be credible and has a good reputation, as a result, its requests are more prone to be accepted. Trust management systems are mainly used to quantify trust and describe the credibility, reliability, or ability of an entity. Apart from this, a large number of the most advanced models have been mentioned in WSNs [23]- [29]. Obviously, the current research findings have greatly promoted the development of related research, but there are still some shortcomings. For example, some researchers have improved trust management system based on beta distribution to enhance the accuracy of trust assessment. Some researchers take little notice of assigning the confidence factor subjectively, which results in inaccurate trust assessment. Others only combine direct and indirect observation to calculate trust without considering the limited energy. It may reduce the lifetime of the network.
In view of the above problems, we proposed an effective exponential-based trust and reputation evaluation system in this paper, short for ETRES. In our proposal, the trust and reputation of the node are represented by the exponential distribution. The performance of trust evaluation of the algorithm is enhanced by improving the related factors allocation scheme. Firstly, we adopt the exponential distribution to represent the nodes' trust and reputation. Secondly, the direct trust is calculated from the interaction records and the indirect trust is computed until the level of uncertainty of direct trust is enough high. The entropy theory is utilized to access the level of uncertainty. The method of assigning weight is proposed to deal with the problem of assigning weight subjectively. Finally, we incorporate a confidence factor into our method to get the total trust. The trust of the node is explored for the scheme of data aggregation. The node with high trust is select reliable relay nodes to transmit data, which can reduce the risk of internal attacks in the network. Furthermore, the proposed method is conveniently incorporated into the existing network. Compared with the existing trust model based on the beta distribution, the exponential distribution represents the time interval of independent random events, which indicates that it can depict the interaction record in the time dimension. What is more, it only uses the time interval between two neighbor cooperation to evaluate trust without considering other states exist in the interaction between nodes. Generally speaking, the main contributions of the paper are as follows: (1) In our proposal, the exponential distribution is first explored to express trust and reputation. Compared with beta distribution, the exponential distribution only uses the time interval between two adjacent collaboration to calculate trust without considering other states exist in the interaction between nodes. It means that the proposed method is more reasonable to reflect the trust of nodes. (2) The entropy theory is utilized to access the level of uncertainty. When uncertainty is high, the indirect trust is integrated into the direct trust to strengthen the credibility of trust. It not only effective save the computing power of nodes but also has low energy consumption, which can prolong the service life of the network. (3) The method of assigning weight is proposed to deal with the problem of assigning weight. In our proposal, the calculation of the confidence factor is redefined, which based on the number of cooperation between nodes. The confidence factor is closely related to the direct trust. When compromised nodes perform bad interactions, the confidence factor will force the direct trust to drop rapidly. The deployment of the paper is as follows. Section II shows the related work. Section III describes the proposed trust and reputation evaluation system in detail. Section IV talks performance analysis and comparison. Section V discusses the conclusion.

II. RELATED WORK
Reputation is defined to mean the evaluation of a target node by a neighbor node to perform a task, while trust is an entity value generated by reputation. On account of the historical record, it reflects positively and negatively. Trust management systems are segmented into two categories, trust model and trust management scheme. Currently, there are many trust models, such as the entropy trust model, fuzzy logic trust model, D-S evidence trust models, and Game Theory trust models [30], [31]. At the same time, a large number of trust models are proposed in WSNs' to observe node behaviors and resist internal attacks from compromised nodes. Some of them are discussed as follows.
With respect to the trust management scheme, Xia et al. [32] used an information theoretic framework to quantitatively measure trust and design a novel trust model with multiple trust decision factors. These factors are integrated to represent trust relationship's uncertainty and inhomogeneity from various angles. However, the weight of these factors is undefined in this scheme; Furthermore, renewing a node's trust for next decision-making costs more energy. Wang and Pang [33] utilized a light-weight trust model which considers data aggregation and communication failure due to wireless channels. Direct trust is evaluated by successful or unsuccessful interactions and similar or dissimilar data comparisons. It takes communication ability, the lifetime of node and consistency of data to compute the overall trust value. It costs more energy in computing the trust of the node. Furthermore, the detection rate of the compromised node is not considered. Wang et al. [34] firstly proposed a sensor with a changeable sampling frequency, and its control algorithm. The system is established on the basis of multiple factors (e.g. data factor and energy factor et. al.). The scheme gives the reward coefficient of the revised data and the penalty coefficient of the erroneous data. A combined trust model is used to describe the relationship of nodes and the importance of the multiple factors, and the trust value between nodes is calculated by weighting. The proposed model has a low fault detection rate and detects the fault in time duration. Furthermore, it does not take into account energy consumption. Fang et al. [35] established a beta-based trust and reputation evaluation system to describe WSNs' node trust and reputation evaluation. The proposed system is based on observing nodes' actions, and the beta distribution is utilized to represent the distribution of nodes' credibility. The overall trust value of the node is used to select relay nodes, mitigating internal attack risks. The method can effectively resist the internal attack of compromised nodes. However, it does not take into account node energy, computation, memory constraints. Luo et al. [36] put forward a trust management system for clustered WSNs to keep watch on the sensor nodes' behaviors and evaluate their trust values. Identification labels of sensor nodes are generated by employing a hash algorithm to distinguish external attackers from normal nodes. The compromised nodes are detected by dynamically managing the trust value of each node. The scheme results show that it can detect the malicious nodes quickly, which resists malicious attacks. However, the scheme seems not to detect the malicious nodes quickly, which prevents clustered WSNs from external attacks and internal compromised nodes' attacks. Fang et al. [37] proposed a time windowbased resilient trust management scheme resisting the reputation time-varying attack in WSNs. In the system, on the basis of beta distribution, the behaviors of compromised nodes are analyzed for a period of time, and the difference of judgment and the trend analysis are used to detect abnormal reputation value of nodes. The control factor and the time window are incorporated to confirm and remove the malicious nodes. It can defend reputation time-varying attacks effectively, but the energy efficiency is not integrated into the trust evaluation system. Based on the above analysis of the trust management system, we find that a large number of trust management schemes mainly focus on a specific behavior; what's more, most of them are inclined to neglect the energy of the node.
With regard to the trust model, Anita et al. [38] presented 2-ACKT protocols with 2-ACKT-1 and 2-ACKT-G to establish trust with low communication overhead and memory requirement. The proposed scheme computes the direct trust using a link layer acknowledgment and a two-hop acknowledgment from a downstream neighbor. The trust is calculated by the sensor node based on the number of successful interactions of the data forwarding behavior of a neighbor. The scheme outperforms the conventional multi-hop and trust-based routing schemes in terms of packet delivery ratio, network lifetime, communication overhead, and memory requirements. However, it costs a lot of energy and increases the time complexity. Umarani [39] established an enhanced beta trust model to find a malicious attack. The neighbor node is selected by the sensor node based on trust information in the course of communication. The state of the neighbor node is periodically updated. The recovery procedure is incorporated to raise the throughput of the network. The scheme not only improves the collaboration among sensor nodes by trust value, but also increases the lifetime of the network by the recovery procedure. However, it does not take into account the use of energy and memory constraints to build trust models. Labraoui [40] used a trust model based on risk evaluation to effectively deal with conflicting behaviors of malicious nodes. Reputation is evaluated based on direct and indirect observation, and a cumulative evaluation of long-term behavior. The risk is assessed on the basis of mutual information. Risk factor evaluation can enable the trust model more reliable due to it becomes more sensitive to malicious attacks. It can detect on-off attack effectively but does not consider more attacks in a mobile environment. Ganeriwal et al. [41] proposed a Distributed Reputationbased Framework for WSNs (RFSN). There are two key building blocks in RFSN, watchdog and reputation system, respectively. The watchdog is used to observe behaviors of neighbor nodes and rate their behaviors as cooperative or non-cooperative. The reputation system is utilized to maintain the reputation of a node. An aging mechanism is established for trust updating, consequently, a node's trustworthiness is reconsidered continuously. Obviously, it assumes that each node has enough interactions with neighbor nodes so that reputation can reach stationary. More importantly, the RFSN scheme only propagates good reputation information about other nodes. Unfortunately, sensor nodes cannot defend malicious attacks because they cannot share their bad reputation information with each other. The effectiveness of the proposed method is testified by simulation experiments. Many scholars have put forward various improvement schemes based on the scheme and achieved good experimental results. From the perspective of the trust model, currently, a great deal of trust model is improved based on the beta distribution. Furthermore, there are still numerous scholars integrate beta distribution to propose a new method for resisting the internal attack. It seems that trust management schemes are improved by a novel mathematical distribution to improve trust management schemes.
The existing trust management system is complex. Not only the calculation and storage requirements of sensor nodes are high, but also the scope of application is limited. In this paper, an effective exponential-based trust and reputation evaluation system is proposed. The system enables the algorithm of the trust evaluation system simpler and more effective to resist the internal attack. It is noteworthy that the scheme is conveniently incorporated into the existing network.

III. THE PROPOSED TRUST AND REPUTATION EVALUATION SYSTEM
In this part, a novel trust and reputation evaluation system based on the exponential distribution is proposed for WSNs, which named an effective exponential-based trust and reputation evaluation system (ETRES). When nodes need to interact, nodes will decide whether to interact with another node based on trust. The trust assessment process is illustrated in Figure 1.

A. TRUST AND REPUTATION MODELING
The trust and reputation of the node are represented by the beta distribution among the related trust systems [18], [42], which assumes that only the cooperation and the non-cooperation in the process of interaction between nodes. Aiming at avoiding the existing states between interactions, the time interval between two adjacent collaboration is used to represent the trust and reputation of the node. Furthermore, we derive the expression of the nodes' trust and reputation according to the relationship between beta distribution and exponential distribution. In order to simplify the model of trust and reputation, we divide the behavior of nodes into two categories in two adjacent collaboration, namely, cooperation and non-cooperation. Undoubtedly, it is not adopting the potential hypothesis, because trust and reputation mainly depend on the cooperation between nodes. We assume that interaction between the nodes has remained (a + b) times. The modeling as follows.
where variable a and b represents the number of successful interactive behaviors and unsuccessful interactive behaviors of the node, respectively. P represents the probability of successful cooperation. Obviously, node i holds about the reputation distribution of node j, marked as R ij , the representation is as follows.
Since f (p) is the probability distribution of reputation p, the maximum of the function is used to express the maximum probability of p. Thus, we defined the maximum value of the function as the trust value of the node. This process can be expressed by formulas 3-5.
After the derivation, we can get the maximum of the above function, which is represented as follows.
Trust is represented by the maximum value of the reputation distribution [33], [37], [41]. Consequently, the node's trust is defined as, In order to verify the effectiveness of the algorithm, we should proof the trust will still converge regardless of the increase in the number of malicious nodes. The proof is as follows.
Formula (6) represents the function of trust is bounded. We verify the monotonicity of the function of trust by formula (7).
Obviously, T ij < 0, it indicates that the function is strictly monotone decreasing. According to the Monotone Convergence Theorem, the function of trust will still converge regardless of the increase in the number of malicious nodes.

B. TRUST AND REPUTATION EVALUATION SYSTEM MODELING
On the basis of the above modeling, we get an expression of the nodes' reputation and trust, which based on the exponential distribution. Now, we will build a trust and reputation system to resist attacks from the network. The detailed process of building trust and reputation system is as follows.

1) INTRODUCTION OF ENTROPY
Entropy is a key concept in information theory. It is a measure of uncertainty in random events. Entropy reflects the degree of order of a system, and the higher the entropy, the lower the degree of order. Normally, the entropy of a random variable x is represented as follows.
where p(x) represents the probability density function of random variables x. The entropy function is a symmetric function in its definition domain [0,1]. As shown in Figure 2, the probability of a random event x i is denoted by p(x i ).
When p(x i ) = 0 (or p(x i ) = 1), H (x) = 0. It means that a random event x i will (or will not) occur without uncertainty. Contrarily, when p(x i ) = 0.5, H (x) take the maximum value. It means that a random event is completely uncertain under any conditions. 33862 VOLUME 7, 2019

2) DIRECT TRUST
Direct observation is an interactive record between two entities obtained by observation without a third party. The direct trust is originated from the direct observation between node i and node j, which is represented as D ij . Where node i or node j represents an index between nodes. Due to the exponential distribution denotes the probability of the time interval between two adjacent events occurring, the exponential distribution is adopted as the prior distribution of interactions between nodes. Supposing that the future interacts in the same way as the former, we can represent the direct trust as follows.

3) DIRECT TRUST UPDATE
Assume that the reputation indicator of node i and node j is founded between nodes. The interaction between node i and node j requires (m + n) times, where m indicates the number of successful interactions and n expresses the number of unsuccessful interactions. The reputation of the node j is updated. The representation is as follows.
As we can see from the above, the reputation update is only related to two parameters.

4) WEIGHT ASSIGNMENT
More weight should be given to up-to-date interactive information. Thus, the added weight value can be represented as below.
a new = (s age × a) + m, b new = (s age × b) + n (12) where s age is weight, 0 < s age < 1. The weight ensures that all nodes interact together. The reasonable weight value makes the historical reputation weight decreased gradually. Furthermore, the nodes need to successful interaction together to maintain a good reputation.

5) JUDGEMENT OF DIRECT TRUST
Direct trust and indirect trust are considered within the conventional method, which costs more extra energy and enables the load of resource-constrained wireless sensor nodes heavy. Inspired by human social relations, if the level of uncertainty goes down to a low level, it is unnecessary to consider the recommendation of others. That is to say, direct observation is able to execute the trust assessment. Entropy theory is a concept in the realm of thermodynamics, statistics, and information theory [42]. It is the measurement of uncertainty or information quantity in a random signal or event [18]. Therefore, assume H (D ij ) is the entropy of direct observation and thr is the threshold of non-determinacy. The setting of the threshold is closely related to the security of the network system. The greater the entropy threshold, the lower the system security. If thr ≤ H (D ij ) ≤ 1, which expresses that the non-determinacy of direct trust is high and more related information is needed, then the indirect trust calculation is introduced. If not, the total trust that node i holds about node j is simply set to direct value, i.e. OT ij = D ij .

6) INDIRECT TRUST
When a node is deemed as ''uncertain,'' the recommendation from third parties is required. The assessing node i obtains the recommendation of node j through their common neighbor nodes k, marked as N k . Node i has a prior reputation distribution of common neighbor nodes k already. Node i sends an inquiry message to its neighbors and the common neighbors are shared by node i and node j send back their interaction records with (a kj , b kj ) in response. Accordingly, the reputation of node i and node j can be represented as (a j , b j ). The working mechanism can be illustrated with the help of the flow diagram shown in Figure 3. The circles express the communication range of node i and node j, respectively. More notably, the communication range of selecting neighbor nodes is one-hop. Assume the recommendation offered by the common neighbor nodes k is R k ij . Given (a kj , b kj ) and (a ik , b ik ), the recommendation trust value is calculated as follows, where (Ra k ij , Rb k ij ) is the recommendation interaction record, Ra k ij represents the cooperation interaction record by the common neighbor nodes observes. Rb k ij represents the noncooperation interaction record by the common neighbor nodes observes.
According to the information that node i have, not every recommendation is reliable and trustless feedback cause  error outcome. Apparently, it is significant to estimate the credibility of recommenders to ensure accuracy in calculating indirect trust. Only the recommendations from dependable nodes are acceptable. The trust levels of node i towards recommender k, which is symbolized as follows.
Assume there are r advisers and their trust values held by node i are marked as T i1 , · · · , T i(r−1) , T ir . If T ik ≥ χ , the recommendation from node k is utilized. Oppositely, it will be completely ignored. Where χ (0 ≤ χ ≤ 1) is a self-defined threshold, and k = 1, 2 . . . , r. In our proposed model, we assign weights based on the trust level of recommenders to mitigate the impact of personal preference. The following method is proposed to compute the weight of R k ij .
where s k (0 ≤ s k ≤ 1, q k=1 s k = 1) is the weight of R k ij . q is the number of received recommendations. The indirect trust is as follows.

7) TOTAL TRUST AGGREGATION
The total trust value OT ij , which node i holds about node j, is utilized via the following expression.
where α is considered as a confidence factor. Importing confidence factor is a significantly effective strategy to resist the false recommendation from malicious nodes. Furthermore, it conforms to human interaction customary. It can be calculated as follows.
where t represents the number of cooperation between node i and node j. z is a dynamic value with a range of (0,1) and varies with the application scenario. Apparently, the weight of direct trust value is positively correlated with the number of direct interactions, that is, direct trust value changes with the number of direct interactions.

C. EXPONENTIAL-BASED TRUST AND REPUTATION EVALUATION SYSTEM FOR RESISTING THE INTERNAL ATTACKS
The trust and reputation system is considered as the most effective methods to resist the internal attack, which includes the selective forwarding attack, the on-off attack, the slander attack, and the collusion attack. The on-off attack is considered that nodes behave well or badly alternatively trying to remain undetected while causing damage [43]. The selective forwarding attack is deemed that malicious nodes can transmit or discard specific messages probabilistically, which makes the packets unable to reach the destination, resulting in a chaotic state of the network. Both the on-off attack and the selective forwarding attack are harmful to the internet. Obviously, the trust evaluation system is the most appropriate and effective method to resist them due to the trust of malicious nodes may decrease continuously with the number of noncooperation. Compromised nodes can also act as normal nodes and gain high credibility by the cooperation continues to offer a good reputation for the same type of nodes, which named the collusion attack. For the above internal attack, we can discard the misbehaving nodes by setting a threshold value.
In this paper, an effective method is proposed to resist internal attacks in WSNs, which named exponential-based trust and reputation system, short for ETRES. In this method, the behaviors of nodes are largely depended on the trust value of nodes, which are calculated by the interaction between nodes. Consequently, the system is used to resist the onoff attack and the selective forwarding attack. Additionally, it is also utilized to detect the compromised node, which can launch the collusion attack.

1) WEAKENING THE IMPACT OF THE ON-OFF ATTACK
The on-off attack is launched by malicious nodes. Thus, rejecting to cooperate with malicious nodes is an appropriate way to defense the on-off attack and the selective forwarding attack. In this part, the property of the node is estimated based on the total trust. For the bad nodes, it takes little effect on the total trust, good node versa. The total trust value is calculated by direct trust, which based on direct observation or indirect trust is integrated as needed, which based on indirect observation. The detail process is shown in Algorithm 1. The total trust © the direct trust 7: Else 8: Calculate the indirect trust 9: The total trust © α×the direct trust + β×the indirect trust 10: End 11: End

2) DETECTING THE COMPROMISED NODES
The collusion attack is launched by neighbor nodes. Therefore, the trust of the neighbor node should be accessed when the indirect trust needs to be considered. In our method, there is an attractive way to resist attacks from compromised nodes. When the certainty of direct trust is relatively high, it is unnecessary to compute the indirect trust from indirect observations. It means that the scheme can save more energy and prolong the lifetime of the network. In more detail, resisting internal attacks from the compromised node are two main advantages of our method. One is that when the certainty of the target node is relatively high, the trust of the evaluating node can be calculated by the direct trust. Defending the attacks from compromised nodes can be avoided by without considering indirect information from neighbor nodes. The other is that when the uncertainty of the trust of the target node is relatively high, the indirect trust is integrated to enhance the trust of the evaluating node, which can be calculated by indirect information. However, not all indirect information is trustworthy. It is necessary to evaluate the indirect information from third parties to discard the compromised nodes, which may result in the adverse evaluation of normal nodes. In the course of evaluating the indirect information, compromised nodes can be determined by setting a threshold value χ. It can offer more credible information to evaluate the target node and detect the compromised node. The detail process is shown in Algorithm 2.

IV. PERFORMANCE ANALYSIS AND COMPARISON
In this section, performance and security evaluations are implemented on MATLAB platform. Without considering the internal security in a random appearance, we focus on the efficiency of resisting the internal attacks that keep exist in medium and small scale WSNs. Since RFSN [41] is the benchmark in WSNs, and BTMS [18] has been a highly valued method and received much attention in recent years. Therefore, we contrast ETRES model with typical RFSN [41] and BTMS [18]. The results show that ETRES has a powerful capability of trust assessment and attack defense.
Typically, in the phase of initializing trust values, all nodes are defined as the same initial trust value. We assume that The total trust © the direct trust 7: Else 8: Calculate neighbor nodes' trust value T ik 9: If T ik ≥ χ 10: Calculate the indirect trust 11: The total trust © α×the direct trust + β× the indirect trust 12: Else 13: Discard the compromised nodes 14: End 15: End 16: End all nodes are good nodes. It does not require initialization time, but encourages malicious nodes to create a new ID and reenter the network in a form of new reputation. Conversely, it can resolve the problem of forgery of new IDs, but it takes a lot of time to build trust in the system. Based on the above hypothesis, we propose a neutral method that set the initial trust as 0.5. In other words, let a = b. Unfortunately, it is difficult to determine the number of interactions of a or b. When the number of interactions between nodes is scarce, the trust value is not accurate enough. Contrarily, it not only increases the weight of the historical trust information, affects the evaluation of trust, but also increases the convergence time of the trust value and affects the stability of the network. For a or b, the selection of reasonable value is significant.
In the real world, the base station will collect the sensing data from the sensor node and transmit it to the next hop node. Then, the interaction records are confirmed by comparison. To simplify the simulation, the packet modification/ packet dropping is ignored to verify the proposed evaluation system. Suppose that the signal channel is perfect, and normally transmits packets in ideal condition. In the initial phase, we define the initial trust is 0.5. That is a equals b. The simulation conditions are as followings. Generally speaking, the higher the reliable neighbor nodes of the one-hop communication range, the higher the evaluation. But we set two or three neighbor nodes for simulating simply the proposed method.
The neighbor node number of node j is 2. Node i evaluates the trust value of neighbor node j, then it is renewed for each interaction. The performance of the proposed method, RFSN [41] and BTMS [18] will be compared in four different scenarios.
A. SCENARIO 1 Assume node i and node j are reliable, and the neighbor node is also reliable. Node i intends to interact with node j, and VOLUME 7, 2019 node i needs to evaluate the trust of node j firstly. Suppose the trust of the node i to node j as (7,7). Suppose the trust of the neighbor nodes to node j as (7,7). Suppose the trust of node i to neighbor nodes as (25,5). Finally, we compare ETRES with RFSN [41] and BTMS [18] in trust evaluation. The simulation result is shown in Figure 4.
On account of the above simulation results, RFSN [41], BTMS [18] and ETRES are utilized to evaluate reliable nodes, the trust of reliable nodes is gradually increasing, and the performance of RFSN, BTMS and ETRES are good. Relatively, ETRES is better than RFSN and BTMS due to the fast growth of the trust curve indicates that the initialization time is short. It can save more energy. As shown in Figure 4. Opponents can launch an on-off attack whereby nodes behave well or badly alternatively trying to remain undetected while causing damage [43]. Suppose the trust of the node i to node j as (7,7). Suppose the trust of the neighbor nodes to node j as (7,7). Suppose the trust of node i to neighbor nodes as (25,5). Based on the definition of the on-off attack, we set an attacker to behave well in the first 20 interactions to set up a good reputation but behave badly in the next 40 interactions. And then it behaves well continuously. We compare ETRES with RFSN [41], and BTMS [18] in trust evaluation. The simulation result is illustrated in Figure 5. On account of the above simulation results, RFSN [41], BTMS [18] and ETRES are utilized to resist the on-off attack. For on-off attack, although ETRES, BTMS and RFSN have a similar performance, we can see that the trust value of ETRES falls much faster than that of RFSN and BTMS. It means that the nodes need only a small amount of bad behavior to cause the loss of trust quickly in a short time. Apparently, it also obeys human interaction rules. As shown in Figure 5. The red square solid line represents the simulation result of ETRES. The magenta round solid line represents the simulation result of RFSN. The blue asterisk solid line represents the simulation result of BTMS.
In order to verify the extensiveness of the algorithm, we assume the neighbor node number of node j is 3. At the same time, various parameters will be set in this simulation.

C. SCENARIO 3
Assume node j is unreliable node and one of the neighbor nodes between node i and node j is an unreliable node. But the other two shared neighbors are normal nodes. Node i intends to interact with node j, and node i needs to evaluate the trust of node j firstly.
Suppose the trust of the node i to node j as (20,20). Suppose the trust of the neighbor nodes to node j as (0,0). Suppose the trust of node i to neighbor nodes as (2,15), (9,9), (30,2) respectively. Finally, we compare ETRES with RFSN [41] in trust evaluation. The simulation result is shown in Figure 6.
On account of the above simulation results, RFSN [41], BTMS [18] and ETRES are utilized to resist attacks launched by the compromised nodes. From Figure 6 we can know, compared with RFSN and ETMS, the trust of ETRES decrease quickly than RFSN, which means ETRES has a better performance to resist attacks launched by the compromised nodes.   D. SCENARIO 4 In this part, we assume that node j is unreliable. What's more, neighbor nodes are compromised nodes. Node i intends to interact with node j, and node i needs to evaluate the trust of node j firstly.
Suppose the trust of the node i to node j as (15,15). Suppose the trust of the neighbor nodes to node j as (8,8), (6,1), (6,1), respectively. Suppose the trust of node i to neighbor nodes as (10,1). Finally, we compare ETRES with RFSN [41] and BTMS [18] in trust evaluation. The simulation result is shown in Figure 7.
On account of the above simulation results, RFSN [41], BTMS [18] and ETRES are utilized to resist the collusion attack. As for Figure 7, our proposed method can effectively resist the collusion attack, while RFSN and BTMS have a poor performance to resist the collusion attack.
Briefly speaking, the simulation results based on the above results show that the proposed scheme ETRES has a powerful ability to trust assessment and attack defense. Compared with RFSN and BTMS, there are several reasons for obtaining such simulation results. Firstly, we use entropy theory to evaluate the uncertainty of direct trust. Only when the uncertainty is high enough, indirect trust is introduced to enhance the certainty of direct trust. It is beneficial to improve the security of the network by obtaining high trust value in a short time. Furthermore, the trust and reputation evaluation system can save a lot of energy due to indirect trust is calculated as needed. As shown in Figure 4. Secondly, when a node behaves badly, other nodes refuse to interact with it. The uncertainty of the direct trust of the node increases dramatically over time, and then the direct trust declines rapidly. As shown in Figure 5. Thirdly, as for the attacks launched by compromised nodes on the internet, the confidence factor is integrated into the trust management system to resist the internal attack dynamically, which is computed based on the number of operations. Especially when the compromised node performs a bad behavior, this method can make the trust value of the node drop quickly. As shown in Figures 6-7.

V. CONCLUSION
Trust management system is an effective method to detect misbehaving from malicious nodes. At present, a large number of trust management systems based on the beta distribution are proposed. Unfortunately, there is a potential hypothesis which two states exist in the process of interaction between nodes. In fact, it may lead to inaccurate trust values due to multiple states exist in WSNs. Therefore, a trust and reputation system based on the exponential distribution, ETRES for short, is proposed. In our method, the exponential distribution is used to express the trust and reputation of nodes. It can establish a trust management system based on the state of successful interaction without considering other states. The confidence factor is redefined, which is computed by the number of successful interactions. It can force the direct trust to drop rapidly, which can weaken the impact of malicious nodes. Compared with RFSN and BTMS, ETRES evaluates the total trust of nodes by its reputation distribution and its confidence factor that on the basis of the successful interaction information. The simulation results show that ETRES can evaluate the trust of nodes reasonably, and it can resist internal attacks, especially on-off attacks. The trust of nodes is used for the scheme of data aggregation. The node with high trust is selected reliable relay nodes to transmit data, which can reduce the risk of internal attacks in the network. Furthermore, the proposed method is conveniently incorporated into the existing network. Unfortunately, there are still some drawbacks in our method. Although the proposed method can effectively resist the internal attacks, the performance difference between the above method seems to be very close. Therefore, in the future, we will be committed to improving the algorithm for detecting compromised nodes effectively and enhancing network security. In addition, we would like to concentrate on the application of the trust management system and seek a better way to balance between energy and security.