## 2 State of the Art  
In the recent years, many researchers have considered the problem of performance monitoring in WSNs under different requirements and objectives. The main proposed approaches can be classified into the categories of active and passive categories, with some others that are in the middle. To the first category belongs Memento [15]. It makes use of an in-band monitoring approach since it allows nodes to transmit additional diagnosis packets in the same channel of the data packets. Three broad classes of information are introduced: failure detection to inform the user about failed nodes, symptom alerts to proactively inform the user about symptoms of impending failure or reporting on performance, and ex-post facto inspection to inform the user of the timeline of the events to help infer why a failure or symptom occurred. According to this approach, it is required that each node uses its portion of memory and computing capacity to create the new monitoring messages. Apart from consuming the bandwidth of the network with the new message, the main problem of this approach is the use of the nodes computing and memory capacities. Similarly, Sympathy [16] is an active in-band monitoring tool that has defined some metrics to enable failure detection and an algorithm to find the potential causes. However, due to limited processing power at the nodes and the limited bandwidth of the network, it is very likely that the introduced diagnosis overhead interferes with the operation of the network itself. SNMS [17] is another active in-band monitoring approach. Its innovation is that SNMS generates network traffic only in response to direct human actions and not during the steady state. With respect to the previous ones, it then limits the usage of the network capacity and node computational capacities; however, it still needs a considerable amount of nodes memory. Compared with the predecessors in-band monitoring algorithms, DiMo [18] performs some processing locally at the nodes involved in the measurements so that they only report to the sink if a node is potentially failed. This greatly reduces the transmission overhead and energy consumption. In the middle between the active and passive categories, there are some hybrid methods that make use of the two types of approaches. In the active approach, a tag is introduced on all packets and a sniffer is used to capture the traffic and analyze the tags. In the passive approach, an out-of-band infrastructure is used for the monitoring, where no additional packets are generated but the computing capacity of the nodes is used for the analysis of the packets. DiF [26] is a Diagnosis Framework for WSN that introduces packet tags. The purpose of the framework is to minimize the effort spent on developing diagnosis tools for variety of WSN, to speed up development of WSN, and to simplify diagnosis and verification of network deployment. It is a very effective method, but it is very complex to be implemented for large networks. In [19] the researchers propose DSN: a non-permanent, wireless cable replacement. It makes use of an out-band monitoring approach and does not disturb the target WSN more than the traditional cable-based approach. The DSN nodes are attached to WSN target devices via a programming and debugging cable and form an autonomous network. DSN nodes provide two radios. The first radio (DSN radio) is used to form a wireless network among the deployment support nodes, while the second radio (WSN radio) is used to overhear the traffic of the sensor network. SNIF [24] is a general framework for passive inspection of multi-hop sensor networks to detect problems related to individual nodes, wireless links, paths and global problems. To overhear the traffic of multi-hop networks, multiple radios are needed, forming a distributed network sniffer. SNIF uses a wireless network of DSN. This approach works indeed very well in small size networks. However, as soon as the network size increases, this approach has the problem of scalability.