We propose application specific virtual machines as a method to safely and efficiently program sensor networks. Although sensor networks encompass a wide range of application domains, any given network supports a single one. A VM tailored to a particular deployment can provide retasking flexibility within its application class while keeping programs efficient. We present Mate, an architecture for customizing VMs over a wide range of sensor network applications. Customizing the instruction set and triggering events allows for language flexibility, provides very high code density, and enables a wide range of applications.
We evaluate Mate by comparing custom built VMs to two existing proposals for user-level sensor network programming, abstract regions and tree-based aggregation (TinyDB). We show that a VM implemented in our architecture can provide equivalent functionality to the current implementations of these proposals while improving efficiency. Additionally, by decomposing application domains into a set of reusable, fine-grained software components, implementing new user-level programming abstractions is greatly simplified.