declarative sensor networks david chu computer science division eecs department uc berkeley dblunch...
TRANSCRIPT
declarativesensor networks
David ChuComputer Science DivisionEECS DepartmentUC Berkeley
DBLunchUC Berkeley
2 March 2007
context
Leach's Storm Petrel
Sensor Networks 10’s – 100’s – 1000’s – 10,000’s
contextSensor Networks early experiences
motivation
programming sensor networks is difficult!
building entire sensor systems is even harder!!
inspiration
data management network design
s e n s o r n e t w o r k s
inspiration : data management• declarative is widely used in data
management– relational databases– spreadsheets– abstract “what” from “how”
• (Sensor-Network-As-Database)
inspiration : network design• declarative is new idea in networking
– compact– flexible– analyzable, optimizable– Internet Routing, Overlays built declaratively
• (the P2 project)
inspiration
data management network design
s e n s o r n e t w o r k s
( DSN )
what we did
• adapted declarative language
• built compiler & runtime for sensornets
• wrote declarative examples
… from original Trickle paper … DSN specification
10x6 topology
30x2 topology
agenda
1. language overview
2. declarative sensornet examples
3. system architecture
4. feasibility assessment
5. application to landslide detection
brief language overview
Rule2:
Fact:
Rule1:
join don’t care
Built-ins:
implies
a full example : tree
D
S
C
D
Z
C2
SC1
and others…
geographic routing* tracking localization link estimator
*fallback routing not shown
arch : compiler
Network support
Generated nesC code
store(…) :- prod(…), cons(…). … path(…) :- link(…), dest(…).…
Binary Image
Snlog Compiler/OptimizerSnlog
Program
GenericPredicateTemplate……
nesCTemplates
nesC Backend
Execution Planner
Snlog Frontend
nesC Compiler
Built-in Predicates
Type system
Database Operators
RuntimeComponents
RuntimeTemplate……
DSN Runtime Support
arch : runtime
the network
Join Join Proj
tupleready
Join AggProj Sel
table(compiler generated)
builtin(user’s library)
database operators(compiler’s library)
push interfaces
pull interfaces
thread of control
event signal
Sel Ag Proj
… … …
… …
… …
runtimedaemon
mac daemon
tupleready
tuplereadysendready
tupleready sendready
implementation challenges• predictable execution
→ dynamic vs. static allocation
• memory constraints→ memory footprint optimizations
no temporary tables, join/agg operator choice
• asynchrony→ rule-level atomicity
priorities
evaluation
evaluating tree-collection
messages sent
hop-counts
(similar performance)
lines of code
compiled size
TelosB mote code space = 48KB, data space = 10KB
VLDB 2006 demo
current efforts
• energy-based optimization– send or store
• language semantics clarity– non-monotonic logic
conclusion
• sensor networks→ data + communication
• several examples of functional programs
• feasible for today’s hardware platforms
• preparing for landslide deployment
thanks
collaborators
Joe Hellerstein, Scott Shenker, Ion Stoica
Arsalan Tavakoli, Lucian Popa
Phil Levis