A Virtual Machine for Sensor Networks

45
A Virtual Machine for Sensor Networks 이이이 , 이 이 (Dept. of CS) René Müller , Gustavo Alonso , Donald Kossmann, “A virtual machine for sensor networks”, ACM SIGOPS Operating Systems Review, v.41 n.3, June 2007

description

A Virtual Machine for Sensor Networks. René Müller , Gustavo Alonso , Donald Kossmann , “A virtual machine for sensor networks”, ACM SIGOPS Operating Systems Review, v.41 n.3, June 2007. 이상훈 , 허 윤 (Dept. of CS). CONTENTS. INTRODUCTION SYSTEM ARCHITECTURE NETWORK CONTRIBUTIONS - PowerPoint PPT Presentation

Transcript of A Virtual Machine for Sensor Networks

Page 1: A Virtual Machine  for  Sensor  Networks

A Virtual Machine for Sensor Net-works

이상훈 , 허 윤 (Dept. of CS)

René Müller , Gustavo Alonso , Donald Kossmann, “A virtual machine for sensor networks”, ACM

SIGOPS Operating Systems Review, v.41 n.3, June 2007

Page 2: A Virtual Machine  for  Sensor  Networks

2

INTRODUCTION SYSTEM ARCHITECTURE NETWORK CONTRIBUTIONS DISCUSSION APPENDEX

CONTENTS

Page 3: A Virtual Machine  for  Sensor  Networks

3

Convenient Interface

Power of Virtualization

Page 4: A Virtual Machine  for  Sensor  Networks

4

Resource Utilization

Power of Virtualization

Page 5: A Virtual Machine  for  Sensor  Networks

5

Interoperability

Power of Virtualization

Page 6: A Virtual Machine  for  Sensor  Networks

INTRODUCTION

Page 7: A Virtual Machine  for  Sensor  Networks

7

Wide Variety of Tasks in WSN Development, Deployment and Main-tenance are largely ad-hoc

Background

Page 8: A Virtual Machine  for  Sensor  Networks

8

Low-level Programming High-level Programming

Adv. • Full flexibility• Full control of the node

• Platform independent• Declarative Approach• Queries relatively small • Reprogrammable - Cheap Update

Dis. • Cumbersome to program• Strongly Platform dependent• Lack of Reprogrammability - update = binary image

• Limited Expressiveness and Extensibility - none of user-defined function - based on query language after all

Background Advantages/Disadvantages of Low-level and High-

level

Page 9: A Virtual Machine  for  Sensor  Networks

9

Problem Definition

Full Controllable

But, less SW ab-straction

Good Abstraction,

But, insufficient expressiveness and extensibility

Low-level Programming High-level Programming

Take advantage of low-level features Take advantage of high-level features

GAP• Reprogramming is expensive

• Programming is cumbersome • Existing approach is less extensible and expressive

Page 10: A Virtual Machine  for  Sensor  Networks

10

Solution Approach

Full Controllable

But, less SW abstraction

Good Abstraction,

But, insufficient expressiveness

and extensibility

Low-level Programming High-level Programming

SwissQM canfill the GAPGAP

Page 11: A Virtual Machine  for  Sensor  Networks

SYSTEM ARCHITEC-TURE

Overall Architecture System Inside

QM Program

Page 12: A Virtual Machine  for  Sensor  Networks

12

WSN with SwissQMOverall Architecture

Page 13: A Virtual Machine  for  Sensor  Networks

13

System Inside

Compact Code Size

Static Data (To Keep states through invocations)

- Raw mode and Managed Mode

Multi-Program Model

Incoming and Out-going Data buffer

Page 14: A Virtual Machine  for  Sensor  Networks

14

Bytecode Interpreter Operand Stack Transmission buffer

◦ For Incoming and Outgoing Data◦ Application Specific Feature?

Synopsis◦ A table used for data aggregation◦ To keep state between different invocations of

the same program

Components >Virtual Machine

Page 15: A Virtual Machine  for  Sensor  Networks

15

program descriptors◦ QM Bytecode◦ Stack ◦ Synopsis ◦ Transmission buffer

Static Memory All-cocation◦ Gateway program

admission control.

Memory Layout

Page 16: A Virtual Machine  for  Sensor  Networks

16

JVM Instructions◦ Essential Instructions

SwissQM “core” In-structions:◦ Buffer / Sensor /

Sysnopsis Application-specific

◦ In-network Data Ag-gregation(merge)

Instruction Set

Page 17: A Virtual Machine  for  Sensor  Networks

17

Consist 3 Code Sections◦ Init

When the program is loaded◦ Delivery

When time period is due◦ Reception

When a message is received

Code Execution

Page 18: A Virtual Machine  for  Sensor  Networks

18

EWMA Graph imple-mented by Six Concur-rent QM Program◦ P0: Raw Light◦ P4: EWMA Filter◦ P5: Window Average

Example: Keeping State

Page 19: A Virtual Machine  for  Sensor  Networks

19

Example: Keeping State

Page 20: A Virtual Machine  for  Sensor  Networks

20

Example: Keeping State

Page 21: A Virtual Machine  for  Sensor  Networks

21

Example: MergePreparing

TR buffer for Merge

Parameter of Merge Function

Page 22: A Virtual Machine  for  Sensor  Networks

In-Network DATA PROCESSING

Page 23: A Virtual Machine  for  Sensor  Networks

23

A fixed size buffer of 16 bytes Two ways of usage

◦ Raw mode An array of 16-bit elements(transition buffer) Accessed over an element index Load/store data from/into synopsis

iload_sy and istore_sy◦ Managed mode

Accessed through the merger Combines data from transfer buffer with the synopsis

Synopsis

Page 24: A Virtual Machine  for  Sensor  Networks

24

Express a complex operation with a single bytecode in-struction

Parameterized instruction implements the aggregate opera-tions

Aggregation involves three functions◦ Initialiser

Create initial aggregation state◦ Merger

Merge with the aggregation state ◦ Finalizer

Computes the final value of the aggregation

Merge Instruction

Table 2: Aggregate operations for merge in-struction

Page 25: A Virtual Machine  for  Sensor  Networks

25

Return the maximum light value among all nodes have the same parent node

Intermediate nodes send a synopsis includes◦ Own parent and light value◦ Pair node ID

Merge Example

Figure 6: Merging aggregation state from the transmission buffer to the local synop-sis

Page 26: A Virtual Machine  for  Sensor  Networks

26

Delivery section only for synopsis sending◦ Deeper node must be scheduled to activate earlier

than parent Position recognition by constant exchange of routing in-

formation Use simple algorithm for schedule shifting

In case of a node running out of space and not able to store the aggregation state◦ Merge operation notice a full synopsis and forwards ◦ Perform final aggregation at the gateway

Reduces the number of messages invoked by nodes at lower layers

Managing Aggregation

Page 27: A Virtual Machine  for  Sensor  Networks

NETWORK

Page 28: A Virtual Machine  for  Sensor  Networks

28

Using Mint routing protocol A link quality estimator based on

WMEWMA(window mean with exponential weighted moving average)of the success rate

Embedding of clock synchronization informa-tion◦ Avoids the cost of separate time-synchronization

message◦ Timestamp of received message minus an average

transmission delay (18 ms)

Topology Management

Page 29: A Virtual Machine  for  Sensor  Networks

29

QM programs are split into fragment mes-sages◦ Identification number of program◦ Enumeration number or fragment

Program Dissemination

Figure 7: Message mapping: fragment messages -> broadcast messages -> TinyOS messages

Page 30: A Virtual Machine  for  Sensor  Networks

30

Two mechanisms for message lost◦ Timeout for program reception

Compute number of outstanding fragments Allocate dynamic program structures on the heap and start

timer Send a “program request” message to neighbor and

restarts timer Includes program ID and bit-mask encoded missing fragment

Generate requested fragment Sends fragment in a “program reply” message

◦ Snooping result messages Snoop for lately joined node and judge by program identifier Request for all fragments

Program Dissemination

Page 31: A Virtual Machine  for  Sensor  Networks

31

Run in the TinyOS simulator Measure time for program distribution which fits into a sin-

gle message Best case: all nodes get in about 5 seconds Worst case: only 2% of nodes get and 53.6 seconds

Experiment Program Distribu-tion

Figure 8: Program coverage during program distribution over time

Page 32: A Virtual Machine  for  Sensor  Networks

CONTRIBUTION

Page 33: A Virtual Machine  for  Sensor  Networks

33

Flexible Application Boundary◦ User-defined Functions

Compact Code Size◦ By Well-defined Instruc-

tion Set Support Application-

specific Function ◦ Data Aggregation◦ Merge Function

Application-Specific Virtual Ma-chine

Page 34: A Virtual Machine  for  Sensor  Networks

34

Platform Independency

Interoperability

Page 35: A Virtual Machine  for  Sensor  Networks

35

Borrows many ideas from TinyDB, but improved a lot due to the design

Small Footprint

SwissQM TinyDBCore size

33kB Flash3kB SRAM

65kB Flash3kB SRAM

Message size 36 bytes 49 bytes

Expressions in query

Translated to a short

sequence of bytecode

instructions(Short

message)

Part of query

evaluation(Long

message)

Page 36: A Virtual Machine  for  Sensor  Networks

DISCUSSION

Page 37: A Virtual Machine  for  Sensor  Networks

37

Show your opinion-Wisdom

cf. What should you come out of your research?

Thesis,Doctrine

Report

Wisdom

Implication of the con-clusion, new insights,

new theory, new para-digm

KnowledgeTo draw conclusion from

information

InformationTo use data

DataOutcome of the recording

Page 38: A Virtual Machine  for  Sensor  Networks

38

Authors’ Conclusion◦Filling the Gap between Low-level and High-level layers

◦etc. Flexibility Eases Program Dissemination

Conclusion

Page 39: A Virtual Machine  for  Sensor  Networks

39

Beyond Conclusion◦ There is no discussion session◦ No implication, No insights

cf. Mate Case

Cons.

Page 40: A Virtual Machine  for  Sensor  Networks

40

No Evaluation Work◦ But, Redefine Existing Problem by their own

way

Pros.

Page 41: A Virtual Machine  for  Sensor  Networks

41

An Aspect of Problem Definition◦ Dealing with a well-known Problem

◦ But, Redefine Existing Problem by their own way

Pros.

Philip Levis, David Culler, Maté: a tiny virtual machine for sensor networks, 10th annual conference on Architec-tural Support for Programming Languages and Operating

Systems , Pages: 85 – 95, 2002

Page 42: A Virtual Machine  for  Sensor  Networks

42

Introduce remarkable contribution with negligible trade-off

Easy to understand by Examples◦ Describing their program architecture by introducing highly relevant and

practical examples◦ Easily Motivate readers to understand System Architecture (and Even the

Need for system)

Pros.

• Separation between sensors and external inter-face

• Multi-programming environment• Small Footprint• Extensibility• Easy program dissemination• Easy Program Environment

• Keeping State• Concurrency• Data Aggregation

Page 43: A Virtual Machine  for  Sensor  Networks

43

Think of better implication from conclusion of this paper◦ They see another dimension of availability

to meet system requirements(Hardly see trade-off)

Ask to discuss

Page 44: A Virtual Machine  for  Sensor  Networks

APPENDEXInstruction Set

Page 45: A Virtual Machine  for  Sensor  Networks

45

Instruction Set