CSE 599c Hot Topics in Data Management Systems

Lecture 10: Sensor Networks

Magdalena Balazinska

Winter 2006

Today's Papers

S. Madden, M. Franklin, J. Hellerstein, and W. Hong. TinyDB: An Acquisitional Query Processing System for Sensor Networks. In TODS 30(1), 2005.

Outline

Stream processing related research projects

Note: slides removed from online version

Sensor networks

Properties of sensor networks

Why a query processor?

Query processing challenges

Query processing techniques

What is a Sensor Network

Wireless sensor

Wired server

Some Sensor Network Properties

Battery powered

Limited resources

Low processing speed, small memory, low bw

Wireless communication

Communicate only with direct neighbors

Only a few sensors talk to the wired base station

Broadcast communication

Must be autonomous!

Data Processing Challenges

Energy conservation

Accuracy, latency, res. utilization trade-offs

ex: chose sampling rate or desired life-time

Must consider low-level processing aspects

Readings to collect (when and where)

How to transmit and aggregate data on the way

What topology to form

How to handle failed transmissions

Benefits of a Query Processor

Writing applications for a sensor network

Involves programming many features

Requires significant expertise

Must conserve energy at application level

Query processor can provide

Functionality shared across many applications

Efficient implementation

Declarative query language is easier to use

Want to target non-experts

Proposed Approach

Develop a query processor: TinyDB

Users submit declarative queries

System takes care of the rest

TinyDB components

Query language

Query optimization

Query dissemination

Query execution

Query Language: Sampling

[Figure 1

from Madden2005]

SELECT nodeid, light

FROM sensors

SAMPLE PERIOD 1s

FOR 10s

SELECT nodeid, light

FROM sensors

LIFETIME 30 days

Query Language: Events

ON EVENT bird-detect(loc):

SELECT AVG(light), AVG(temp), event.loc

FROM sensors AS s

WHERE dist(s.loc, event.loc) < 10m

SAMPLE PERIOD 2s FOR 30s

SELECT nodeid, temp

WHERE temp > thresh

OUTPUT ACTION SIGNAL hot(nodeid,temp)

SAMPLE PERIOD 10s

Query Optimization

Cost-based optimization at base station

Minimize power consumption dominated by

sampling physical sensors

transmitting query results

Optimizer inputs:

Query to optimize, operators selectivities

Cost of sampling each attribute (energy)

Cost of processing and transmitting (energy)

Power-Aware Optimization

SELECT accel, mag

FROM sensors

WHERE accel > c1 AND mag > c2

SAMPLE PERIOD 0.1s

Cost accelerometer: 0.0048 J/sample

Cost magnetometer: 0.295 J/sample

Power-Aware Optimization

[Fig 6 from

Madden 2005]

Query Dissemination

select light

from sensors

where loc=B

Do I need to

participate?

loc=A

loc=B

Approach: semantic

routing tree on a

constant attribute

Semantic Routing Tree

flood request

to build tree

loc=A

loc=B

Choose parent based on

- semantics

- link quality

Tell parent attribute value

Query Execution

Precondition: nodes are synchronized

Step 1: Sleep

zzz

zzz

zzz

zzz

zzz

zzz

zzz

zzz

zzz

select avg(temp)

from sensors

sample period 1s

Query Execution

Step 2: Wake-up and sample

Step 3: Receive data from children

Step 4: Process aggregate data locally

Aggregate: init, merge, & evaluate

Step 5: Send to parent

(1,75F)

(1,76)

(1,77)

76F

79F

78F

(4,304)

(1,78)

(6,461)

(1,76)

temp=76.9F

75F

76F

77F

78F

76F

Conclusion

Data management problems

Not limited to beefy servers

Also exists on small and heterogeneous devices

Sensor networks are one extreme example

Query processor simplifies app. development

Main optimization criterium is power

Must consider various low-level challenges

2006-01-01T23:16:26