# A Reference Model for Monitoring IoT WSN-Based Applications
## 2 Wireless Sensor Networks Monitoring Tools
Developed on TinyOS, it constitutes a complete network management system. Nucleus uses a service, which is independent of the data network, which allows the distribution of queries and collecting results. It also includes a system event logger, where variables and events to monitor are specified by the application programmer. Nucleus is the clearest example of active monitoring. Sympathy [16] is the most cited example of passive monitoring. Sympathy analyses information flows received by the sink and it is able to infer faults and their probable origin using a decision tree. This is based on the premise that a sensor network application produces a predictable flow of traffic using periodic messages. Any changes in this flow indicate strange behaviors. The causes of these alterations can be deduced from the well-known characteristics of the traffic. PAD [17] assumes a similar approach, but each more actively marks the packets sent with two bytes, which help to build an inference model to reconstruct the network topology in the central processing station. The fault detector does not need to be centralized in the application gateway. The authors of Memento [18] propose a distributed system that sends periodic messages with information on their own state. These messages, bitmaps, are added along the way to the sink. In addition, each more can detect faults in their neighbors if they fail to transmit a regular heartbeat. Thus, motes can transmit their view of network status, which can be corrected by their parents. Memento is an active monitor, but the intrusion is minimal. Event-based networks, however, have no regular and predictable traffic. Bearing this in mind, the authors of Envirologo [19] proposed a system to record and replay events. The code of the more is extended with annotations that mark which events should be stored in the non-volatile memory. Traces stored in this way may then be replayed upon demand, even at different speeds. Lightweight tracing [20] provides a path-encoding algorithm that produces highly compressed traces, which are stored in non-volatile memory. In NodeMD [21] a more checks for faults, reporting them by sending a trace that stores the sequence of events that led to the failure, and automatically quarantines itself, entering an interactive mode to allow the network manager determine the causes of failure. PDA [22] proposes a mechanism called passive distributed assertions that allows developers to detect failures and provides hints on possible causes. PDA allow a programmer to formulate assertions over distributed node states using a simple declarative language, causing the sensor network to emit information that can be passively collected and evaluated to verify the assertions hold. Reference [23] presents FAMoS: a flexible active monitoring service to collect wireless sensor network traffic volume and distribution data. The service is provided with limited overhead and it is applicable in many contexts. Each node locally collects data about network traffic and then periodically transmits the data to a back-end for further analysis and processing. All these cases involve some sort of intrusiveness in the system: the monitored application is not identical to the one that will be executed. This can lead to a 'probe' effect: by removing the monitoring system (all resources are required in real installations) the system behaves differently and our initial premises may be invalid. Also, the instrumented code to provide information to the monitors can introduce new bugs. Some proposals try to minimize the intrusion degree using the debugging port of sensor nodes: FlashBox [24] is a Flash-based system to record non-deterministic events in embedded systems that can aid in crash investigation and replay. It is a minimally invasive monitoring system. The Aveksha platform [25; 26] provides tracing of events and breakpoints for a single node co-locating a debug board with the sensor node under test.