## 3 Communication Framework Overview for Sensor Data Loss Reduction  
In this section, we present an overall framework to reduce sensor data loss in the course of communication failure. In fact, this framework provides for the requirement analysts or designers a guideline for the identification and realization of functionalities necessary to support the reduction of sensor data loss during communication failures in wireless sensor networks. Our overall framework has five sequential modes over a sensor node, as shown in Figure 1, which are the _Normal Operation_ (_NO_), _Communication Failure Propagation_ (_CFP_), _Sensor Data Save and Compression_ (_SDSC_), _Communication Recovery Propagation_ (_CRP_), and _Compressed Data Transmission and Recovery_ (_CDTR_) modes,. The detailed explanation of the overall framework is as follows:  
In the _NO_ mode, each sensor node in a sensor network performs its operations normally, such as sampling, processing, sending, or receiving sensor data. There occurs no communication failure in this mode. When a communication failure occurs, the sensor network mode moves from the _NO_ mode to the _CFP_ mode. In this mode, the first sensor node to detect a communication failure propagates to its neighbor nodes a Communication Failure (_CF_) message to notify them of the communication failure occurrence. Every sensor node to receive a _CF_ message tries to find an alternative routing path, other than via the sender node of the _CF_ message. If the sensor node finds a new routing path, it invalidates the routing path via the sender node of the _CF_ message and performs transmission operations through the new routing path. If any new routing path is not found, then the sensor node propagates to its neighbor nodes the Communication Failure (_CF_) message and its mode moves into _SDSC_ mode. In this mode, the sensor node starts saving sensor data generated from its sensor into its data queue. The sensor node performs the compression operation over some or all of the sensor data in the queue when the data queue is full. In this mode, as soon as the sensor node receives from the previous sensor node of the CF message a Communication Recovery (\(CR\)) message to notify that the previous communication failure has been recovered, the sensor node mode moves from the _SDSC_ mode into the _CRP_ mode. In _CRP_ mode, the sensor node validates the invalidated routing path via the sender, propagates the CR message to its neighbor nodes again and then its mode moves to the _CDTR_ mode. In the _CDTR_ mode, the sensor node reverts to using the validated or recovered routing path from the previous mode as a new primary routing path. In this mode, the sensor node sends all the saved or compressed sensor data in data queue and the compression information through the recovered routing path. After that, the sensor node mode returns to the _NO_ mode and proceeds with normal operations. The destination node to receive all the compressed sensor data and the compression information proceeds with restoring all the lost sensor data from the compression in _SDSC_ mode to the approximated values, which are similar to their original sensor data. There occurs sensor data loss due to the compression operations in _SDSC_ mode. In fact, sensor data loss is inevitable in the communication failures with no alternative routing path. Specifically, in the long-term communication failures, without taking any action after the full state of the data or the routing queue, almost all of the new generated and routed sensor data will be lost inevitably. Therefore, lost sensor data cannot be restored to the same values as the original sensor data, or even to similar values. The only solution to resolve this problem is to devise a compression method to compress sensor data in a full queue state and restore the lost ones in the compression process to the same or similar values.