mate : a tiny virtual machine for sensor networks

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

Upload: kai-rosario

Post on 04-Jan-2016

27 views

Category:

Documents


0 download

DESCRIPTION

Mate : A Tiny Virtual Machine for Sensor Networks. Presented by: Mohammad Kazem Ghaforian [email protected] M azandaran U niversity of S cince & T echnology B abol 17 December 2009. Mate - a tiny virtual machine for sensor networks: 1. REFERENCES. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Mate : A Tiny Virtual Machine for Sensor Networks

Mate:A Tiny Virtual Machine for Sensor Networks

Presented by:Mohammad Kazem Ghaforian

[email protected]

Mazandaran University of Scince & TechnologyBabol

17 December 2009

Mate - a tiny virtual machine for sensor networks: 1

Page 2: Mate : A Tiny Virtual Machine for Sensor Networks

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, DeepakGanesan (UCLA). Building Ecient Wireless Sensor Networks with Low-Level Naming. In Proceedings of the18th 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 Migrationwith 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 ArchitectureConference, 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

Page 3: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 3

overview

• mote (hardware)• tiny os (os)• maté (vm)• applications• … discussion

Page 4: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 4

mote – pictures

Page 5: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 5

mote – specifications

Mote Type WeC Rene Rene2 Dot Mica

 

Date Sep-99Oct-

00 Jun-01 Aug-01 Feb-02

Microcontroller (4MHz)

Type AT90LS8535 ATMega163 ATMega103/128

Prog. mem. (KB) 8 16 128

RAM (KB) 0.5 1 4

Communication

Radio RFM TR1000

Rate (Kbps) 10 10/40

Modulation Type OOK OOK/ASK

Battery Power

Type/Size Li/CR2450 Alk/2AA Li/CR2032 Alk/2AA

Capacity (mAh) 575 2850 225 2850

Page 6: Mate : A Tiny Virtual Machine for Sensor Networks

Maté - a tiny virtual machine for sensor networks: 6

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

Page 7: Mate : A Tiny Virtual Machine for Sensor Networks

Maté - a tiny virtual machine for sensor networks: 7

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”

Page 8: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 8

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)

Page 9: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 9

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

Page 10: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 10

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

Page 11: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 11

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

Page 12: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 12

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

Page 13: Mate : A Tiny Virtual Machine for Sensor Networks

Maté - a tiny virtual machine for sensor networks: 13

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é…

Page 14: Mate : A Tiny Virtual Machine for Sensor Networks

Mate- a tiny virtual machine for sensor networks: 14

maté – overview

• tiny os component• uses other components, such as:

sensors, network stack and non-volatile storage

• 7286 bytes code, 603 bytes RAM

Page 15: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 15

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

Page 16: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 16

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)

0 1 2 3

Subroutines

Clock

Send

Receiv

e

Events

gets/sets

0 1 2 3

Subroutines

Clock

Send

Receiv

e

Events

gets/sets

Page 17: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 17

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

0 1 2 3

Subroutines

Clock

Send

Receiv

e

Events

gets/sets

0 1 2 3

Subroutines

Clock

Send

Receiv

e

Events

gets/sets

Code

OperandStack

ReturnStack

PC

Code

OperandStack

ReturnStack

PC

Page 18: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 18

applications – send

• send sensor reading

pushc 1 # Light is sensor 1sense # Push light reading on stackpushm # Push message buffer on stackclear # Clear message bufferadd # Append reading to buffersend # Send message using built-inhalt # ad-hoc routing system

Page 19: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 19

applications – counter

• send sensor reading• LED counter

gets # Push heap variable on stackpushc 1 # Push 1 on stackadd # Pop twice, add, push resultcopy # Copy top of stacksets # Pop, set heappushc 7 # Push 0x0007 onto stackand # Take bottom 3 bits of valueputled # Pop, set LEDs to bit patternhalt #

Page 20: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 20

applications – reprogram

• send sensor reading• LED counter• infection

• forw

Page 21: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 21

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

Page 22: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 22

applications – performance

• send sensor reading• LED counter• infection• BLESS routing• performance (energy): CPU vs. size

Page 23: Mate : A Tiny Virtual Machine for Sensor Networks

Mate - a tiny virtual machine for sensor networks: 23

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

Page 24: Mate : A Tiny Virtual Machine for Sensor Networks

Maté:A Tiny Virtual Machine for Sensor Networks

Comments, Questions…