Mate: A Tiny Virtual Machine for Sensor Networks Presented

24 Slides719.50 KB

Mate: A Tiny Virtual Machine for Sensor Networks Presented by: Mohammad Kazem Ghaforian M [email protected] Mazandaran University of Scince & Technology Babol 17 December 2009 Mate - a tiny virtual machine for sensor

REFERENCES [1] Smart buildings admit their faults. Lab Notes: Research from the College of Engineering, UC Berkeley. http://coe.berkeley.edu/labnotes/1101.smartbuildings.html, 2001. [2] Small Times: Big News in Small Tech. http://www.smalltimes.com [3] Edouard Bugnion, Scott Devine, and Mendel Rosenblum. Disco: Running Commodity Operating Systems on Scalable Multiprocessors. In Proceedings of the Sixteenth ACM Symposium on Operating Systems Principles, 1997. [4] John Heidemann, Fabio Silva, Shalermek Intanagonwiwat, Ramesh Govindan (USC/ISI), Deborah Estrin, Deepak Ganesan (UCLA). Building Ecient Wireless Sensor Networks with Low-Level Naming. In Proceedings of the 18th ACM Symposium on Operating System Principles,2001 [5] Jason Hill and David Culler. A wireless embedded sensor architecture for system-level optimization. Intel Research IRB-TR-02-00N, 2002. [6] Wolfgang Emmerich, Cecilia Mascolo, and Anthony Finkelstein. Implementing Incremental Code Migration Mate - a tiny virtual machine for sensor

overview mote (hardware) tiny os (os) maté (vm) applications discussion Mate - a tiny virtual machine for sensor networks: 3

mote – pictures Mate - a tiny virtual machine for sensor networks: 4

mote – specifications Mote Type Date WeC Rene Rene2 Dot Mica Sep-99 Oct00 Jun-01 Aug-01 Feb-02 Microcontroller (4MHz) Type AT90LS8535 ATMega163 ATMega103/128 8 16 128 0.5 1 4 Prog. mem. (KB) RAM (KB) Communication Radio RFM TR1000 Rate (Kbps) 10 10/40 Modulation Type OOK OOK/ASK Battery Power Type/Size Capacity (mAh) Li/CR2450 Alk/2AA Li/CR2032 Alk/2AA 575 2850 225 2850 Mate - a tiny virtual machine for sensor networks: 5

mote – using networks hundreds or thousands of ‘motes’ routine failure repopulate, reprogram resource constrained 4MHz 8-bit microcontroller 512 bytes to 4KB RAM 8-128KB program memory 10-40Kbit 916.5MHz wireless radio 2850 mAh on-board power sensors light, temperature, humidity, pressure acceleration, magnetic field actuators: LEDs, radio Maté - a tiny virtual machine for sensor networks: 6

mote – applications great duck island (GDI) monitor storm pestrel (bird) nests on island near Maine what to monitor, how to use sensors still undetermined earthquake damage assessment embed devices inside structures also: sound propagation testing, water damage detection devices are unreachable after deployment query processing install in-network aggregate functions motivates “flexible, rapid, powerful reprogramming mechanism” Maté - a tiny virtual machine for sensor networks: 7

mote – challenges energy on-board power, solar recharging difficult, impossible communication lossy, low bandwidth power hungry: sending 1 bit computing 1K instructions in-network processing and aggregation programming programming in the aggregate active networking and active sensors (reprogramming) Mate - a tiny virtual machine for sensor networks: 8

tiny os – components designed for motes (sensor networks) component-based programming model command, event handlers fixed storage frame “threads”; atomic UART, packet, AM, AM-route, clock, echo, clock Mate - a tiny virtual machine for sensor networks: 9

tiny os – execution designed for motes (sensor networks) component-based programming model split-phase non-blocking execution commands (down), events (up) non-blocking; interrupt handlers (@10-20kHz) tasks blocking; FIFO queue high parallelism, efficient; complicated programming model Mate - a tiny virtual machine for sensor networks: 10

tiny os – networking designed for motes (sensor networks) component-based programming model split-phase non-blocking execution top-level packet abstraction Active Messages component handles MAC single hop communication unreliable data link protocol 30 byte payload 16-bit mote ID, 0xffff broadcast 8-bit type; selects software handler 8-bit AM group; logical network separation Mate - a tiny virtual machine for sensor networks: 11

tiny os – performance designed for motes (sensor networks) component-based programming model split-phase non-blocking execution top-level packet abstraction performance metrics 3.4KB complete sensing and communications application transmit at 1 J/bit inactive 5 A peak load 19.5mA 40 s comm. event propagation Mate - a tiny virtual machine for sensor networks: 12

tiny os – shortcomings shortcomings programming model complex timing, asynchrony application flexibility needed can reprogram, but slow and energy consuming 8KB binary approx. 2 minutes mote uses Harvard architecture no user/kernel boundary enter maté Maté - a tiny virtual machine for sensor networks: 13

maté – overview tiny os component uses other components, such as: sensors, network stack and non-volatile storage 7286 bytes code, 603 bytes RAM Mate- a tiny virtual machine for sensor networks: 14

maté – bytecode tiny os component stack-based bytecode interpreter single byte instruction set basic instructions data, arithmetic, comm., sense 8 native UDFs s-class: send/recv contexts x-class: embedded operands polymorphic: values, sensor readings, messages bounds checks; no cross-capsule access Mate - a tiny virtual machine for sensor networks: 15

maté – capsules tiny os component stack-based bytecode interpreter code capsules up to 24 instructions (subroutine) single packet; atomic receive 32-bit version code send receive clock subroutine 1 2 3 Send 0 Events Clock type: Subroutines Receive auto install newer capsule gets/sets forward capsules: forw, forwo 7 capsules (up to 215 capsules) Mate - a tiny virtual machine for sensor networks: 16

maté – execution tiny os component stack-based bytecode interpreter code capsules execution contexts 1 2 gets/sets PC Code one-word heap 3 Receive zero to halt instruction operand stack (16) [msg] for send/recv [zero] for clock; persists return address stack (8) [ capsule, PC ] 0 Events Send PC Subroutines Clock 3 contexts - send, receive, clock subroutines shared state Operand Stack Return Stack Mate - a tiny virtual machine for sensor networks: 17

applications – send send sensor reading pushc 1 sense pushm clear add send halt # # # # # # # Light is sensor 1 Push light reading on stack Push message buffer on stack Clear message buffer Append reading to buffer Send message using built-in ad-hoc routing system Mate - a tiny virtual machine for sensor networks: 18

applications – counter send sensor reading LED counter gets pushc 1 add copy sets pushc 7 and putled halt # # # # # # # # # Push heap variable on stack Push 1 on stack Pop twice, add, push result Copy top of stack Pop, set heap Push 0x0007 onto stack Take bottom 3 bits of value Pop, set LEDs to bit pattern Mate - a tiny virtual machine for sensor networks: 19

applications – reprogram send sensor reading LED counter infection forw Mate - a tiny virtual machine for sensor networks: 20

applications – route send sensor reading LED counter infection BLESS routing send packets to root node root node has hop count of zero each node tries to determine minimal hop count send packets back up maintains single parent TinyOS maintains multiple parents 108 bytes Mate - a tiny virtual machine for sensor networks: 21

applications – performance send sensor reading LED counter infection BLESS routing performance (energy): CPU vs. size Mate - a tiny virtual machine for sensor networks: 22

discussion mote limitations Harvard architecture (static native UDFs) VM creates “user-land” tiny os limitations single group (interacting applications) no carrier sense (packets aggregation) ideas and future work “virtual memory” functionality reprogramming spectrum: binary, UDI, bytecode phased execution new event/capsule types; e.g. sensor thresholds Bombilla: query processing engine higher level languages, concurrency control Mate - a tiny virtual machine for sensor networks: 23

Maté: A Tiny Virtual Machine for Sensor Networks Comments, Questions

Back to top button