CPT-S Topics in Computer Science Big Data

Slides:



Advertisements
Similar presentations
1 S4: Small State and Small Stretch Routing for Large Wireless Sensor Networks Yun Mao 2, Feng Wang 1, Lili Qiu 1, Simon S. Lam 1, Jonathan M. Smith 2.
Advertisements

COS 461 Fall 1997 Routing COS 461 Fall 1997 Typical Structure.
HIERARCHY REFERENCING TIME SYNCHRONIZATION PROTOCOL Prepared by : Sunny Kr. Lohani, Roll – 16 Sem – 7, Dept. of Comp. Sc. & Engg.
Fast Firewall Implementation for Software and Hardware-based Routers Lili Qiu, Microsoft Research George Varghese, UCSD Subhash Suri, UCSB 9 th International.
Fast Algorithms For Hierarchical Range Histogram Constructions
Mining Data Streams.
Algorithms for Distributed Functional Monitoring Ke Yi HKUST Joint work with Graham Cormode (AT&T Labs) S. Muthukrishnan (Google Inc.)
SYNOPSIS DIFFUSION For Robust Aggregation in Sensor Networks Suman Nath, Phillip B. Gibbons, Srinivasan Seshan, Zachary R. Anderson Presented by Xander.
Managing Distributed Data Streams – I Slides based on the Cormode/Garofalakis VLDB’2006 tutorial.
DNA Research Group 1 CountTorrent: Ubiquitous Access to Query Aggregates in Dynamic and Mobile Sensor Networks Abhinav Kamra, Vishal Misra and Dan Rubenstein.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 22 Introduction to Computer Networks.
Tributaries and Deltas: Efficient and Robust Aggregation in Sensor Network Streams Amit Manjhi, Suman Nath, Phillip B. Gibbons Carnegie Mellon University.
Aggregation in Sensor Networks NEST Weekly Meeting Sam Madden Rob Szewczyk 10/4/01.
Aggregating Information in Peer-to-Peer Systems for Improved Join and Leave Distributed Computing Group Keno Albrecht Ruedi Arnold Michael Gähwiler Roger.
Estimating Set Expression Cardinalities over Data Streams Sumit Ganguly Minos Garofalakis Rajeev Rastogi Internet Management Research Department Bell Labs,
P2P Course, Structured systems 1 Introduction (26/10/05)
CS 580S Sensor Networks and Systems Professor Kyoung Don Kang Lecture 7 February 13, 2006.
 Structured peer to peer overlay networks are resilient – but not secure.  Even a small fraction of malicious nodes may result in failure of correct.
Hash, Don’t Cache: Fast Packet Forwarding for Enterprise Edge Routers Minlan Yu Princeton University Joint work with Jennifer.
Computer Networks Layering and Routing Dina Katabi
Network Course Internetworking Protocols Dr. Raed Al Qadi.
1 Next Few Classes Networking basics Protection & Security.
Content Addressable Network CAN. The CAN is essentially a distributed Internet-scale hash table that maps file names to their location in the network.
Dave McKenney 1.  Introduction  Algorithms/Approaches  Tiny Aggregation (TAG)  Synopsis Diffusion (SD)  Tributaries and Deltas (TD)  OPAG  Exact.
PODC Distributed Computation of the Mode Fabian Kuhn Thomas Locher ETH Zurich, Switzerland Stefan Schmid TU Munich, Germany TexPoint fonts used in.
Jennifer Rexford Princeton University MW 11:00am-12:20pm Measurement COS 597E: Software Defined Networking.
CS 484 Load Balancing. Goal: All processors working all the time Efficiency of 1 Distribute the load (work) to meet the goal Two types of load balancing.
LOOKING UP DATA IN P2P SYSTEMS Hari Balakrishnan M. Frans Kaashoek David Karger Robert Morris Ion Stoica MIT LCS.
1 Plaxton Routing. 2 History Greg Plaxton, Rajmohan Rajaraman, Andrea Richa. Accessing nearby copies of replicated objects, SPAA 1997 Used in several.
Yinghui Wu, SIGMOD Incremental Graph Pattern Matching Wenfei Fan Xin Wang Yinghui Wu University of Edinburgh Jianzhong Li Jizhou Luo Harbin Institute.
Continuous Monitoring of Distributed Data Streams over a Time-based Sliding Window MADALGO – Center for Massive Data Algorithmics, a Center of the Danish.
TAG: a Tiny AGgregation service for ad-hoc sensor networks Authors: Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, Wei Hong Presenter: Mingwei.
William Stallings Data and Computer Communications
Mining Data Streams (Part 1)
Auburn University
CPT-S 415 Big Data Yinghui Wu EME B45.
Zhu Han University of Houston Thanks for Professor Dan Wang’s slides
Introduction to Wireless Sensor Networks
Distributed database approach,
Data Streaming in Computer Networking
A Study of Group-Tree Matching in Large Scale Group Communications
A paper on Join Synopses for Approximate Query Answering
Auburn University COMP7330/7336 Advanced Parallel and Distributed Computing Mapping Techniques Dr. Xiao Qin Auburn University.
Wireless Sensor Network Architectures
RE-Tree: An Efficient Index Structure for Regular Expressions
CHAPTER 3 Architectures for Distributed Systems
Hash-Based Indexes Chapter 11
Augmented Sketch: Faster and More Accurate Stream Processing
Net 435: Wireless sensor network (WSN)
Intra-Domain Routing Jacob Strauss September 14, 2006.
Routing: Distance Vector Algorithm
Query-Friendly Compression of Graph Streams
Counting How Many Elements Computing “Moments”
Spatial Online Sampling and Aggregation
Routing in Packet Networks Shortest Path Routing
Data Integration with Dependent Sources
Edge computing (1) Content Distribution Networks
CIS 700: “algorithms for Big Data”
B+-Trees and Static Hashing
Hash-Based Indexes Chapter 10
Strayer University at Arlington, VA
CSCI B609: “Foundations of Data Science”
Range-Efficient Computation of F0 over Massive Data Streams
Data-Centric Networking
Evaluation of Relational Operations: Other Techniques
Minwise Hashing and Efficient Search
Brad Karp UCL Computer Science
Chapter 11 Instructor: Xin Zhang
Lu Tang , Qun Huang, Patrick P. C. Lee
Presentation transcript:

CPT-S 483-05 Topics in Computer Science Big Data Yinghui Wu EME 49

Data stream processing CPT-S 483 05 Big Data Data stream processing Incremental query processing Data stream processing: Overview Data synopsis in data stream processing Robustness and reliability Distributed data stream models Object.

Incremental query processing 3

Incremental query answering Real-life data is dynamic – constantly changes, ∆G Re-compute Q(D⊕∆D) starting from scratch? Changes ∆D are typically small Compute Q(D) once, and then incrementally maintain it Incremental query processing: Input: Q, D, Q(D), ∆D Output: ∆M such that Q(D⊕∆D) = Q(D) ⊕ ∆M Computing graph matches in batch style is expensive. We find new matches by making maximal use of previous computation, without paying the price of the high complexity of graph pattern matching. When changes ∆D to the data D are small, typically so are the changes ∆M to the output Q(D⊕∆D) Minimizing unnecessary recomputation 4 4

Complexity of incremental problems Incremental query answering Input: Q, D, Q(D), ∆D Output: ∆M such that Q(D⊕∆D) = Q(D) ⊕ ∆M G. Ramalingam, Thomas W. Reps: On the Computational Complexity of Dynamic Graph Problems. TCS 158(1&2), 1996 The cost of query processing: a function of |D| and |Q| incremental algorithms: |CHANGED|, the size of changes in the input: ∆G, and the output: ∆M The updating cost that is inherent to the incremental problem itself Bounded: the cost is expressible as f(|CHANGED|, |Q|)? Optimal: in O(|CHANGED| + |Q|)? The amount of work absolutely necessary to perform Complexity analysis in terms of the size of changes 5 5

Incremental graph pattern matching 6

Complexity of incremental algorithms Result graphs Union of isomorphic subgraphs for subgraph isomorphism A graph Gr = (Vr, Er) for (bounded) simulation Vr : the nodes in G matching pattern nodes in Gp Er: the paths in G matching edges in Gp Affected Area (AFF) the difference between Gr and Gr’, the result graph of Gp in G and G⊕∆G, respectively. |CHANGED| = |∆G| + |AFF| Optimal, bounded and unbounded problem expressible by f(|CHANGED|)? P Ann, CTO Pat, DB Bill, Bio subgraph isomorphism P * 1 2 Ann, CTO Pat, DB Dan, DB Bill, Bio Mat, Bio (bounded) simulation edge-path relation Measure the complexity with the size of changes

Incremental simulation matching Input: Q, G, Q(G), ∆G Output: ∆M such that Q(G ⊕ ∆G) = Q(G) ⊕ ∆M Incremental simulation is in Batch updates O(|∆G|(|Q||AFF| + |AFF|2)) time in O(|AFF|) time unbounded Optimal for single-edge deletions and general patterns single-edge insertions and DAG patterns 10:00 General patterns and graphs; batch updates 2 times faster than its batch counterpart for changes up to 10% 8 8

Semi-boundedness Semi-bounded: the cost is a PTME function f(|CHANGED|, |Q|) Incremental simulation is in | Q | is small O(|∆G|(|Q||AFF| + |AFF|2)) time Independent of | G | for batch updates and general patterns 15:00,16:00 Independent of | G | Semi-boundedness is good enough! 9 9

Complexity of incremental algorithms (cont) Insert e2 Ann, CTO Dan, DB Mat, Bio Insert e1 e5 Insert e3 e3 Bill, Bio Tom, Bio e4 Insert e4 e2 Pat, DB Don, CTO Ross, Med Insert e5 e1 ∆G G P * 1 2 CTO DB Bio Gr Ann, CTO Don, CTO affected area Pat, DB Dan, DB Bill, Bio Tom, Bio Mat, Bio

Incremental Simulation matching Problem statement Input: Gp, G, Gr, ∆G Output: ∆Gr, the updates to Gr s.t. Msim(G⊕∆G) = M(Gp,G)⊕∆M Complexity unbounded even for unit updates and general patterns bounded for single-edge deletions and general patterns bounded for single-edge insertions and DAG patterns, within optimal time O(|AFF|) In O(|∆G|(|Gp||AFF| + |AFF|2)) for batch updates and general patterns Measure the complexity with the size of changes

Incremental Simulation: optimal results unit deletions and general patterns delete e6 e = (v, v’), if v and v’ are matches Ann, CTO Dan, DB identify affected edges (between matches) Mat, Bio 2. find invalid match Bill, Bio e6 3. propagate affected Area and refine matches Pat, DB Don, CTO G Q CTO DB Bio Gr affected area / ∆Gr Ann, CTO Pat, DB Dan, DB e6 optimal with the size of changes Bill, Bio Mat, Bio Linear time wrt. the size of changes

Incremental Simulation: optimal results e = (v, v’), if v’ is a match and v a candidate unit insertion and DAG patterns insert e7 e = (v, v’), if v’ and v are candidate Ann, CTO Dan, DB identify affected edges (between candidate-match) Mat, Bio Bill, Bio 2. find new valid matches e7 3. propagate affected Area and refine matches Pat, DB Don, CTO G Q CTO DB Bio Gr Ann, CTO candidate Dan, DB Pat, DB e7 e7 optimal with the size of changes Bill, Bio Mat, Bio Linear time wrt. the size of affected area

Incremental subgraph isomorphism Incremental subgraph isomorphism matching: Input: Gp, G, Gr, ∆G Output: ∆Gr, the updates to Gr s.t. Miso(G⊕∆G) = Miso(Gp,G)⊕∆M Incremental subgraph isomorphism: Output: true if there is a subgraph in G⊕∆G that is isomorphi = Miso(Gp,G)⊕∆M Complexity IncIsoMatch is unbounded even for unit updates over DAG graphs for path patterns IncIso is NP-complete even for path pattern and unit update

Incremental subgraph isomorphism Input: Q, G, Miso(Q, G), ∆G Output: ∆M such that Miso (Q, G⊕∆G) = Miso(Q, G) ⊕ ∆M Boundedness and complexity Incremental matching via subgraph isomorphism is unbounded even for unit updates over DAG graphs for path patterns Incremental subgraph isomorphism is NP-complete even when G is fixed 18 We have proposed an algorithm to demonstrate the benefits of incremental matching, based on locality property. Upon updates to the data graphs, we only need to consider the subgraphs induced by the nodes and edges that are within k hops of the updated edges, where k is the diameter of the pattern graph Gp. Input: Q, G, M(Q, G), ∆G Question: whether there exists a subgraph in G⊕∆G that is isomorphic to Q Neither bounded nor semi-bounded 15 15

Data stream processing 16

Streams – A Brave New World Traditional DBMS: data stored in finite, persistent data sets Data Streams: distributed, continuous, unbounded, rapid, time varying, noisy, . . . Data-Stream Management: variety of modern applications Network monitoring and traffic engineering Sensor networks Telecom call-detail records Network security Financial applications Manufacturing processes Web logs and clickstreams Other massive data sets…

IP Network Monitoring Application DSL/Cable Networks Broadband Internet Access Converged IP/MPLS Core PSTN Enterprise Networks Voice over IP FR, ATM, IP VPN Network Operations Center (NOC) SNMP/RMON, NetFlow records Peer Source Destination Duration Bytes Protocol 10.1.0.2 16.2.3.7 12 20K http 18.6.7.1 12.4.0.3 16 24K http 13.9.4.3 11.6.8.2 15 20K http 15.2.2.9 17.1.2.1 19 40K http 12.4.3.8 14.8.7.4 26 58K http 10.5.1.3 13.0.0.1 27 100K ftp 11.1.0.6 10.3.4.5 32 300K ftp 19.7.1.2 16.5.5.8 18 80K ftp Example NetFlow IP Session Data 24x7 IP packet/flow data-streams at network elements Truly massive streams arriving at rapid rates AT&T collects 600-800 Gigabytes of NetFlow data each day. Often shipped off-site to data warehouse for off-line analysis

Network Monitoring Queries DBMS (Oracle, DB2) Back-end Data Warehouse Off-line analysis – slow, expensive What are the top (most frequent) 1000 (source, dest) pairs seen over the last month? How many distinct (source, dest) pairs have been seen by both R1 and R2 but not R3? Set-Expression Query Network Operations Center (NOC) SELECT COUNT (R1.source, R2.dest) FROM R1, R2 WHERE R1.dest = R2.source SQL Join Peer Enterprise Networks PSTN DSL/Cable Networks

Real-Time Data-Stream Analysis IP Network PSTN DSL/Cable Networks Network Operations Center (NOC) BGP Must process network streams in real-time and one pass Critical NM tasks: fraud, DoS attacks, SLA violations Real-time traffic engineering to improve utilization Tradeoff communication and computation to reduce load Make responses fast, minimize use of network resources Secondarily, minimize space and processing cost at nodes

Sensor Networks Wireless sensor networks becoming ubiquitous in environmental monitoring, military applications, … Many (100s, 103, 106?) sensors scattered over terrain Sensors observe and process a local stream of readings: Measure light, temperature, pressure… Detect signals, movement, radiation… Record audio, images, motion…

Sensornet Querying Application Query sensornet through a (remote) base station Sensor nodes have severe resource constraints Limited battery power, memory, processor, radio range… Communication is the major source of battery drain “transmitting a single bit of data is equivalent to 800 instructions” [Madden et al.’02] http://www.intel.com/research/exploratory/motes.htm base station (root, coordinator…)

Data-Stream Algorithmics Model Stream Processor Approximate Answer with Error Guarantees “Within 2% of exact answer with high probability” Stream Synopses (in memory) Continuous Data Streams Query Q R1 Rk (Terabytes) (Kilobytes) Approximate answers– e.g. trend analysis, anomaly detection Requirements for stream synopses Single Pass: Each record is examined at most once Small Space: Log or polylog in data stream size Small-time: Low per-record processing time (maintain synopses)

Distributed Streams Model Network Operations Center (NOC) Query site Query 1 Q(S1 ∪ S2 ∪…) S6 S5 S4 S3 S1 S2 - “Holistic” here is used to capture the intuition that the query is over a set of global streams (the whole network). This is separate from the notion of “holistic aggregates” (which is formally defined later)… Large-scale querying/monitoring: Inherently distributed! Streams physically distributed across remote sites E.g., stream of UDP packets through subset of edge routers Challenge is “holistic” querying/monitoring Queries over the union of distributed streams Q(S1 ∪ S2 ∪ …) Streaming data is spread throughout the network

Distributed Streams Model Network Operations Center (NOC) Query site Query 1 Q(S1 ∪ S2 ∪…) S6 S5 S4 S3 S1 S2 - “Holistic” here is used to capture the intuition that the query is over a set of global streams (the whole network). This is separate from the notion of “holistic aggregates” (which is formally defined later)… Need timely, accurate, and efficient query answers Additional complexity over centralized data streaming! Need space/time- and communication-efficient solutions Minimize network overhead Maximize network lifetime (e.g., sensor battery life) Cannot afford to “centralize” all streaming data

Distributed Stream Querying Space “One-shot” vs. Continuous Querying One-shot queries: On-demand “pull” query answer from network One or few rounds of communication Nodes may prepare for a class of queries Continuous queries: Track/monitor answer at query site at all times Detect anomalous/outlier behavior in (near) real-time, i.e., “Distributed triggers” Challenge is to minimize communication Use “push-based” techniques May use one-shot algs as subroutines Querying Model Communication Class of Queries

Distributed Stream Querying Space Minimizing communication often needs approximation and randomization E.g., Continuously monitor average value Must send every change for exact answer Only need ‘significant’ changes for approx (def. of “significant” specifies an algorithm) Probability sometimes vital to reduce communication count distinct in one shot model needs randomness Else must send complete data Querying Model Communication Class of Queries

Distributed Stream Querying Space Class of Queries of Interest Simple algebraic vs. holistic aggregates E.g., count/max vs. quantiles/top-k Duplicate-sensitive vs. duplicate-insensitive “Bag” vs. “set” semantics Complex correlation queries E.g., distributed joins, set expressions, … Querying Model Communication Class of Queries 1 Query |(S1 ∪ S2) ⋈ (S5 ∪ S6)|

Distributed Stream Querying Space Communication Network Characteristics Topology: “Flat” vs. Hierarchical vs. Fully-distributed (e.g., P2P DHT) Querying Model Communication Class of Queries Coordinator Fully Distributed Hierarchical “Flat” Other network characteristics: Unicast (traditional wired), multicast, broadcast (radio nets) Node failures, loss, intermittent connectivity, …

Tree based Aggregation 30

Network Trees Tree structured networks are a basic primitive Much work in e.g. sensor nets on building communication trees We assume that tree has been built, focus on issues with a fixed tree Flat Hierarchy Base Station Regular Tree

Can do much better by “In-network” query processing Computation in Trees Goal is for root to compute a function of data at leaves Trivial solution: push all data up tree and compute at base station Strains nodes near root: batteries drain, disconnecting network Very wasteful: no attempt at saving communication Can do much better by “In-network” query processing Simple example: computing max Each node hears from all children, computes max and sends to parent (each node sends only one item)

Efficient In-network Computation What are aggregates of interest? SQL Primitives: min, max, sum, count, avg More complex: count distinct, point & range queries, quantiles, wavelets, histograms, sample Data mining: event detection, association rules, clusterings etc. Some aggregates are easy – e.g., SQL primitives Can set up a formal framework for in network aggregation

Generate, Fuse, Evaluate Framework Abstract in-network aggregation. Define functions: Generate, g(i): take input, produce summary (at leaves) Fusion, f(x,y): merge two summaries (at internal nodes) Evaluate, e(x): output result (at root) E.g. max: g(i) = i f(x,y) = max(x,y) e(x) = x E.g. avg: g(i) = (i,1) f((i,j),(k,l)) = (i+k,j+l) e(i,j) = i/j Can specify any function with g(i) ={i}, f(x,y) = x ∪ y Want to bound |f(x,y)| e(x) f(x,y) g(i)

Classification of Aggregates Different properties of aggregates (from TAG paper [Madden et al ’02]) Duplicate sensitive – is answer same if multiple identical values are reported? Example or summary – is result some value from input (max) or a small summary over the input (sum) Monotonicity – is F(X ∪ Y) monotonic compared to F(X) and F(Y) (affects push down of selections) Partial state – are |g(x)|, |f(x,y)| constant size, or growing? Is the aggregate algebraic, or holistic?

Classification of some aggregates Duplicate Sensitive Example or summary Monotonic Partial State min, max No Example Yes algebraic sum, count Summary average median, quantiles holistic count distinct sample Example(s) algebraic? histogram adapted from [Madden et al.’02]

Cost of Different Aggregates Slide adapted from http://db.lcs.mit.edu/madden/html/jobtalk3.ppt Simulation Results 2500 Nodes 50x50 Grid Depth = ~10 Neighbors = ~20 Uniform Dist. Holistic Show names in Tax? Algebraic

Holistic Aggregates Holistic aggregates need the whole input to compute (no summary suffices) E.g., count distinct, need to remember all distinct items to tell if new item is distinct or not So focus on approximating aggregates to limit data sent Adopt ideas from sampling, data reduction, streams etc. Many techniques for in-network aggregate approximation: Sketch summaries Other mergable summaries Building uniform samples, etc…

Sketch Summaries Sketch summaries are typically pseudo-random linear projections of data. Fits generate/fuse/evaluate model: Suppose input is vectors xi and aggregate is F(åi xi) Sketch of xi, g(xi), is a matrix product Mxi Combination of two sketches is their summation: f(g(xi),g(xj)) = M(xi + xj) = Mxi + Mxj = g(xi) + g(xj) Extraction function e() depends on sketch, different sketches allow approximation of different aggregates.

CM Sketch Simple sketch idea, can be used for point queries, range queries, quantiles, join size estimation. Model input at each node as a vector xi of dimension U, U is too large to send whole vectors Creates a small summary as an array of w ╳ d in size Use d hash function to map vector entries to [1..w] W d

CM Sketch Structure h1(j) hd(j) j,xi[j] d w Each entry in vector x is mapped to one bucket per row. Merge two sketches by entry-wise summation Estimate xi[j] by taking mink sketch[k,hk(j)] [Cormode, Muthukrishnan ’04]

Sketch Summary CM sketch guarantees approximation error on point queries less than e||x||1 in size O(1/e log 1/d) Probability of more error is less than 1-d Similar guarantees for range queries, quantiles, join size AMS sketches approximate self-join and join size with error less than e||x||2 ||y||2 in size O(1/e2 log 1/d) [Alon, Matias, Szegedy ’96, Alon, Gibbons, Matias, Szegedy ’99] FM sketches approximate number of distinct items (||x||0) with error less than e||x||0 in size O(1/e2 log 1/d) FM sketch in more detail later [Flajolet, Martin ’83] Bloom filters: compactly encode sets in sketch like fashion

Other approaches: Careful Merging Approach 1. Careful merging of summaries Small summaries of a large amount of data at each site Can sometimes carefully merge summaries up the tree Problem: if not done properly, the merged summaries can grow very large as they approach root Balance final quality of answer against number of merges by decreasing approximation quality (precision gradient) See [Greenwald, Khanna ’04; Manjhi et al.’05; Manjhi, Nath, Gibbons ‘05]

Other approaches: Domain Aware Approach 2. Domain-aware Summaries Each site sees information drawn from discrete domain [1…U] – e.g. IP addresses, U = 232 Build summaries by imposing tree-structure on domain and keeping counts of nodes representing subtrees [Agrawal et al ’04] show O(1/e log U) size summary for quantiles and range & point queries Can merge repeatedly without increasing error or summary size 5 3 1 2 1 1 3

Other approaches: Random Samples Approach 3. Uniform random samples As in centralized databases, a uniform random sample of size O(1/e2 log 1/d) answers many queries Can collect a random sample of data from each node, and merge up the tree (will show algorithms later) Works for frequent items, quantile queries, histograms No good for count distinct, min, max, wavelets…

Thoughts on Tree Aggregation Some methods too heavyweight for e.g., sensor nets, but as technology improves may soon be appropriate Most are well suited for, e.g., wired network monitoring Trees in wired networks often treated as flat, i.e. send directly to root without modification along the way Techniques are fairly well-developed owing to work on data reduction/summarization and streams Open problems and challenges: Improve size of larger summaries Avoid randomized methods? Or use randomness to reduce size?

Robustness and Loss 47

Unreliability Tree aggregation techniques assumed a reliable network we assumed no node failure, nor loss of any message Failure can dramatically affect the computation E.g., sum – if a node near the root fails, then a whole subtree may be lost Clearly a particular problem in sensor networks If messages are lost, maybe can detect and resend If a node fails, may need to rebuild the whole tree and re-run protocol Need to detect the failure, could cause high uncertainty

Sensor Network Issues Sensor nets typically based on radio communication So broadcast (within range) cost the same as unicast Use multi-path routing: improved reliability, reduced impact of failures, less need to repeat messages E.g., computation of max structure network into rings of nodes in equal hop count from root listen to all messages from ring below, then send max of all values heard converges quickly, high path diversity each node sends only once, so same cost as tree

Order and Duplicate Insensitivity It works because max is Order and Duplicate Insensitive (ODI) [Nath et al.’04] Make use of the same e(), f(), g() framework as before Can prove correct if e(), f(), g() satisfy properties: g gives same output for duplicates: i=j ⇒ g(i) = g(j) f is associative and commutative: f(x,y) = f(y,x); f(x,f(y,z)) = f(f(x,y),z) f is same-synopsis idempotent: f(x,x) = x Easy to check min, max satisfy these requirements, sum does not

Applying ODI idea Only max and min seem to be “naturally” ODI How to make ODI summaries for other aggregates? Will make use of duplicate insensitive primitives: Flajolet-Martin Sketch (FM) Min-wise hashing Random labeling Bloom Filter

Random Samples Suppose each node has a (multi)set of items. How to find a random sample of the union of all sets? Use a “random tagging” trick [Nath et al.’05]: For each item, attach a random label in range [0…1] Pick the items with the K smallest labels to send Merge all received items, and pick K smallest labels (a, 0.34) (a, 0.34) (a, 0.34) (d, 0.57) K=1 (c, 0.77) (c, 0.77) (b,0.92)

Uniform random samples Result at the coordinator: A sample of size K items from the input Can show that the sample is chosen uniformly at random without replacement Related to min-wise hashing Suppose we want to sample from distinct items Then replace random tag with hash value on item name Result: uniform sample from set of present items Sample can be used for quantiles, frequent items etc.

1 1 1 Bloom Filters Bloom filters compactly encode set membership k hash functions map items to bit vector k times Set all k entries to 1 to indicate item is present Can lookup items, store set of size n in ~ 2n bits Bloom filters are ODI, and merge like FM sketches item 1 1 1

Open Questions and Extensions Characterize all queries – can everything be made ODI with small summaries? How practical for different sensor systems? Few FM sketches are very small (10s of bytes) Sketch with FMs for counters grow large (100s of KBs) What about the computational cost for sensors? Amount of randomness required, and implicit coordination needed to agree hash functions etc.? Other implicit requirements: unique sensor IDs? 6 5 4 3 2 1 1

Decentralized Computation and Gossiping 56

Decentralized Computations All methods so far have a single point of failure: if the base station (root) dies, everything collapses An alternative is Decentralized Computation Everyone participates in computation, all get the result Somewhat resilient to failures / departures Initially, assume anyone can talk to anyone else directly

Gossiping “Uniform Gossiping” is a well-studied protocol for spreading information I know a secret, I tell two friends, who tell two friends … Formally, each round, everyone who knows the data sends it to one of the n participants chosen at random After O(log n) rounds, all n participants know the information (with high probability) [Pittel 1987]

Aggregate Computation via Gossip Naïve approach: use uniform gossip to share all the data, then everyone can compute the result. Slightly different situation: gossiping to exchange n secrets Need to store all results so far to avoid double counting Messages grow large: end up sending whole input around

ODI Gossiping If we have an ODI summary, we can gossip with this. When new summary received, merge with current summary ODI properties ensure repeated merging stays accurate Number of messages required is same as uniform gossip After O(log n) rounds everyone knows the merged summary Message size and storage space is a single summary O(n log n) messages in total So works for FM, FM-based sketches, samples etc.

Push-Sum Setting: all n participants have a value, want to compute average Define “Push-Sum” protocol In round t, node i receives set of (sumjt-1, countjt-1) pairs Compute sumit = åj sumjt-1, countit = åj countj Pick k uniformly from other nodes Send (½ sumit, ½countit) to k and to i (self) Round zero: send (value,1) to self Conservation of counts: åi sumit stays same Estimate avg = sumit/countit x y i (x+y)/2

Push-Sum Convergence 8,1 10,1 2,1 12,1 6,1 9, 1 11,3/2 6, ½ 11½,3/2 7½,1 5½,3/4 7½,3/4 8½,9/8 7½,7/8

Convergence Speed Can show that after O(log n + log 1/e + log 1/d) rounds, the protocol converges within e n = number of nodes e = (relative) error d = failure probability Correctness due in large part to conservation of counts Sum of values remains constant throughout (Assuming no loss or failure)

Gossip on Vectors Can run Push-Sum independently on each entry of vector More strongly, generalize to Push-Vector: Sum incoming vectors Split sum: half for self, half for randomly chosen target Can prove same conservation and convergence properties Generalize to sketches: a sketch is just a vector But e error on a sketch may have different impact on result Require O(log n + log 1/e + log 1/d) rounds as before Only store O(1) sketches per site, send 1 per round

Thoughts and Extensions How realistic is complete connectivity assumption? nodes only see a local subset Variations: spatial gossip ensures nodes hear about local events with high probability [Kempe, Kleinberg, Demers ’01] Can do better with more structured gossip, but impact of failure is higher [Kashyap et al.’06] Is it possible to do better when only a subset of nodes have relevant data and want to know the answer?

Summary Incremental query processing Data stream processing: Overview Data synopsis in data stream processing Robustness and reliability Distributed data stream models Next week: Distributed and parallel Big data processing.