tages of such an approach would be lost and there-
fore these kinds of methods do add unnecessary over-
head. Analysis of existing software update mecha-
nisms is the reason for our different approach to the
problem of updating sensor nodes. All these proto-
cols are not satisfactorily for our challenges, admit-
ting they do cover their specific problems very well.
The next chapter does introduce our protocol ideas to
reach a fast and reliable update while developing new
software for sensor networks.
3 OUR APPROACH
In this chapter we describe basic ideas of the update
protocol and give reasons for their use. The process
is designed to update any amount of nodes in reason-
able time. The update itself does only support full
updates, i.e. there is no possibility to update a part
of the firmware while keeping other parts of the soft-
ware. The complete flash memory is reprogrammed
with the new code. Since we designed and imple-
mented the update process for a specific hardware
from Texas Instruments (TI) we used existing soft-
ware and ideas where possible, but nonetheless these
ideas can be easily used for other systems as well.
The already available TI 1:1 update process was the
basis for our further development. In the existing up-
date mechanism a code distributor, described in the
next chapter, communicates over USB with a pc ap-
plication to collect the source code and send this new
code to the update device, the sensor node. The TI
update process needs specific software on the sensor
node, which will be updated, to work. Because of
that, the update process is only one-time executeable.
If the new loaded software does not support the spe-
cific sequence to launch and execute the update pro-
cess, the complete process is not useable any longer,
but must be manually flashed again. This kind of lim-
itations were another reason for the development of a
more practical update mechanism. The TI software,
after the wireless update is started and initialization
process is complete, does use a simple stop and wait
method, meaning that after every single data packet
an acknowledgement from the device is expected. If
validation is positive the next data packet is ready for
transmission. Otherwise, the current data packet will
be sent again. This idea was extended and adapted
to get it working with more than one device. The
new approach does work similar, although currently
not every packet is validated, but after a specific num-
ber of data packets the update device transmits an ac-
knowledgement packet to advert the current position
in the complete update process. This is also known
as a go-back-N protocol. While the source code dis-
tributor receives good acknowledgement packets, i.e.
no error occurred, it continues with the next valid data
packet. A bad packet indicates an error and this data
packet will be sent again as long as all update devices
do not correctly receive it. The bad data packet is now
the new position in the update and from there on all
packets are transmitted. However, an error is not rec-
ognized immediatley, but only with the next acknowl-
edgement. Since the process is designed to work with
any amount of sensor nodes it must be ensured that
all nodes know when to send their acknowledgement
packet, otherwise some transmissions will fail due to
interference with other possible transmissions. This
is secured by the used time division multiple access
(TDMA) mechanism. Every node has a specific, fixed
time interval when to send the acknowledgement. The
first easy idea and implementation uses the TDMA
mechanism after a fixed amount of data packets in-
dependent whether the radio channel is of good or
bad quality. A bad transmission channel could re-
sult then in slow error recognition. On the contrary
when the radio channel is quite good the acknowl-
edgement phase is kind a waste of time since an er-
ror is not very likely. An update protocol, which uses
the information about the radio channel and its qual-
ity could save both time and energy since it decides
flexible when an ack phase is needed more often. The
adaption to the quality of the current radio channel
is used in different environments. In some TCP/IP
implementations there is a mechanism called AIMD
(Additive Increase Multiplicative Decrease). When
the error rate is low the ack phase is used very rarely,
but is increased by a multiplicative factor after an er-
ror occurred, originally shown in (Jacobson, 1988).
A detailed analysis of the algorithms is presented in,
e.g., (Edmonds, 2012) and (Karp et al., 2000). A sim-
ilar, simplified mechanism is used by our second de-
signed update protocol. The idea was to get a bet-
ter adaption to the actual needed acknowledgement
rate given by the physical quality of the radio chan-
nel. Mechanisms, messages and its sequences to ini-
tialize the update process are presented and analyzed
in 5.1. The complete update protocol, not only the ac-
knowledgement phase of the process, is a time based,
shared protocol, meaning all sensor nodes share the
same system time. Data packets with new code come
every fixed time step and all nodes can synchronize
with the system time with every data packet which
is received. This ensures that every update device, if
correctly synchronized with the code distributor (mas-
ter clock), can switch to receive mode very shortly
before the packet is transmitted by the update distrib-
utor. This saves a lot of energy since update nodes
Fast and Reliable Update Protocols in WSNs During Software Development, Testing and Deployment
21