View
218
Download
0
Category
Preview:
Citation preview
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
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
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
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
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
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
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
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
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
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.
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
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
March 6th, 2008 Andrew OfstadECE 256, Spring 2008
Collection
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
March 6th, 2008 Andrew OfstadECE 256, Spring 2008
Grouping Example
QuickTime™ and a decompressor
are needed to see this picture.
March 6th, 2008 Andrew OfstadECE 256, Spring 2008
A Few Advantages…
• Decreased Communication• Nodes send one message per epoch
• “Lost Nodes” can reconnect
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.
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
March 6th, 2008 Andrew OfstadECE 256, Spring 2008
Optimizations
QuickTime™ and a decompressor
are needed to see this picture.
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
March 6th, 2008 Andrew OfstadECE 256, Spring 2008
Loss Tolerance
QuickTime™ and a decompressor
are needed to see this picture.
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
March 6th, 2008 Andrew OfstadECE 256, Spring 2008
Implementation
• Prototype with TinyOS motes
QuickTime™ and a decompressor
are needed to see this picture.
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
March 6th, 2008 Andrew OfstadECE 256, Spring 2008
Thanks!
Q and A
Recommended