## 4 Attack Resistance
### Denial of Service Attacks  
A Denial of Service (DoS) attack is an attempt to interrupt, disrupt, or destroy services and operations in a system, which includes:* _Jamming, collision and flooding_: These attacks consist in interfering in communication by sending messages through several protocol layers. The immediate effect of these attacks is the loss of part of the messages from the nodes of the affected area. The affected area depends on the layer in which it occurs. The upper the attack occurs on the protocol stack, the more it spreads. So the scope of these attacks could be zone or global depending on their dimension and the layer where they occur (physical, link, or transport layers). [PERSON] and [PERSON] [34] explain several countermeasures for these attacks: they suggest confinement, small frames, error-correcting codes and client puzzles.
* _Neglect and greed_: This simple form of DoS attack focus on a router vulnerability by arbitrarily ignoring all or some messages. It is especially dangerous in environments using hierarchical routes and static routing protocols. A possible solution would be a routing protocol with several paths available [34].
* _Misdirection, blackholes and wormholes_[35]: These attacks are very difficult to avoid, detect and confine. Authorization and monitoring have been proposed to avoid them. However, it is not possible to deploy a secure wireless sensor networks based exclusively on ciphering and authorization. It is necessary to supply additional techniques to reinforce the system. We will use redundancy again to detect these attacks. There exists some countermeasures consisting on enhanced protocols [36], however they require too many resources to be used in tiny nodes.  
Now, we will show how our system can detect and confine the denial of service attacks.  
Jamming, collision and flooding  
Whether it is jamming, collision or flooding, the effects in the network are similar: loss of messages and node disappearance. The seriousness and extension of the attack depends on the number of nodes, the stack layer where it takes place and several other parameters. Nevertheless, it leads some nodes to disappear. As no new value from these nodes arrives to the routers, as trust tables are sent to the servers, the global trust service will soon discover that the latest values coming from these nodes are obsolete and it will mark them as lost.  
The detection of the attack can be performed when a group of nodes in the same area disappears suddenly. If a node with positive reputation disappears temporally its reputation will be decreased. This measure will also affect directly to the routers in the area. Therefore, a message will not be sent through an affected router, avoiding the zone.  
Flooding attacks could be more dangerous if messages are scattered and the whole network is affected. But if the reputation of a faked node is decreased, its forwarded messages will not be routed and, therefore, harm will not spread.  
Neglect and greed, and blackholes  
A router may neglect to route all or some messages, but every node has two or more routers that are used randomly, and so eventually the messages will arrive to the destination.  
Some of the messages include their own route, and the servers analyze the routes of consistent messages to find out the routers which do not route properly. A feedback of negative reputation for these routers will cause messages to follow other routes avoiding these malicious routers.