300 likes | 465 Views
Reconstruction of the Correct Temporal Order of Sensor Network Data. Matthias Keller , Lothar Thiele, Jan Beute l. IPSN 2011 / April 14, 2011 / Chicago, IL. PermaSense Matterhorn Deployment. August 2008 – today Single base station Up to 19 sensor nodes TinyOS /Dozer [Burri2007]
E N D
Reconstruction of the Correct Temporal Order of Sensor Network Data Matthias Keller, Lothar Thiele, Jan Beutel IPSN 2011 / April 14, 2011 / Chicago, IL
PermaSense Matterhorn Deployment • August 2008 – today • Single base station • Up to 19 sensor nodes • TinyOS/Dozer [Burri2007] • Constant rate • < 0.1 MByte/node/day
A Closer Look Reveals Different Artifacts • We can observe • Packet duplicates • Node restarts • Order inconsistencies • Temporal vs. logical
The Observed Phenomena … • Modify results derived from the data • Statistics, observed sequences of states, … • Are unacceptable when data quality is key • Scientific modeling, early warning, … • Difficult to avoid in real sensor networks • Resource-scarcity, dynamics, multi-hop routing … Data cleaning and system validation on a higher layer • Removal of artifacts threatening data utility • Guarantees on data quality and data ordering Problem Statement
Related Work • Logical notion of time • Lamport’s clock, vector clocks • Network time synchronization • FTSP, gradient clock sync, … • Data-driven time synchronization • Using microseismics[Lukac2009] • Using sunlight measurements [Gupchup2009] • Offline time reconstruction with Phoenix [Gupchup2010] • Sensor nodes exchange clock information during runtime
Goals of the Data Analysis • Validate packets based on a model of the real system • For valid packets • Add extra packet ordering information • Provide guarantees on time information • Mark other packets as non-conforming
Overview • System Model • Data Analysis • Bounds on packet generation time • Duplicate filtering • Epoch assignment • Forward and backward reasoning • Case Study with Model Validation 1 2 3
Overview • System Model • Data Analysis • Bounds on packet generation time • Duplicate filtering • Epoch assignment • Forward and backward reasoning • Case Study with Model Validation 1 2 3
Model of Multi-hop Data Collection • Periodic sampling • Sampling period T • Sequencing • Increasing sequence number • Resets on arithmetic overflow } } } } T T T T • Elapsed time on arrival • Sensor nodes measure packet sojourn time • Base station annotates packets with UTC timestamps a 4 sec c 4 sec 1 sec b 7 sec 6 sec 2011/04/14 10:03:31 – 7 sec = 2011/04/14 10:03:24 2 sec
Error Model • Clock drift • Affects measurement of • Sampling period T • Packet sojourn time ts • Indirectly leading to ordering inconsistencies • Temporal vs. logical • Node restarts • Cold restart: Power cycle • Soft restart: Watchdog reset } } T <T Shortens sampling period • Packet loss • Packet duplicates Lost 1-hop ACK 2 Node restart ✗ 1 ✗ ✗ Empty queue ✗ 3 Queue reset Retransmission
Formal System Model (1/2) Considering a single sensor node with source address o: • Abstract sequence counter: i • – at last cold restart: • Packet sequence number: • Sampling period: T • Clock drift and resolution: • Packet generation time:
Formal System Model (2/2) • Estimated sojourn time on node N: • Estimated total sojourn time: • Arrival time at base station: • Estimated generation time: • Maximum network diameter: • Error bounds on generation time calculation:
Data Processing • Input format: • Origin o, Sequence number s, total sojourn time , payload p, arrival time tb • Output format: • Unique packet identifier id reflects temporal order of generation • Bounds on packet generation time
Analysis Concepts • Remove uncertainty caused by sequence number • Assign packets to epochs • Determine unique packet id • Determine upper and lower bounds on generation time • Use forward and backward reasoning • Remove non-compliant packets • Duplicated packets • Incorrect time information • Behavior not covered by formal model problems:- arithmetic overflow- node restarts problems:- clock drift- node restarts
Overview • System Model • Data Analysis • Bounds on packet generation time • Duplicate filtering • Epoch assignment • Forward and backward reasoning • Case Study with Model Validation 1 2 3
Bounds on Packet Generation Time • Worst-case bounds for a single packet • Forward and backward reasoning is applied to tighten these bounds • Requirement: Exact ordering information
Overview • System Model • Data Analysis • Bounds on packet generation time • Duplicate filtering • Epoch assignment • Forward and backward reasoning • Case Study with Model Validation 1 2 3
Duplicate Filtering • We consider packets with • the same source address o • the same sequence number s • an equal payload p • We construct a graph G = (V, E) • Duplicate-free data set is achieved by only considering packets that are within the maximum independent set of G v w v
Overview • System Model • Data Analysis • Bounds on packet generation time • Duplicate filtering • Epoch assignment • Forward and backward reasoning • Case Study with Model Validation 1 2 3
Separate Data into Epochs • Observation: Sequence number s(i) resets to zero • Every smax packets due to arithmetical overflow • After a cold restart due to loss of state • After epoch assignment: • k “generated before” l id(k) < id(l) s(i) smax i e = 1 e = 2 e = 3 e = 4 e = 5
Epoch Assignment (1/3) • For each packet, calculate a reference point • Ideal case: Perfect clocks, absence of node restarts • Packets belonging to the same epoch have an equal reference point TC • Real case: Imperfect clocks, node restarts • Epoch assignment based on bound
Epoch Assignment (2/3) Theorem 1 All packets k, l that belong to the same epoch, i.e., e(k) = e(l), satisfy where where is an upper bound on the network sojourn time, i.e., and
Epoch Assignment (3/3) Theorem 2 Suppose that the generation period T satisfies Then all packets k, l that belong to different epochs, e.g., e(k) < e(l), satisfy Where is defined in Theorem 1.
Overview • System Model • Data Analysis • Bounds on packet generation time • Duplicate filtering • Epoch assignment • Forward and backward reasoning • Case Study with Model Validation 1 2 3
Forward and Backward Reasoning • Initially set worst-case bounds are often too pessimistic • Given the correct order of packet generation, initially set bounds can be improved by using information from temporarily adjacent packets • Example: A packet cannot be generated earlier than its predecessor i i-1 t
Overview • System Model • Data Analysis • Bounds on packet generation time • Duplicate filtering • Epoch assignment • Forward and backward reasoning • Case Study with Model Validation 1 2 3
Matterhorn Deployment Data • Three phases of system operation • Initial difficulties with hardware and software • Non-conforming system operation • Sensor nodes subject to a high number of restarts • Daily shut down of base station due to insufficient energy
Model Validation I) II) Model-based approach Unfiltered Data Verified Data Duplicate filtering Epoch assignment Violating packets Model Model ?= ?= ?= ?= # of sequence violations # of sequence violations
Detailed Results • Previously “dirty” data set has been restored for use • Appropriate method for continuous system validation
Conclusions • Data integrity testing and order reconstruction based on a system model of a real system • Give guarantees on data quality • Duplicate-free data • Correct temporal order of generation • Correct logical ordering • Proposed intermediate packet filtering step facilitates the usage of wireless sensor networks for applications that require highest data quality