Smart Dust and TinyOS: Hardware and Software for Network Sensors - the software part – David E.

Download Report

Transcript Smart Dust and TinyOS: Hardware and Software for Network Sensors - the software part – David E.

Smart Dust and TinyOS:
Hardware and Software for
Network Sensors
- the software part –
David E. Culler
Kris Pister
University of California, Berkeley
Intel Research Berkeley
log (people per computer)
A New Computer Class Emerging
Mainframe
Minicomputer
Workstation
PC
Laptop
PDA
???
year
10/8/2002
NAE
CMOS Trends: miniaturization
and more
Itanium2 (241M )
nearly a thousand 8086’s
fit in a modern microproc.
Actuation
Sensing
Communication
I SDQ SD
PLL baseband
filters
mixer
LNA
10/8/2002
NAE
Processing &
Storage
log (people per computer)
New Role for Computing
Number Crunching
Data Storage
productivity
interactive
streaming
information
to/from physical
world
year
10/8/2002
NAE
Example: Habitat Monitoring
Acadia National Park
Mt. Desert Island, ME
> 1000 ft
Great Duck Island
Nature Conservancy
Leach’s Storm Petrel
10/8/2002
NAE
~2 ft
Current State of the Art
10/8/2002
NAE
Sensor Network Solution
Processing
Wireless network
Light, Temp, Humidity,
Barometer, Passive IR
(occupancy)
10/8/2002
NAE
Typical Applications
• # nodes >> # people
• sensor/actuator data stream
• unattended
• inaccessible
• prolonged deployment
• energy constrained
• operate in aggregate
• in-network processing necessary
• what they do changes over time
=> must be programmed in situ
10/8/2002
NAE
the Technology-Application Gap
service
network
system
architecture
algorithm / theory
data
mgmt
mgmt / diag / debug
application
technology
MEMS Comm. uRobots
10/8/2002
NAE
Power
prog / data model
Monitoring & Managing Spaces and Things
Open Experimental Platform to
Catalyze a Community
Services
Networking
TinyOS
Rene 00
WeC 99
Dot 01
Small microcontroller
Demonstrate
scale
- 8 kb code, 512 B data
Simple, low-power radio
- 10 kb
EEPROM storage (32 KB)
Mica 02
Designed for
experimentation
NEST open exp. platform
128 KB code, 4 KB data
-sensor boards
50 KB radio
-power boards
512 KB Flash
Simple sensors
comm accelerators
10/8/2002
NAE
An Operating System for Tiny
Devices embedded in the Physical
World
10/8/2002
NAE
Traditional Systems
• Well established
layers of abstractions
• Strict boundaries
• Ample resources
• Independent
Applications at
endpoints
communicate pt-pt
through routers
• Well attended
Application
Application
User
System
Network Stack
Transport
Threads
Network
Address Space
Data Link
Files
Physical Layer
Drivers
Routers
10/8/2002
NAE
by comparison ...
• Highly Constrained resources
– processing, storage, bandwidth, power
• Applications spread over many small nodes
– self-organizing Collectives
– highly integrated with environment and network
– communication is fundamental
• Concurrency intensive in bursts
– streams of sensor data and
network traffic
=> Provide a framework for:
• Robust
– inaccessible, critical operation
• Defining boundaries
• Unclear where the
boundaries belong
10/8/2002
• Resource-constrained
concurrency
• Appl’n-specific processing
NAE
allow abstractions to emerge
Tiny OS Concepts
• Scheduler + Graph of Components
init
Commands,
Event Handlers
Frame (storage)
Tasks (concurrency)
Messaging Component
– frame per component, shared stack, no
heap
• Very lean multithreading
• Efficient Layering
10/8/2002
NAE
internal thread
Internal
State
TX_pack
et_done
(success
RX_pack
)et_done
(buffer)
• Constrained Storage Model
init
Power(mode)
TX_packet(buf)
–
–
–
–
msg_rec(type, data)
msg_sen
d_done)
• Component:
Events
send_msg
(addr,
type, data)
Commands
power(mode)
– constrained two-level scheduling model:
threads + events
application
Application = Graph of Components
Route map
router
sensor appln
packet
Radio byte
bit
Radio Packet
byte
Active Messages
Serial Packet
UART
Temp
photo
HW
ADC
clocks
RFM
10/8/2002
SW
NAE
Example: ad hoc, multi-hop
routing of photo sensor
readings
3450 B code
226 B data
Graph of cooperating
state machines
on shared stack
Example TinyOS study
• UAV drops 10 nodes along road,
– hot-water pipe insulation for package
•
•
•
•
•
•
•
•
Nodes self-configure into linear network
Synchronize (to 1/32 s)
Calibrate magnetometers
Each detects passing vehicle
Share filtered sensor data with 5 neighbors
Each calculates estimated direction & velocity
Share results
As plane passes by,
– joins network
– upload as much of missing dataset as possible from each node when
in range
• 7.5 KB of code!
• While servicing the radio in SW every 50 us!
10/8/2002
NAE
Vast Networks of Tiny Devices
• Past 25 years of internet technology built up around
powerful dedicated devices that are carefully configured and
very stable
– local high-power wireless subnets at the edges
– 1-1 communication between named computers
• Here, ...
•
•
•
•
•
•
every little node is potentially a router
work together in application specific ways
collections of data defined by attributes
connectivity is highly variable
must self-organize to manage topology, routing, etc
and for power savings, radios may be off 99% of the time
10/8/2002
NAE
Directed Diffusion Concept
• Nodes express ‘interest’ in data with certain
attributes (sinks)
• Establishes gradient from sources
10/8/2002
NAE
Estrin, Govindan, Heideman
Directed Diffusion Concept
• Nodes express ‘interest’ in data with certain
attributes (sinks)
• Establishes gradient from sources
• Sources generate data
• Useful paths reinforced, others suppressed
• in-network aggregation
• nested queries
10/8/2002
NAE
Challenges
• Probabilistic Connectivity
• Contention creates
interference
• Mobility
• Discovery
– Flooding does not scale
• Mechanism for
reinforcement and
suppression
• Naming, operators
10/8/2002
NAE
Common Special Case: Data Gather
• Collection of nodes take periodic samples
• Stream data towards a root node
• Root announces interest
– depth = 0
• Nodes listen to neighbors
• When hear neighbor with smaller depth
– start transmitting data to good neighbor with smallest depth
– set own depth to one greater and include with data
• Data transmission continuously reinforces /
adjusts routes
10/8/2002
NAE
Network Discovery: Radio Cells
10/8/2002
NAE
Network Discovery
2
2
2
2
1
1
2
0
10/8/2002
NAE
Surge Demo
10/8/2002
NAE
Local Operations => Global Behavior
• Packets directed to a “parent” neighbor
– all other neighbors “hear” too
– carry additional organizational information
• Each nodes builds estimate of neighborhood
– adjusted with every packet and with time
• Interactively selects parent
• Routes traffic upward
Collectively they build and maintain a stable
spanning tree
takes energy to maintain structure
node #
depth child?
parent?
% link goodness
17
1
yes
90
.7
6
3
75
.6
yes
...
10/8/2002
NAE
Programming Challenges
•
•
•
•
thousands of constrained nodes,
interacting in real-time with physical world,
where you cannot touch them,
and what you want them to do changes with
time...
• How do you program the network?
• How do you specify what you want it to do?
10/8/2002
NAE
Programmable network fabric
• Architectural approach
– new code image pushed through the network as packets
– assembled and verified in local flash
– second watch-dog processor reprograms main controller
• Viral code approach
– each node runs a tiny virtual machine interpreter
– captures the high-level behavior of application domain as
individual instructions
– packets are “capsule” sequence of high-level instructions
– capsules can forward capsules
• Rich challenges
– security
– energy trade-offs
– DOS
10/8/2002
pushc 1
sense
pushm
clear
add
send
forw
NAE
halt
#
#
#
#
#
#
#
#
Light is sensor 1
Push light reading
Push message buffer
Clear message buffer
Append val to buffer
Send message using AHR
Forward capsule
Higher-level Programming?
• Ideally, would specify the desired global behavior
• Compilers would translate this into local
operations
• High-Performance Fortran (HPF) analog
– program is sequence of parallel operations on large matrices
– each of the matrices are spread over many processors on a
parallel machine
– compiler translates from global view to local view
» local operations + message passing
– highly structured and regular
• We need a much richer suite of operations on
unstructured aggregates on irregular, changing
networks
10/8/2002
NAE
Sensor Databases – a start
• Relational databases: rich queries
described by declarative queries over
tables of data
–
–
–
–
select, join, count, sum, ...
user dictates what should be computed
query optimizer determines how
assumes data is presented in complete, tabular form
• First step: database operations over
streams of data
– incremental query processing
• Big step: process the query in the sensor
net
– query processing == content-based routing?
– energy savings, bandwidth, reliability
10/8/2002
NAE
SELECT AVG(light)
GROUP BY roomNo
App
Query,
Trigger
Data
TinyDB
Sensor Network
TinyDB Demo
10/8/2002
Joe Hellerstein, Sam Madden, Wei Hong, Michael Franklin
NAE
New Architectures?
Embedded Network Arch.
Typical Wireless Arch. (cellphone)
audio
Codec
kbd / display
Sensor / Actuators
Application Controller
CoProc
narrow
standardized
intrerface
DSP
Multi-Purpose
Controller
protocol
accelerators
Protocol Processor
rich physical interface
RF Transceiver
RF Transceiver
• Traditional approach is to partition design into specialized
subsystems with rigid interfaces.
• TinyOS allows low and high-level processing to be interleaved.
– rich physical information can be exposed
– specialized hardware to accelerate primitives
• Enables cross-layer optimizations
10/8/2002
NAE
Example: monitoring and alarm
• Monitoring
– sample every 4 seconds, aggregate over 5 minutes, transmit
statistical summary
» ~20,000 samples, ~300 reports per day per node
– aggregate statistics up the routing tree
– schedule rendezvous, so radio mostly off
• Alarm
– upon detection of dramatic environmental change
– routes alarm through parent at any time
• Where the energy goes
–
–
–
–
–
10/8/2002
sleeping
sensing & processing
communication
listening for communication to start
listening for an alarm message
NAE
Cross-Layer optimization
• Sensing & Processing
– 15 mw
17 mJ per day
• Sleeping
– 45 uw
5038 mJ per day
• Communination
– hardware accelerators for edge capture and serialization
– 10 kbps => 50 kbps
2262 => 452 mJ/day
5x
• Rendezvous: 2x time-synchronization*
– time-stamp packets: +- 100 ms
– radio bit edge detection: +- 2 us
– radio-level timesynch
669 => 33 mj/day
20x
• Wake-up
– packet listen: 108 ms (21 ms)
54,000 => 25 mj/day
– sample radio channel for energy: 50 us
2000x
• Combined: 2AA lifetime grows from 1 year to 9 years
– dominated by sleep energy
10/8/2002
NAE
* receiver-based alternative (Elison)
A rich growing research agenda
•
•
•
•
•
•
Localization
High-fidelity Time-Synch
Collaborative Processing
Multi-layered storage hierarchy
Simulation environments
Distributed Algorithms
10/8/2002
NAE
CENS
10/8/2002
NAE
Tiny Stuff
10/8/2002
NAE
Example: Distributed Control
• Sensor field quietly monitors
– net env. data for health monitoring
– off-line geographic localization
• Event detected locally by small group
• Local broadcast of processed data Hill, Whitehouse, et al.
• Group leader elected to aggregate
– time sensitive
• Multihop geographic transport to well-define dest
– base-station for processing & response
– mobile pursuer node
• Additional time-sensitive cooperative
localization data for pursuer
navigation and planning
10/8/2002
NAE