Median And Beyond


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Median And Beyond

  1. 1. Median and Beyond: New Aggregation Techniques for Sensor Networks EECS 600 Advanced Network Research, Spring 2005 Hongbo Jiang April 11, 2005
  2. 2. Context <ul><li>Introduction </li></ul><ul><li>Background & Related Work </li></ul><ul><li>Q-digest </li></ul><ul><li>Queries on q-digest </li></ul><ul><li>Experiment </li></ul><ul><li>Discussion </li></ul>
  3. 3. Introduction – wireless sensor networks <ul><li>Limitation </li></ul><ul><ul><li>Computation capability, communication bandwidth, battery power...... </li></ul></ul><ul><li>Unreliability </li></ul><ul><ul><li>Inherent unreliability of sensing function. That is, individual sensor readings are inherently unreliable. </li></ul></ul><ul><li>To address these two aspects, let us look insight some methods for communication in query processing… </li></ul>
  4. 4. Typical Models – (I) <ul><li>Each node collects data and this data needs to be delivered to the users through the network interconnection. </li></ul><ul><ul><li>How to accomplish this? Let each sensor node deliver its data periodically to host computer (base station), where the data can be assembled for subsequent analysis. </li></ul></ul><ul><li>Drawback </li></ul><ul><ul><li>Excessive communication. </li></ul></ul>
  5. 5. Typical Models – (II) <ul><li>Exploit the multi-hop routing protocols in sensor networks in such a way that messages from multiple nodes are combined en-route from the sensor nodes to base station. </li></ul><ul><ul><li>Routing tree with the base station as the root. </li></ul></ul><ul><li>Drawback: It suffers from the problem of larger message sizes as information passes through the routing tree from the leaf nodes to the base station. </li></ul>
  6. 6. TinyDB & Cougar – In-networks Aggregation <ul><li>Observations: </li></ul><ul><ul><li>The individual sensor values do not hold much value. </li></ul></ul><ul><ul><li>Extracting all the data out of a sensor network is very inefficient in terms bandwidth and power usage. </li></ul></ul><ul><li>In-network aggregation </li></ul><ul><ul><li>Compute aggregation value such as AVG, SUM, COUNT and MIN/MAX , over routing tree, minimizing both the number of messages as well as the size of the message. </li></ul></ul><ul><li>Drawback: not suitable for some application (sophisticated analysis by computing median, quantiles, and consensus measures.). </li></ul>
  7. 7. AVG vs. MEDIAN <ul><li>To compute AVG, every node sends two integers to its parent: </li></ul><ul><ul><li>One representing the sum of all data values of its children </li></ul></ul><ul><ul><li>Total number of its children. </li></ul></ul><ul><ul><li>That is, AVG can be computed by using constant memory and by sending constant sized messages. </li></ul></ul><ul><li>To compute MEDIAN, we need to keep track of all distinct values and thus the message size and memory required to store it grows linearly with the size of the networks. </li></ul>
  8. 8. This paper focus on… <ul><li>Approximation schemes: </li></ul><ul><ul><li>100% accurate is not necessary </li></ul></ul><ul><ul><li>Approximation scheme in this paper based on q-digest can be adapted to meet any user specified tolerance at the expense of higher memory and bandwidth consumption. </li></ul></ul><ul><li>Q-digest: </li></ul><ul><ul><li>A novel data structure provides guarantees on approximation error and maximum resource consumption. </li></ul></ul>
  9. 9. Context <ul><li>Introduction </li></ul><ul><li>Background & Related Work </li></ul><ul><li>Q-digest </li></ul><ul><li>Queries on q-digest </li></ul><ul><li>Experiment </li></ul><ul><li>Discussion </li></ul>
  10. 10. Assumption <ul><li>Each sensor’s reading is assumed to be an integer value in the range [1, σ ] – σ is the maximum possible value of the signal. </li></ul><ul><li>Query from BS; The sensors organize themselves in a spanning tree. ( Q : How can we get this spanning tree?) </li></ul><ul><li>Link quality is perfect – no packets loss </li></ul>
  11. 11. An aggregation such as MEDAIN is more difficult than MIN, MAX, or AVERGAGE <ul><li>Under the natural assumption that each sensor only forwards a fixed amount of data, it is easy to argue that one cannot calculate the median (or any other quantile) precisely. </li></ul><ul><li>Example: A = B U C </li></ul><ul><ul><li>B = {1,2,3}; C={1000,1001,1002} </li></ul></ul><ul><li>Then only approximation is possible. </li></ul>
  12. 12. Context <ul><li>Introduction </li></ul><ul><li>Background & Related Work </li></ul><ul><li>Q-digest </li></ul><ul><li>Queries on q-digest </li></ul><ul><li>Experiment </li></ul><ul><li>Discussion </li></ul>
  13. 13. Q-digest <ul><li>Interesting properties: </li></ul><ul><ul><li>Error-Memory Trade-off </li></ul></ul><ul><ul><li>Confidence Factor </li></ul></ul><ul><ul><li>Multiple Queries </li></ul></ul>
  14. 14. Example of q-digest <ul><li>A q-digest consists of a set of buckets of different sizes and their associated counts. </li></ul><ul><ul><li>The depth of the tree T is log( σ ) </li></ul></ul><ul><ul><li>Each node v can be considered a bucket and has a range (v.min, v.max) </li></ul></ul><ul><ul><li>The size of the q-digest is determined by a compression parameter k. ( Q : How to determine the compression parameter k?) </li></ul></ul>
  15. 15. Q-digest property <ul><li>Property </li></ul><ul><ul><li>i) count(v) <= [n/k] (for a non-leaf node) </li></ul></ul><ul><ul><li>ii) count(v) + count(v p ) + count(v s ) > [n/k] (for a non-root node) </li></ul></ul><ul><li>Comments </li></ul><ul><ul><li>i) assert that unless it is a leaf node, no node should have a high count. This property will be used later to prove error bounds on q-digest </li></ul></ul><ul><ul><li>ii) says that we should not have a node and its children with low counts. The intuition behind this property is that if two adjacent buckets which are siblings have low counts, then we do not want to include tow separate counters for them </li></ul></ul>
  16. 16. Building a q-digest <ul><li>An exact representation of the data will consist of the frequencies {f 1 ,f 2 ,…,f σ } </li></ul><ul><li>To construct the q-digest we will hierarchically merge and reduce the number of buckets (bottom-up) </li></ul><ul><li>Comment </li></ul><ul><ul><li>Detailed information concerning data values which occur frequently (such as node with 4 and 6) are preserved in the digest. </li></ul></ul><ul><ul><li>While less frequently occurring values (such as node d ) are lumped into larger buckets resulting in information loss. </li></ul></ul>
  17. 17. Merging q-digests <ul><li>Take union of the two q-digest and add the counts of buckets with the same range ([min,max]) </li></ul><ul><li>Then compress the result, to build a new q-digest </li></ul>
  18. 18. Representation of a q-digest <ul><li>To represent a q-digest tree in a compact fashion we number the nodes from 1 to 2 σ -1 in a lever by lever order </li></ul><ul><li>To transmit the q-digest we send a set of tuple of the following form <nodeid(v), count(v)> which requires a total of (log(2 σ )+log n) bits for each tuple. Q : Why? </li></ul>
  19. 19. Representation of a q-digest <ul><li>Example </li></ul><ul><ul><li>{<1,1>,<6,2>,<7,2>,<10,4>,<11,6>} </li></ul></ul>
  20. 20. Context <ul><li>Introduction </li></ul><ul><li>Background & Related Work </li></ul><ul><li>Q-digest </li></ul><ul><li>Queries on q-digest </li></ul><ul><li>Experiment </li></ul><ul><li>Discussion </li></ul>
  21. 21. Queries on q-digest <ul><li>Quantile Query : Given a fraction q belongs to (0,1), find the value whose rank in sorted sequent of the n value is nq. </li></ul><ul><ul><li>Sort the nodes of q-digest in increasing right endpoints (max values) </li></ul></ul><ul><ul><li>Post-order traversal of list nodes in q-digest </li></ul></ul><ul><ul><li>Scan list L (from the beginning) and add the counts of nodes as they are seen. For some node v, this sum becomes more than qn, we report v.max as our estimate of the quantile. </li></ul></ul><ul><li>Example: MEDIAN query on q-digest Q shown in Fig 1. </li></ul>
  22. 22. Example <ul><li>Q: MEDIAN query on q-digest Q shown in Fig 1. - {<1,1>,<6,2>,<7,2>,<10,4>,<11,6>} </li></ul><ul><li>A: ( post-order ) </li></ul><ul><ul><li>The sorted list is {<10,4>,<11,6>,<6,2>,<7,2>,<1,1>} </li></ul></ul><ul><ul><li>The count at node <11,6> will be more than 0.5n (8). Then the answer is 4 </li></ul></ul>
  23. 23. Queries on q-digest <ul><li>Other queries </li></ul><ul><ul><li>Inverse quantile </li></ul></ul><ul><ul><li>Range Query </li></ul></ul><ul><ul><li>Consensus Query </li></ul></ul><ul><li>The method is similar… </li></ul>
  24. 24. Context <ul><li>Introduction </li></ul><ul><li>Background & Related Work </li></ul><ul><li>Q-digest </li></ul><ul><li>Queries on q-digest </li></ul><ul><li>Experiment </li></ul><ul><li>Discussion </li></ul>
  25. 25. Experimental Evaluation <ul><li>Setup </li></ul><ul><ul><li>C++ </li></ul></ul><ul><ul><li>Network topology – routing tree </li></ul></ul><ul><ul><li>All pair of nodes within a fixed radio range can be considered as neighbors. </li></ul></ul><ul><ul><li>1000*1000 area and 1000 sensors (then 2000*2000 area and 2000 sensors) </li></ul></ul><ul><ul><li>Sensor data value: random and correlated </li></ul></ul>
  26. 26. Range queries and Histogram
  27. 27. Accuracy and Message Size
  28. 28. Accuracy and Message Size <ul><li>What is the list ? </li></ul><ul><li>Q : Why the list-correlated and list-random looks different. </li></ul>
  29. 29. Accuracy and Message Size <ul><li>Given a message size m, we ask the question: What fraction of total nodes transmitted messages of size large then m? </li></ul>
  30. 30. Total Data Transmission <ul><li>Sine the number of distinct values is less for correlated scenario, the amount of data transferred is lower for correlated data. </li></ul>
  31. 31. Thanks <ul><li>Comment? </li></ul>