that are randomly distributed are not suitable for DG
because they affect almost all pages and negate the
benefits that DG has. With increasing code shifts, de-
pendencies on the instructions cause the instructions
to reorder, increasing page writes.
Despite all the advantages and disadvantages of
the algorithms, time can be a limiting factor. Figure 7
shows the average runtime of all algorithms for differ-
ent image sizes. Both scales are logarithmic. While
the basic algorithms itself scale with a similar com-
plexity (O(n
3
) for non-paged and O(n
4
) for paged al-
gorithms), the page algorithms are one to three orders
of magnitude slower. This is because the algorithms
have to be executed for each page, but the input size is
only halved. Larger images have more pages, which
increases the distance during runtime. A positive fact
is that the delta calculation for each page can be done
independently after the page order has been calculated
leaving much potential for parallelization.
7 CONCLUSION
This paper studied the implications of diverse execu-
tion strategies for incremental code updates. These
range from larger delta files through shortened life-
times to node failures. While the original idea of in-
cremental code updates is to conserve energy by prop-
agating only a delta file generated by differencing al-
gorithms, the effects on the sensor node’s flash mem-
ory are also relevant.
To study the impact of these diverse execution
strategies on incremental code updates, the flash
memory accesses were included in the consideration,
in addition to the usual delta size.
First, it could be observed that the differencing
algorithms themselves behave relatively the same re-
gardless of whether the page-based approach was in-
tegrated or not, or how big the page size is. Although
the effect of the page size is low, there are differences
between the different execution strategies, for exam-
ple, through better encoding of offsets and lengths.
With larger address spaces of microcontrollers, the
differences may be even greater.
After all, the runtime of an algorithm is also cru-
cial and can be a limiting factor. Page-based algo-
rithms are one to three orders of magnitude slower,
but it should be mentioned that the delta computation
for each page could be parallelized after the page up-
date order is determined, which could speed up the
runtime.
In conclusion, while a reduced delta size can min-
imize transmission costs, reducing flash access may
also increase the lifetime of sensor nodes by not un-
necessarily wearing the flash memory. And the code
update execution strategy is critical. In the future,
with growing complexity for embedded systems, al-
gorithms must be able to handle larger images. Due to
the recent trends for general-purpose processors with
stagnating clock rates and increasing number of cores,
algorithms that can be parallelized are highly benefi-
cial for those future applications.
ACKNOWLEDGEMENTS
This work was supported by the Federal Ministry
of Education and Research (BMBF) under research
grant number 03IPT601X.
REFERENCES
Brown, S. and Sreenan, C. (2006). Updating software in
wireless sensor networks: A survey. Technical report,
Dept. of Computer Science, National Univ. of Ireland,
Maynooth.
Dong, W., Chen, C., Liu, X., Bu, J., and Gao, Y. (2011). A
lightweight and density-aware reprogramming proto-
col for wireless sensor networks. IEEE Transactions
on Mobile Computing, 10(10):1403–1415.
Dong, W., Liu, Y., Chen, C., Bu, J., and Huang, C. (2010a).
R2: Incremental reprogramming using relocatable
code in networked embedded systems. In IEEE IN-
FOCOM 2010. IEEE.
Dong, W., Liu, Y., Wu, X., Gu, L., and Chen, C. (2010b).
Elon: enabling efficient and long-term reprogram-
ming for wireless sensor networks. ACM SIGMET-
RICS Performance Evaluation Review, 38(1):49–60.
Dong, W., Mo, B., Huang, C., Liu, Y., and Chen, C. (2013).
R3: Optimizing relocatable code for efficient repro-
gramming in networked embedded systems. In INFO-
COM, 2013 Proceedings IEEE, pages 315–319. IEEE.
Gracioli, G., Alhammad, A., Mancuso, R., Fr
¨
ohlich, A. A.,
and Pellizzoni, R. (2015). A survey on cache manage-
ment mechanisms for real-time embedded systems.
ACM Computing Surveys (CSUR), 48(2):32.
Hennessy, J. L. and Patterson, D. A. (2011). Computer ar-
chitecture: a quantitative approach. Elsevier.
Jeong, J. (2003). Node-level representation and system sup-
port for network programming.
Jeong, J. and Culler, D. (2004). Incremental network pro-
gramming for wireless sensors. In IEEE Communica-
tions Society Conference on Sensor and Ad Hoc Com-
munications and Networks (SECON), pages 25–33.
Kachman, O. and Balaz, M. (2016a). Effective over-the-
air reprogramming for low-power devices in cyber-
physical systems. In Doctoral Conference on Com-
puting, Electrical and Industrial Systems, pages 284–
292. Springer.
SENSORNETS 2019 - 8th International Conference on Sensor Networks
38