March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor...

25
March 6th, 2008 Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph Hellerstein, Wei Hong Published in 2002 Research funds coming from IBM, Intel, and Microsoft

Transcript of March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor...

Page 1: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

TAG: a Tiny Aggregation Service for Ad-Hoc Sensor

NetworksSamuel Madden, Michael J.

Franklin,Joseph Hellerstein, Wei Hong

Published in 2002Research funds coming from IBM, Intel, and

Microsoft

Page 2: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Motivation

• Sensor networks are computers• Applications extract Info from network

• Aggregation saves resources• Philosophy: Aggregation as network service

• Extract info aggregation to higher level

Page 3: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

TAG Contributions

• Basic query interface (like SQL)

• Power and time efficient distribution of queries

• Query Language Abstraction leads to Optimizations

• High level language leads to network loss techniques

Page 4: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Ad-Hoc Routing

• Doesn’t matter, as long as:– Query requests deliverable to all nodes

– Provides routes from every node to root

– No duplicate messages received by node

• TAG uses a routing tree

Page 5: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Routing Tree

1

2 3

56 4

RootP: NoneL: 0

P: 1L: 1

P: 1L: 1

P: 3L: 2

P: 3L: 2

P: 2L: 2

P = ParentL = Level

Page 6: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Query Model

• SQL style query syntax• Table called “sensors”• Schema known to base station• Append-only relational database

Page 7: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

TAG Query Syntax Example

SELECT AVG(volume), room FROM sensorsWHERE floor = 6GROUP BY roomHAVING AVG(volume) > thresholdEPOCH DURATION 30s

Page 8: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

TAG Query Syntax

SELECT {agg(expr), attrs} FROM sensorsWHERE {selPreds}GROUP BY {attrs}HAVING {havingPreds}EPOCH DURATION i

Page 9: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Aggregate Functions (agg)

3 Components:1) Merging function

f<z> = f(<x>, <y>)2) Initializer i3) Evaluator e

4

3 2

1

<S1, C1>

i(x) = <x1, 1>

<S2, C2>

f(<S1, C1>, <S2, C2>)= <S1 + S2, C1 + C2>

<S4, C4>

f(<S2, C2>, <S3, C3>, <S4, C4>)

<S3, C3>

i(x) = <x3, 1>

e(<S, C>) = S/C

Page 10: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Classes of Aggregates

• Duplicate Sensitivity• Exemplary or Summary• Monotonicity• Amount of Partial State Information

– Distributive– Algebraic– Holistic– Unique– Content Sensitive

Classification based on four categories:

QuickTime™ and a decompressor

are needed to see this picture.

Page 11: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Attribute Catalog• Queries contain named attributes

• Each mote has catalog of supported attributes

• Assume central query processor stores attributes of motes

• Mote returns NULL if attribute not supported

• Increases scalability

Page 12: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Algorithm• Two Phases:

– Query Distribution– Collection

• Single aggregate value every epoch

• Aggregation before propagation• Children deliver partial state in time interval specified by parent

Page 13: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Collection

Page 14: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Grouping

• Specified by GROUP BY query clause

SELECT AVG(volume), room FROM sensorsWHERE floor = 6GROUP BY roomHAVING AVG(volume) > thresholdEPOCH DURATION 30s

• Each sensor reading in single group

• Groups partitioned by attributes

Page 15: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Grouping Example

QuickTime™ and a decompressor

are needed to see this picture.

Page 16: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

A Few Advantages…

• Decreased Communication• Nodes send one message per epoch

• “Lost Nodes” can reconnect

Page 17: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Simulation• Done in Java• Java Objects passed as messages

QuickTime™ and a decompressor

are needed to see this picture.

Page 18: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Optimizations

• Snooping on Shared Channels– Nodes can overhear missed query– Nodes can exclude certain messages

• Hypothesis Testing– Somewhat query specific– Nodes don’t send data if irrelevant

– Ex: root finds level 1 min, then uses “having” to narrow down query

Page 19: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Optimizations

QuickTime™ and a decompressor

are needed to see this picture.

Page 20: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Improving Loss Tolerance

Important because single node loss causes entire subtree loss…

1. Each node keeps track of neighbor link quality

• Keeps proportion of messages received

• Chooses parent’ over weaker parent

2. Node chooses a new parent if no messages received over set time

Page 21: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Loss Tolerance

QuickTime™ and a decompressor

are needed to see this picture.

Page 22: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Realistic Simulation

QuickTime™ and a decompressor

are needed to see this picture.

Caching: use old “cached” information when new info not received from children

Page 23: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Implementation

• Prototype with TinyOS motes

QuickTime™ and a decompressor

are needed to see this picture.

Page 24: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Conclusions

• High Level Query Language• Aggregation and Bandwidth Reduction

• Tight network integration, optimizable

• Currently working towards “event driven” model

Page 25: March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.

March 6th, 2008 Andrew OfstadECE 256, Spring 2008

Thanks!

Q and A