Abstract
Spatial Programming (SP) is a novel programming model for networks of embedded systems. The goal of Spatial Programming is to offer a simple, yet expressive way of describing distributed computations over massive, ad hoc networks of spatially distributed embedded systems. Four main design principles represent the basis for Spatial Programming: space is a first order programming concept that needs to be exposed to applications, the access to spatially distributed network resources is decoupled from networking, references to network resources are consistent throughout the program, and SP programs should tolerate the network configuration dynamics. This paper presents the Spatial Programming design and its implementation using Smart Messages. Smart Messages are migratory execution units consisting of code and data, which migrate through the network, route themselves at each node in the path, and execute on nodes of interest. We have developed and evaluated an SM prototype over a modified version of Sun’s KVM (as a Java execution environment). The SM prototype executes over Compaq’s handheld iPAQs running Linux and the IEEE 802.11 MAC for wireless communication. The preliminary experimental results for one application running over our prototype show that Spatial Programming can be a viable programming model for networks of embedded systems and that Smart Messages can be successfully used to implement it.