When the Sensors Hit the Road The Car Tel Project
description
Transcript of When the Sensors Hit the Road The Car Tel Project
When the Sensors Hit the RoadThe CarTel Project
Sam MaddenMIT CSAIL
http://cartel.csail.mit.edu
With Hari Balakrishnan, Vladimir Bychkovsky, Jakob Eriksson, Bret Hull, Yang Zhang, Kevin Chen, Waseem Daher, Michel Goraczko, Hongyi Hu, Sejoon Lim, Allen Miu, Daniela Rus, Eugene Shih, Arvind Thiagarajan,
Sivan Toledo
Stanford Database Group
1st Generation Sensor Networks
Periodic monitoring– Wake up and sense– Sleep for Minutes
Event-based monitoring– Transmit on external event
Low data rates, duty cyles
Static, small area
Extremely underpowered devices “Mote
”
~=
Participatory Sensing
“Crowd-sourced” sensing– Individuals contribute their data– Rather than relying on fixed deployments
Examples:– Personalized Environmental Impact Report– Microsoft SensorMap– Dartmouth BikeNet– MapMyRun, etc. CarTel CarTel
Cars as a Vehicle for Participatory Sensing
Observation:– Static sensing infeasible
over very wide areas– Some apps do not need
high temporal fidelity
Real-world problems:– Civil infrastructure
monitoring– Road-surface conditions– Visual mapping– Commute optimization– Carpool finding– Speed trap mapping
Opportunistic Mobility
Rather than deploy new mobile nodes, take advantage of existing mobility
Example: cellphones w/ sensors– 1.5 billion phones worldwide– High spatial coverage– High-performance processor
Cars equipped with sensors– 650 million cars on the road– Abundance of power and space– Have >100 embedded sensors
What system architecture is best suited for mobile, wide-area sensing?
Data collection servers
Clients
Internet
OpenWi-Fi
GPRSCollect / Process
Deliver
Visualize
CarTel System Overview
Portal
Cabernet / QuickWifi(Carry & Forward Network)
ICEDB(Intermittently Connected & Embedded DB)
Per-node
sensing &
computation
hardware
RoadmapOverview
CarTel Components– Portal– IceDB– Cabernet
Managing missing and uncertain data
Case Studies– Traffic Analysis– WiFi Mapping– Potholes
Portal
Web-based visualization framework
Apps retrieve sensor data by issuing queries to ICEDB
Visualize sensor data using map overlays
Continuous queries to direct sensing– Pushed to remote nodes
using Cabernet
Local ad-hoc queries read streaming results
Visualize / Analyze
Web server
Portal Applications
Traffic Wi-Fi
ICEDB server
CQ
Rel.DB
Cabernet
PortalData Viz.
Streamingsensor data Cont. queries
Visualize / Analyze
DataCollectionDemo
ICEDB: Intermittently Connected Embedded DB
Relational model is a convenient abstraction for data collection
ICEDB:– Queries written in extended SQL– Continuous query processor– Distributed
Bandwidth is variable1. Buffer query and DDL commands2. Buffer query results3. Support “drill down” queries 4. Prioritize results
Collect / Process
SELECT img
FROM camera, gps
WHERE gps.pos in [x,y]
AND camera.time= gps.time
SAMPLE 1s
ICEDB Query Processing
DB
CQ
Ad-hocQuery
Processor
OutputBuffers
Cabern
et
ADAPTERS
sensor
sensor
sensor
Collect / Process
Remote Node
2 data paths to cope with limited BW
ICEDB Server ICEDB Remoteresults
queries
Inter-query Prioritization
Remote node
BISECTPortal SELECT lat, lon
FROM gpsWHERE insert_time
> cqtime – 5EVERY 5 secondsBUFFER IN gpsbufDELIVERY ORDER bisect(gpsbuf)
Portal Portal
Remote node
FIFO
Portal Portal Portal
t=1 t=2 t=3
SELECT lat, lonFROM gpsWHERE insert_time
> cqtime – 5EVERY 5 secondsBUFFER IN gpsbufDELIVERY ORDER fifo(gpsbuf)
Collect / Process
Global Prioritization
Collect / Process
toICEDBServer
toICEDBServer
SELECT lat, lon, image FROM cameraWHERE insert_time > cqtime – 5EVERY 5 secondsBUFFER IN cambufSUMMARIZE AS
SELECT floor(lat/100), floor(lon/100) FROM cambufGROUP BY floor(lat/100), floor(lon/100)
Global Prioritization
Collect / Process
ICEDB Server
1
22
2
1
1
Specifying Priorities
Three SQL language extensions:1. Global prioritization:
SUMMARIZE AS
2. Inter-query prioritization:PRIORITY
3. Intra-query prioritization:DELIVERY ORDER BY
For more details: ICDE ’06
Collect / Process
Cabernet
Disconnection-tolerant transport layer
Buffer data untilconnectivity becomes available– Not connection oriented
QuickWifi: Fast connection establishment
CTP: Unlike TCP, wireless losses ≠ congestion losses
Deliver
QuickWifi
Jakob Eriksson et al – Mobicom 08
Challenge: Connection Establishment is Slow
Process– Scan 11 channels (600 ms average), receive beacon– Authenticate (1 round trip, 3s timeout)– Associate (1 round trip, 3s timeout)– DHCP Discovery (1 round trip, 3s timeout)– DHCP Request (1 round trip, 3s timeout)– ARP Request (1 round trip, 2s timeout)
Many messages, loss rates high, retries often needed
Default Linux stack took 13s to associate, on average (whole connection lasts only 19s avg!)
Deliver
Connection Optimizations
Scan more popular channels first (1,6,11)
Since authentication in open networks always succeeds, do it in parallel with association
Set timeouts to 100 ms
Mean conn. time: 370 ms
DHCP via broadcast addr
Roadmap
Overview
CarTel Components– Portal– Cabernet– Cabernet
Managing missing and uncertain data
Case Studies– Traffic Analysis– WiFi Mapping– Potholes
Noisy Data Challenge
Challenge: how to store and query all of this data?
Discrete points don’t work well
Most apps don’t actually want raw data!– Prefer trajectories, fields, fit functions– Idea: support these as first class objects
inside the DBMS
Model-Based Views
Proposed in MauveDB [SIGMOD 06]– Models can be queried like database views – Basic idea:
• compute model• grid modeled area• use model to compute values at each cell of grid• answer queries using grid
FunctionDB: efficient implementation for an important class of models– Continuous functions of one or more
variables
Benefits
Declarative Queries– No need to write procedures to manipulate
models, or re-implement or re-optimize each new query
View provides intuitive SQL-like interface
If data is already in database, do not need to move data to/from math package like MATLAB
FunctionDB: Key IdeaDatabase system that fits continuous functions to dataMauveDB-like query Interface (SQL + Grids)Algebraic query processor
Raw data (temp readings)
Query: Report when temp crosses threshold
SELECT time WHERE temp = thresh
Regression Function temp(t)
Solve equation temp(t) = thresh
temp
time
FunctionDB: System Architecture
Raw Data“Function Table”
(Storing Piecewise Model)X Y
1 1.1
3 3.1
4 3.9… …
Start
End Slope
Intercept
1 8 1 0
8 12 2 -8
User fits or imports
functions
Algebraic Query Processor(Operates on algebraic
representation)
User Query Query Result
Query Results• Grid semantics: all queries yield discrete
points sampled at user-specified interval (“grid size”)
SELECT x,y WHERE temp < 20 GRID x 8, y 88
8
temp < 20
Algebraic Execution: Overview
• FunctionDB supports efficient algebraic execution for piecewise polynomial functions
• Restriction helps achieve grid semantics even when no closed form solutions are available• E.g., Non-linear polynomials, multi-
variate polynomials, complex constraints
X^2 + Y^3 < 25
SELECT * WHERE Temp < 20 GRID X 8, Y 8 Efficient Algebraic Implementation
User
X:[0,20) , Y:[0,20) , Temp = X+Y
X:[0,20) , Y:[0,20) , Temp = X+Y , Temp < 20
Substitute
Approx
X:[0,20) , Y:[0,20) , Temp = X+Y , X+Y-20 < 0
Grid
Symbolic Filter (Temp < 20)
Function Table Temp = F(X,Y)
Gridded Result Hypercubes+Boundary Points
X+Y < 20
X+Y < 20
Hypercube Approximation• Use technique from graphics rasterization
(Taubin’s test)• Tests if polynomial F(X,Y, …) can have zeros
within a given hypercube H (i.e., F lies on boundary of H)
Hypercube H
Z = F(X,Y)
Z = 0Y
X
Zero of F
• Allows efficient pruning by testing corners of hypercube
Subdivision Algorithm
Predicate
Bounding Box-
-
-
+
Check centers of all grid cells smaller than grid size
++ ++
More Algebraic Operators
• Solver for single-variable equations• Function Inference• E.g., X+Y = 20 X = 20-Y• (Eliminates independent variables)
• Continuous aggregates• E.g., Average Integration
Evaluation: Temperature Data
• Data: <Sensor ID, X, Y, time, temp>• 54 sensors, 10 days of data, 1 million raw data
points• Fit regression model temp = F(X,Y,time)• Degree-2 piecewise polynomial with 22 pieces
• Evaluation queries:• Find regions where temp < threshold (Filter)• Area of region where temp < threshold
(Aggregate)
• Compared algebraic approach to two baselines:• Evaluating all grid points• Pruning search using a precomputed B-Tree
Result 1: Benefits Of Algebraic Execution Depend On Selectivity
Result 2: Algebraic Execution Wins Significantly For Aggregate Queries
Wider grid size is faster, but too wide a grid size
results in low accuracy owing to discretization
error
Roadmap
Overview
CarTel Components– Portal– Cabernet– Cabernet
Managing missing and uncertain data
Case Studies– Traffic Analysis– WiFi Mapping– Potholes
Route Planning
Match traces to map
Compute Gaussian delay for each segment– Assume independence
Minimize 3 Objectives– Distance
• Google Maps
– Expected delay– Pr(missing time goal)
Max. Probability Planning
Travel time of each edge is a Gaussian– If indepdendent, travel time of a path is also Gaussian
Goal: find path with max. probability of reaching destination by deadline
Unlike standard shortest paths, no optimal substructure– If AxCyB is best path from A to B, AxC is not
necessarily the best path from A to C
Implies cannot use A* or Dijkstra
2
A BC
13Lim et al. “Stochastic Motion Planning and Applications to
Traffic.” To Appear, Workshop on Algorithmic Foundations of Robotics, 2008
WiFi As A Sensor
Is WiFi feasible as an uplink from cars?– Study with taxis; 30,000 distinct APs
Answer:– Significant connectivity “in the wild”
• ~ 200 kB / minute• Even at normal driving speeds
– Connections last about 20 seconds
– See an access point about every 20 seconds!
See MOBICOM 2006
Conclusion
Mobile and participatory sensornets can sense at much higher scale over larger areas than static networks
Applications: traffic, fleet management, automotive diagnostics, wireless network monitoring, civil/environmental monitoring, traffic planning,…
CarTel technologies: Portal, IceDB, Cabernet/QuickWifi, FunctionDB
Platform enabled research results: Pothole Patrol, Traffic, WiFi as Uplink
For more info: http://cartel.csail.mit.edu