Endeavouring to Build Networks of Tiny Devices David Culler Computer Science Division U.C. Berkeley www.cs.berkeley.edu/~culler.
Download ReportTranscript Endeavouring to Build Networks of Tiny Devices David Culler Computer Science Division U.C. Berkeley www.cs.berkeley.edu/~culler.
Endeavouring to Build Networks of Tiny Devices David Culler Computer Science Division U.C. Berkeley www.cs.berkeley.edu/~culler Background • Q1: design principles for Extremely Diverse system architectures? – immense services (Millennium, Ninja) – tiny devices appln as graph of state machines concurrency intensive, variation in load, robustness reactive tiny devices became “eyes and ears” of ubiquitous computing become source of control as well 4/2001 TinyOS 2 Emerging Microscopic Devices • CMOS trend is not just Moore’s law • Micro Electical Mechanical Systems (MEMS) – rich array of sensors are becoming cheap and tiny • Low-power Wireless Communication I SDQ SD • Imagine, all sorts of chips that are connected to the physical world and to cyberspace! 4/2001 PLL TinyOS baseband filters mixer LNA 3 Current One-Inch Networked Sensor • 1” x 1.5” motherboard – – – – – – – ATMEL 4Mhz, 8bit MCU, 512 bytes RAM, 8K pgm flash 900Mhz Radio (RF Monolithics) 10-100 ft. range ATMEL network pgming assist Radio Signal strength control and sensing I2C EPROM (logging) Base-station ready stackable expansion connector » all ports, i2c, pwr, clock… • Several sensor boards – – – – – 4/2001 basic protoboard tiny weather station (temp,light,hum,press) vibrations (2d acc, temp, LIGHT) accelerometers magnetometers TinyOS 4 TinyOS Approach • Stylized programming model with extensive static information – Program = graph of TOS components – TOS component = command/event interface + behavior • Rich expression of concurrency – Events propagate across many components – Tasks provide internal concurrency • Regimented storage management • Very simple implementation • Broad range of alternative execution mechanisms • For More see http://tinyos.millennium.berkeley.edu 4/2001 TinyOS 5 Tiny OS Concurrency Framework Messaging Component – frame per component, shared stack, no heap • Very lean multithreading • Efficient Layering TinyOS internal thread Internal State TX_pack et_done (success RX_pack )et_done (buffer) • Constrained Storage Model 4/2001 msg_rec(type, data) msg_sen d_done) Commands, Event Handlers Frame (storage) Tasks (concurrency) init Power(mode) TX_packet(buf) – – – – init • Component: Events send_msg (addr, type, data) – constrained two-level scheduling model: threads + events Commands power(mode) • Scheduler + Graph of Components 6 application Application = Component Graph Route map router sensor appln packet Radio Packet byte Radio byte bit Active Messages RFM 4/2001 Serial Packet UART Temp photo SW HW ADC clocks TinyOS Example: ad hoc, multi-hop routing of photo sensor readings 7 DARPA-esq demo • UAV drops nodes along road, – hot-water pipe insulation for package • • • • • • • Nodes self configure into linear network 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! 4/2001 TinyOS 8 Cory Energy Monitoring/Mgmt System • • • • 50 nodes on 4th floor 5 level ad hoc net 30 sec sampling 250K samples to database over 6 weeks 4/2001 TinyOS 9 Energy Monitoring Network Arch 20-ton chiller sensor net GW control net GW GW 802-11 PC modbus PC MYSQL telegraph scada term UCB power monitor net 4/2001 Browser TinyOS 10 Directions • Systems technology: long-term management – – – – – – integrate new MAC and rate control (Alec Woo) in situ network programming (Rob Szewczyk) node query scheme (Sam Madden) implicit discovery (Phil Levi) signal strength adaptation telegraph • Power management – – – – – 4/2001 Battery monitoring and adaptation current and voltage sensors non-intrusive load monitoring integrate with broader sensor net alert response TinyOS 11 Emerging “de facto” tiny system • Feb. bootcamp – 40 people – UCB, UCLA, USC, Cornell, Rutgers, Wash., – LANL, Bosch, Accenture, Intel, crossbow • Several groups actively developing around tinyOS on “rene” node • Concurrency framework has held up well. • Next generation(s) selected as DARPA networked embedded system tech (NEST) open platform • Smaller building blocks for ubicomp 4/2001 TinyOS 12 NEST Program Structure – evolution Challenge Application composition services coordination synthesis services services Composition Platform SWOpen platform HW platform sensors processing communication actuators initial low-power wireless storage year Open Platform 3 100+ tiny devices for alg. dev. 2 1 0 4/2001 TinyOS 13 HW Platforms • Current: SmartDust MacroMOTE => Renes => • Phase 1: 6 months => algorithm studies – Mote++, MEMS sensors, TinyOS – more microcontroller » atmega163 => 2x storage » atmega103 => 128K flash, 4k ram » TIMSP430 => 60k flash, 2k ram, HW *, ... » many subtle factors – RFM with “ASH” 100 kb/s » too early for bluetooth – 100+ nodes for < 20K$ • Phase 2: 30 months => composition of alg’s – ARM-power, Bluetooth physical – integrated system – OS?? 4/2001 TinyOS 14 SW Platform • Tiny event-driven component OS – allows NEST abstractions to emerge and each level • Language-based robustness and optimization – eg., critical path and jitter analysis – inter-component transformations – narrow interface with simple IDL • Tiny networking – power-aware appln-specific ad hoc routing, MAC, transmission control – in network aggregation – in situ programming • Algorithm building blocks – – – – 4/2001 Local multicast event-driven reception intelligent pruning of retransmission non-blocking execution TinyOS 15 Programming Environment & Tools • Provide support for: event-driven programming, composition, debugging & visualization in the small (node) and large (collection) • Emulation => simulation => real devices – identical APIs, range of visibility, and reality • Debugging and visualization tools – geared toward many interacting nodes & event-centric development • Application-Specific Virtual Machines – analogous to query-plan vs query-processing engine • FSM-based programming abstractions • Macrocomputing 4/2001 TinyOS 16 FSM-based Software Approach • Fundamentally, we are not computing, we are moving data intelligently – threads are a computing abstraction, FSMs are a protocol abstraction use FSMs as the base then add some computing • natural high concurrency • natural handling of events, exceptions, and the environment • tools for understanding stability (e.g markov models, game theory, control theory) • composition is separate from creation – late bind the callee in a separate step called "composition" 4/2001 TinyOS 17 Macrocomputing • Program a large, unstructured collection in aggregate – Single program, multiple data » but errors and probabilistic behavior » unstructured collection – “global” variables that reflect collections » need to handle error propagation – scatter/gather for collections? – online query processing? • multi-WEbS abstractions 4/2001 TinyOS 18 Security • Individual nodes may be compromised, but hard to get large fraction of nodes. • Attacks introduce another form of unreliability in the data. • Lightweight encryption/decryption, authentication. • Novel protocols to support aggregate operations, eg., broadcast, w/o shared root key • Resilient aggregation 4/2001 TinyOS 19 Resilient Aggregators • operate in the face of faulty nodes, intermittent communication, and security attacks – ex max is not resilient, nine-tile is. • develop algebra of resilient aggregators • Random sampling as implementation • foundation for security model – easy to attack a node – hard to attack large fraction of the nodes 4/2001 TinyOS 20 Simulation • Large-scale NEST simulator – very large number of small nodes – integrated with event-driven OS design for efficiency – checkpointing • Adversarial simulation mode – Detecting “composition” bugs and scaling bugs • Target failure: search for bugs – – – – – test race conditions automatically pick orders that consume resources more efficient than random-walk testing simulator is an adversary… guided search • Hybrid simulator/testbed 4/2001 TinyOS 21 Test-bed Kits • • • • in situ programming/upgrade and debugging synchronized logging (trace extraction) passive monitoring data collection 4/2001 TinyOS 22 Challenge Applications active markers • sequence of applications obstacles – interactive spaces – flock of model cars UAVs – Multi-agent pursuit- evasion • also environmental monitoring – stunt ranch “whole canopy ecophysiology” with UCLA 4/2001 evader TinyOS 23 Closed-loop at many levels • Within a node – behavior adapts to available energy, physical measurements, network condition • Across the network – discovery and routing, transmission rate and schedule – adopting roles, • Within the middleware components – synchronization, scheduling • On the vehicle – direction, stability, probabalistic map building • Among the vehicles – competitive, hidden markov decision processes 4/2001 TinyOS 24 New building blocks for Ubicomp 4/2001 TinyOS 25 New Collaboration • Intel Berkeley Lablet Extreme Interconnected Systems (XIS) lab 4/2001 TinyOS 26