Philip Levis UC Berkeley 6/17/20021 Maté: A Tiny Virtual Machine Viral Programs with a Certain Cosmopolitan Charm.

Slides:



Advertisements
Similar presentations
A System Architecture for Tiny Networked Devices
Advertisements

Chapter 2: Data Manipulation
Computer Architecture
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
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.
Steven Koelmeyer BDS(hons)1 Reconfigurable Hardware for use in Ad Hoc Sensor Networks Supervisors Charles Greif Nandita Bhattacharjee.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
How to Code on TinyOS Xufei Mao Advisor: Dr. Xiang-yang Li CS Dept. IIT.
Network Reprogramming & Programming Abstractions.
Generic Sensor Platform for Networked Sensors Haywood Ho.
Generic Sensor Platform for Networked Sensors Haywood Ho.
TinyOS Software Engineering Sensor Networks for the Masses.
1 Ultra-Low Duty Cycle MAC with Scheduled Channel Polling Wei Ye Fabio Silva John Heidemann Presented by: Ronak Bhuta Date: 4 th December 2007.
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.
1 EE249 Discussion System Architecture Directions for Networked Sensors (J. Hill, et al) Presented By: Sarah Bergbreiter EE249 Discussion Section October.
TOSSIM: Visualizing the Real World Philip Levis, Nelson Lee, Dennis Chi and David Culler UC Berkeley NEST Retreat, January 2003.
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.
Computer Organization
hardware and operating systems basics.
Chapter 1 Algorithm Analysis
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
JOP: A Java Optimized Processor for Embedded Real-Time Systems Martin Schöberl.
Fundamentals of Python: From First Programs Through Data Structures Chapter 14 Linear Collections: Stacks.
Rapid Development and Flexible Deployment of Adaptive Wireless Sensor Network Applications Chien-Liang Fok, Gruia-Catalin Roman, Chenyang Lu
4-1 Chapter 4 - The Instruction Set Architecture Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of.
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
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Overview of Hardware.
CS 147 June 13, 2001 Levels of Programming Languages Svetlana Velyutina.
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.
CS542 Seminar – Sensor OS A Virtual Machine For Sensor Networks Oct. 28, 2009 Seok Kim Eugene Seo R. Muller, G. Alonso, and D. Kossmann.
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.
Wireless Sensor Networks for Habitat Monitoring Intel Research Lab EECS UC at Berkeley College of the Atlantic.
이상훈, 허 윤 (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.
Programmable Packets in the Emerging Extreme Internet David Culler UC Berkeley Intel Berkeley.
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.
Computer Organization 1 Instruction Fetch and Execute.
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.
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.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
System Architecture Directions for Networked Sensors.
Subroutines and Stacks. Stack The stack is a special area in memory used by the CPU to store register information or general data information during program.
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
©SoftMoore ConsultingSlide 1 The CPRL Virtual Machine.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Storage Classes There are three places in memory where data may be placed: In Data section declared with .data in assembly language in C - Static) On the.
Computer Organization
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
Overview: Active Sensor networks
Presentation transcript:

Philip Levis UC Berkeley 6/17/20021 Maté: A Tiny Virtual Machine Viral Programs with a Certain Cosmopolitan Charm

Philip Levis UC Berkeley 6/17/20022 Maté Motivation Overview Architecture, Instructions Viral code Evaluation Bombadillo Conclusion

Philip Levis UC Berkeley 6/17/20023 Motivation TinyOS programming complex Application flexibility needed Binary reprogramming takes ~2 minutes –significant energy cost –can lose motes

Philip Levis UC Berkeley 6/17/20024 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

Philip Levis UC Berkeley 6/17/20025 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

Philip Levis UC Berkeley 6/17/20026 Maté Architecture 0123 Subroutines Clock Send Receive Events gets/sets Code Operand Stack Return Stack Maté PC Mate Context

Philip Levis UC Berkeley 6/17/20027 Maté Instructions 0123 Subroutines Clock Send Receive Events gets/sets Code Operand Stack Return Stack Maté PC Mate Context

Philip Levis UC Berkeley 6/17/20028 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

Philip Levis UC Berkeley 6/17/20029 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 #

Philip Levis UC Berkeley 6/17/ cnt_to_leds, Binary gets # 0x1b pushc 1 # 0xc1 add # 0x06 copy # 0x0b sets # 0x1a pushc 7 # 0xc7 and # 0x02 putled # 0x08 halt # 0x00

Philip Levis UC Berkeley 6/17/ 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

Philip Levis UC Berkeley 6/17/ Maté Capsules 0123 Subroutines Clock Send Receive Events gets/sets Code Operand Stack Return Stack Maté PC Mate Context

Philip Levis UC Berkeley 6/17/ 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

Philip Levis UC Berkeley 6/17/ Maté Contexts 0123 Subroutines Clock Send Receive Events gets/sets Code Operand Stack Return Stack Maté PC Mate Context

Philip Levis UC Berkeley 6/17/ 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

Philip Levis UC Berkeley 6/17/ Viral Code Every capsule has version information Maté installs newer capsules it hears on network Motes can forward their capsules (local broadcast) –forw –forwo

Philip Levis UC Berkeley 6/17/ 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 #

Philip Levis UC Berkeley 6/17/ Evaluation Code Propagation Execution Rate 42 motes: 3x14 grid 3 hop network –largest cell 30 motes –smallest cell 15 motes

Philip Levis UC Berkeley 6/17/ Code Propagation

Philip Levis UC Berkeley 6/17/ Code Propagation, Continued (seconds) Network: 1/8Network: 1/4 NewMeanStd. Dev.MeanStd. Dev 1/ / / / Network: 1/2Network: 1/1 NewMeanStd. Dev.MeanStd. Dev 1/ / /

Philip Levis UC Berkeley 6/17/ Maté Instruction Issue Rate ~10,000 instructions per second Task operations are 1/3 of Maté overhead

Philip Levis UC Berkeley 6/17/ Energy Consumption Compare with binary reprogramming Maté imposes a CPU overhead Maté provides a reprogramming time savings Energy tradeoff

Philip Levis UC Berkeley 6/17/ 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

Philip Levis UC Berkeley 6/17/ Future Work Execution model Programming language: motlle Concurrency Code propagation Bombadillo: application specific virtual machines

Philip Levis UC Berkeley 6/17/ Conclusions Spectrum of reprogramming emerges –Hardware –Native code –Bytecode interpreter VM can provide user-land guarantees Will be available in next TinyOS release

Philip Levis UC Berkeley 6/17/ Questions