Adding Scripting to TOSSIMCS 294-1, Fall 2003
Phil Levis and Mike Demmer
TOSSIM allows users to develop and test TinyOS applications in a controlled and repeatable manner. The simulator provides an API for external programs to interact with a running simulation, by changing radio connectivity, making motes boot or fail, and controlling ADC readings. However, the ability to interact with a running simulation is currently only available through TinyViz, a GUI. Interacting with a simulation in a repeatable and controlled way is difficult and laborious.
Our goal is to provide users a scripting interface to TOSSIM. Having executable scripts will enable regression testing and simplify comparative analysis between different systems. Users will be able to schedule mote boot times, inject packets, modify radio connectivity, and do all of the things currently available through the TOSSIM API . In addition to these low-level operations, the scripting language will provide higher-level programming primitives, such as scripting mote motion, and executing code in response to an event from TOSSIM (e.g., run a script when a mote's routing parent changes). In addition to loading scripts at simulator boot, users will also be able to dynamically interact with a running simulation.
The scripting language is based on Jython, a Java implementation of the Python language. In addition to all of the Python programming constructs, Jython includes access to Java classes and libraries. This means users will be able to access all of the rest of the TinyOS Java toolchain from within the scripting environment.
Our project also includes several improvements to TOSSIM, including accurate packet-level simulation, simplified variable access, and, if possible, alternative radio models (e.g., mica2) to the current EmpiricalModel, which is based on mica data.
|Philip Levis, Nelson Lee, Matt Welsh, and David Culler. "TOSSIM: Accurate and Scalable Simulation of Entire TinyOS Applications." To appear in Proceedings of the First ACM Conference on Embedded Networked Sensor Systems (SenSys 2003).|
|Sung Park, Andreas Savvides, and Mani B. Srivastava. "Simulating Networks of Wireless Sensors." In Proceedings of the 2001 Winter Simulation Conference.|
|Sung Park, Andreas Savvides, and Mani B. Srivastava. "SensorSim: A Simulation Framework for Sensor Networks." In Proceedings of the 3rd ACM International Workshop on Modeling, Analysis and Simulation of Wireless and Mobile Systems, 2000.|
|Joshua Redstone, Susan J. Eggers and Henry M. Levy. "An Analysis of Operating System Behavior on a Simultaneous Multithreaded Architecture." In Proceedings of the 9th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS IX), 2000.|
|The Network Simulator|
|The Jython Language|
|The Python Programming Language|