Presentation is loading. Please wait.

Presentation is loading. Please wait.

Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai.

Similar presentations


Presentation on theme: "Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai."— Presentation transcript:

1 Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai

2 Traditional system Keyboard Kernel Monitor Mouse Wireless Transceiver Application 1Application 2 Provides Services

3 Sensor Systems Sensor applications developed on top of TinyOS. TinyOS similar to traditional OS but light weight. Some of the services provided by TinyOS  Transmit and receive a packet wirelessly.  LED for displaying to display output.  Accessing storage (Flash) etc. Application specific. So only one application is loaded onto each sensor. TinyOS component-based OS

4 TinyOS Components Provide services. Services are accessed via interfaces. Interfaces defines functions used for accessing services (e.g. Timer, SendMsg, RecvMsg). Function calls:  Blocking  Non-blocking

5 Split-phase operation In TinyOS all function calls are non-blocking. Example: Sending packets. Application sends data by invoking a function called send. Transmission of packet is a long latency operation.  Long latency operations are grouped into a function called Task which is scheduled for execution when CPU is idle. So packet is scheduled for later transmission and send immediately returns. After transmission TinyOS notifies the application by invoking a callback function implemented by the application.  Two way communication between components.

6 Commands & Events Interfaces define both the functions for accessing the service and the call back functions (enables two-way communication between components). Commands: Functions invoked to access a service. Events: Callback functions. Component providing an service via an interface will have command definition. Component using an interface will have event definition. Example:  Command: start of Timer  Event: fired of Timer

7 Interface Example: Timer interface Timer { command result_t start(char type, uint32_t interval); command result_t stop(); event result_t fired(); }

8 TinyOS Application Will contain at least one component called configuration and might contain another component called Module. Configuration: Defines how TinyOS components are connected to the Application (Wiring). Module: Application specific code. Example: Blink Application.  Configuration: Blink.nc  Module: BlinkM.nc Each application provides stdcontrol interface.

9 Main Component Entry point into application. Starts a scheduler queue (FIFO) for Tasks. Passes control to application component through start command of stdcontrol interface provided by application. Two threads of execution  Scheduler for tasks  Commands and events

10 Wiring of components: Blink Component BlinkM SingleTimer HPLClock Hardware Clock Set Interrupt Specific parameters ISR calls clock fired Event handler Clock Interface HPLClock provides the interface for Setting timer interrupt parameters TimerC implements the event handler for fired event Timer Interface TimerC provides the interface for Setting timer interrupt parameters BadgeM implements the event handler for fired event Leds Led interface for turning on and off LEDS Main stdControl Interface BadgeM implements stdControl interface Entry point All wirings Below this are predetermined

11 Event and Commands in BlinkM FIFO Scheduler Clock ISR (TOSH_INTERRUPT) HPLClock SingleTimer BlinkM Fired Leds RedToggle Main Starts FIFO Start Command Event Function Tasks Start setInterval Timer Interface Leds Interface stdcontrol Interface stdcontrol Interface

12 TOSSIM Simulator to test sensor network applications. Distributed systems are hard to debug. Before actual deployment TOSSIM can be used to debug developed application on a large sensor network. No specific modification to application code. Application compiled for TOSSIM will the simulator code too. Run the exe file and pass the number of nodes to be simulated as the parameter.

13 Programming Assignment I Develop an application for the flooding-based tree construction protocol that we discussed in class on TinyOS using NesC and simulate it using TOSSIM Things you should know  Basic NesC programming language constructs  How to transmit and receive user defined packets using the services provided by the communication component in TinyOS?  How to use TimerM component?  How to compile the application for TOSSIM?  How to display the output in TOSSIM?

14 Deliverables Soft copy of your application's configuration file. Soft copy of your application's module file Soft copy of the header file with packet definitions and AM message type definitions A document that details the working of your application. Also should contain the difference in the routing tree, if any, when the lossy and the simple radio model are used. Also include the amount of time it took you to complete each of the steps mentioned above and the task. Zip file which contains all these files. Name the zip file using your lastname_firstname.

15 Estimated Time for Assignment Step 1: 2 Hours Step 2: 8 Hours Step 3: 2 Hours Step 4: 1 Hour Task: 5 Hours Total: 18 Hours


Download ppt "Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai."

Similar presentations


Ads by Google