tag: a tiny aggregation service for ad-hoc sensor networks authors: samuel madden, michael franklin,...

26
TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE 291: Wireless Sensor Networks May 1 st 2003

Upload: merryl-hunt

Post on 01-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks

Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein

Presented by: Vikas Motwani

CSE 291: Wireless Sensor Networks

May 1st 2003

Page 2: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Outline

Motivation For TAG Approach, Operation and Syntax Aggregate structure and Implementation Benefits of TAG Simulation and Optimizations Experimental results Conclusion

Page 3: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Current state of data collection

Main idea of sensor networks is to extract data from the network/environment

Data could be raw sensor readings or summaries/aggregations of many readings

Previous work views aggregation as application-specific mechanism that would be implemented on a per-need basis in error prone languages like C

Page 4: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Hence: Motivation for TAG

Aggregation: should be a core service rather than a set of extensible C APIs.

In-network processing necessary to save power as sensor networks are bandwidth and power constrained and communication is energy expensive

Power: Transmitting 1 bit = 800 instructions!!! Useful to non networking/programming experts who

can focus on their custom applications without worrying about underlying hardware/software and data collection mechanisms

Page 5: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

One Word Answers!!!

Hardware: Motes Software: TinyOS Routing: Ad-Hoc Major Constraint: Power Constraint dominated by: Communication

Page 6: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

The Tiny AGgregation Approach

Essential Attributes Simple, declarative interface for data collection and

aggregation – SQL style Intelligently distributes and executes aggregation queries

in the sensor network in a time & power-efficient manner Sensitive to resource constraints and lossy

communication properties of wireless sensor networks Processes aggregates by computing over the data as it

flows through the sensors, discarding irrelevant information and compacting relevant readings

Page 7: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Operation

Users pose aggregation queries from a base station Messages propagate from the base station to all

nodes through routing tree rooted at base station Divide time into epoch and in each epoch, Sensors

route local and children data back to user using routing tree

As data flows up the tree, it is aggregated according to aggregation function and value based partitioning specified in original query

Page 8: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Language: SQL style query syntax

SQL-like syntax SELECT: specifies an arbitrary arithmetic expression over one or

more aggregation values expr: The name of a single attribute agg: Aggregation function Attrs: selects the attributes by which the sensor readings are

partitioned WHERE, HAVING: Filters out irrelevant readings GROUP BY: specifies an attribute based partitioning of readings EPOCH DURATION: Time interval of aggr record computation

Each record is a <groupID, aggregate_value> pair

Page 9: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Aggregate Structure

Implement aggregate via 3 functions: Merging Function f Initializer I Evaluator e

Example: AVERAGE Partial State record: Sum and Count: <S,C>

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

Initializer i(x)=<x,1>

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

Original SQL specs has 5 options: COUNT, MAX, MIN, SUM, AVG

Page 10: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Classification of Aggregates and States

Duplicate sensitivity (insensitive aggr: unaffected by duplicate readings from same node, sensitive: changes)

Exemplary(returns one or more representative values of a set) vs. Summary(returns some computation/summary)

Monotonic aggregates Amount of state required for every partial state record – depends

on number of values per record Distributive Algebraic Holistic Unique Content – sensitive

Page 11: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Attribute Catalog

Queries in TAG contain named attributes Included on each mote is a small catalog of attributes that

can be searched for attributes of a specific name Central query processor caches or stores attributes of all

motes it may access When a TAG sensor receives a query, it converts names

fields into local catalog identifiers, or sends back a NULL if it is lacking the attribute

Not all nodes have identical catalogs, so can be implemented for heterogeneous sensing

Page 12: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

In Network Aggregates/Implementation

Distribution and Collection Phases with goal to reduce messages Mote p receives a request r to aggregate, wakes up, synchronizes clock p chooses sender of message as its parent and r includes interval in

which p must reply back with partial state record P then sends the message down the network to its children, setting the

delivery interval for its children to reply back by broadcasting r This propagation ends when all nodes in the network are queried During the epoch after the propagation, each mote listens for messages

from its children, during the specified interval. Then computes a partial state record consisting of any child values

heard with its own local sensor readings. Each mote transmits this partial state record up the network Every epoch, new aggregate produced Most of the times, motes are idle and in low power state

Page 13: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

The First Non-Text Slide

Page 14: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Grouping

Each sensor placed in exactly one group partitioned according to an expression over all attributes

Basic grouping technique: push the query down network, as the nodes to choose which group they belong to, as they flow upwards, update aggregate values in appropriate groups, and now partial state records are attached with a group ID

When a parents receives an aggregate from a child, it checks the group ID. If it is in the same group, it combines the two values using the combining function. If different group, stores the value of the child’s group along with its own and forwards up.

Page 15: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Grouping Example

Page 16: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Additional Benefits of TAG

Principle Advantage: ability to dramatically decrease communication required to compute aggregate vs. central aggregation approach

Ability to tolerate disconnections and loss, as lost nodes can reconnect to network by listening to another node’s state records, even if not intended for them

In TAG, each node transmits only one value. In non-TAG, nodes at top of tree have to transmit lot more values and get drained faster

Also, by dividing time into epochs, long idle times are present for the processor and radio to be put in deep sleep modes with little power.

Just 10 more slides to go..

Page 17: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Simulation Based Evaluation

Simulated TAG in Java Simple: nodes have perfect lossless communication with regularly

placed neighbors Random: nodes’ placement random Realistic model to capture actual behavior of radio and link layer on

TinyOS motes (uses results from real world experiments to approximate actual loss of TinyOS radio) – has high loss rates

Simulator models mote behavior at a course level: time divided in epochs, messages encapsulated in java objects

Simulation cannot model fine grained details of network like real world characteristics and modeling radio contention at a byte level

Page 18: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Performance of TAG

MIN & COUNT – small as only one integer per partial state record

Average – 2 integers, so double cost of distributive

Median – same as centralized as parents have to forward all children’s values to root

Count Distinct – only slightly less expensive

Histogram – size of fixed-width buckets = 10, sensor values ranged over interval [10..1000]

Page 19: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Optimizations: Channel Sharing and Hypothesis Testing

Channel sharing: If node misses initial request to aggregate, it can snoop (at regular

intervals) network traffic and “catch up” and include itself Can also reduce if node sees a higher value reported that its own for

MAX, it will not bother to send a message Reduces number of messages sent

Hypothesis Testing: Root can provide information that will reduce number of readings as it

will reduce the number of nodes that need to report back at initialization. E.g.; MAX, MIN

For summary aggregates, hypothesis testing via a guess is not as effective as monotonic aggregates. Root has to send a fixed size tolerable error bound over the value of the aggregate

Page 20: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Benefits of Hypothesis Testing

Steady State Messages/ EpochHypothesis Testing with MAX Query

0

500

1000

1500

2000

2500

3000

10 20 30 40 50

Network Diameter

Mess

ages

/ E

poch

No Hyp

Hyp = 50

Hyp = 90

Snooping

Page 21: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Improving tolerance to loss: Effects of a single loss

Wanted to see the effect of the loss of a single node and how long network takes to stabilize and children of lost node to find new parents

Amount of time taken for lost nodes to reintegrate is directly proportional to depth of lost node due to tree topology

Max loss of variable and some aggregates are more sensitive to a single loss than others. COUNT has large error in worst case: if node that connects the root to a large portion of the network is lost, temporary error is high.

Page 22: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Effect of a Single Loss

Average Error From Single Loss vs. Aggregation Function

0

0.5

1

1.5

2

2.5

3

3.5

10 20 30 40 50

Network Diameter

Perc

en

t Err

or

Fro

m S

ing

le

Lo

ss

AVERAGECOUNTMAXMEDIAN

Page 23: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Child Caching

Percentage of Network Involved, Child Caching

0

0.2

0.4

0.6

0.8

1

1.2

10 20 30 40 50

Network Diameter

% N

etw

ork

No Cache

5 Epochs Cache

9 Epochs Cache

15 Epochs Cache

Parents remember the partial state records their children reported for some number of rounds and use those previous values when new values are unavailable due to lost child messages

Page 24: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Experimental Results

16 nodes, depth 4 tree, COUNT aggregate

# of messages Centralized: 4685 TAG: 2330 50% better!!

Centralized: Increased network contention, Per hop loss rates = 15% (TAG = 5%)

Centralized: Only 45% of messages from nodes at bottom of tree reached root.

Page 25: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Limitations

Grouping Problem: # of groups can exceed the total storage on any device – solution is to evict one or more groups from local storage

More Eviction Schemes as best and worst case had difference of only 10%

Caching temporarily smears the aggregate values that are computed making caching undesirable for some workloads

Correctness Check: which nodes are included in aggregation and which are not?

Page 26: TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE

Conclusion

TAG is based on a declarative query interface Uses aggregation extensively Makes network tasking easier for the user who does not

have to modify low level code or worry about topology, routing and loss tolerance

TAG outperforms centralized approaches in most cases due to aggregation

Produces an order of magnitude reduction in bandwidth and power consumption

Questions??