Maté: A Tiny Virtual Machine for Sensor Networks Philip Levis David Culler Computer Science Division Intel Research: Berkeley University of California Intel Corporation Berkeley, California Berkeley, California ASPLOSX 2002 ICS280 – Winter'05 Presenter: Daniel Massaguer 1
Motes are Harvard architectures - > installing new code requires a reset WSN are faulty, ->node replacement large and scattered on unreachable places, ->unfeasible to recharge batteries or manually reprogram and resource constraint. ->transmitting a new binary image is costly. Once deployed, even though physically unreachable, network must be reprogrammable at low cost. Examples: GDI WSN, WSN embedded into a building. 2
Mate is a byte-code interpreter VM that allows this reprogramming. It provides a small set of high-level primitives -> programs shorter and easier. 3
Architecture 24-byte capsules 4
Architecture Mica and rene2 (ATMega163): Prog. Mem 16KB RAM: 1KB MicaZ: Prog. Mem 128KB RAM: 4KB 5
Instruction Set ● 1 Instr = 1 byte, 1 TinyOS task Pushc 1 # Push 1 onto op. stack sense # Read sensor 1 (light) pushc 7 and # Take the bottom 3 bits putled # Set LEDs to these 3 bits halt 6
Code Capsules and Execution If Mate receives a more recent version of a capsule, it installs it 32 bits Capsule: type version Code (24 instr-bytes) ● Subroutines 0-3 ● clock ● receive ● send Capsule reception is atomic 7
Code Infection Mate Code: Forw ; forwards this capsule blah blah blah [...] halt Mate Code: Forwo ; forwards other capsules blah blah blah [...] halt 8
Evaluation — BLESS Included in standard TinyOS release. Parent selection based on snooped traffic: Every packet is broadcasted and contains routing ● information Minimize hop count ● New parent if haven't heard from the old one ● TinyOS BLESS : 600 lines of Code Mate BLESS : 108 bytes 9
Evaluation — Instruction rate *Aprox. 1/3 of overhead due to 1 instr->1 TinyOS task (queue, dequeue) 10
Evaluation — Energy Increase of abstraction IPS decrease , Energy increases 11
Evaluation — Energy For a small number of executions -> Mate For large number of executions -> native code Reduction of code size Energy decreases Increase of abstraction IPS decrease , Energy increases 12
Evaluation — Energy For a small number of executions -> Mate For large number of executions -> native code Example, GDI: wakes up every 8 seconds, reads and sends. -> Mate saves energy if running for 5 days or less Reduction of code size Energy decreases Increase of abstraction IPS decrease , Energy increases 13
Evaluation — Network Infection A self-forwarding capsule congestion Clock capsule runs p2 \ p1 every second and forwards itself with prob p1 or p2 p1 -> network p2 -> new capsule 14
Discussion—extensions Phased execution, Agility, and Active Sensors Capsule forwarding: tags, tweaking forwarding rate, setgrp Architectural directions: user/kernel protection, virtual memory 15
Conclusions Mate, a VM for sensor network programming and reprogramming ● 'faster' program development, ● OS protection, ● viral reprogramming Congestion due to forwarding is an important issue Trade-off between installation time and execution time dmassagu uci edu < @ . > 16
Recommend
More recommend