21.08.2013 Views

A State-Based Programming Model for Wireless Sensor Networks

A State-Based Programming Model for Wireless Sensor Networks

A State-Based Programming Model for Wireless Sensor Networks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

32 Chapter 3. <strong>Programming</strong> and Runtime Environments<br />

<strong>Programming</strong> Framework<br />

<strong>Programming</strong> Tools<br />

<strong>Programming</strong> <strong>Model</strong><br />

<strong>Programming</strong> Languages<br />

Runtime Environment<br />

System Software<br />

− Middleware<br />

− Libraries<br />

− Operating System Kernel<br />

Hardware<br />

Compiler, Linker, Debugger<br />

Language abstractions<br />

C, C++, nesC<br />

OS and data abstractions<br />

RPC, EnviroTrack, TinyDB<br />

libC, Berkeley sockets<br />

Linux, TinyOS<br />

PCs, BTnodes<br />

Figure 3.1: <strong>Programming</strong> frameworks <strong>for</strong> sensor nodes consist of reusable code<br />

and software components, programming languages, software tools<br />

to create and debug executable programs.<br />

plat<strong>for</strong>ms must make an a priori decision which models, abstractions, and system<br />

services to support. They are faced with the dilemma to provide an expressive<br />

enough programming model without imposing too heavy a burden on the<br />

scarce system resources. Resources spent <strong>for</strong> the system software are no longer<br />

available to application programmers.<br />

In this chapter we will review state-of-the-art programming models and the<br />

programming abstractions supported in current system software <strong>for</strong> sensor<br />

nodes. We start by presenting basic requirements that must be met by the system<br />

software and application programs alike in Sect. 3.1. Then, in Sect. 3.2,<br />

we present the three basic programming models that have been proposed <strong>for</strong><br />

sensor-node programming, that is, the event-driven model, the multi-threaded<br />

model, and the control loop. We continue our discussion with Sections 3.3<br />

and 3.4 on dynamic memory management and on process models, respectively.<br />

<strong>Based</strong> on our initial requirements (from Sect. 3.1) we analyze these programming<br />

models and abstractions with respect to the runtime support they necessitate.<br />

Finally, in Sect. 3.4, we summarize state-of-the-art programming frameworks<br />

(most of which we have introduced in the previous sections already in order to<br />

highlight certain aspects) and present in greater detail two programming frameworks,<br />

which represent variations of the basic event-driven model.<br />

3.1 System Requirements<br />

In the last chapter we have discussed the unique characteristics of sensor networks.<br />

These characteristics result in a unique combination of constraints and<br />

requirements that significantly influence the software running on sensor nodes.<br />

But this influence is not limited to the choice of application algorithms and data<br />

structures. The nodes’ system software, that is, the operating system and other

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!