Immediate Detection of redicates in ervasive Environments Ajay Kshemkalyani University of Illinois at Chicago November 30, 2010 A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 1 / 7
Outline of Talk Sensing the physical world for pervasive apps. Immediate redicate Detection: Motivation System and Execution Model redicates detected conjunctive and relational Approximate Snapshot Algorithms for immediate predicate detection Simple Clock-Free algorithm Interval Vector algorithm Consensus algorithm Characterization of accuracy of above algorithms erformance overhead comparison Discussion A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 2 / 7
redicate Detection by Sensing for ervasive Apps. Distributed sensed values assembled to determine context and adapt behavior or actuate /interact with environment redicates local predicate φi : on variables sensed locally by sensor i Conjunctive: φ = i N φ i, e.g., location = 915SEO temp < 20C Relational: φ = f i N (φ i ), e.g., x i + y j > 10 Do not assume physically synchronized clocks resource-constrained sensornets/ remote environments periodic clock synchronization may not be affordable skew ɛ (µ-secs to ms): imprecision in detecting predicates layer independance Explore use of lightweight middleware approaches A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 3 / 7
Immediate redicate Detection Detect global predicate φ that held at some instant in distributed observation of distributed asynchronous message-passing system Existing literature assumes instantaneous snapshots possible with synchronized physical clocks costs incurred by lower layer skew ɛ when overlap of intervals in which φ is true 2ɛ, false negatives resource-constrained sensornets, remote environments: unavailable or costly In MidSens 10, used lightweight middleware clocks to detect predicates Drawback: predicate gets detected after each sensor has sensed one more event, its next, locally (to also report completion time of interval) Immediate detection: for real-time on-line actuation and raising alarms ropose 3 clock-free algorithms A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 4 / 7
: Bound to Characterize Accuracy of Clock-Free redicate Detection Algorithms : bound on asynchronous message transmission delay for system-wide broadcast queuing in buffers, process scheduling, context switching retransmission (for reliability) Algorithms do not use ; accuracy determined by actual ( ) in a race difficult to estimate; characterizes degree of imprecision under races Contrast: physical clocks skew (ns for HW solns or µs-ms for SW solns) : 100ms - secs in WSNS in closed environments, e.g., smart homes Adequate when n is low and/or event rate is low, e.g., home. office, habitat, nature, structure monitoring << speed of human and object movements wild, remote terrain, nature monitoring: events rare w.r.t. hysical clocks: precision not needed (in the urban or wild), nor affordable (in the wild) A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 5 / 7
Sensor Network Model World plane vs. network plane Sensors/actuators modeled as processes (n) p: bound on number of sensed events at any sensor Network plane: asynchronous, FIFO channels Network plane cannot capture world plane causality: covert channels Interval: duration between two consecutively sensed events at a sensor roblem: Detect conjunctive or relational predicate over sensed values A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 6 / 7
roblem Definition Definition Given a conjunctive or relational φ on sensed values of the world plane, detect each occurrence of φ, holding at the same instant, without using physically synchronized clocks, in the network plane. Each detection should occur on-line at the earliest possible instant. Characterization of accuracy: same for relational and conjunctive predicates Level of accuracy lower for relational predicates A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 7 / 7
Time Models for SensorNets World plane causality over covert channels : cannot be tracked by network plane Hence, p n possible consistent states in state lattice World plane events to be observed: non-deterministic; single run only (Contrast: distributed programs: partial order induced by in-network deterministic sends/ receives) A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 8 / 7
Approximations in Simulating hysical Time World plane execution: one path of the many paths in state lattice Goal: identify the pn states and evaluate φ in them Control messages of our algorithms induce an artificial (non-semantic) lattice of consistent global states eliminate many of the O(p n ) states of state lattice Algorithms make approximations to the actual path traced by world plane execution, without constructing the lattice A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 9 / 7
Simulating hysical Time using Strobes Let I = {I 1,... I n } be a set of intervals, one per process. I.t s and I.t f denote the start and finish logical clock values of interval I. Definition All I i I overlap in physical time, i.e., Instantaneously I, iff Definition overlap(i) = min i (I i.t f ) max i (I i.t s ) max(i i.t s ) < min(i i.t f ) (1) i i overlap and used to characterize accuracy of 3 proposed algorithms. A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 10 / 7
Overview of roposed Algorithms Simple Value Vector at sink (or at all) node(s); Clock-Free send to sink (or broadcast) event notification; Algorithm evaluate φ whenever Value Vector changes Interval Value Vector, Interval Vector at all nodes + Vector broadcast Value Vector, Interval Vector + Algorithm evaluate φ by all nodes whenever Interval Vector changes Consensus Interval Vector Algorithm + Algorithm transmit (or broadcast) Consensus Message + consensus evaluated at sink (or by all) node(s) A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 11 / 7
Examples of otential False Negatives 4 X 5 i 7 Y 8 j Z k 1 2 Figure: Overlap: a potential false negative. i j k 1 Z 4 X 5 7 Y 8 Figure: Overlap: an inevitable false negative. 2 4 X 5 i 7 Y 8 j Z k 1 2 Figure: Overlap: a potential false negative. 4 X 5 i 7 Y 8 j Z k 1 2 Figure: Overlap: a potential false negative. A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 12 / 7
Examples of otential False ositives i 4 X 5 j Z k 1 2 7 Y 8 Figure: No overlap: a potential false positive. i j Z k 1 2 4 X 5 7 Y 8 Figure: No overlap: false positive not possible. i j Z k 1 2 4 X 5 7 Y 8 Figure: No overlap: a potential false positive. A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 13 / 7
Results: Simple Clock-Free and Interval Vector Algorithms Theorem For a single observer in a system without any synchronized clocks, for the Simple Clock-Free and Interval Vector algorithms: 1 overlap = φ is correctly detected 2 0 overlap < = any outcome is possible 3 0 overlap > = any outcome is possible 4 overlap = φ is correctly detected as not holding Corollary For a single observer in a system without any synchronized clocks, for the Simple Clock-Free and Interval Vector algorithms: 1 ositive detection = overlap > 2 Negative detection = overlap < A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 14 / 7
Approximations by Algorithms Two levels of approximations to the np actual states 1 each of the n observers sees its best approximation to the actual global states at each of the np events 2 the np approximations of the actual global states observed by any observer are seen in a permutation that is the best approximation to the actual order Interval Vector algorithm makes better approximations than Simple Clock-Free algorithm. Yet, 1 a positive detection may be false (w/ overlap [, 0]) 2 a negative detection may be false (w/ overlap [0, ]) Consensus algorithm eliminates the first drawback, and reduces the number of instances that suffer from the second drawback. A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 15 / 7
Consensus Algorithm: Idea Cosensus algorithm runs consensus among observers approximations. Besides a positive and a negative bin, it creates a third bin: borderline. 1 ositives are all true with overlap (0, ); 2 borderline cases satisfy overlap (, ); 3 negatives are true or a few inevitable false cases with overlap (0, ). The application can classify the borderline cases in either direction. W.r.t Simple Clock-Free and Interval Vector algorithms, the number of false negatives is decreased, and the number of false positives is decreased A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 16 / 7
Consensus Algorithm: Idea Definition φ over an interval vector IV is: 1 confirmed by all iff count(iv ) = n 2 confirmed by only some iff n > count(iv ) > 0 3 confirmed by none iff count(iv ) = 0 A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 17 / 7
Consensus Algorithm: Results Theorem For n observers in a system without any synchronized clocks, for the Consensus algorithm, we have for any IV : 1 overlap = φ is confirmed by all 2 0 overlap < = φ is confirmed by all, only some, or none 3 0 overlap > = φ is confirmed by only some, or none 4 overlap = φ is confirmed by none Corollary For n observers in a system without any synchronized clocks, for the Consensus algorithm, we have for any IV : 1 Confirmed by all positive bin = true positive = overlap 0 2 Confirmed by only some borderline bin = > overlap > 3 Confirmed by none negative bin = (true negative (= overlap < 0) false negative having 0 < overlap < ) A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 18 / 7
On-the-fly Lattice Approximation Implicitly build on-the-fly the sub-lattice of those (up to n 2 p) states that the nodes do actually observe collectively, based on the np events. Also performs the corroborations among the n 2 p observations on-the-fly. 3 IV= 6 0 i 4 4 6 0 4 7 0 4 7 1 j IV= 3 6 0 7 3 7 0 4 7 0 4 7 1 8 4 8 1 k IV= 3 6 0 1 3 6 1 3 7 1 7 local interval number execution of Evaluate_State local sensed event broadcast of event notification broadcast of Consensus_Message 4 7 1 A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 19 / 7 2 4 7 2
Comparison of Algorithms for redicate Detection Baseline: Even with synchronized physical clocks, some false negatives/positives when race window < 2ɛ Ω(np) wireless broadcasts of 1 integer to sink to report each sensed event. np evals of φ at sink Algorithm Strobe Vector Strobe Scalar Simple Clock-Free Interval Vector Consensus roperties [MidSens 10] [MidSens 10] Message 1 BC of size O(n) 1 BC of size O(1) 1 msg of size O(1) 1 BC of size O(n) 1 BC of size O(n)/event complexity /event /event to sink /event /event + d messages ( or BCs), (can BC instead) where d [0, n 2 p] rocessing O(n 2 p)/node + O(np)/node + O(p)/node + O(n 2 p)/node + O(n 2 p)/node + [O(n 3 p) + (O(np) [O(n 2 p) + (O(np) O(np) eval of φ at O(np) eval of φ O(np) eval of φ/node + eval of φ)] at sink eval of φ)] at sink sink (if BC, at all) at sink or at all O(d) at sink (or at all) Detection after intervals after intervals 2 latency complete complete Observer Yes Yes No No Yes independence Detection by no extra msg cost no extra msg cost use BC instead of no extra msg cost no extra msg cost all observers msg to sink overlap true positive true positive true positive true positive true positive overlap some true positive; some true positive; some true positive; some true positive; some true positive; (0, ) some false negative some false negative some false negative some false negative some false negative; (better than SCF) some in borderline overlap true negative some true negative; some true negative; some true negative; some true negative; (, 0) some false positive some false positive some false positive some in borderline (better than SCF) overlap true negative true negative true negative true negative true negative A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 20 / 7
Conclusions roblem: Algorithms to immediately detect conjunctive or relational predicate over sensed values Do not assume physically synchronized clocks resource-constrained sensornets/ remote environments, e.g. wild periodic clock synchronization may not be affordable or necessary skew ɛ (µ-secs to ms): imprecision in detecting predicates precision not needed (urban or wild), nor affordable (wild) layer independance roposed predicate detection algorithms; attractive in small WSNs, e.g. smart homes, when: message cost over reporting sensed events to sink is low n is low and/or sensed event rate <<, typical of human and object movements A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 21 / 7
Discussion Analyze impact of assuming total order and causal order in WSNs: Can naturally occur in small WSNS, shared media networks Can also be provided by middleware at low cost No long-term effect of commuication failures on predicate detection distributed and symmetric algorithms at low cost Explore how more failures and mobility can be tolerated Refine the borderline bin, e.g., based on # witnesses A. Kshemkalyani (U Illinois at Chicago) Immediate Detection of redicates...... Nov 30, 2010 22 / 7