Technology > Systems Area Projects > Avrora: Sensor Network Simulation
We have implemented Avrora, an instruction-level sensor network simulator. Avrora simulates a network of AVR/Mica2 motes. We want to enhance Avrora with new capabilities for executing and monitoring simulations of heterogeneous sensor networks. First, we want Avrora to support dynamically updateable sensor code, a feature that is becoming increasingly popular with sensor network operating systems such as SOS. Second, we want Avrora to support other sensor platforms, particularly Telos motes. Third, we want Avrora to support source-level monitoring of simulations, thereby enabling an approach to bug finding.
We will explain our approach in three paragraphs, one for each of the problems we address. In a later section, we will summarize our progress so far.
Support for dynamically updateable sensor code. Currently Avrora supports an execution model in which Avrora loads an assembly file, transforms the file into an internal format, and begins execution. For TinyOS applications, Avrora’s simple execution model works fine. However, for SOS applications, for example, the assembly file may attempt to update the code memory, and Avrora currently ignores such an action. To support updateable code, we need an assembler and a disassembler to transform from assembly code to binary format and back. When a code update happens, Avrora could first run the assembler, then do a code update on the binary format, and then disassemble back to the assembly level. The writing of assemblers and disassemblers is a solved problem, of course, although an error-prone task indeed. Our goal is to generate assemblers and disassemblers automatically.
Support for other sensor platforms.Avrora currently supports just two AVR-based platforms, namely Mica2 motes (implemented by Ben Titzer, UCLA, and Daniel Lee, CMU) and a robotics-oriented platform (implemented by Jacob Everist, USC). Support for other platforms such a Telos motes would be a major step forward. For example, when we compare Mica2 motes and Telos motes, we see that Mica2 is based on an Atmega128 8-bit microcontroller, while Telos is based on an MSP 430 16-bit microcontroller. Moreover, they use different radios and have different kinds of devices on board. Our instruction set description language will be a big help, and yet it looks like we will have to make some extensions to the language to support Telos motes in the best possible way. Currently, Avrora simulates the various devices and the radio on the Mica2 platform using handwritten code. Until now, it has not seemed beneficial to generate such implementations from more abstract descriptions. However, now that IEEE 802-15.4-compliant radios are on the way to becoming standard, it may be time to look into systematic ways of building radio simulations to various degrees of fidelity and various speed-precision tradeoffs. Our goal is to support simulation of heterogeneous sensor networks with more than one kind of sensor node.
Support for source-level monitoring. Avrora has an instrumentation framework which enables precision measurement of application-specific quantities. The instrumentation framework allows adding arbitrary profiling behavior at any point in the program or in response to any type of event at any point in simulation time, without making any modifications to the simulator or influencing the program's behavior or timing. For example, it is easy to write a program profiler which counts how many times each instruction is executed, and it is equally easy to write a memory profiler which counts how many times each memory location is accessed. Avrora comes with a variety of already-written instrumentations that can help with debugging sensor code. However, all of that instrumentation is done at the binary level. We are currently developing means to allow source-level instrumentation to be easily written and automatically integrated into the simulation. We have designed a monitoring language in which one can monitor source-level variables and functions. We are currently in the process of implementing a first version of the monitoring language. We believe that the monitoring language will make it much easier to debug sensor network code at the C level because it can give access to the values of variables, without changing the behavior or timing of the code.
Our goal is to develop an enhanced version of Avrora with which we can run the following experiments: 1) run SOS on Avrora, 2) run a sensor network with both Mica2 motes and Telos Motes on Avrora, and 3) run a combined Emstar-Avrora system and demonstrate that we can easily find the task-queue bug in the Transceiver using our monitoring framework.
Currently: Ben L. Titzer (UCLA, Ph.D student), Jonathan K. Lee (UCLA, Ph.D. student), and Jens Palsberg (UCLA, faculty member).