270 likes | 478 Views
Mate : A Tiny Virtual Machine for Sensor Networks. Presented by: Mohammad Kazem Ghaforian M_ghaforian@ustmb.ac.ir M azandaran U niversity of S cince & T echnology B abol 17 December 2009. Mate - a tiny virtual machine for sensor networks: 1. REFERENCES.
E N D
Mate:A Tiny Virtual Machine for Sensor Networks Presented by: Mohammad KazemGhaforian M_ghaforian@ustmb.ac.ir MazandaranUniversity of Scince & Technology Babol 17 December 2009 Mate - a tiny virtual machine for sensor networks: 1
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 with XML. In Proceedings of the 22nd International Conference on Software Engineering, 2000. [7] Philip J. Koopman, Jr. Modern Stack Computer Architecture. In System Design and Network Architecture Conference, 1990. [8] Tim Lindholm and Frank Yellin. The Java Virtual Machine Specication, Second Edition. Addison-Wesley, 1999. Mate - a tiny virtual machine for sensor networks: 2
overview • mote (hardware) • tiny os (os) • maté (vm) • applications • … discussion
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
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”
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)
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
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
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
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 1J/bit • inactive ~ 5 A • peak load ~ 19.5mA • 40s comm. event propagation
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é – overview • tiny os component • uses other components, such as: sensors, network stack and non-volatile storage • 7286 bytes code, 603 bytes RAM
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
maté – capsules • tiny os component • stack-based bytecode interpreter • code capsules • up to 24 instructions (subroutine) • single packet; atomic receive • 32-bit version code • auto install newer capsule • type: • send • receive • clock • subroutine • forward capsules: forw, forwo • 7 capsules (up to 215 capsules)
maté – execution • tiny os component • stack-based bytecode interpreter • code capsules • execution contexts • 3 contexts - send, receive, clock • subroutines shared • state • PC • zero to halt instruction • operand stack (16) • [msg] for send/recv • [zero] for clock; persists • return address stack (8) • [<capsule, PC>] • one-word heap
applications – send • send sensor reading
applications – counter • send sensor reading • LED counter
applications – reprogram • send sensor reading • LED counter • infection • forw
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
applications – performance • send sensor reading • LED counter • infection • BLESS routing • performance (energy): CPU vs. size
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
Maté:A Tiny Virtual Machine for Sensor Networks Comments, Questions…