Enabling efficient reprogramming through reduction of executable modules in networked embedded systems
Introduction
Networked embedded systems, such as wireless sensor networks (WSNs), have been proposed for a wide range of applications such as military surveillance, habitat monitoring, and infrastructure protection [1], [2]. WSNs are also deployed in many industrial environments for sophisticated sensing and control purpose [3]. In industrial monitoring applications, WSNs can be used to remotely monitor the health of equipments and machineries, allowing users to detect machine failures and to reduce repair cost. WSNs are essential to industrial automation and management. In inventory management systems, WSNs improve the visibility of materials and enable users to manage and control real-time inventory data.
In many industrial environments, we usually experience a great number of hazards that can range from strong mechanical vibrations, high temperatures, fragile surfaces, and even explosive gases. It is difficult or infeasible to physically collect previously deployed nodes. On the hand, WSN software often needs to be changed after deployment for a variety of reasons—upgrading node software, correcting software bugs, and patching security holes. Enabling sensor nodes to be reprogrammable over the air is crucial for the maintenance of WSNs [4], [5].
In the reprogramming process, the loading mechanism of a sensor node is responsible to load a new code image (disseminated over the air) onto the program flash, enabling sensor nodes to execute the new code. The loading mechanism impacts the overall reprogramming efficiency: a simple bootloader, e.g., TOSBoot [6], requires the replacement of an entire application image, which is not energy-efficient to disseminate; a virtual machine (VM), e.g., Maté [7] and JVM [8], can naturally support loading and executing a very compact code, but requires additional runtime support. Moreover, the VM code is less expressive than the native code.
Contrary to the abovementioned mechanisms, dynamic loading is an efficient way to enable sensor nodes to be reprogrammable: on one hand, it allows disseminating the loadable module, which is much smaller than the entire application image required by the bootloader mechanism; on the other hand, it allows executing the native code, which is much more efficient for execution than the VM instructions required by the virtual machine mechanism.
There also exist a number of differential-based approaches to reduce the transferred code size [9], [10], [11]. Existing differential-based approaches require the knowledge of exact software configurations on the sensor nodes. If sensor nodes are running different versions of their software (which is typical when a fraction of nodes are being updated for testing), differential-based approaches do not scale [8].
In this paper, we explore the dynamic modular design for micro embedded systems, such as sensor nodes. Our design and implementation are guided by the following requirements, including (1) small module size, (2) flexible programming model, and (3) fine-grained configuration.
There is a tradeoff between the reprogramming efficiency and reliability. The use of additional reprogramming techniques, such as general compression and differential encoding, can further reduce the transferred file size. However, they require a more complicated design on the sensor nodes. Complicated mechanisms are likely to be causes of failures [12], [13]. Our design focuses on reducing the unnecessary fields in the module file format while retaining its essential functionalities. Dynamic linking and loading of the modules are sophisticated techniques on PCs and we believe that they can also be reliably and efficiently performed on the sensor nodes.
While some existing works address one or two requirements, few of them present a holistic solution.
The existing modular approach, CELF [8] (based on Contiki OS [14]), only redefines long data types to short ones for low-end microcontrollers. This approach is not enough for aggressively optimizing the module size because the metadata (such as the relocation table and the symbol table) still occupies a large fraction of the module size.
MELF (based on SOS [15]), being small in module size, has several limitations. First, it needs a special SOS module header to be defined by programmers. Second, it does not support defining global variables in a module. Third, it does not support functions calls by names for inter-module communications. These limitations should be avoided.
Therefore, in this paper, we propose a new modular approach, SELF, to have a good tradeoff between the module size and the module’s functionalities (e.g. for enabling flexible programming, fine grained configuration). At the high level, we maintain ELF’s basic structure, e.g. the data, bss, text, sym, reloc sections while reducing unnecessary overheads for resource-constrained sensor nodes.
We have implemented the modular approach based on a micro embedded OS, SenSpire OS [16], for AVR and MSP430 platforms. The evaluation results show 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. SELF retains necessary information to enable flexible modular programming and inter-module communications. We have further developed a long-term energy efficiency model to explore the tradeoffs of different reprogramming approaches.
The contributions of this paper are highlighted as follows:
- •
We design, implement, and evaluate the SELF format which has a good tradeoff in the module size and module’s functionalities. We quantitatively compare our methods with state-of-the-arts, including MELF [15], CELF [8], and Minilink [17].
- •
We develop a long-term energy model considering both reprogramming energy consumption and execution energy consumption. Based on this model, we discuss tradeoffs of different reprogramming approaches. We further study the impact of several key system parameters to the network lifetime.
The rest of this paper is structured as follows: Section 2 presents our design in detail. Section 3 shows the evaluation results. Section 4 describes related work. Finally, Section 5 concludes this paper.
Section snippets
Design
This section describes our design approach in detail. Section 2.1 gives the design overview. Section 2.2 describes techniques we employed to reduce the module file size. We quantify sizes of different components constituting the entire module, and compare our approach to two well-known module formats for sensor systems (i.e., CELF [8] and MELF [15]). Section 2.3 describes the dynamic loading process which carefully handles module dependencies, thus enabling a fine-grained module configuration.
Evaluations
In this section, we evaluate our modular design approach. Section 3.1 compares SELF with standard ELF and also shows the overall statistics of SELF. Section 3.2 compares SELF with MELF (for SOS) from three perspectives. Section 3.3 compares SELF with CELF (for Contiki OS). Section 3.4 studies the reprogramming energy efficiency. Finally, Section 3.5 presents a long-term energy model to study our work in a broader spectrum of network reprogramming approaches.
We conduct our experiments based on
Related work
Modular design [15], [14], [19] and network reprogramming [4], [6], [25] are two closely related topics for networked embedded systems such as sensor networks [1], [2].
The modular design approach can effectively reduce the transferred code size, hence improves energy efficiency of network reprogramming.
ELF is one of the most common object code format for dynamic linking. It is a standard format for object files and executables that is used for most modern Unix-like systems. An ELF object file
Conclusions
In this paper, we present a systematic modular design approach for networked embedded systems. We effectively reduce the module file size to enable efficient network reprogramming, while at the same time retain necessary information to maintain module flexibility. We further handle module dependencies in a fine-grained manner, which improves system reliability while keeping the system configuration to its minimum requirement.
We have implemented the modular approach based on a micro embedded OS,
Acknowledgement
This work is supported by the Fundamental Research Funds for the Central Universities (2012QNA5007), the National Science Foundation of China (Grant No. 61070155 and Grant No. 61202402), and the Program for New Century Excellent Talents in University (NCET-09-0685).
Wei Dong received the BS and Ph.D. degrees in Computer Science from Zhejiang University in 2005 and 2010, respectively. He was a Postdoc Fellow at the Department of Computer Science and Engineering in Hong Kong University of Science and Technology from Dec. 2010 to Dec. 2011. He is currently an assistant professor at the College of Computer Science in Zhejiang University. His research interests include networked embedded systemsand wireless sensor networks.
References (30)
- et al.
Wireless sensor networks: a survey
Computer Networks
(2002) - L. Mo, Y. He, Y. Liu, J. Zhao, S. Tang, X.-Y. Li, G. Dai, Canopy closure estimates with greenorbs: sustainable sensing...
- et al.
System level design for clustered wireless sensor networks
IEEE Transactions on Industrial Informatics
(2007) - et al.
Reprogramming wireless sensor networks: challenges and approaches
IEEE Network Magazine
(2006) - et al.
Adaptive multilevel code update protocol for real-time sensor operating systems
IEEE Transactions on Industrial Informatics
(2008) - J. W. Hui, D. Culler, The dynamic behavior of a data dissemination protocol for network programming at scale, in:...
- P. Levis, D. Culler, Maté: a tiny virtual machine for sensor networks, in: Proceedings of ASPLOS,...
- A. Dunkels, N. Finne, J. Eriksson, T. Voigt, Run-time dynamic linking for reprogramming wireless sensor networks, in:...
- J. Jeong, D. Culler, Incremental network programming for wireless sensors, in: Proceedings of IEEE SECON,...
- P. von Richenbash, R. Wattenhofer, Decoding code on a sensor node, in: Proceedings of IEEE DCOSS,...
Cited by (5)
GITAR: Generic extension for Internet-of-Things ARchitectures enabling dynamic updates of network and application modules
2016, Ad Hoc NetworksCitation Excerpt :Then, we compare adding or updating mesh application and the corresponding Rime modules in GITAR and Contiki. For each case, we consider the standard ELF file and two possible ELF file reduction methods available in the literature: SELF object files [37] used in RemoWare [34] and ELF files compressed with the Lempel–Ziv algorithm (LZ77) [38,39]. Another possible compression approach is represented by compressed ELF (CELF) [27] which replaces the 32-bit ELF headers with 16-bit CELF headers.
Energy Efficient Scheduling for Networked IoT Device Software Update
2019, 15th International Conference on Network and Service Management, CNSM 2019Energy efficient software update mechanism for networked iot devices
2019, Proceedings - IEEE Global Communications Conference, GLOBECOMA Machine Learning Method for Power Prediction on the Mobile Devices
2015, Journal of Medical SystemsOptimizing relocatable code for efficient software update in networked embedded systems
2014, ACM Transactions on Sensor Networks
Wei Dong received the BS and Ph.D. degrees in Computer Science from Zhejiang University in 2005 and 2010, respectively. He was a Postdoc Fellow at the Department of Computer Science and Engineering in Hong Kong University of Science and Technology from Dec. 2010 to Dec. 2011. He is currently an assistant professor at the College of Computer Science in Zhejiang University. His research interests include networked embedded systemsand wireless sensor networks.
Chun Chen received his Bachelor of Mathematics degree from Xiamen University, China, in 1981, and his Masters and Ph.D. degrees in Computer Science from Zhejiang University, China, in 1984 and 1990 respectively. He is a professor in College of Computer Science, the Dean of College of Software, and the Director of Institute of Computer Software at Zhejiang University. His research activity is in image processing, computer vision, CAD/CAM, CSCW, and embedded system.
Jiajun Bu received the BS and Ph.D. degrees in Computer Science from Zhejiang University, China, in 1995 and 2000, respectively. He is a professor in College of Computer Science and the deputy dean of the Department of Digital Media and Network Technology at Zhejiang University. His research interests include embedded system, mobile multimedia, and data mining. He is a member of the IEEE and the ACM.
Chao Huang received his BS degree from Dalian University of Technology. He is currently a M.phil. student in the College of Computer Science of Zhejiang University. His research interests include networked embedded systems and wireless sensor networks.