Wireless Mobile and Sensor Networks Project #1 Assignment
Wireless Mobile and Sensor Networks Project #1 Assignment
Project #1 Assignment
Table of contents
1. Abstract
2. Introduction
5. Project Implementation
7. Source Code
9. Future Work
11. References
Abstract
Wireless Sensor Networks (WSNs) are composed of a large number of very small devices used for
biomedical or environmental monitoring applications. Sensor networks potentially consist of thousands of
tiny, low-power nodes, each of which executes concurrent, reactive programs that must operate with
severe memory and power constraints. In this project we present TinyOS, a flexible, application-specific
operating system for sensor networks. Using Tinyos, simulate a WSN with two nodes based on the
TinyOS simulator (TOSSIM) for wireless sensor devices. Also experiences working with TinyOS are
presented which is a platform for sensor network innovation and applications
Introduction
Tinyos is a free and open source component-based operating system and platform for wireless sensor
networks (WSNs). TinyOS is an embedded operating system written in the nesC programming language.
TinyOS applications are written in nesC, an extension of the C programming language and it is optimized
for the memory limitations of sensor networks. TinyOS programs are built out of software components,
some of which present hardware abstractions. Components are connected to each other using interfaces.
TinyOS provides interfaces and components for common use such as packet communication, routing,
sensing, actuation and storage.
Active Message
Communication
Main (includes Scheduler)
Active Message
Actuating Sensing
Communication
Application (User Components)
Mote Hardware
nesC, is a systems programming language for networked embedded systems such as motes. nesC
supports a programming model that integrates reactivity to the environment, concurrency, and
communication. nesC is based on the concept of components, and directly supports Tinyos’s event based
concurrency model.
TOSSIM is a discrete event simulator for Tinyos sensor networks. Instead of compiling a TinyOS
application for a mote, users can compile it into the TOSSIM framework, which runs on a PC. This
allows users to debug, test, and analyze algorithms in a controlled and repeatable environment. As
TOSSIM runs on a PC, users can examine their Tinyos code using debuggers and other development
tools.
Project Objectives
To build and simulate a simple wireless sensor network with two nodes (one sensor node and one
sink
node) using Tinyos and Tossim.
Need to install tinyos operating system and learn the nesC programming language with which
tinyos applications are built.
To study Tossim, a simulator tool for tinyos with the help of which we can simulate wireless
sensor network.
System Requirements
Tinyos 2.X
Graphviz
Getting started with Tinyos and nesC
The first few tutorial lessons give the basic idea of tinyos and nesC. The first step is to install tinyos-2.x
which involves the following steps.
After the installation the first step is to check that environment is set up correctly. For this we have to run
the tos-check-env command. This should run successfully without errors.
Studying the sample application like Blink gives us the fundamental idea for writing applications in
tinyos. Blink is composed of two components: a module, called "BlinkC.nc", and a configuration, called
"BlinkAppC.nc". We should know that all applications require a top-level configuration file, which is
typically named after the application itself. In this example BlinkAppC.nc is the configuration for the
Blink application and the source file that the nesC compiler uses to generate an executable file.
BlinkC.nc, provides the implementation of the Blink application.
Mote to mote radio communication provides information on how to use the interfaces and components.
There are various numbers of interfaces and some them that are commonly used are given below.
Packet - Provides commands for clearing a message's contents, getting its payload length, and
getting a pointer to its payload area.
Send - provides commands for sending a message and canceling a pending message send. The
interface provides an event to indicate whether a message was sent successfully or not.
Receive - Provides the basic message reception interface. This interface provides an event for
receiving messages.
PacketAcknowledgements - Provides a mechanism for requesting acknowledgements on a per-
packet basis.
RadioTimeStamping - Provides time stamping information for radio transmission and reception.
Sensing demonstrates two sensor applications: a simple application called Sense that periodically takes
sensor readings and displays the values on the LEDs. Sensing involves two tasks: configuring a sensor
and reading the sensor data. The first task is difficult, because a sensing application like, for example,
Sense runs on TinyOS platform. It is not possible to know the configuration details of sense application
because the configuration details of sensors will be different from platform to platform. Unless Sense
knows about all sensors on all platforms it will be unable to perform the configuration task. But,
performing the second task i.e.) reading the sensor data -can be solved so that the Sense application can
collect sensor data though it is running on a different platform.
TOSSIM simulates entire TinyOS applications. It works by replacing components with simulation
implementations. TOSSIM supports two programming interfaces: Python and C++. The first step is to
compile Tossim with the help of make micaz sim command. The make system of Tossim performs the
following steps:
Graphviz is open source graph visualization software. Graph visualization is a way of representing
structural information as diagrams of abstract graphs and networks.
Clicking on MainC, which gives the wirings for the boot sequence:
In the navigation panel on the left, components are below interfaces. Click on WirelessSensorAppC, and
we get a figure like this:
Future Work
References
1. http://www.tinyos.net/
2. http://webs.cs.berkeley.edu/tos/tinyos-1.x/doc/
3. www.tinyos.net/presentations/TOSposter.ppt
4. http://atc.dacya.ucm.es/atc/descargar.php?file=DCIS07.pdf