In WSN applications, conditions do arise where it is mandatory to update existing firmware residing in each node with the aim of remotely effecting essential software improvements. Classically, programming the nodes involves the use of wired communication Interface, however using these links remotely is not feasible. In addition, it is economically impracticable to reprogram each node in the field especially when they can’t be Reach and are in large numbers. Hence, the only viable option left is to employ a reliable over-the-air update process.
2. Dr. E. M. Eronu, E.T. Ibrahim and H.M. John
http://www.iaeme.com/IJCET/index.asp 156 editor@iaeme.com
Cite this Article: Dr. E. M. Eronu, E.T. Ibrahim and H.M. John, A Review of
Memory Utilisation and Management Related Issues In Wireless Sensor
Network Reprogramming Procedures, International Journal of Computer
Engineering and Technology, 7(3), 2016, pp. 137–154.
http://www.iaeme.com/IJCET/issues.asp?JType=IJCET&VType=7&IType=3
1. INTRODUCTION
In WSN applications, situation do arise where it is necessary to make changes to
existing firmware residing in each node in order to remotely correct bugs and make
essential software enhancements. Effecting these changes remotely requires the
conveyance of the new codes from source to intended destination via some wired
(Serial Peripheral Interface, Universal Serial Bus, and Ethernet, etc.) or wireless
(ZigBee, GPRS, Wi-Fi, etc.) communication interface. Every node features an
uploader executable code that receives and programs the new code to its flash
memory. Classically, programming the nodes involves the use of links like JTAG,
however using these links remotely is not feasible. In addition, it is economically
impracticable to reprogram each node in the field especially when they can’t be reach
and are in large numbers. Hence, the only viable option left is to employ a reliable
over-the-air update process.
Reprogramming of a Wireless Sensors Nodes (WSN) in real time allows for
diversification of wireless sensor network applications. However, implementing
reprogramming procedures in resource constrained sensor nodes can be
counterproductive. The core components consisting of the microcontroller’s
processing elements and various memory units are generally known to have limited
capabilities in processing speed and storage size respectively.
Memory utilization during Over the Air (OTA) reprogramming processes has the
tendency of impacting negatively on the WSN‘s overall performance. The impact
could result in the nodes’ performance degradation as well as a depletion of available
energy resource during the several erase, read and rewrite operations cycles. This
paper intents to explore memory utilization related issues and their impact on WSN
performance during reprogramming procedures based on existing reprogramming
approaches reviewed in literature.
The remaining part of this article is organized as follows: Section two provides
some additional background information on OTA procedures and the characteristics
of memory components used in WSN applications, Section three introduces and
describes a selected number of OTA reprogramming procedures in terms of the
influence they have on: WSN application’s performance, the depletion of the nodes’
available limited energy resource. In addition, we explore measures adopted in
addressing the highlighted issues. We discuss some of the findings and make
appropriate recommendations in section four. Lastly, the article is concluded in
Section five.
2. BACKGROUND INFORMATION
Over the air programming (OTA) denotes numerous procedures used for updating or
distributing new-fangled firmware and configuration settings in WSNs and the
Internet of Things. In OTA paradigm, a single node at a base location relays the
update to either all the nodes in the network or close by nodes which will redistribute
this update to others beyond the reach of the central node. The Over the Air approach
3. A Review of Memory Utilisation and Management Related Issues In Wireless Sensor
Network Reprogramming Procedures
http://www.iaeme.com/IJCET/index.asp 157 editor@iaeme.com
ranks among the most prominent and flexible reprogramming methods currently in
use.
The efficiency of an OTA programming paradigm performance depends on
several factors. These factors entails the rate at which the sensor node’s energy
resource is expended by its core components: the processor, the different
communication interface (UART, SPI, Wi-Fi etc.), the various memory types (internal
flash memory, external flash memory, electrical erasable programmable read only
memory (EEPROM) and random access memory (RAM)). In this article, our
emphasis is to explore the role of the memory its utilisation pattern and impact during
OTA reprogramming processes. Wireless sensor nodes ‘memory in use are largely
classified in three categories: internal flash which are mainly used for program and
data code storage , EEPROM for storing configuration data, Random Access Memory
(RAM) which serves as scratch pad or rapid storing and retrievable data storage, and
external flash used to provide extended.
Amongst the memory types in use by sensor nodes, the flash memory constitute
the most energy resource consuming element. Flash memories are non-volatile
storage medium that requires high programming and erasing voltages. Hence to
electrically erase and reprogrammed them, certain on chip charge pumps are used to
produce the high voltages needed. The flash memory comes in two forms, the NAND
and NOR types. The NAND uses tunnel injection for writing and tunnel release for
erasing. They can be read and programed a byte or a word at a time. However, they
can only be erased a "block" at a time. This usually sets all bits in the block to 1. Once
a bit is set to 0 in a freshly erased block, the entire block has to be erased in order to
revert that bit to 1. This implies that, flash memory offers random access read and
programming processes, but does not allow for random access rewrite or erase
operations.
Due to recent advances in memory fabrication technology, WSN applications are
gradually adopting a new brand of memory refer to as ferroelectric memory (FRAM)
[1, 2]. FRAM is much like the dynamic read access memory (DRAM) but has non-
volatile memory technology capabilities [1]. Each distinct bit can be accessed and
unlike EEPROM or Flash, FRAM does not require a special sequence to write data
nor does it require a charge pump to achieve the higher programming voltages [1].
While Flash programming is implemented via a tunneling mechanism, FRAM
programming depends on a ferroelectric effect to induce polarization in a dipolar
molecule. This translates to lesser wear-out far during each memory erase and rewrite
operation, and consequently lasts over 1 billion times longer than Flash [1].
3. REPROGRAMMING PROCEDURES
As reported in literature [3, 4], over-the-air update processes implementation can be
classified into four main categories, these are: entire program code replacement [5,
6], virtual Machine [7], Loadable Native Code Modules [8] and delta based (binary
differences) [5]. Each category implementation comes in several variations. The
variations are as a result of successive research works aimed at addressing some
salient issues relating to their adoption in practice. We provide brief description of
these OTA reprogramming procedures as implemented in each of the category, the
impact of their implementation on the WSN‘s application performance and how they
contribute to the depletion of the nodes’ available minimal energy resource. In
addition, we highlight measures adopted in addressing these issues.
4. Dr. E. M. Eronu, E.T. Ibrahim and H.M. John
http://www.iaeme.com/IJCET/index.asp 158 editor@iaeme.com
3.1. Entire Program Code Replacement Approach
Often referred to as the traditional means of remotely updating firmware in WSN
systems. It is generally implemented via the use a bootloader application that runs on
each wireless sensor node. When a remote server sends new firmware to the node, the
bootloader application selectively execute either the main application or runs an
application update routine. Typically, during system update, the entire main
application code in flash memory is erased and reprogrammed with the updated
version. Since only one copy of the main application exist, and if there are undetected
errors when the update is effected, the wireless sensor node may not operate correctly
or could stop functioning completely. Xnp [9] and Deluge [10] are examples of
techniques that employ this approach. They operate by distributing a new binary
image of an application and it’s OS over the network. For every new update
procedure, the entire image is compiled, linked and redeployed from the server/base
station to each node. Deluge transmits the entire binary codes (firmware) during every
code update, thereby causing a large number of energy hungry memory (EEPROM
and or flash program) writing to transpire. Concerns about energy demands by the
Deluge protocol subsequently leads to the evolution of newer OS-based
reconfiguration paradigm.
There are some variations to how this approach is implemented. In one of the
variations, provision is not made to implement or maintain a backup copy of the
application hence less flash memory size is required. However, the main application
has to be suspended or stopped after the update process and a reboot initiated in order
to get the nodes to run the update. Furthermore, the approach is generally not tolerant
of power loss during the update process and this could result in several repeated read,
erase, and writing of flash memory attempts. A second variation entails implementing
the update procedure with a complete software backup held in memory. If an error is
detected during the course of updating the system, the system can then revert back to
the backup copy of the main application. This option is better implemented in a
multitasking operating system platform. The platform allows the system to execute
the main application tasks while concurrently updating the new copy of the
application as a background task. The approach allows the system to return back to its
original working state should there be a sudden system’s power failure. However,
there is a demand for additional memory space to store the backup copy of the
application.
Free scale’s Kinetics [6] addressed some of the issues highlighted above by
implementing a flash memory swap technique in some of its microcontroller devices.
The Swap feature is best suited for systems that require a very robust firmware update
mechanism. It provides the protection of a backup copy and negligible application
downtime [6]. The devices feature two or more internal flash blocks that support the
swap paradigm. This implies that the memory base address of each flash block can be
exchanged. In addition, the address location of each flash block will consequently be
exchanged in the logical memory map of the device. After a reboot, the integrated
flash swap system basically chooses which software executes with respect to the
position of the flash block in the logical memory map. This allows for a code backup
system with the additional ease of programming. Thereby enabling the node to
execute out of one block while erasing/programming the other block. On Kinetis
devices, the flash swap system monitors/controls all the steps of switching from the
old application to new; there is an added assurance of reliable operation in the case of
a power loss during one of those steps [6]. This approach eliminates the use of
5. A Review of Memory Utilisation and Management Related Issues In Wireless Sensor
Network Reprogramming Procedures
http://www.iaeme.com/IJCET/index.asp 159 editor@iaeme.com
bootloaders thereby allowing the nodes to start running without delays and system
start-up. It provides power loss tolerant capabilities and minimal application
downtime.
3.2. Virtual Machine Approach
Virtual machines (VM) were intended to offer run-time reprogramming features for
WSN’s devices that run on the TinyOS platform. A typical VM often refer to in
literature is the Mat´e developed by Levis and Culler [7].
Code meant for updates are downloaded and executed by the virtual machine at
run-time. In comparison to the native machine code replacement approach, virtual
machine code can be made smaller, thus reducing the energy consumption of
transporting the code over the network, and the processing energy required to effect
memory erase and writing processes.
However, the shortcomings associated with this approach is the increased energy
expended in interpreting the code for time-consuming programs.
3.3. Loadable Native Code Modules Approach
The approach distributes loadable modules, which are comparatively much lesser than
the entire application image. Often refer to as the modular design approach, it can
efficiently lessen the conveyed code size, thereby decreasing the amount of energy
consumed in the course of WSN reprogramming. The binary files loaded conforms to
the standard Execution Linking Format (ELF) typically used in Linux operating
system related platforms. It is composed of program code, data and supplementary
details such as a symbol table, the names of all external unresolved symbols, and
relocation tables [8]. The relocation tables contain information as regards where the
native code and data are to be placed in memory other than where they were initially
meant to be during compilation. The Contiki, an embedded operating system provides
dynamic loading and unloading of individual programs and services [8].
The two main issues curtailing its utilisation are the considerably large size of
ELF based loadable modules and the intensive linking processes. The Processing
overheads are directly linked to the various book-keeping tasks meant to resolve cross
referenced symbols that are required for linking and loading of new module.
In [11], efforts were made to reduce the module file size while at the same time
preserve essential information required to maintain the module’s flexibility and
consistency. Evaluation results shows that the proposed SELF module file format is
4.6–7.6 times smaller than the standard ELF format, and is 1.6–2.4 times smaller than
the CELF format. Similarly in [12] ELF files were adjusted so as to reduce their size
thereby reducing storage requirements in sensor nodes. The optimisations improve
the processing speed, resulting in energy savings of up to 66% when compared to the
original ELF while still maintaining the overall structure of the file itself.
3.4. Delta Based (Binary Differences) Approach
The approach entails transferring the difference between the original and the new or
modified firmware thereby minimizing reprogramming time and energy. However,
often a small change in the original source code can cause large changes in the
compiled binary.
Overcoming this limitation can be resolved by inserting ‘adjustable buffer zones’
at fixed intervals in memory or by redirecting the function calls through an indirection
6. Dr. E. M. Eronu, E.T. Ibrahim and H.M. John
http://www.iaeme.com/IJCET/index.asp 160 editor@iaeme.com
table [13]. However, they both have their shortcomings: first one causes the wastage
of code memory on already resource constrained sensor nodes and the second one
causes an extra indirection for every function in the source code [13, 9]. Thereby
resulting in an additional performance cost and depletion of memory resource in
maintaining the extra indirection table.
Some concerted efforts at addressing the earlier highlighted challenges adopted
and implemented a simple memory manager that employs a static allocation and
deallocation policy [14]. Here, slop space is allocated in linear ratio to the size of the
functions. Providing too much slop will waste memory, while too little slop can cause
frequent relocations. However, after several updates, flash and SRAM memory may
become fragmented, and it may be helpful to compact discontinuous regions.
Compaction is costly because of the enormous volume of reading and rewriting
required. The process further becomes more complicated because shifting code or
data segments around entails reprocessing of relocation entries.
4. DISCUSSION AND RECOMMEDATIONS
The type of memory used during reprogramming procedure directly relates to the cost
of energy expended in sensor nodes. Among the three memories types, the internal
flash memory exhibit a higher tendency to consuming energy resources.
Reprogramming approaches largely requires full flash memory rewriting and
consumes considerably greater power and time. Furthermore, these processes take
large portions of available external memory to store the backup image and related
patches. Such storage overlaps and restricts other critical operation and functional
capacity of the nodes and the entire network in general In addition, writing to an
external memory is slow and requires significantly more power than writing to other
kinds of memory. As such supplementary external memory exclusively for
reprogramming would result in increased mote size, cost and power demands. FRAM
memory type’s adoption and usage in wireless senor nodes has the potential of
addressing some of the issues relating to flash memory usage. FRAM’s dynamic
accessibility and non-volatility properties allows it to perform dual function of both
data and program memory at any given time. This gives designers the choice to create
embedded software that relies heavily on data processing or not at constrained by the
limitations of the microcontroller’s memory type.
The Architecture of WSN Operating system (EOS)’s kernel influences the way
memories are utilised during reprogramming procedures. The EOS’s kernel
architectures generally associated with WSNs are namely Monolithic, Modular and
Virtual Machine. The Monolithic entails the application, libraries and drivers all
integrated as a single system image. The Modular consist of the application and OS
components implemented as separate modules and designed to function interactively.
Virtual Machine features the application as a set of static and dynamic components
having a network wide single system image.
Implementing an efficient reprogramming process to a large extend will require a
trade-off between performance and the flexibility of altering application’s needs.
Monolithic kernel always forms a single system image for the node and hence not
preferred if there are frequent changes in the requirements of the application. Modular
architecture make code maintenance and modification easier. However, overheads
associated with loading and unloading modules dynamically could influence the
performance of the nodes operation negatively. The overhead also involves
contiguous memory allocated to each module. The fact that virtual machine code can
7. A Review of Memory Utilisation and Management Related Issues In Wireless Sensor
Network Reprogramming Procedures
http://www.iaeme.com/IJCET/index.asp 161 editor@iaeme.com
be made smaller thereby reducing the energy consumed when transporting the code
over the network makes it advantageous to adopt, However, the drawback, is an
increase in energy consumed in construing the code for large and time consuming
programs. In Table 1.0, we provide highlights of OTA reprogramming approach
memory utilisation related issues and measures adopted in addressing them
Table 1 Highlights of OTA reprogramming approach memory utilisation related issues and
measures adopted in addressing them
OTA REPROGRAMMING
APPROACH
MEMORY UTILISATION AND MANAGEMENT
RELATED ISSUES
MITIGATION STRATEGY ADOPTED
Entire program code
replacement approach
It transmits the entire binary codes (firmware)
during every code update, thereby causing a
large number of energy hungry memory
(EEPROM and or flash program) writing to
transpire.
The main application has to be suspended or
stopped after the update process and a reboot
initiated in order to get the nodes to run the
update. Subsequently, leading to an increase in
system downtime.
Generally not tolerant of power loss and it
could lead to several repeated read, erase, and
writing of flash memory attempts
Freescale’s Kinetics [6]
implemented a flash memory swap
technique which provides the
protection of a backup copy and
negligible application downtime.
Virtual Machine
implementation
Increased energy expended in interpreting the
code for time-consuming programs.
None
Loadable Native Code
Modules
Considerably large size of ELF based loadable
modules.
The intensive linking processes.
Efforts made to reduce the module
file size were demonstrated in [11].
Proposed SELF module file format is
4.6–7.6 times smaller than the
standard ELF format while at the
same time preserving essential
information required to maintain the
module’s flexibility and consistency.
Similarly in [12] ELF files were
adjusted so as to reduce their size
thereby reducing storage
requirements in sensor nodes. The
optimisations improve the processing
speed, resulting in energy savings of
up to 66% when compared to the
original ELF while still maintaining
the overall structure of the file itself.
OTA REPROGRAMMING
APPROACH
MEMORY UTILISATION AND MANAGEMENT
RELATED ISSUES
MITIGATION STRATEGY
ADOPTED
Delta Based (Binary
Differences)
A small change in the original source code can
cause large changes in the compiled binary.
Efforts attempted in [13] could lead to the
wastage of code memory and an extra
indirection for every function in the source code
[13, 9]. Thereby resulting in an additional
performance cost and depletion of memory
resource in maintaining the extra indirection
table.
It appears evolving solution leads to more
complicated challenges: because shifting code
or data segments around entails reprocessing of
relocation entries.
Overcoming this limitation can be
resolved by inserting ‘adjustable
buffer zones’ at fixed intervals in
memory or by redirecting the
function calls through an indirection
table [13].
Adopted and implemented a simple
memory manager that employs a
static allocation and deallocation
policy [14].
The internal workings of EOS also decides the efficiencies and optimisations
limits attainable when seeking to reduce energy cost associated with memory usage
8. Dr. E. M. Eronu, E.T. Ibrahim and H.M. John
http://www.iaeme.com/IJCET/index.asp 162 editor@iaeme.com
during WSN reprogramming processes. A multithreaded model of operation for
example requires a considerable huge chunk of the memory resources. Individually
thread is assigned its own stack and since one cannot predict the stack size a thread
requires in advance, the stack in most cases has to be overestimated. If we decide to
link one or more threads to handle reprogramming routines, the amount of memory
wasted is better imagined in view of the constrained available memory resource. To
provide concurrency short of per-thread stacks, event-driven systems have been
proposed [8]. However, the demerit of employing an event-driven systems as an
alternative need to be explored as well.
5. CONCLUSION
Highlights of memory utilisation related issues and efforts at addressing during Over
the Air (OTA) reprogramming processes as implemented in WSN technologies were
presented. In our view, an effective reprogramming approach for sensor nodes should
aspire to maintain the following benchmark: negligible energy usage, nominal time to
complete the reprogramming process (delay), marginal processing requirements,
lesser memory footprint (in flash memory), and more also trivial RAM usage.
REFERENCES
[1] R. A. Mena and A. Kozitsky, RF430FRL152H Novel Ferroelectric RAM
Memory (FRAM) NFC Embedded Tag Based Sensors, December 2012.
[Online]. Available: http://www.ti.com.cn/cn/lit/wp/sloy005/sloy005.pdf.
[Accessed 29 May 2016].
[2] A. Hoskins and J. McCann, Beasties: Simple Wireless Sensor Nodes, in 33rd
IEEE Conference on Local Computer Networks, 2008.
[3] S. Jun-Zhao, OS-based Reprogramming Techniques in Wireless Sensor
Networks: A Survey, in Ubi-media Computing (U-Media), 3rd IEEE
International Conference, July, 2010.
[4] S. Misra and E. M. Eronu, Implementing Reconfigurable Wireless Sensor
Networks: The Embedded Operating System Approach, Embedded Systems, in
High Performance Systems, Applications and Projects, 2012, pp. 221–232.
[5] P. R. Krishna, S. Bagchi and P. S. Midkiff, Zephyr: Efficient Increamental
Reprogramming of Sensor Nodes using Function call Indirections and
Difference Computation, in Proceedings of the Annual Technical Conference
(USENIX), San Diego, CA,USA, , June, 2009.
[6] M. Lobdell, Robust Over-the-Air Firmware Updates Using Program Flash
Memory Swap on Kinetis Microcontrollers, June 2012. [Online]. Available:
cache.nxp.com/files/microcontrollers/doc/app_note/AN4533.pdf. [Accessed 29
May 2016].
[7] P. Levis and D. Culler, Mat´e: A tiny virtual machine for sensor, in ASPLOS-X,
San Jose, CA, USA, 2002.
[8] A. Dunkels, N. Finne, J. Eriksson and T. Voigt, Run-time Dynamic linking for
Reprogramming Wireless Sensor Networks, in Proceedings of the 4th
International Conference on Embedded Networked Sensor Systems, New York,
USA, 2006.
[9] J. Jeong and D. Culler, Incremental network programming for wireless sensors,
in the IEEE International Conference on Sensor and Ad Hoc Communications
and Networks (SECON’04), 2004.
9. A Review of Memory Utilisation and Management Related Issues In Wireless Sensor
Network Reprogramming Procedures
http://www.iaeme.com/IJCET/index.asp 163 editor@iaeme.com
[10] J. Hui and D. Culler, The dynamic behavior of a data dissemination protocol for
network programming, in the ACM SIGOPS International Conference on
Embedded Networked Sensor, 2004.
[11] W. Dong, C. Chen, J. Bu and C. Huang, Enabling efficient reprogramming
through reduction of executable modules in networked embedded systems, Ad
Hoc Networks, 11(1), 2012.
[12] W. Munawar, H. M. Alizai, O. Landsiedel and K. Wehrle, Modular remote
reprogramming of sensor nodes, International Journal of Sensor Networks,
19(3/4) pp. 251–263, 2015.
[13] R. K. Panta, S. Bagchi and S. P. Midkiff, Zephyr: efficient incremental
reprogramming of sensor nodes using function call indirections and difference
computation, in USENIX Annual technical conference, CA, USA, 2009.
[14] Mr. Om Mehta and Prof. Gaurang Raval, 3-D Localization In Wireless Sensor
Network, International Journal of Computer Engineering and Technology, 5(3),
2014, pp. 9–22.
[15] Miss. Neha Sarwade and Prof. Dineshpatil, Accurate Event Detection and
Secure Event Transmission In Wireless Sensor Network, International Journal of
Computer Engineering and Technology, 5(6), 2014, pp. 65–73.
[16] S.V.Annlin Jeba, Dr.B. Paramasivan, An Evaluation of En-Route Filtering
Schemes on Wireless Sensor Networks, International Journal of Computer
Engineering and Technology, 3(2), 2012, pp. 62–73.
[17] J. Koshy and R. Pandey, Remote Incremental Linking for Energy-Efficient
Reprogramming of Sensor Networks, in The Second European Workshop on
Wireless Sensor Networks, 2005.