Mate: A Tiny Virtual Machine for Sensor Networks Phil Levis and David Culler Presented by Andrew Chien CSE 291 Chien April 22, 2003 (slides courtesy, Phil.

Slides:



Advertisements
Similar presentations
Phil Buonadonna, Jason Hill CS-268, Spring 2000 MOTE Active Messages Communication Architectures for Networked Mini-Devices Networked sub-devicesActive.
Advertisements

A System Architecture for Tiny Networked Devices
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Instruction Set Design
ISA Issues; Performance Considerations. Testing / System Verilog: ECE385.
INSTRUCTION SET ARCHITECTURES
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Trickle: Code Propagation and Maintenance Neil Patel UC Berkeley David Culler UC Berkeley Scott Shenker UC Berkeley ICSI Philip Levis UC Berkeley.
Run-Time Dynamic Linking for Reprogramming Wireless Sensor Networks
1BA3 G Lacey Lecture 51 Evaluating mathematical expressions  How do computers evaluate x + y or any mathematical expression ?  Answer : “Reverse Polish.
A Dynamic Operating System for Sensor Nodes (SOS) Source:The 3 rd International Conference on Mobile Systems, Applications, and Service (MobiSys 2005)
What is a Wireless Sensor Network (WSN)? An autonomous, ad hoc system consisting of a collective of networked sensor nodes designed to intercommunicate.
Programming Vast Networks of Tiny Devices David Culler University of California, Berkeley Intel Research Berkeley
TOSSIM A simulator for TinyOS Presented at SenSys 2003 Presented by : Bhavana Presented by : Bhavana 16 th March, 2005.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Memory Allocation. Three kinds of memory Fixed memory Stack memory Heap memory.
Network Reprogramming & Programming Abstractions.
Generic Sensor Platform for Networked Sensors Haywood Ho.
TinyOS Software Engineering Sensor Networks for the Masses.
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Maté: A Tiny Virtual Machine for Sensor Networks Philip Levis and David Culler Presented by: Michele Romano.
Philip Levis UC Berkeley 6/17/20021 Maté: A Tiny Virtual Machine Viral Programs with a Certain Cosmopolitan Charm.
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Intro to Java The Java Virtual Machine. What is the JVM  a software emulation of a hypothetical computing machine that runs Java bytecodes (Java compiler.
A Portable Virtual Machine for Program Debugging and Directing Camil Demetrescu University of Rome “La Sapienza” Irene Finocchi University of Rome “Tor.
A System Architecture for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
Lecture 17 Today’s Lecture –Instruction formats Little versus big endian Internal storage in the CPU: stacks vs. registers Number of operands and instruction.
Rapid Development and Flexible Deployment of Adaptive Wireless Sensor Network Applications Chien-Liang Fok, Gruia-Catalin Roman, Chenyang Lu
1 4.2 MARIE This is the MARIE architecture shown graphically.
Mate: A Tiny Virtual Machine for Sensor Networks Presented by: Mohammad Kazem Ghaforian Mazandaran University of Scince & Technology.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Rapid Development and Flexible Deployment of Adaptive Wireless Sensor Network Applications Chien-Liang Fok, Gruia-Catalin Roman, Chenyang Lu
ITEC 352 Lecture 12 ISA(3). Review Buses Memory ALU Registers Process of compiling.
A Time Predictable Instruction Cache for a Java Processor Martin Schoeberl.
Mate: A Tiny Virtual Machine for Sensor Networks Philip Levis and David Culler Presented by: Damon Jo.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Korea Advanced Institute of Science and Technology Active Sensor Networks(Mate) (Published by Philip Levis, David Gay, and David Culler in NSDI 2005) 11/11/09.
TRICKLE: A Self-Regulating Algorithm for Code Propagation and Maintenance in Wireless Sensor Networks Philip Levis, Neil Patel, Scott Shenker and David.
이상훈, 허 윤 (Dept. of CS) René Müller, Gustavo Alonso, Donald Kossmann, “A virtual machine for sensor networks”, ACM SIGOPS Operating Systems Review, v.41.
Dhanshree Nimje Smita Khartad
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presented by Yang Zhao.
Chapter 5 A Closer Look at Instruction Set Architectures.
Today’s Lecture Unconditional branch instruction
Power and Control in Networked Sensors E. Jason Riedy and Robert Szewczyk Presenter: Fayun Luo.
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presenter: James.
CSC 235 Computer Organization. Computer Organizaton ä Top_Level Structure ä The von-Neumann Machine ä Stack Machine ä Accumulator Machine ä Load/Store.
A Dynamic Operating System for Sensor Nodes Chih-Chieh Han, Ram Kumar, Roy Shea, Eddie Kohler, Mani, Srivastava, MobiSys ‘05 Oct., 2009 발표자 : 김영선, 윤상열.
Concurrency Properties. Correctness In sequential programs, rerunning a program with the same input will always give the same result, so it makes sense.
Lecture 5 A Closer Look at Instruction Set Architectures Lecture Duration: 2 Hours.
Autonomous prototype sensors (motes) 4 MHz, 8bit MCU, 4 KB RAM, 8KB ROM short-range (1-10ft.) radio light and other sensors LED and serial port outputs.
3/12/2013Computer Engg, IIT(BHU)1 PARALLEL COMPUTERS- 2.
Information Security - 2. A Stack Frame. Pushed to stack on function CALL The return address is copied to the CPU Instruction Pointer when the function.
System Architecture Directions for Networked Sensors.
RISC / CISC Architecture by Derek Ng. Overview CISC Architecture RISC Architecture  Pipelining RISC vs CISC.
Building Wireless Efficient Sensor Networks with Low-Level Naming J. Heihmann, F.Silva, C. Intanagonwiwat, R.Govindan, D. Estrin, D. Ganesan Presentation.
Computer Organization
Basic Processor Structure/design
A Closer Look at Instruction Set Architectures
A Closer Look at Instruction Set Architectures
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
Trickle: Code Propagation and Maintenance
The Von Neumann Model Basic components Instruction processing
ECEG-3202 Computer Architecture and Organization
A Closer Look at Instruction Set Architectures Chapter 5
ECEG-3202 Computer Architecture and Organization
Introduction to Computer Systems
Addressing mode summary
Overview: Active Sensor networks
Presentation transcript:

Mate: A Tiny Virtual Machine for Sensor Networks Phil Levis and David Culler Presented by Andrew Chien CSE 291 Chien April 22, 2003 (slides courtesy, Phil Levis)

CSE 291 Sensor Networks – 4/22/2003 Maté Motivation Overview Architecture, Instructions Viral code Evaluation Conclusion

CSE 291 Sensor Networks – 4/22/2003 Motivation Programming complexity »Low level »Error Prone Application flexibility (?) Binary reprogramming takes ~2 minutes »significant energy cost »can lose motes Idea: use a virtual machine – load the programs as structures pointing to lower level libraries

CSE 291 Sensor Networks – 4/22/2003 Sensor Network Programming Requirements Small (fit on Motes) Expressive (lots of applications) Concise (programs short for memory and network bandwidth) Resilient (don’t crash the system) Efficient (in sensing and communication) Tailorable – for application-specific operations Simple – in-situ, fast, “autonomous” programming

CSE 291 Sensor Networks – 4/22/2003 Maté Overview TinyOS component 7286 bytes code, 603 bytes RAM Three concurrent execution contexts Stack-based bytecode interpreter Code broken into 24 instruction capsules Self-forwarding code Rapid reprogramming Message receive and send contexts

CSE 291 Sensor Networks – 4/22/2003 Maté Overview, Continued Three execution contexts »Clock, Receive, Send Seven code capsules »Clock, Receive, Send, Subroutines 0-3 One word heap »gets / sets instructions Two-stack architecture »Operand stack, return address stack

CSE 291 Sensor Networks – 4/22/2003 Maté Architecture 0123 Subroutines Clock Send Receive Events gets/sets Code Operand Stack Return Stack Maté PC Mate Context

CSE 291 Sensor Networks – 4/22/2003 Maté Instructions 0123 Subroutines Clock Send Receive Events gets/sets Code Operand Stack Return Stack Maté PC Mate Context

CSE 291 Sensor Networks – 4/22/2003 Maté Instructions Two-stack architecture One byte per instruction Three classes: basic, s-type, x-type »basic: data, arithmetic, communication, sensing »s-type: used in send/receive contexts »x-type: embedded operands basic 00iiiiiii = instruction s-type 01iiixxxx = argument x-type 1ixxxxxx

CSE 291 Sensor Networks – 4/22/2003 Code Snippet: cnt_to_leds gets # Push heap variable on stack pushc 1 # Push 1 on stack add # Pop twice, add, push result copy # Copy top of stack sets # Pop, set heap pushc 7 # Push 0x0007 onto stack and # Take bottom 3 bits of value putled # Pop, set LEDs to bit pattern halt #

CSE 291 Sensor Networks – 4/22/2003 cnt_to_leds, Binary gets # 0x1b pushc 1 # 0xc1 add # 0x06 copy # 0x0b sets # 0x1a pushc 7 # 0xc7 and # 0x02 putled # 0x08 halt # 0x00

CSE 291 Sensor Networks – 4/22/2003 Sending a Message pushc 1 # Light is sensor 1 sense # Push light reading on stack pushm # Push message buffer on stack clear # Clear message buffer add # Append reading to buffer send # Send message using built-in halt # ad-hoc routing system

CSE 291 Sensor Networks – 4/22/2003 Maté Capsules 0123 Subroutines Clock Send Receive Events gets/sets Code Operand Stack Return Stack Maté PC Mate Context

CSE 291 Sensor Networks – 4/22/2003 Maté Capsules Hold up to 24 instructions Fit in a single TinyOS AM packet »Installation is atomic Four types: send, receive, clock, subroutine Context-specific: send, receive, clock Called: subroutines 0-3 Version information

CSE 291 Sensor Networks – 4/22/2003 Maté Contexts 0123 Subroutines Clock Send Receive Events gets/sets Code Operand Stack Return Stack Maté PC Mate Context

CSE 291 Sensor Networks – 4/22/2003 Contexts Each context associated with a capsule Executed in response to event »external: clock, receive »internal: send (in response to sendr ) Execution model »preemptive: clock »non-preemptive: send, receive Every instruction executed as TinyOS task

CSE 291 Sensor Networks – 4/22/2003 Viral Code Every capsule has version information Maté installs newer capsules it hears on network Motes can forward their capsules (local broadcast) »forw »forwo

CSE 291 Sensor Networks – 4/22/2003 Forwarding: cnt_to_leds gets # Push heap variable on stack pushc 1 # Push 1 on stack add # Pop twice, add, push result copy # Copy top of stack sets # Pop, set heap pushc 7 # Push 0x0007 onto stack and # Take bottom 3 bits of value putled # Pop, set LEDs to bit pattern forw # Forward capsule halt #

CSE 291 Sensor Networks – 4/22/2003 Evaluation Code Propagation Execution Rate 42 motes: 3x14 grid 3 hop network »largest cell 30 motes »smallest cell 15 motes

CSE 291 Sensor Networks – 4/22/2003 Code Propagation

CSE 291 Sensor Networks – 4/22/2003 Code Propagation, Continued (seconds) Network: 1/8Network: 1/4 NewMeanStd. Dev.MeanStd. Dev 1/ / / / Network: 1/2Network: 1/1 NewMeanStd. Dev.MeanStd. Dev 1/ / /

CSE 291 Sensor Networks – 4/22/2003 Maté Instruction Issue Rate ~10,000 instructions per second Task operations are 1/3 of Maté overhead

CSE 291 Sensor Networks – 4/22/2003 Energy Consumption Compare with binary reprogramming Maté imposes a CPU overhead Maté provides a reprogramming time savings Energy tradeoff

CSE 291 Sensor Networks – 4/22/2003 Case Study: GDI Great Duck Island application Simple sense and send loop Runs every 8 seconds – low duty cycle 19 Maté instructions, 8K binary code Energy tradeoff: if you run GDI application for less than 6 days, Maté saves energy

CSE 291 Sensor Networks – 4/22/2003 Summary / Discussion Spectrum of reprogramming »Native code; Bytecode interpreter »How important is flexibility? »Is a viral model reasonable? Security? VM’s provide opportunities, but also overhead »Interpretive overhead is *high* »If operations are large enough (e.g. send), overhead is negligible (3000% to 3%) »What is a realistic mix? »Opportunity for managing heterogeneity and evolution?

CSE 291 Sensor Networks – 4/22/2003 Right requirements? Small (fit on Motes) Expressive (lots of applications) Concise (programs short for memory and network bandwidth) Resilient (don’t crash the system) Efficient (in sensing and communication) Tailorable – for application-specific operations Simple – in-situ, fast, “autonomous” programming => and does it meet them?