Download presentation
Presentation is loading. Please wait.
Published byJessie Welch Modified over 9 years ago
1
CS542 Seminar – Sensor OS A Virtual Machine For Sensor Networks Oct. 28, 2009 Seok Kim Eugene Seo R. Muller, G. Alonso, and D. Kossmann
2
Contents Motivation SwissQM Overview System Architecture QM Program Network Summary
3
Motivation Introduction Wireless sensor networks are increasingly being used today. Re-programming sensor networks is difficult. TinyOS Integrate OS and application as single unit Application OS
4
Motivation Surge Basic application Sample one specific sensor periodically and send it to a sink node Low level abstraction nesC code Parameter or Program App. OS task void SendData() { SurgeMsg *pReading; uint16_t Len; dbg(DBG_USR1, "SurgeM: Sending sensor reading\n"); if (pReading = call Send.getBuffer(&gBuffer,&Len)) { : : } }
5
Motivation Surge Basic application Sample one specific sensor periodically and send it to a sink node Low level abstraction Advantage Efficiency Full control of the node Disadvantage Platform dependent Limited update at runtime Expensive reprogramming of whole application Parameter or Program App. OS
6
Motivation TinyDB Use a declarative system Data acquisition task expressed as a query QP OS Query High level abstraction SQL-like Query Query Processor (QP) Use table SELECT nodeid FROM sensors WHERE light>100 SAMPLE PERIOD 30s SELECT nodeid FROM sensors WHERE light>100 SAMPLE PERIOD 30s NodeIDLightTemp…
7
Motivation TinyDB Use a declarative system Data acquisition task expressed as a query QP OS Query High level abstraction Advantage Platform independent Change query Change application Disadvantage Too abstract Limited expressiveness
8
Overview Main idea User interface Language independent Gateway Do everything that can be done at the gateway The sensors only process capturing, aggregating, forwarding data. Program processing Increase of concurrency limit Network Reduction of messages sent in the network Solution Use virtual machine (VM) at sensor node SwissQM (Scalable WirelesS Sensor network Query Machine)
9
Overview SwissQM sensor network Use 33kB Flash memory and 3kB SRAM
10
Overview SwissQM virtual machine VM is on each sensor node QM Program VM Instruction Set VM Execution Environment TinyOS QM program Bytecode: set of instructions VM instruction set Provide 59 instructions 40 VM instructions (stack, arithmetic, control) 19 core instructions (buffer, sensor, transmission)
11
Convert of the query language Advantage Easy to extend the number of supported query language Reduce the workload of sensor compared to TinyDB System Architecture Various Queries QM Program Translation Virtual Query Query Complier, Query Optimiser Query Complier, Query Optimiser QM Program Query Type1Query Type2 Gateway
12
System Architecture Integer-based virtual machineComponents Bytecode interpreter Execute code section Operand stack Store the operands of its bytecode instructions Transmission buffer (array) Buffer the data received and sent Synopsis (table) Store the aggregation state Merge the data from its children and itself SwissQM on the sensor node
13
33kB Flash memory 3kB SRAM System Architecture SwissQM core 59 instruction set 23kB 10kB : Bytecode interpreter & static memory allocator QM pro1 : QM pro6 384 byte Program descriptor list 16 byte Sampling period, Length of the program, point to the program’s data structure, … QM bytecode Synopsis (optional) Transmission Buffer Stack 64 byte
14
System Architecture QM program structure.section init Initialize QM program when the QM program is loaded.section delivery Is invoked periodically.section reception Is called when data received from children node
15
Example 1: Basic Sampling and Sending QM program: section delivery, “@10s” get_temp# read temperature sensor ipushb 60 if_icmple end# skip if temp<=60 get_nodeid# read node’s ID istore 0# store it at pos. 0 send_tb# send transmission buffer end:.section reception send_tb# forward tuple from child Stack: Transmission buffer: Event: Timer fires Query: SELECT s.nodeid FROM sensors WHERE temp > 60 SAMPLE PERIOD 10s
16
Example 1: Basic Sampling and Sending Temp (64) Stack: Transmission buffer: Event: QM program: section delivery, “@10s” get_temp# read temperature sensor ipushb 60 if_icmple end# skip if temp<=60 get_nodeid# read node’s ID istore 0# store it at pos. 0 send_tb# send transmission buffer end:.section reception send_tb# forward tuple from child Query: SELECT s.nodeid FROM sensors WHERE temp > 60 SAMPLE PERIOD 10s
17
Example 1: Basic Sampling and Sending 60 Temp (64) Stack: Transmission buffer: Event: QM program: section delivery, “@10s” get_temp# read temperature sensor ipushb 60 if_icmple end# skip if temp<=60 get_nodeid# read node’s ID istore 0# store it at pos. 0 send_tb# send transmission buffer end:.section reception send_tb# forward tuple from child Query: SELECT s.nodeid FROM sensors WHERE temp > 60 SAMPLE PERIOD 10s
18
Example 1: Basic Sampling and Sending Stack: Transmission buffer: Event: QM program: section delivery, “@10s” get_temp# read temperature sensor ipushb 60 if_icmple end# skip if temp<=60 get_nodeid# read node’s ID istore 0# store it at pos. 0 send_tb# send transmission buffer end:.section reception send_tb# forward tuple from child Query: SELECT s.nodeid FROM sensors WHERE temp > 60 SAMPLE PERIOD 10s
19
Example 1: Basic Sampling and Sending nodeID Stack: Transmission buffer: Event: QM program: section delivery, “@10s” get_temp# read temperature sensor ipushb 60 if_icmple end# skip if temp<=60 get_nodeid# read node’s ID istore 0# store it at pos. 0 send_tb# send transmission buffer end:.section reception send_tb# forward tuple from child Query: SELECT s.nodeid FROM sensors WHERE temp > 60 SAMPLE PERIOD 10s
20
Example 1: Basic Sampling and Sending Stack: nodeID Transmission buffer: Event: QM program: section delivery, “@10s” get_temp# read temperature sensor ipushb 60 if_icmple end# skip if temp<=60 get_nodeid# read node’s ID istore 0# store it at pos. 0 send_tb# send transmission buffer end:.section reception send_tb# forward tuple from child Query: SELECT s.nodeid FROM sensors WHERE temp > 60 SAMPLE PERIOD 10s
21
Example 1: Basic Sampling and Sending Stack: Transmission buffer: Event: Transmission QM program: section delivery, “@10s” get_temp# read temperature sensor ipushb 60 if_icmple end# skip if temp<=60 get_nodeid# read node’s ID istore 0# store it at pos. 0 send_tb# send transmission buffer end:.section reception send_tb# forward tuple from child Query: SELECT s.nodeid FROM sensors WHERE temp > 60 SAMPLE PERIOD 10s
22
Network Messaging in the Network Message Types Program Messages Result Messages Command Messages (Node Reset, Program Stop,…) Traffic Pattern Root to all Program and Command Messages All to Root Result Messages Local Broadcasts Routing updates and time synchronization
23
Network Routing of Result Messages Topology Spanning tree protocol Every node keeps a link to a parent node closer to the root Link quality calculation Clock synchronization Piggybacking Routing message contains timestamp Set clock with timestamp – transmission delay
24
In-network Aggregation Reduce the number of messages sent to the gateway Ex) What is the average temperature in the network? Basic transmission Aggregation result # of message: 5 # of message: 3 45 44 48
25
In-network Aggregation In-network Aggregation in SwissQM Use the synopsis, translation buffer, and merge instruction Use TAG Approach (Tiny Aggregation) Initialiser function Create the initial aggregation state on the synopsis Merger function Merge its own state with the aggregation states received from its children Finaliser function Computes the final value of the aggregation
26
Merge Instruction Invoke the merge function in stack Structure merge( n, m, aggop 1,..., aggop m ) n : Grouping Expressions m: Aggregate Expressions aggop: aggregate operation Push arguments on stack in the reverse order Example Merge Function.section reception iconst_2 # aggregate type MAX=2 iconst_1 # num. of aggregate expressions iconst_1 # num. of group expressions merge
27
Merge Function Merge operation Merging aggregation state from the transmission buffer to the local synopsis Example The merge operation of node 2 when node 2 receives the synopsis of node 3
28
Program Dissemination Fragment messages approach Split into several fragment messages. 24 bytes Fragment Fragment 0 10 bytes meta-data The length of the sections Sampling period Presence of synopsis Number of fragment Sensor Allocate memory when it receives fragment 0
29
Program Dissemination Fragment recovery mechanism Timeout for program reception Request node Timer starts when first fragment message is successfully received When this timer times out, request message to its neighbors Contains the program ID and the missing fragments Reply node Generate the requested fragments when it receives request message Send the reply message back to the requesting node.
30
Experiments Compare the program sizes of TinyDB and SwissQM for the queries generating the same data SwissQM not only users less messages, but also smaller messages than TinyDB
31
Pros Characteristics Separation between sensors and external interface Language-independent No application specific functionality in sensors Multi-programming environment Running of six different programs concurrently on a single node Optimization of the use of the sensors Three kinds of process; capturing, aggregating, and forwarding data. Extensibility Support of the use of the user defined functions Easy program dissemination Compact programs due to the powerful instruction set
32
Cons System problem Is not suite to the networks in which many point-to-point streams are dynamically created between sensors interpretation overhead are required Documentary problem No mention about The technical issue of the bytecode instruction set extension Reprogramming technology the proposed virtual machine model uses Too little evaluations on the performance Require long-term experiment to evaluate the performance to run SwissQM compared with the other low-level abstraction program or TinyDB itself Require evaluation of whether SwissQM is the platform-independent
33
CS542 Seminar – Sensor OS Thank you for your attention
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.