## 2 Previous Work
### Trust and Security in WSNs  
In this section, we will discuss the literature related to WSN trust and security. The authors of [1] explain the difference between sensor networks and traditional wireless _ad hoc_ networks. For each layer of the protocol stacks, they survey the different issues and technologies for the sensor networks and provide the available solutions for each. They also highlight the open research issues at each layer. The authors of [7] discuss the challenges in designing a routing protocol for wireless sensor networks and provide a survey of the different available routing techniques. They classify the techniques based on the network structure as flat, hierarchical, or location-based; and based on the protocol operation as query-based, multipath-based, quality-of-service-based, coherent-based, and negotiation-based. For each routing technique, they state its advantages and shortcomings and study the energy and communication overhead tradeoffs. The authors of [2] consider routing security. They discuss the different attacks and present countermeasures. They analyze the security of the major routing protocols and energy-conserving topology maintenance algorithms for sensor networks. They explain how attacks can be adapted from peer-to-peer and _ad hoc_ networks to sensor networks, and present two new attacks: sink holes and HELLO floods. An energy-efficient routing technique is discussed in [8], where the authors develop and evaluate many techniques to enhance routing based either on energy histograms or solely on localization. They show the network lifetime gains for each technique. Localization is a method that can be beneficial to detect complex colluding nodes attacks. Several methods are available to detect misbehaving nodes, to lengthen the network lifetime, and to decrease energy consumption while providing secure routing; among these are: reputation- and trust-based methods [3, 9], location isolation [4], and behavior-based techniques [5]. Of these, we focus mainly on trust- and reputation-based methods, with some behavior consideration at the BS. The authors in [9] explain the difference between sensor networks and traditional mobile _ad hoc_ networks and survey several trust-based systems in wireless sensor networks. They provide different trust definitions and properties as defined in the literature and state that the definition is application-specific and depends on the methods used to calculate the trust value. They extend the definition of trust to include the sensor data and reliability as a new component and introduce a new trust model that is believed, as per the authors, \"to be very robust as it addresses all the drawbacks from the existing approaches.\"  
The authors in [10] differentiate between the security requirements of WSNs and other networks. They present iTrust, which depends on the presence of monitor nodes to assess the behavior of their neighbors and distribute the trust indices after each session. The authors evaluate their model and show its robustness against different attack scenarios. This method uses the available constrained sensor nodes to assess behavior and distribute trust, instead of fully delegating this burden on the powerful BS. Trust models are surveyed in [11]. The author explains the difference between security and trust and between reputation and trust. He surveys the methodologies and factors used in the different trust models and states that in wireless sensor networks it is not enough to examine routing messages to infer trust; however, new methods are needed to calculate both communication trust and data trust while keeping in mind that data is sometimes continuous. In [12] the authors present a security survey on WSNs. They first target the network layer and identify the vulnerabilities and summarize the different defense methods in this protocol layer.