D ata-Centric m iddlew are m ainly processes the sensor data an d com m unicates this data to external applications by introducing generic interfaces. D ata-Centric m iddlew are can be classified into three m ain categories w ith respect to w here the d ata processing takes place. Dis tribu ted In-netw orking processing w here queries an d aggregation is done in the netw ork itself. This approach is applicable in hom oge neous netw orks b u t provides lim ited flexibility in heterogeneous n et w orks w here som e devices m ight n o t be able to com m unicate to each other an d w here centralised translators are needed.
In centralised system s, it is difficult to m aintain an energy-efficient processing as each node has to com m unicate its data to a centralised p o in t w ith o u t perform ing any d ata aggregation. In hy brid approaches, b o th solutions are com bined. In Figure 6, hybrid an d decentralised approaches are shown. In the hyb rid approach, cluster h eads or gate-
2 . 2 M I D D L E W A R E A P P R O A C H E S FOR S E N S O R N E T W O R K S 2 7
Figure 6: Hybrid vs. Decentralised Middleware Approach
ways w hich collect an d aggregate d ata from their neighbouring nodes, split the netw ork into several regions and are responsible for some processing in the netw ork an d p u sh this data to the user term inal. In the decentralised approach all the processing is done in the netw ork in connection 1) and in connection 2), a sink no de sends the aggre gated and processed data to the user term inal. The following section describes the related w ork to data-centric approaches and discusses their design capabilities and advantages.
2.2.1.1 Cougar
The C ougar m iddlew are [138] introduces a declarative database ap proach in w hich the inform ation gained by the sensor nodes is re trieved via declarative queries. The architecture is divided into gate ways and sensor nodes. The gateways ru n a q uery optim iser w hich generates distributed query processing plans and dissem inates them to the nodes. The nodes ru n a query proxy layer interacting betw een routing and application layer. The m iddlew are su pp orts in-netw ork aggregation w here for exam ple queries such as a v g /m in /m a x can be h and led in a capillary network. C ougar leverages a database-like ap proach. External Q ueries are processed by central qu ery optim isers w hich execute the query on the d istributed nodes an d optim ise the queries according to aggregation and in-netw orking attributes. The qu ery optim iser ru n n in g on a gateway is centralised an d m ust there fore be aw are of all the nodes. If any of the nodes fails it has to be u p d ated im m ediately as query plans could be dissem inated to faulty or disappeared nodes. Gossip algorithm s are p ropo sed to forw ard the netw ork status to the query optimiser. The p rim ary platform of cougar is the Mica node run nin g the TinyOS operating system. H ow ever, the evaluation never left the NS-2 [98] sim ulator. O ne m ain goal of C ougar is to reduce the com m unication cost and therefore aggre gation and in-netw orking processing are the m ain objectives of this m iddlew are. In Cougar, gateways are used to distribute the queries to the capillary netw ork. Leader nodes are used to aggregate the data from other nodes or to p u sh partial data to nodes for further process
ing. The d ata can be accessed th ro u g h a SQL-like language. C ougar introduces long-running queries as they are needed in W SN to m on itor phenom ena. These long-running queries usually are n o t realised in conventional system s an d are specifically introd uced for sensor netw orks.
2.2.1.2 SIN A
SINA [115] is a data-centric m iddlew are. SINA introduces tw o dif ferent w ays to interact w ith the sensor netw orks. First, a declarative language sim ilar to SQL to retrieve d ata by the netw ork. A nd sec ond, a Sensor qu ery an d tasking language (SQLT) w hich is a pro cedural prog ram m in g language an d enhances the m iddlew are w ith an event-based approach. Events can be triggered th ro u g h m essages sent by other sensors an d tim ers. SINA introduces tw o following tech niques: H ierarchical C lustering an d A ttribute-based N am ing. H ierar chical C lustering groups sensor nodes according to pow er level an d proximity. This grou pin g is applied recursively to form the hierarchy. The cluster head aggregates, fusions an d filters the d ata by the group to save energy. A ttribute-based nam in g introduces abstraction to the sensor n etw ork in w hich queries are n o t lim ited to q uerying nodes by their nam e b u t also by their context attributes such as geospatial area or sensor type. Sensors m atching these attributes w ill then form a g roup (e.g. typ e = tem perature, location = N orth-East) an d cluster head s w ill aggregate the d ata in the group.
2.2.1.3 TinyDB
TinyDB [89] is a distribu ted query processor ru n n in g on TinyOS [77]. TinyDB is included in the TinyOS developm ent kit an d therefore has a h u ge distribution in the sensor netw ork research co m m unity TinyDB as a standalone com ponent cannot be considered as m iddle w are. However, its data storage an d hand ling can be seen as an in term ed iary layer th a t abstracts the d ata access from underlying W SN technologies. TinyDB introduces a SQL-like language w ith the fea tures such as SELECT, FROM, WHERE, GROUP BY. The qu ery p a ram eters are im plem ented according to the n eeds of sensor netw orks. Tem poral aggregates are u sed to b u ild an aggregation over a specified tim e period. A fter this tim e period, the collected d ata is aggregated an d forw ard ed to the consumer. Event-based queries are triggered w h en a certain event happens; events are prog ram m ed on a lower- level layer such as the operating system. This im plem entation is done on the n od e itself an d no distribu ted event-based processing is su p ported . Lifetim e-based queries ru n over a long p erio d (weeks, m onths, years). The sam pling rate is ad ap ted to this period, the longer tim e range im plies less sam pling rate to reduce energy consum ption in the nodes.
2 . 2 M I D D L E W A R E A P P R O A C H E S F OR S E N S O R N E T W O R K S 29
2.2.1.4 Discussion
D ata-centric approaches utilise sensor netw orks as databases th at can be queried th ro u g h SQL-like statem ents. Sensor data is stored in ta bles an d can b e queried on dem and, on a frequent basis or on spec ified events sim ilar to triggers in traditional database approaches. A central q uery processor is usually n eed ed to develop a q uery p lan w hich can be distrib uted over the netw ork an d also acts as the ter m inal p o in t for u ser queries. The m ain challenges in this aspect are the q uery distribution an d data aggregation. Data-centric approaches are useful in m onitoring scenarios in w hich it is m ore im po rtan t to retrieve inform ation th a n interact w ith the nodes. Solutions such as C ougar can be seen as the first conceptual step into data-centric m id dlew are solutions for WSN. It is a centralised approach b u t in tro duces m echanism s for data-aggregation an d in-netw ork processing as it can be seen in Table 3. Solutions such as SINA an d TinyDB en hance C ougar ap proach by introducing a pro ced ural p rogram m ing language for better event handling. TinyDB is a m ore com plete so lution for data-centric approaches im plem ented for the TinyOS oper ating system ; the others never left the sim ulator as show n in Table 2.
Table 2: Data-Centric middleware approaches
M id d lew are P latform
C ougar NS-2
SINA Clom oSim
TinyDB Mica2
Table 3: Features of data-centric middleware
Cougar SINA TinyDB |
1 Self-H ealing Backup cluser head N o N o 1
I Ota C od e deploym en t N o N o N o 1
1 H eterogeneous N o d e Support N o N o TinyOS ]
1 Sensor Discovery N o N o N o 1
1 Declarative Q uery Yes Yes Yes 1
1 Event-based triggering L ong-running queries Yes Yes 1
1 SOA Integration N o N o N o 1