Simulating TinyOS Networks

November 11, 2003

Sensor networks are composed of large numbers of tiny sensing and computing devices. Each of these devices, called motes, have very limited communication, computational and energy resources. Often embedded in uncontrolled physical environments, such as nature reserves, vineyards, or seismically threatened structures, these networks require distributed algorithms for efficient data processing, while individual motes require highly concurrent and reactive behavior for efficient operation. Their embedded nature makes controlled experiments difficult; separating the algorithmic and the real-world components of performance is almost impossible, and reproducibility is not much easier. Application development is complicated by the motes' small form factor and limited accessibility in the field; inspecting the internal state of programs on many remote nodes is laborious. Inspection that disturbs the reactive nature of a mote (e.g., a breakpoint) can invalidate the observed behavior.

We have developed a TinyOS mote simulator, TOSSIM, to ease the development of sensor network applications. TOSSIM scales to thousands of nodes, and compiles directly from TinyOS code; developers can test not only their algorithms, but also their implementations. TOSSIM simulates the TinyOS network stack at the bit level, allowing experimentation with low-level protocols in addition to top-level application systems. Users can connect to TOSSIM and interact with it using the same tools as one would for a real-world networking, making the transition between the two easy.

TOSSIM also has a GUI tool, TinyViz, which can visualize and interact with running simulations. Using an simple plugin model, users can develop new visualizations and interfaces for TinyViz.


TOSSIM and its documentation are included in the standard TinyOS release.


Currently, TOSSIM provides a scalable, high fidelity simulation of a complete TinyOS sensor network. Its principal limitation resides in introducing phenomena into the simulation. TinyViz allows users to interact with a simulation through a GUI, but these interactions are often ad-hoc, as well as laborious and difficult to reproduce.

We are currently developing a scripting language, as yet unnamed, which will allow users to interact with running and paused simulations. This will allow users to reproduce complex scenarios (of motion, for example) and construct tests of algorithmic corner cases. Additionally, having a full scripting language will allow users to build scripting primitives, slowly creating a library of functions and test cases for TinyOS efforts.

Initially, work on TinyOS was very low level, exploring things such as media access, sensor filtering, and timer implementations. The initial design of TOSSIM was focused on this work: it simulates every bit of the mica platform radio i stack. As this work was matured, more and more effort has been spent on higher layers, such as complex applications. In order to support developers of these larger systems, we are currently developing a packet-level simulation for the mica2 platform. The challenge is to capture all of the issues and problems that can arise in commmunication (timing, packet corruption, MAC) while remaining efficient. Initial evaluation suggests a hundred-fold performance improvement; however, this option will not support applications that modify low level radio implementations.

  • "TOSSIM: Accurate and Scalable Simulation of Entire TinyOS Applications." In Proceedings of the First ACM Conference on Embedded Networked Sensor Systems (SenSys 2003). [PDF]

  • "TOSSIM: A Simulator for TinyOS Networks." User's manual, in TinyOS documentation. [PDF]

Phil Levis is the principal developer of TOSSIM; please contact him if you have any questions or problems.