CS542 Seminar – Sensor OS A Virtual Machine For Sensor Networks
description
Transcript of CS542 Seminar – Sensor OS A Virtual Machine For Sensor Networks
3
CS542 Seminar Sensor OSA Virtual Machine For Sensor Networks
Oct. 28, 2009Seok KimEugene SeoR. Muller, G. Alonso, and D. KossmannContentsMotivationSwissQMOverviewSystem ArchitectureQM ProgramNetworkSummary
MotivationIntroductionWireless sensor networks are increasingly being used today.Re-programming sensor networks is difficult. TinyOSIntegrate OS and application as single unit
ApplicationOS
MotivationSurgeBasic applicationSample one specific sensor periodically and send it to a sink node
Low level abstractionnesC code
Parameter or ProgramApp.OStask void SendData() { SurgeMsg *pReading; uint16_t Len; dbg(DBG_USR1, "SurgeM: Sending sensor reading\n"); if (pReading = call Send.getBuffer(&gBuffer,&Len)) {:: }}
4
MotivationSurgeBasic applicationSample one specific sensor periodically and send it to a sink node
Low level abstractionAdvantageEfficiencyFull control of the node
DisadvantagePlatform dependent Limited update at runtimeExpensive reprogramming of whole applicationParameter or ProgramApp.OS5
MotivationTinyDBUse a declarative systemData acquisition task expressed as a query
QPOSQueryHigh level abstractionSQL-like Query
Query Processor (QP)Use tableSELECT nodeid FROM sensorsWHERE light>100SAMPLE PERIOD 30sNodeIDLightTemp6
MotivationTinyDBUse a declarative systemData acquisition task expressed as a query
QPOSQueryHigh level abstractionAdvantagePlatform independentChange query Change application
DisadvantageToo abstractLimited expressiveness7OverviewMain ideaUser interfaceLanguage independentGatewayDo everything that can be done at the gatewayThe sensors only process capturing, aggregating, forwarding data.Program processingIncrease of concurrency limitNetworkReduction of messages sent in the network
SolutionUse virtual machine (VM) at sensor nodeSwissQM (Scalable WirelesS Sensor network Query Machine)OverviewSwissQM sensor networkUse 33kB Flash memory and 3kB SRAM
OverviewSwissQM virtual machineVM is on each sensor node
QM ProgramVM Instruction SetVM Execution EnvironmentTinyOSQM programBytecode: set of instructions
VM instruction setProvide 59 instructions40 VM instructions (stack, arithmetic, control)19 core instructions (buffer, sensor, transmission)Convert of the query languageAdvantageEasy to extend the number of supported query languageReduce the workload of sensor compared to TinyDB
System Architecture
Various QueriesQM ProgramTranslationTranslationVirtual QueryVirtual QueryQuery Complier,Query OptimiserQM ProgramQuery Type1Query Type2GatewaySystem Architecture
Integer-based virtual machineComponentsBytecode interpreterExecute code section
Operand stackStore 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 itselfSwissQM on the sensor node1233kB Flash memory
3kB SRAM
System ArchitectureSwissQM core59 instruction set23kB10kB: Bytecode interpreter & static memory allocatorQM pro1:QM pro6384 byteProgram descriptor list16 byte16 byte16 byteSampling period, Length of the program,point to the programs data structure, QM bytecodeSynopsis (optional)Transmission BufferStack64 byteSystem ArchitectureQM program structure.section initInitialize QM program when the QM program is loaded.section deliveryIs invoked periodically.section receptionIs called when data received from children node
Example 1: Basic Sampling and SendingQM program:section delivery, @10sget_temp# read temperature sensoripushb 60if_icmple end# skip if temp 60SAMPLE PERIOD 10sExample 1: Basic Sampling and SendingTemp (64)Stack:Transmission buffer:Event: QM program:section delivery, @10sget_temp# read temperature sensoripushb 60if_icmple end# skip if temp 60SAMPLE PERIOD 10sExample 1: Basic Sampling and Sending60Temp (64)Stack:Transmission buffer:Event: QM program:section delivery, @10sget_temp# read temperature sensoripushb 60if_icmple end# skip if temp 60SAMPLE PERIOD 10sExample 1: Basic Sampling and SendingStack:Transmission buffer:Event: QM program:section delivery, @10sget_temp# read temperature sensoripushb 60if_icmple end# skip if temp 60SAMPLE PERIOD 10sExample 1: Basic Sampling and SendingnodeIDStack:Transmission buffer:Event: QM program:section delivery, @10sget_temp# read temperature sensoripushb 60if_icmple end# skip if temp 60SAMPLE PERIOD 10sExample 1: Basic Sampling and SendingStack:nodeIDTransmission buffer:Event: QM program:section delivery, @10sget_temp# read temperature sensoripushb 60if_icmple end# skip if temp 60SAMPLE PERIOD 10sExample 1: Basic Sampling and SendingStack:Transmission buffer:Event: TransmissionQM program:section delivery, @10sget_temp# read temperature sensoripushb 60if_icmple end# skip if temp 60SAMPLE PERIOD 10sNetworkMessaging in the NetworkMessage TypesProgram MessagesResult MessagesCommand Messages (Node Reset, Program Stop,)
Traffic PatternRoot to allProgram and Command MessagesAll to RootResult MessagesLocal BroadcastsRouting updates and time synchronization
NetworkRouting of Result MessagesTopologySpanning tree protocolEvery node keeps a link to a parent node closer to the rootLink quality calculation
Clock synchronizationPiggybackingRouting message contains timestampSet clock with timestamp transmission delay
In-network AggregationReduce the number of messages sent to the gatewayEx) What is the average temperature in the network?Basic transmissionAggregation result# of message: 5# of message: 3454448
In-network AggregationIn-network Aggregation in SwissQMUse the synopsis, translation buffer, and merge instructionUse TAG Approach (Tiny Aggregation)Initialiser functionCreate the initial aggregation state on the synopsisMerger functionMerge its own state with the aggregation states received from its childrenFinaliser functionComputes the final value of the aggregation
Merge InstructionInvoke the merge function in stackStructuremerge( n, m, aggop1, . . . , aggopm )n : Grouping Expressionsm: Aggregate Expressionsaggop: aggregate operationPush arguments on stack in the reverse orderExample
< 1, 1, MAX >Merge Function
.section receptioniconst_2 # aggregate type MAX=2iconst_1 # num. of aggregate expressionsiconst_1 # num. of group expressionsmergeMerge FunctionMerge operationMerging aggregation state from the transmission buffer to the local synopsisExampleThe merge operation of node 2 when node 2 receives the synopsis of node 3
Program DisseminationFragment messages approachSplit into several fragment messages.
24 bytes FragmentFragment 010 bytes meta-dataThe length of the sectionsSampling periodPresence of synopsisNumber of fragmentSensorAllocate memory when it receives fragment 0
Program DisseminationFragment recovery mechanismTimeout for program receptionRequest nodeTimer starts when first fragment message is successfully receivedWhen this timer times out, request message to its neighborsContains the program ID and the missing fragmentsReply nodeGenerate the requested fragments when it receives request messageSend the reply message back to the requesting node.
ExperimentsCompare 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
ProsCharacteristicsSeparation between sensors and external interfaceLanguage-independentNo application specific functionality in sensorsMulti-programming environmentRunning of six different programs concurrently on a single nodeOptimization of the use of the sensorsThree kinds of process; capturing, aggregating, and forwarding data.ExtensibilitySupport of the use of the user defined functionsEasy program disseminationCompact programs due to the powerful instruction set
ConsSystem problem
Is not suite to the networks in which many point-to-point streams are dynamically created between sensorsinterpretation overhead are required
Documentary problemNo mention about The technical issue of the bytecode instruction set extensionReprogramming technology the proposed virtual machine model uses
Too little evaluations on the performanceRequire long-term experiment to evaluate the performance to run SwissQM compared with the other low-level abstraction program or TinyDB itselfRequire evaluation of whether SwissQM is the platform-independent
QM program 32CS542 Seminar Sensor OSThank you for your attention