Querying Sensor Networks

Slides:



Advertisements
Similar presentations
SELF-ORGANIZING MEDIA ACCESS MECHANISM OF A WIRELESS SENSOR NETWORK AHM QUAMRUZZAMAN.
Advertisements

Trickle: Code Propagation and Maintenance Neil Patel UC Berkeley David Culler UC Berkeley Scott Shenker UC Berkeley ICSI Philip Levis UC Berkeley.
한국기술교육대학교 컴퓨터 공학 김홍연 TinyDB : An Acquisitional Query Processing System for Sensor Networks. - Samuel R. Madden, Michael J. Franklin, Joseph M. Hellerstein,
Towards a Sensor Network Architecture: Lowering the Waistline Culler et.al. UCB.
1 Sensor Network Databases Ref: Wireless sensor networks---An information processing approach Feng Zhao and Leonidas Guibas (chapter 6)
1 Querying Sensor Networks Sam Madden UC Berkeley.
What is a Wireless Sensor Network (WSN)? An autonomous, ad hoc system consisting of a collective of networked sensor nodes designed to intercommunicate.
Programming Vast Networks of Tiny Devices David Culler University of California, Berkeley Intel Research Berkeley
An Energy-Efficient MAC Protocol for Wireless Sensor Networks
1 Implementation and Research Issues in Query Processing for Wireless Sensor Networks Wei Hong Intel Research, Berkeley Sam Madden.
1 Supporting Aggregate Queries Over Ad-Hoc Wireless Sensor Networks Samuel Madden UC Berkeley With Robert Szewczyk, Michael Franklin, and David Culler.
Reconfigurable Sensor Networks Chris Elliott Honours in Digital Systems Charles Greif and Nandita Bhattacharjee.
Aggregation in Sensor Networks NEST Weekly Meeting Sam Madden Rob Szewczyk 10/4/01.
Approximate data collection in sensor networks the appeal of probabilistic models David Chu Amol Deshpande Joe Hellerstein Wei Hong ICDE 2006 Atlanta,
Sensor Networks: Implications for Database Systems and Vice-Versa Michael Franklin January UCB Sensor Day.
1 Acquisitional Query Processing in TinyDB Sam Madden UC Berkeley NEST Winter Retreat 2003.
The Design of an Acquisitional Query Processor For Sensor Networks Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, and Wei Hong Presentation.
A Transmission Control Scheme for Media Access in Sensor Networks Alec Woo, David Culler (University of California, Berkeley) Special thanks to Wei Ye.
Model-driven Data Acquisition in Sensor Networks Amol Deshpande 1,4 Carlos Guestrin 4,2 Sam Madden 4,3 Joe Hellerstein 1,4 Wei Hong 4 1 UC Berkeley 2 Carnegie.
Data Management for Sensor Networks Zachary G. Ives University of Pennsylvania CIS 650 – Database & Information Systems April 4, 2005.
TAG: A TINY AGGREGATION SERVICE FOR AD-HOC SENSOR NETWORKS Presented by Akash Kapoor SAMUEL MADDEN, MICHAEL J. FRANKLIN, JOSEPH HELLERSTEIN, AND WEI HONG.
T AG : A TINY AGGREGATION SERVICE FOR AD - HOC SENSOR NETWORKS Samuel Madden, Michael J. Franklin, Joseph Hellerstein, and Wei Hong Presented by – Mahanth.
15-744: Computer Networking L-13 Sensor Networks.
1 Implementation and Research Issues in Query Processing for Wireless Sensor Networks Wei Hong Intel Research, Berkeley Sam Madden.
TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Paper By : Samuel Madden, Michael J. Franklin, Joseph Hellerstein, and Wei Hong Instructor :
CS2510 Fault Tolerance and Privacy in Wireless Sensor Networks partially based on presentation by Sameh Gobriel.
The Design of an Acquisitional Query Processor For Sensor Networks Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, and Wei Hong.
TinyOS By Morgan Leider CS 411 with Mike Rowe with Mike Rowe.
March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.
1 Pradeep Kumar Gunda (Thanks to Jigar Doshi and Shivnath Babu for some slides) TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden,
TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE.
1 TAG: A Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden UC Berkeley with Michael Franklin, Joseph Hellerstein, and Wei Hong December.
1 Querying Sensor Networks Sam Madden UC Berkeley December 13 th, New England Database Seminar.
INT 598 Data Management for Sensor Networks Silvia Nittel Spatial Information Science & Engineering University of Maine Fall 2006.
The Design of an Acquisitional Query Processor for Sensor Networks CS851 Presentation 2005 Presented by: Gang Zhou University of Virginia.
1 Fjording The Stream An Architecture for Queries over Streaming Sensor Data Samuel Madden, Michael Franklin UC Berkeley.
한국기술교육대학교 컴퓨터 공학 김홍연 Habitat Monitoring with Sensor Networks DKE.
Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)
REED: Robust, Efficient Filtering and Event Detection in Sensor Networks Daniel Abadi, Samuel Madden, Wolfgang Lindner MIT United States VLDB 2005.
1 REED: Robust, Efficient Filtering and Event Detection in Sensor Networks Daniel Abadi, Samuel Madden, Wolfgang Lindner MIT United States VLDB 2005.
ResTAG: Resilient Event Detection with TinyDB Angelika Herbold -Western Washington University Thierry Lamarre -ENSEIRB Systems Software Laboratory, OGI.
1 Report of Advanced Data Base Topics Project Instructor : Dr. rahgozar euhanna ghadimi, Ali abbasi, kave pashaii Data Storage selection in sensor networks.
An Energy-Efficient MAC Protocol for Wireless Sensor Networks Speaker: hsiwei Wei Ye, John Heidemann and Deborah Estrin. IEEE INFOCOM 2002 Page
Aggregation and Secure Aggregation. Learning Objectives Understand why we need aggregation in WSNs Understand aggregation protocols in WSNs Understand.
W. Hong & S. Madden – Implementation and Research Issues in Query Processing for Wireless Sensor Networks, ICDE 2004.
0.1 IT 601: Mobile Computing Wireless Sensor Network Prof. Anirudha Sahoo IIT Bombay.
In-Network Query Processing on Heterogeneous Hardware Martin Lukac*†, Harkirat Singh*, Mark Yarvis*, Nithya Ramanathan*† *Intel.
Aggregation and Secure Aggregation. [Aggre_1] Section 12 Why do we need Aggregation? Sensor networks – Event-based Systems Example Query: –What is the.
Sep Multiple Query Optimization for Wireless Sensor Networks Shili Xiang Hock Beng Lim Kian-Lee Tan (ICDE 2007) Presented by Shan Bai.
1 TAG: A Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden UC Berkeley with Michael Franklin, Joseph Hellerstein, and Wei Hong December.
Building Wireless Efficient Sensor Networks with Low-Level Naming J. Heihmann, F.Silva, C. Intanagonwiwat, R.Govindan, D. Estrin, D. Ganesan Presentation.
The Design of an Acquisitional Query Processor For Sensor Networks Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, and Wei Hong Presentation.
MAC Protocols for Sensor Networks
- Pritam Kumat - TE(2) 1.  Introduction  Architecture  Routing Techniques  Node Components  Hardware Specification  Application 2.
TAG: a Tiny AGgregation service for ad-hoc sensor networks Authors: Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, Wei Hong Presenter: Mingwei.
MAC Protocols for Sensor Networks
Wireless Sensor Networks
Demetrios Zeinalipour-Yazti (Univ. of Cyprus)
Querying Sensor Networks
Distributed database approach,
Wireless Sensor Network Architectures
The Design of an Acquisitional Query Processor For Sensor Networks
Trickle: Code Propagation and Maintenance
Distributing Queries Over Low Power Sensor Networks
Querying Sensor Networks
Data-Centric Networking
REED : Robust, Efficient Filtering and Event Detection
Protocols.
Aggregation.
Protocols.
Presentation transcript:

Querying Sensor Networks Sam Madden UC Berkeley

Smart Sensor, aka “Mote” Sensor Networks Small computers with: Radios Sensing hardware Batteries Remote deployments Long lived 10s, 100s, or 1000s Battery Pack Smart Sensor, aka “Mote” Discuss other platforms?

Motes Mica Mote 4Mhz, 8 bit Atmel RISC uProc 40 kbit Radio 4 K RAM, 128 K Program Flash, 512 K Data Flash AA battery pack Based on TinyOS* *Hill, Szewczyk, Woo, Culler, & Pister. “Systems Architecture Directions for Networked Sensors.” ASPLOS 2000. http://webs.cs.berkeley.edu/tos

Programming Sensor Nets Is Hard Months of lifetime required from small batteries 3-5 days naively; can’t recharge often Interleave sleep with processing Need high level abstractions! 200-800 instructions per bit transmitted! Lossy, low-bandwidth communication Nodes coming and going ~20% loss @ 5m Multi-hop Remote, zero administration deployments Highly distributed environment Limited Development Tools Embedded, LEDs for Debugging! High-Level Abstraction Is Needed! Limited tools! Make more quantitative – e.g. compared to typical laptop, typical network, computing capabilities?

A Solution: Declarative Queries Users specify the data they want Simple, SQL-like queries Using predicates, not specific addresses System: TinyDB System processes queries Challenges Language Data location Power efficient data collection Multihop result delivery “Transparent optimization”  System does better* than most programmers * Is more power efficient

Earthquake monitoring in shake-test sites. Sensor Net Sample Apps Habitat Monitoring: Storm petrels on Great Duck Island, microclimates on James Reserve. Traditional monitoring apparatus. Earthquake monitoring in shake-test sites. Vehicle detection: sensors along a road, collect data about passing vehicles. Build?

Overview TinyDB: Queries for Sensor Nets Processing Aggregate Queries (TAG) Experiments & Optimizations Acquisitional Query Processing Other Research Future Directions Acquisitional Query Processing?

Overview TinyDB: Queries for Sensor Nets Processing Aggregate Queries (TAG) Experiments & Optimizations Acquisitional Query Processing Other Research Future Directions Acquisitional Query Processing?

TinyDB Demo

TinyDB Architecture TinyDB ~10,000 Lines Embedded C Code Queries SELECT AVG(temp) WHERE light > 400 Results T:1, AVG: 225 T:2, AVG: 250 Multihop Network Schema: “Catalog” of commands & attributes Query Processor Aggavg(temp) ~10,000 Lines Embedded C Code ~5,000 Lines (PC-Side) Java ~3200 Bytes RAM (w/ 768 byte heap) ~58 kB compiled code (3x larger than 2nd largest TinyOS Program) Filterlight > 400 Name: temp Time to sample: 50 uS Cost to sample: 90 uJ Calibration Table: 3 Units: Deg. F Error: ± 5 Deg F Get f : getTempFunc()… Mention – no self describing tuples But can support heterogeneous networks via variations in the catalog get (‘temp’) got(‘temp’) Tables Samples Schema getTempFunc(…) TinyOS TinyDB

Declarative Queries for Sensor Networks “Find the bright nests.” “Count the number occupied nests in each loud region of the island.” Sensors Examples: SELECT nodeid, nestNo, light FROM sensors WHERE light > 400 EPOCH DURATION 1s 1 Epoch Nodeid nestNo Light 1 17 455 2 25 389 422 405 Describe queries in english Going to present a small subset of the query language – will introduce more later

Aggregation Queries “Find the bright nests.” 2 “Count the number occupied nests in each loud region of the island.” SELECT AVG(sound) FROM sensors EPOCH DURATION 10s 2 SELECT region, CNT(occupied) AVG(sound) FROM sensors GROUP BY region HAVING AVG(sound) > 200 EPOCH DURATION 10s 3 Regions w/ AVG(sound) > 200 Epoch region CNT(…) AVG(…) North 3 360 South 520 1 370 Describe queries in english

Overview TinyDB: Queries for Sensor Nets Processing Aggregate Queries (TAG) Experiments & Optimizations Acquisitional Query Processing Other Research Future Directions Acquisitional Query Processing?

Tiny Aggregation (TAG) In-network processing of aggregates Common data analysis operation Aka gather operation or reduction in || programming Communication reducing Operator dependent benefit Across nodes during same epoch Exploit query semantics to improve efficiency! Madden, Franklin, Hellerstein, Hong. Tiny AGgregation (TAG), OSDI 2002.

Query Propagation Via Tree-Based Routing Used in: Query delivery Data collection Topology selection is important; e.g. Krishnamachari, DEBS 2002, Intanagonwiwat, ICDCS 2002, Heidemann, SOSP 2001 SIGMOD 2003 Continuous process Mitigates failures A B C D F E Q:SELECT … R:{…} Q Q R:{…} Q Note that topology maintenance is ongoing Mention what happens on deletion R:{…}

Basic Aggregation In each epoch: Each node samples local sensors once Generates partial state record (PSR) local readings readings from children Outputs PSR during assigned comm. interval At end of epoch, PSR for whole network output at root New result on each successive epoch Extras: Predicate-based partitioning via GROUP BY 1 2 3 4 5 Comm interval = slot within longer epoch Tell you in a few moments how comm intervals are assigned Show you basic aggregation process

Illustration: Aggregation SELECT COUNT(*) FROM sensors Interval 4 1 2 3 4 5 Sensor # Epoch 1 2 3 4 5 Interval # 1

Illustration: Aggregation SELECT COUNT(*) FROM sensors Interval 3 1 2 3 4 5 Sensor # 1 2 3 4 5 2 Interval #

Illustration: Aggregation SELECT COUNT(*) FROM sensors Interval 2 1 2 3 4 5 Sensor # 1 2 3 4 5 1 3 Interval #

Illustration: Aggregation SELECT COUNT(*) FROM sensors 5 Interval 1 1 2 3 4 5 Sensor # 1 2 3 4 5 Interval #

Illustration: Aggregation SELECT COUNT(*) FROM sensors Interval 4 1 2 3 4 5 Sensor # 1 2 3 4 5 Say something about a new node arriving, or a node leaving Notice number of empty slots Interval # 1

Interval Assignment: An Approach SELECT COUNT(*)… 4 intervals / epoch Interval # = Level 4 3 Level = 1 2 Epoch Comm Interval 4 3 2 1 5 1 2 3 4 5 L T Z CSMA for collision avoidance Time intervals for power conservation Time Sync (e.g. Elson & Estrin OSDI 2002) Going to present once instance of a technique for communication scheduling, alternatives are possible depending on power requirements and dynamic nature of the network. Will talk (briefly) about these in a few slides This one works well in practice. Assign each node to a comm interval equal to its level in the routing tree selected as query flows down the tree. Note that level is power power consveration; each interval is long enough for several Transmissions, and several nodes may transmit in each interval. Rely on CSMA for collision avoidance. Nodes listen in the interval prior to their transmission interval; L’s are listen intervals, T’s transmit Note that this constrains the maximum depth of the tree. In practice trees are not that deep, can determine depth through some protocol or By assuming a maximum depth. Can’t support joining of nodes below leaves. In real implementations, e.g. GDI, have assumed a maximum depth of 2. Leaves just wake up, transmit, go to sleep, and parents listen for the Epoch. So, we’ve traded channel utilization for power consveration. This is a knob we can turn through Pipelining! Pipelining: Increase throughput by delaying result arrival until a later epoch Madden, Szewczyk, Franklin, Culler. Supporting Aggregate Queries Over Ad-Hoc Wireless Sensor Networks. WMCSA 2002.

Aggregation Framework As in extensible databases, we support any aggregation function conforming to: Aggn={finit, fmerge, fevaluate} Finit {a0}  <a0> Fmerge {<a1>,<a2>}  <a12> Fevaluate {<a1>}  aggregate value Partial State Record (PSR) Example: Average AVGinit {v}  <v,1> AVGmerge {<S1, C1>, <S2, C2>}  < S1 + S2 , C1 + C2> AVGevaluate{<S, C>}  S/C Restriction: Merge associative, commutative

Types of Aggregates SQL supports MIN, MAX, SUM, COUNT, AVERAGE Any function over a set can be computed via TAG In network benefit for many operations E.g. Standard deviation, top/bottom N, spatial union/intersection, histograms, etc. Compactness of PSR

Overview TinyDB: Queries for Sensor Nets Processing Aggregate Queries (TAG) Experiments & Optimizations Acquisitional Query Processing Other Research Future Directions Acquisitional Query Processing?

Taxonomy of Aggregates TAG insight: classify aggregates according to various functional properties Yields a general set of optimizations that can automatically be applied Drives an API! Property Examples Affects Partial State MEDIAN : unbounded, MAX : 1 record Effectiveness of TAG Duplicate Sensitivity MIN : dup. insensitive, AVG : dup. sensitive Routing Redundancy Exemplary vs. Summary MAX : exemplary COUNT: summary Applicability of Sampling, Effect of Loss Monotonic COUNT : monotonic AVG : non-monotonic Hypothesis Testing, Snooping How does the COUNT example fit in here?

Taxonomy Related Insights Communication Reducing In-network Aggregation Hypothesis Testing Snooping Sampling Quality Increasing Multiple Parents Child Cache

Simulation Environment Evaluated TAG via simulation Coarse grained event based simulator Sensors arranged on a grid Two communication models Lossless: All neighbors hear all messages Lossy: Messages lost with probability that increases with distance

Benefit of In-Network Processing Simulation Results 2500 Nodes 50x50 Grid Depth = ~10 Neighbors = ~20 Uniform Dist. Holistic Unique Distributive Algebraic Aggregate & depth dependent benefit!

Channel Sharing (“Snooping”) Insight: Shared channel can reduce communication Suppress messages that won’t affect aggregate E.g., MAX Applies to all exemplary, monotonic aggregates

Hypothesis Testing Insight: Guess from root can be used for suppression E.g. ‘MIN < 50’ Works for monotonic & exemplary aggregates Also summary, if imprecision allowed How is hypothesis computed? Blind or statistically informed guess Observation over network subset

Experiment: Snooping vs. Hypothesis Testing Uniform Value Distribution Dense Packing Ideal Communication Pruning at Leaves Pruning in Network

Use Multiple Parents Use graph structure Increase delivery probability with no communication overhead For duplicate insensitive aggregates Or aggregates that can be expressed as a sum of parts Send (part of) aggregate to all parents In just one message, via multicast Assuming independence, decreases variance SELECT COUNT(*) A B C c/n R n = 2 A B C R A B C c R P(link level loss) = p P(loss) = p2 E(cnt) = c * p2 Var(cnt) = c2 * p2 * (1 – p2)  V # of parents = n E(cnt) = n * (c/n * p2) Var(cnt) = n * (c/n)2 * p2 * (1 – p2) = V/n

Multiple Parents Results Critical Link! No Splitting With Splitting Better than previous analysis expected! Losses aren’t independent! Insight: spreads data over many links

TAG Advantages Simple but powerful data collection language Logical partitioning via grouping In network processing Reduces communication Power and contention benefits Power Aware Routing Integration of sleeping, computation Continuous stream of results Taxonomy driven techniques to Improve quality Reduce communication So what’s new, what was hard, etc?

Overview TinyDB: Queries for Sensor Nets Processing Aggregate Queries (TAG) Experiments & Optimizations Acquisitional Query Processing Other Research Future Directions Acquisitional Query Processing?

Acquisitional Query Processing (ACQP) Closed world assumption does not hold Could generate an infinite number of samples An acqusitional query processor controls when, where, and with what frequency data is collected! Versus traditional systems where data is provided a priori Madden, Franklin, Hellerstein, and Hong. The Design of An Acqusitional Query Processor. SIGMOD, 2003 (to appear).

ACQP: What’s Different? How does the user control acquisition? Rates or lifetimes Event-based triggers How should the query be processed? Sampling as a first class operation Event – join duality Which nodes have relevant data? Which samples should be transmitted?

Lifetime Queries Lifetime vs. sample rate SELECT … EPOCH DURATION 10 s LIFETIME 30 days Extra: Allow a MAX SAMPLE PERIOD Discard some samples Sampling cheaper than transmitting

(Single Node) Lifetime Prediction

Operator Ordering: Interleave Sampling + Selection At 1 sample / sec, total power savings could be as much as 3.5mW  Comparable to processor! SELECT light, mag FROM sensors WHERE pred1(mag) AND pred2(light) EPOCH DURATION 1s E(sampling mag) >> E(sampling light) 1500 uJ vs. 90 uJ Correct ordering (unless pred1 is very selective and pred2 is not): Cheap Costly (pred1) (pred2) mag light Traditional DBMS (pred1) (pred2) mag light (pred1) (pred2) mag light ACQP

Exemplary Aggregate Pushdown SELECT WINMAX(light,8s,8s) FROM sensors WHERE mag > x EPOCH DURATION 1s Novel, general pushdown technique Mag sampling is the most expensive operation! WINMAX (mag>x) WINMAX (mag>x) mag light Traditional DBMS ACQP mag (light > MAX) light

Overview TinyDB: Queries for Sensor Nets Processing Aggregate Queries (TAG) Experiments & Optimizations Acquisitional Query Processing Other Research Future Directions Don’t ferget to summarize what we’ve seen!

Fun Stuff Temporal aggregates Sophisticated, sensor network specific aggregates Lossy compression Wavelets “Isobar Finding” Hellerstein, Hong, Madden, and Stanek. Beyond Average. IPSN 2003 (to appear)

Additional Research Sensors, TinyDB, TinyOS This Talk: TAG (OSDI 2002) ACQP (SIGMOD 2003) WMCSA 2002 IPSN 2003 TOSSIM. Levis, Lee, Woo, Madden, & Culler. (In submission) TinyOS contributions: memory allocator, catalog, network reprogramming, OS support, releases, TinyDB

Other Research (Cont) Stream Query Processing CACQ (SIGMOD 2002) Madden, Shah, Hellerstein, & Raman Fjords (ICDE 2002) Madden & Franklin Java Experiences Paper (SIGMOD Record, December 2001) Shah, Madden, Franklin, and Hellerstein Telegraph Project, FFF & ACM1 Demos Telegraph Team

TinyDB Deployments Initial efforts: Ongoing deployments: Network monitoring Vehicle tracking Ongoing deployments: Environmental monitoring Generic Sensor Kit Building Monitoring Golden Gate Bridge Too much? Or towards end (can skip if needed!) Not future – ongoing! Make it seem like it’s exciting! I’m actively involved!

Overview TinyDB: Queries for Sensor Nets Processing Aggregate Queries (TAG) Experiments & Optimizations Acquisitional Query Processing Other Research Future Directions Don’t ferget to summarize what we’ve seen!

TinyDB Future Directions Expressing lossiness No longer a closed world! Additional Operations Joins Signal Processing Integration with Streaming DBMS In-network vs. external operations Heterogeneous Environments Real Deployments

Summary Higher-level programming abstractions for sensor networks are necessary For many apps, queries are the right abstraction! Ease of programming Transparent optimization Aggregation is a fundamental operation Semantically aware optimizations Close integration with network Acquisitional Query Processing Framework for addressing the new issues that arise in sensor networks, e.g. Order of sampling and selection Languages, indices, approximations that give user control over which data enters the system Consideration of database, network, and device issues Of course, there will still be some people who want to use low level programming -- some people still program in assembly http://telegraph.cs.berkeley.edu/tinydb

Questions?