Middleware Architecture of WSN:
i. The middleware generally gathers information from both the application and network protocols, determines how to support the connected applications, and at the same time adjust network protocol parameters.
ii. Sometimes the middleware goes under the network protocols layer and interfaces with the operating system directly. WSN middleware needs to dynamically adjust network protocol parameters and configure the sensor nodes based on application requirements in terms of performance improvement, QoS, and energy conservation.
iii. The WSN middleware can abstract the common properties of applications and offer general purpose services that can be used by a wide range of applications.
iv. In general, a middleware solution may consist of three components: resource management, which is a functional element that monitors the network status and gets application requirements, event detection and management that is used to detect and manage events, and API (Application Programming Interface) which is invoked by the applications in order to use services of the middleware and achieve the required performance and QoS parameters. Figure below shows a general architecture of a WSN middleware.
vi. WSN middleware should provide data management functions since it is dealing with a data centric technology. These data management functions can include the following:
• Data dissemination:
i. In WSN the data sensed by the sensor nodes need to be transmitted to a special node or a sink for more analysis, control, and management.
ii. Data dissemination protocols which are related to routing protocols are required to provide an effective data transmission.
iii. The major difference between a data dissemination protocol and a routing protocol is that the former is general and designed to find a path between source and destination, and the latter should guarantee successful transmission from nodes to sink.
The initial phase of triggering data transmission that is initiated by the sink, and the data transmission phase when sensor nodes report data to the sink.
• Data compression:
Many characteristics of WSN make it possible to implement effective data compression techniques.
i. First, neighboring sensor nodes tend to collect correlated data especially when their deployment is dense in the network.
ii. Second, this correlation may become more apparent on the path from the sensor nodes to the sink due to the treelike logical topology of most Wireless Sensor Networks.
iii. Third, the occurrence of an event in WSN may be assimilated as a random process whose information content can be extracted easily.
iv. Fourth, the application semantics in WSN may enable data aggregation and data fusion.
vi. Fifth, the data reading and reporting in WSN can be reduced thanks to the tolerance of applications for possible errors in data.
Compression includes the following techniques: Information theoretic-based techniques such as Distributed Source Coding Using Syndromes (DISCUS), data aggregation-based compression schemes such as tiny aggregation service for TAG, and sampling of a random process.
• Data storage:
i. Data storage sensor nodes store data related to the sensed events for future use. When considering data storage, several questions need to be answered concerning the type of data that need to be stored, where this data should be stored, and for how long.
ii. This will help defining the data storage requirements of WSN. There exist two types of data in WSN: the raw data collected directly by the sensor nodes and the results from the processed data collected initially.