Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March...

18
Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Transcript of Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March...

Page 1: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Query Processing for Sensor Networks

Yong Yao and Johannes Gehrke

(Presentation: Anne DentonMarch 8, 2003)

Page 2: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Outline What sensor networks are we talking

about? What are the issues? What are the choices? Network issues

Routing Database issues

Query plans Related work

Page 3: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

What Sensor Networks are we talking about?Commercially available: Size: a few cubic inches

Projected according to Moore’s law: ¼ inch available soon (not sure sure if Moore talked about batteries …)

Operating system Embedded version of Linux (redhat) or Windows

ce.net Wireless multi-hop RF radio Powered by batteries (LAN-attached with permanent power sources

exist also)

Page 4: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Berkeley MICA Motehttp://www.xbow.com/Products/Product_pdf_files/Wireless_pdf/MICA.pdf

Note relatedwork toGehrke’sis done atBerkeley(TinyDB)

Page 5: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Issues Wireless

Limited QoS Latency with high variance Limited bandwith Frequently drops packets

Power consumption 1 year idle 1 week under full load

Computation Limited memory and computing power

Uncertainty in sensor readings

Page 6: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Supported Sensors Temperature Light Magnetometers Accelerometers Microphones

Page 7: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Example Uses Buildings

“Is Yong in his office” “Is there an empty seat in the meeting room”

Biology Find out about existence of specific species

of bird Map bird’s trail

MICA Mote developed under DARPA grant …

Page 8: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Choices Query layer should be declarative

Abstract user from physical details (Why are database people interested …)

In-Network processing Preservation of energy and bandwidth Ratio of sending 1 bit vs. executing one instruction 220 to

2900 depending on architecture Different trade-offs => job of query layer

Long-term, e.g., monitoring environment Short-term, e.g., battlefield

Query Proxy between network and application layer (bypasses routing layer to some extent)

Must be closely linked with network layer

Page 9: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

More Choices Special nodes to access network Gateway nodes Noise requires “fusing” of data Aggregation important Queries need DURATION and EVERY Event-oriented model (triggers)

desirable but not implemented

Page 10: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

In-Network Aggregation Why?

Energy to transmit is heaviest burden Partial aggregation

Possible for algebraic aggregate operators (MAX, MIN, SUM, AVG)

Impossible for holistic operator (MEDIAN)

Otherwise: packet merginghttp://citeseer.nj.nec.com/gray97data.html

Page 11: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Synchronization Necessary for partial aggregation and

packet merging AVG and SUM are duplicate sensitive

aggregate operators: Spanning tree MIN and MAX are not duplicate sensitive DAG may be sufficient

Pragmatic approach to synchronization Problem: Predictions may fail due to network

reorganization or query results bi-directional prediction

Page 12: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Routing Differences to wired network

Everybody has to share the routing job Network is unstable

Many ad-hoc routing algorithms exist Routing layer in protocol stack

Database approach requires changes to routing protocol Gehrke points out that that’s not unusual:

Database file-access also bypasses operating system to some extent

Page 13: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Changes to Routing Protocol Intercepting of packets to achieve

Packet merging Partial aggregation

Differences in communication pattern Communication with leader rather than

point-to-point Knowledge about neighbors

Route initialization and maintainance …

Page 14: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Query Plans Example query “What is the quietest open

classroom in Upson Hall” 2 levels of aggregation

Compute average value for each qualified class room Select minimum average over all class rooms

Query plan has Flow blocks Leader nodes

Differences to traditional optimizers Focus on communication cost Flow block instead of relational operator

Page 15: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Flow blocks Task

Collect data Perform computations

Parameters Set of source nodes Leader selection policy Routing structure, e.g., DAG, tree Computation

Page 16: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Query Optimization ExampleSELECT D.gid, AVG(D.value)FROM SensorData DGROUP BY D.gidHAVING AVG(D.value)>Threshold Flow block for each group

Good if nodes in group physically close In-Network Aggregation

Single flow block for all Better if nodes in group are interspersed No In-Network Aggregation possible Packet merging more efficient

Page 17: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Experiments Using a simulator IEEE 802.11 as MAC layer Prove energy decrease from in-

Network aggregation and packet merging

Extra delay overcompensated by reduced collisions

… prove that the rest works too

Page 18: Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)

Summary Interesting database as well as

network issues No data mining issues in this paper

(although I could think of some …)