Sown Code Report: Aggregation Tracking Group Management Pascal A. Vicaire University of Virginia

Slides:



Advertisements
Similar presentations
How to use TinyOS Jason Hill Rob Szewczyk Alec Woo David Culler An event based execution environment for Networked Sensors.
Advertisements

TinyOS Tutorial, Part I Phil Levis et al. MobiSys 2003.
1 Tomás Sánchez López July 9, 2004 Real-time & Embedded Systems Laboratory TinyOS … in deep.
,< 資 管 Lee 附錄 A0 IGMP vs Multicast Listener Discovery.
NesC Prepared for the Multimedia Networks Group University of Virginia.
Feb 2007WSN Training: First Steps in nesC Programming1 First Steps in TinyOS and nesC Programming Topics  Timer Application: MyApp  Application directory.
1 Lab 3 Objectives  Case study: “Hello world” program on motes  Write you first program on mote.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
MUC Coursework ● Deadline: 16 April ● Add all files to a folder, and send a compressed version of the folder (.zip or.tar) to by 26.
1 Lab4 Objectives  Learn to read light sensor data from sensor board  Learn to transmit a message containing the sensed data  through Mote serial port.
Mote Programming. 如何 compile 程式  make [re]install. : desired device address : target platform  install vs. reinstall install : compile the application.
7/13/2007AIIT Summer Course - D#1 Wireless Embedded Systems and Networking Lab Day 5: Part 1: TinyOS Programming on Open Source Distribution Jaein Jeong.
Programming Motes A TinyOS and TOSSIM Tutorial By: Brent Rood.
TinyOS Tutorial CS580S Sensor Networks and Systems February 7, 2007 Jisu Oh Dept. of Computer Science SUNY-Binghamton.
PtinyOS: Simulating TinyOS in Ptolemy II Elaine Cheong Dec 10, 2004 EE290N Project Presentation (Initial NC code generator by Yang Zhao and Edward Lee)
Exam Like Problems. Problem 1 You are given a software module which implements consensus between a static group of servers in an unreliable network. The.
5/5/2003MobiSys 2003 Tutorial TinyOS Tutorial, Part II Robert Szewczyk, Joe Polastre, Phil Levis, David Culler Mobisys 2003.
NesC: 1.1 Bumps and Future Directions David Gay, Intel Research, Berkeley (and the nesC and TinyOS teams)
Routing Status Terence Tong Alec Woo. Introduction Point of the meeting  Two implementations, mh10 and Surge.  In the progress of merging  Issues that.
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
1 Lab 3 Objectives  Case study: “Hello world” program on motes  Write you first program on mote.
1 Code Review of SOWN Demo --- SentrySelection Model By: Gang Zhou Computer Science Department University of Virginia May 2004.
1 Software Development Infrastructure for Sensor Networks  Operating systems ( TinyOS )  Resource (device) management  Basic primitives  Protocols.
Feb 2007WSN Training: XMesh Services1 Lab6 Objectives:  Route Control Interface  Understand XMesh transport services 1.Upstream 2.Upstream with end-to-end.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Peripherals and their Control An overview of industrially available “peripheral devices” that use “pulse-width modulation” for information passing. Review.
Modular Programming Chapter Value and Reference Parameters t Function declaration: void computesumave(float num1, float num2, float& sum, float&
1 Lab 5 Objectives  Use XMesh multi-hop networking service to send sensing data to a base station  Using XServe to display the sensor data message on.
Programming Abstractions in Wireless Sensor Networks Professor Jack Stankovic Department of Computer Science University of Virginia.
Project #2 Mobile Multiplayer Game: Tic-Tac-Toe Project #3 TinyOS Sensing Application EE194WIR Matt Magpayo
Programming in nesC (and TOSSIM)
April 15, 2005TinyOS: A Component Based OSPage 1 of 27 TinyOS A Component-Based Operating System for Networked Embedded Systems Tom Bush Graduate College.
1 TinyOS Computer Network Programming Wenyuan Xu Fall 2007.
Architectures and Applications for Wireless Sensor Networks ( ) Sensor Node Programming II (UART and Radio) Chaiporn Jaikaeo
HW2: Q&A Oct. 02, Lab Machine TinyOS is installed in one machine (531AB). But, you have to bring your kit. There is a sign up sheet. Please sign.
Symmetric Detection. Overview In this phase, each mote will maintain a neighbor table. It provide a command bool isSymmetric(uint16_t neighborID) for.
EnviroTrack: Towards an Environmental Computing Paradigm for Distributed Sensor Networks – Abdelzaher Tarek,etc An Entity Maintenance and Connection Service.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Light Sense Lab. Read data from light(photo diode) sensor, display using oscilloscope.
CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.
Lab 3 Introduction to TinyOS and nesC How to debug programs at PC Examples –Blink Timer –Blink –Hellow World Reference: 1.x/doc/tutorial/lesson1.html.
Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai.
TinyOS Tutorial Lesson 8 Data logging application.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 TinyOS & NesC.
Part 2 TinyOS and nesC Programming Selected slides from:
Feb 2007WSN Training: Creating a Simple Sensor Application1 A TinyOS Sensor Application called MyApp Objectives  How to create a simple Mote firmware.
Feb 2007WSN Training: XMesh Services1 Lab6 Objectives:  Route Control Interface  Understand XMesh transport services 1.Upstream 2.Upstream with end-to-end.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Wireless MAC Practice (MAC I)
Code Review Time Synchronization Presented by Yong Chen Department of Computer Science University of Virginia.
Lecture 5 Sensing 石致豪. Introduction Sense application SenseAppC.nc configuration SenseAppC { } implementation { components SenseC, MainC, LedsC, new.
Lab 3, Part 2 Selected slides from: Wireless Sensor Networks Hardware/Software Tiny OS & NesC Programming borrowed from Turgay Korkmaz.
TinyOS Sandeep Gupta. Operating System (OS) What is an OS? Main functions  Process management  Memory management  Resource management Traditional OSs.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossiping Protocol.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Lab1: LED Control ZigbeX mote has Red, Yellow, Green LED. This lab using LED control component provided by TinyOS.
Based on slides from Andreas Larsson Table from CY Chong, SP Kumar, BA Hamilton - Proceedings of the IEEE, 2003.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 HelloWorld By using LED & Timer components, we will display “helloworld” in a manner of Morse code.
Blink Blink.nc configuration Blink { } implementation { components Main, BlinkM, SingleTimer, LedsC; Main.StdControl -> BlinkM.StdControl; Main.StdControl.
Feb 2007WSN Training: XMesh Enabled Sensor App1 Lab 5 Objectives  Use XMesh multi-hop networking service to send sensing data to a base station  Using.
Communication thread core thread Spawn N negotiation threads... negotiation threads active inactive Initialize An Agent and Its Threads execution thread.
Application Management Editor. Defining Node and Node Capabilities and Functions. MICA2 Monitor Interface Temperature Light Mic pressure Message Node.
Why does it need? [USN] ( 주 ) 한백전자 Background Wireless Sensor Network (WSN)  Relationship between Sensor and WSN Individual sensors are very limited.
TinyOS Sandeep Gupta. TinyOS basics TinyOS is  Single tasking OS  Interrupt driven Written using a Component based language A set of components put.
Simulation of Distributed Application and Protocols using TOSSIM
WSN Training: XMesh Enabled Sensor App
Ad Hoc Networking using Flooding protocol
SOWN Code Review Top-level Control.
An Introduction to nesC
Temperature and Humidity Lab.
WSN Training: TinyOS/nesC Basic Concepts TinyOS and nesC
SenseToRfm SenseToInt.Timer -> TimerC; configuration SenseToRfm {
Overview: Chapter 4 (cont)
Presentation transcript:

Sown Code Report: Aggregation Tracking Group Management Pascal A. Vicaire University of Virginia

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station SensingC Sensing Std Control BottomSensingC Bottom Sensing Attribute Sensing Std Control Group Management LocalM AggregationC BackboneC Trip WireM ReceiveC Base Station Aggregation Std Control Group ManagementC Static Leader TripWire TimerC Tracking Timer LedsC Leds Report CommC Report Comm Std Control TrackingC Configuration Provided Interface Used Interface Module

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station SensingC Sensing Std Control BottomSensingC Bottom Sensing Attribute Sensing Std Control Group Management LocalM AggregationC BackboneC Trip WireM ReceiveC Base Station Aggregation Std Control Group ManagementC Static Leader TripWire TimerC Tracking Timer LedsC Leds Report CommC Report Comm Std Control TrackingC Studied Modules & Configurations Configuration Provided Interface Used Interface Module

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station … setParameters

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station Initialize: Sensing module. Group management module. ReportComm module. Aggregation module. Leader identifier. TripWire information. init ET_POSITION_Sense init whoIsMyLeader isTripWireBase

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station Start: Sensing module. Group management module. Tracking timer. Report module. Aggregation module. Localization module. start getXstart getY

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station Stop: Sensing module. Group management module. Tracking module. Report module. Aggregation module. stop

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station post GMTask(); if (!_isBaseLeader) { _senseCounter++; if (_senseCounter >= SENSE_CNT_THRESHOLD/ENVIRO_WORKING_CLOCK) { _senseCounter = 0; post SenseTask(); } if (_newSensing) { ET_sendCount ++; if (ET_sendCount >= (REFRESH_INTERVAL/ENVIRO_WORKING_CLOCK)) { ET_sendCount = 0; post sendTask(); } fired GMTask senseTask sendTask aggrTask if (_isLeader) { ET_aggrCount ++; if (ET_aggrCount >= (REFRESH_INTERVAL/ENVIRO_WORKING_CLOCK)) { ET_aggrCount = 0; post aggrTask(); } Periodically Post group management task for this Tracking phase Post sense task If not a base Send Sensing Report (Only non base motes) Aggregate received Data if leader

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station Post sensing done task. Sensing Done SenseDoneTask

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station The mote is a group leader if on_off is true. If it is a leader: green LED off, red LED on. If it is not a leader: green LED off, red LED off. Update variables. LeadergreenOffredOn redOff

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station The mote is a group member if on_off is true. If it is a member: green LED on, red LED off. It it is not a member: green LED off, red LED off. Update variables. MembergreenOffredOff greenOn

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station event result_t RC.receiveReport(RCReport *rcReport) { dbg(DBG_TRACKING, "TrackingM.RC.receiveReport\n"); if (_isBaseLeader) { baseStation_reportPosition_struct *temp; temp = (baseStation_reportPosition_struct*)(rcReport->data); call baseStation.reportPosition(temp); } else { baseStation_reportPosition_struct *temp; temp = (baseStation_reportPosition_struct*)(rcReport->data); call GM.receiveMessage(1, temp->GMInformation); } return SUCCESS; } receiveReportreportPositionreceiveMessage Base mote reports to base station Other motes (only leaders can Receive reports) call the group Management module

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station This function does nothing. aggrSendDone

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station ET_Position_senseDone ET_ATTRIBUTES.ET_POSITION=value.

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station Start group management heart beat. GMTask fireHeartBeart

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station Initiate sensor reading SenseTask conditionSense

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station SenseDoneTask joinleave if (_newSensing) { if (_sensing == FALSE) { _sensing = TRUE; call GM.join(); } else { if (_sensing == TRUE) { _sensing = FALSE; if (!_isLeader || _sent) { call GM.leave(); } If there is a new sensing report, and the mote was not currently sensing, Seek to join group. If there is no new sensing report, And the mote was currently sensing, Seek to leave group.

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station Only non base motes. Call aggregation module. SendTask sendData

Local TrackingM Tracking Sens Control Bottom Sensing GM Control Leds Tracking Timer RC Control Trip Wire Static Leader Aggr Control Aggr Attribute Sensing Base Station baseStation_reportPosition_struct temp; tos_time_t timeStamp; dbg(DBG_TRACKING, "TrackingM.aggrTask\n"); ET_AGGRATTRIBUTES = call Aggr.aggregate(); _GMInfo = call GM.getState(); if ((ET_AGGRATTRIBUTES.degreeA + _GMInfo.groupAge) < DEGREE_OF_AGGREGATION) { if (!_sensing) { call GM.leave(); } return; } aggrTask aggregategetStateLeavesendReport setState _GMInfo.groupAge += ET_AGGRATTRIBUTES.degreeA; call GM.setState(_GMInfo); temp.GMInformation = _GMInfo; temp.position.x = (uint16_t)(ET_AGGRATTRIBUTES.A.x); temp.position.y = (uint16_t)(ET_AGGRATTRIBUTES.A.y); call GlobalAbsoluteTimer.getGlobalTime(&timeStamp); temp.timeStamp = timeStamp.low32/100; temp.leaderID = TOS_LOCAL_ADDRESS; temp.degreeOfAggregation = ET_AGGRATTRIBUTES.degreeA; temp.degreeOfMag = ET_AGGRATTRIBUTES.degreeA; temp.degreeOfPIR = 0; temp.degreeOfAccoustic = 0; if (_isLeader) { call RC.sendReport((char *)&temp, BROADCAST_TYPE); _sent = TRUE; if (!_sensing) { call GM.leave(); } Only Leader Aggregate sensing Data If leader did not receive enough sensing Data and is not currently sensing, Leave group without sending report. Otherwise, send Tracking report and leave group If not sensing.

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl ReportCommC RoutingC RoutingSendByBroadcast [RC_ROUTING_PORT] RoutingSendByAddress [RC_ROUTING_PORT] RoutingReceive [RC_ROUTING_PORT] BackboneMTripWireM

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl Init some parameters init

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl Does nothing. start

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl Does nothing. stop

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl … sendReport currentParentsend getCurrentTripWireIDreceive

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl sendDone No message waiting to be sent.

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl sendDone No message waiting to be sent.

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl receive Post process receive message if no other message is already waiting to be processed. ProcessReceiveMessage

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl If group leader, send report. ProcessReceiveMessage receiveReportsendReport

ReportCommM SendMsgByIDTLedsTripWireBackboneReceiveRoutingMsgSendMsgByBct ReportCommStdControl Does nothing. GenericReceive

ReceiveM SendToUARTTLeds baseStation RoutingC ReceiveC RoutingSendByAddress [255] Role: debugging messages?

ReceiveM SendToUARTTLeds baseStation Return leaderID processReport

ReceiveM SendToUARTTLeds baseStation Does nothing. reportPosition

ReceiveM SendToUARTTLeds baseStation Does nothing. sendDone

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation GM StdControl RoutingC RoutingSendByBroadcast [AGGR_ROUTING_PORT] RoutingReceive [AGGR_ROUTING_PORT] AggregationC Group ManagementC

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation Does nothing. GM StdControl start

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation Does nothing. GM StdControl stop

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation Uses averaging functions to aggregate sensing data. Return aggregation degree. GM StdControl aggregate

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation dbg(DBG_USR2, "AggregationM.sendData(leaderID:%d)\n", leaderID); if ((leaderID == TOS_LOCAL_ADDRESS) && !_receivePending) { _receivePending = TRUE; RxBuffer = report; add(); _receivePending = FALSE; signal Aggregation.aggrSendDone(SUCCESS); return SUCCESS; } if (!_sendPending){ _sendPending = TRUE; if ((TxBuffer = (AttrReport*)initRoutingMsg(&_TxMsg, sizeof(AttrReport))) == 0) { GM StdControl sendDataaggregationSendDone send dbg(DBG_USR2, "\t\tinitRoutingMsg fail\n"); _sendPending = FALSE; return FAIL; } *TxBuffer = *report; if (call SendMsgByBct.send(1, &_TxMsg) == FAIL) { dbg(DBG_USR2, "\t\tSendMsgByBct.sendto:%d fail\n", leaderID); _sendPending = FALSE; return FAIL; } dbg(DBG_TEMP, "RSEVENT: %i.%08i: SENDMSG: %d\n", (uint32_t) (tos_state.tos_time / ), (uint32_t) (tos_state.tos_time % * 25), leaderID); return SUCCESS; } else { dbg(DBG_USR2, "\t\t_sendPending fail\n"); return FAIL; } If node is leader, do not send Otherwise, send by Broadcast to leader

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation GM StdControl aggregationSendDone sendDone

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation GM StdControl receive ProcessReceiveAggr dbg(DBG_USR2, "AggregationM.ReceiveRoutingMsg.receive\n"); if(!_receivePending) { TOS_MsgPtr p = _RxMsgP; _receivePending = TRUE; _RxMsgP = msg; if(!post ProcessReceiveAggr()) _receivePending = FALSE; return p; } else { return msg; } Post processReceiveAggr task If no such task pending.

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation GM StdControl receiveMessage ProcessReceiveAggr dbg(DBG_USR2, "AggregationM.ProcessReceiveAggr task\n"); if ((RxBuffer = (AttrReport*)popFromRoutingMsg(_RxMsgP, sizeof(AttrReport))) == 0) { dbg(DBG_USR2, "\tpopFromRoutingMsg fail\n"); _receivePending = FALSE; return; } call GM.receiveMessage(2, RxBuffer->GMInformation); if (RxBuffer->GMInformation.leaderID == TOS_LOCAL_ADDRESS) { dbg(DBG_USR2, "add!\n"); add(); } else { dbg(DBG_USR2, "not add!\n"); } _receivePending = FALSE; Call Group Management Message contents added to message table If node is leader.

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation GM StdControl leader Does nothing.

AggregationM SendMsgByBctReceiveRoutingMsg Aggregation GM StdControl member Does nothing.

GroupManagementM RandomLocal Group Management Static Leader StdControl RandomLFSRLocalMBackboneM GroupManagementC

GroupManagementM RandomLocal Group Management … Static Leader StdControl setParameters

GroupManagementM RandomLocal Group Management Static Leader StdControl init

GroupManagementM RandomLocal Group Management Static Leader StdControl start getXgetY

GroupManagementM RandomLocal Group Management Static Leader StdControl stop

GroupManagementM RandomLocal Group Management Initiate group management timer. Static Leader StdControl fireHeartBeat

GroupManagementM RandomLocal Group Management No status: node becomes member. Follower: node becomes member. Leader Candidate: node becomes leader. Static Leader StdControl join NodeNumberrand memberleader

GroupManagementM RandomLocal Group Management Member: node becomes follower. Leader: node becomes leader candidate. Static Leader StdControl leavememberleader

GroupManagementM RandomLocal Group Management … Static Leader StdControl setState

GroupManagementM RandomLocal Group Management … Static Leader StdControl getState

GroupManagementM RandomLocal Group Management None: follower. Follower: check for group competition. Member: check for group competition. Leader candidate: check for group competition. Leader: check for group competition. Static Leader StdControl ProcessRecuritMessage leader

GroupManagementM RandomLocal Group Management Check if already processing such a message. Static Leader StdControl ProcessRecuritMessage receiveMessage