06.12.2012 Views

CSEM Scientific and Technical Report 2008

CSEM Scientific and Technical Report 2008

CSEM Scientific and Technical Report 2008

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A Remote Reconfiguration Mechanism for WiseNET Wireless Sensor Networks<br />

D. Piguet, P. Dallemagne, L. Von Allmen<br />

This paper describes the design <strong>and</strong> implementation of a remote reconfiguration mechanism for the WiseNET wireless sensor network platform.<br />

With this new feature, the program that runs on the nodes that compose a wireless sensor network can be remotely updated without accessing the<br />

nodes physically. The scheme includes a low-power, reliable dissemination protocol <strong>and</strong> a patch technique based on the calculation of the binary<br />

difference between the current <strong>and</strong> the new version of the program. This technique drastically reduces the size of the transmitted data.<br />

Reconfiguration is an update feature by which devices on a<br />

computer network can download <strong>and</strong> install a new version of<br />

the program they are running. This is a challenge in the world<br />

of wireless sensor networks because such devices have only<br />

limited resources. CPU power, memory <strong>and</strong> energy are<br />

severely restrained. Only a few nodes (e.g. the sinks, the<br />

device which collect the data coming from the network) are<br />

connected to a more powerful device.<br />

Although the solution is not restricted to this case, a network<br />

with a single sink that is also the distributor of the update is to<br />

be assumed. The two main components of the reconfiguration<br />

scheme are a dissemination protocol <strong>and</strong> a patching<br />

technique [ 1] . The process, depicted in Figure 1, follows four<br />

steps:<br />

• Build: a new executable image is created (compilation +<br />

link dedicated to the target).<br />

• Patch: a patch is computed from the difference between<br />

the new image <strong>and</strong> the running one. This step is optional:<br />

it is possible to distribute the entire new image.<br />

• Protocol: a distribution protocol is used to load the object<br />

(patch or entire new image) to the destination nodes. The<br />

object dissemination starts from the sink which received<br />

the data from the host through its serial port. All the<br />

destination nodes must be identical. However, a network<br />

may be made of different types of nodes.<br />

• Re-flashing: on each node, the old image is replaced by<br />

the new image <strong>and</strong> the node is restarted. If a patch has<br />

been distributed, the new image is reconstructed from the<br />

current one prior to re-flashing.<br />

Figure 1: Principle of the reconfiguration of a WiseNET network.<br />

The protocol allows the distribution of the new program to<br />

every node in the network (or a subset of them), originating<br />

from the sink, over possibly multiple hops. It is fully reliable<br />

<strong>and</strong> copes with the constraints of WiseMAC [ 2 ] , the<br />

asynchronous, r<strong>and</strong>om access MAC protocol used by the<br />

platform of interest in which nodes r<strong>and</strong>omly wake-up <strong>and</strong><br />

88<br />

sample the air for eventual received data. Its basic principle is<br />

to use multiple unicast communications to propagate the data<br />

to the neighbours since the cost of waking-up all nodes is too<br />

high, in terms of energy spent. The rules that the individual<br />

nodes have to follow to propagate the object are strictly local,<br />

ensuring the scalability of the protocol. It also encourages<br />

spatial multiplexing by fragmenting the object into pages that<br />

progress towards the leaves of the network tree while their<br />

follower start to be downloaded near the root. The protocol is<br />

pull based: the nodes are informed of the existence of the new<br />

program to download <strong>and</strong> request pages to a node which<br />

represents the next hop towards the sink when the network<br />

operates normally (in this context, it is called the parent node).<br />

The patching technique is used to significantly reduce the size<br />

of the data to be transmitted over the network. A patch, which<br />

represents the difference between the current, running version<br />

of the program <strong>and</strong> the new version to be installed, is sent<br />

over the network instead of the full, new program image. The<br />

patching technique uses the open-source xdelta 3.0 encoder<br />

which computes the difference between two binary files <strong>and</strong><br />

outputs the result in the VCDIFF format defined in the<br />

RFC 3284. Because the VCDIFF format involved look-up <strong>and</strong><br />

hash tables that are too big for a decoder embedded on a<br />

resource constrained node, a new patch format more adapted<br />

to low-resource decoding has been introduced. The patch in<br />

the new format is obtained by translating the VCDIFF patch to<br />

the new format. The results show that the new format allows<br />

patches which are almost as small as the original VCDIFF<br />

patches. Typical compression rates are between 90 <strong>and</strong> 99%<br />

for small changes <strong>and</strong> between 65 <strong>and</strong> 75% in presence of a<br />

major upgrade.<br />

The implementation of the entire scheme (protocol + decoder)<br />

takes a little more than 8 kB in program memory. The part of<br />

the patch decoder is about 2 kB. While not negligible, this is a<br />

reasonable price to pay for a reliable dissemination protocol<br />

<strong>and</strong> a very efficient patch technique. In addition, this technique<br />

is completely independent from the underlying system. It<br />

works equally for an implementation based on a kernel such<br />

as FreeRTOS, a scheduler such as TinyOS or a dedicated<br />

executive.<br />

The project has been partly supported under the FP6 EU<br />

framework (Project IST 034963 WASP).<br />

[1] D. Piguet, et al., “A remote reconfiguration mechanism for<br />

WiseNET wireless sensor networks”, First International<br />

Workshop on Remote Entrusting, Trento (IT), Oct. 15-16, <strong>2008</strong><br />

[2] A. El-Hoiydi, et al.,“WiseMAC: An Ultra Low Power MAC<br />

Protocol for the WiseNET Wireless Sensor Network,” in Proc. 1st<br />

ACM Sen-Sys Conf., Nov. 2003, 302–303

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

Saved successfully!

Ooh no, something went wrong!