MCP: an Energy-Efficient Code Distribution
Protocol for Multi-Application WSNs
Weijia Li, Youtao Zhang, Bruce Childers
Computer Science Department, University of Pittsburgh, Pittsburgh, PA 15260
Abstract. In this paper, we study the code distribution problem in
multi-application wireless sensor networks (MA-WSNs), i.e., sensor net-
works that can support multiple applications. While MA-WSNs have
many advantages over traditional WSNs, they tend to require frequent
code movements in the network, and thus here new challenges for de-
signing energy efficient code dissemination protocols.
We propose MCP, a stateful Multicast based Code redistribution Proto-
col for achieving energy efficiency. Each node in MCP maintains a small
table to record the interesting information of known applications. The ta-
ble enables sending out multicast-based code dissemination requests such
that only a subset of neighboring sensors contribute to code dissemina-
tion. Compared to broadcasting based schemes, MCP greatly reduces
signal collision and saves both the dissemination time and reduces the
number of dissemination messages. Our experiments results show that
MCP can reduce dissemination time by 25% and message overhead by
20% under various network settings.
Wireless sensor networks (WSNs) have recently emerged as a promising com-
puting platform for applications in non-traditional environments, such as deep
sea and wild fields. They are usually under tight memory and energy constraints,
e.g., a Telos sensor node has only 48KB program memory . Many WSNs can
load only one application per node and the same application to all nodes in the
network. We refer to these WSNs as single-application WSNs or SA-WSNs.
While one sensor is usually small and cheap, as the network size scales, a
large WSN may consist of thousands of sensors making it economically less ap-
pealing to run just one application. Recently, researchers have envisioned the
wide adoption of multi-application WSNs or MA-WSNs, which can support sev-
eral applications in one network infrastructure [20,17]. In a MA-WSN, a sensor
stores the code of multiple applications in its external flash memory and loads
the selected application into its program memory for the desired functionality.
The latter program is referred to as the active application. The recent technol-
ogy and research advances clear ways for adopting MA-WSN design. Firstly it is
now possible to integrate more memory (especially flash memory) with the same
budget ; secondly different sensing, clustering, routing and data aggregation
protocols have been proposed to reduce the energy consumption of performing
functionalities of one application . As a result, it is now possible to support
multiple applications during the lifetime of a MA-WSN.
MA-WSNs have many advantages over SA-WSNs. For example, MA-WSN
can be deployed in a national park to monitor both wildfires and animal move-
ment. More sensors could be set to monitor the animal movement in the early
morning or late afternoon when animals tend to leave from or return to their
habinates; while more sensors could be set to monitor wildfires in the summer
season when the weather is dry and the chance to catch fires is high. By ex-
ploiting the same network infrastructure for both events, (1) MA-WSNs save
the investment and effort in deploying and testing two sensor networks; (2) the
sensor network adapts better to the dynamic changing environment and even
adjusts the coverage according to the need.
However, not all nodes in MA-WSNs have the code of all running applica-
tions. Some sensors may need to switch to run the code that can be found neither
in their flash memory nor from their neighboring sensors. This results in more
code movements and makes it critical to design energy-efficient post-deployment
code dissemination/redistribution protocols in MA-WSNs. Most existing code
dissemination protocols, such as Deluge , MNP , Stream  are designed
to disseminate the same code to all sensors in the network. While it is possi-
ble to adopt a naive drop-after-receive scheme that discards unnecessary code
after dissemination, applying these protocols in MA-WSNs tends to introduce
high overhead. A recent proposed protocol, Melete , has a similar design
goal. However, it employs broadcast strategy in dissemination, which introduces
significant signal collision and communication overhead in disseminating appli-
cations with large code sizes. MDeluge  uses a tree-based routing approach to
disseminate the application code to the sensors that need to run the application.
The pre-computed routing table is fixed during one application upgrade, thus it
is subject to the network conjestion and single point failure.
In this paper, we propose a multicast-based code redistribution protocol,
MCP, for the purpose of achieving energy efficiency. MCP employs a gossip-based
source node discovery strategy. Each sensor summarizes the application infor-
mation from overheard advertisement messages. Future dissemination requests
are forwarded to nearby source nodes rather than flooding the network. Our ex-
periments show that MCP greatly reduces both dissemination time and message
overhead, and achieves 10-20% reductions in various settings.
In the remainder of the paper, we describe the code dissemination back-
ground in Section 2 and the MCP protocol in Section 3. Section 4 evaluates the
effectiveness of MCP under different settings. Related work is discussed in Section
5, andSection 6 concludes the paper.
conscious register allocation and data allocation to reduce the script size. The
code size can also be reduced by disseminating modules with symbolic names
and performing remote linking before execution , or by disseminating virtual
machine primitives .
To defend against security attacks during code dissemination,  integrated
digital signature and hashing chaining mechanisms to ensure page-level data
integrity. Since packets within one page may arrive out of order, security attacks
within one page is still possible.  performs packet level security checks to
defend such attacks with the tradeoff to enforce a stronger dissemination order
In this paper, we propose a multicast-based code dissemination protocol,
called MCP, for efficient code dissemination in MA-WSNs. In MCP, each sensor
summarizes overheard information of nearby sources in a small table such that its
dissemination requests can be multicasted to selected source. Compared to design
that floods requests to all neighboring sensors, MCP significantly reduces signal
conflicts. Our experimental results show that MCP can reduce dissemination
time by 25% and message overhead by 20% on average.
This work is supported in part by NSF under grant CCF-0641177, CNS-
0720595, CCF-0811352, CCF-0811295, CNS-0720483, CCF-0702236, and CNS-
1. M. Chu, H. Haussecker, and F. Zhao, “Scalable Information-Driven Sensor Querying
and Routing for ad hoc Heterogeneous Sensor Networks,” In International Journal
on High Performance Computing Applications, 16(3):90-110, Fall 2002.
2. A. Dunkels, N. Finne, J. Eriksson, and T. Voigt, “Run-Time Dynamic Linking
for Reprogramming Wireless Sensor Networks,” ACM International Conference on
Embedded Networked Sensor Systems (SenSys), pages 15–28, 2006.
3. P.K. Dutta, J.W. Hui, D.C. Chu, and D.E. Culler, “Securing the Deluge Network
Programming System,” International Symposium on Information Processing in Sen-
sor Networks (IPSN), pages 326–333, 2006.
4. J. Jeong, and D.E. Culler, “Incremental Network Programming for Wireless Sen-
sors,” IEEE Sensor and Ad Hoc Communications and Networks (SECON), pages
5. J. W. Hui and D. Culler, “The Dynamic Behavior of a Data Dissemination Proto-
col for Network Programming at Scale,” In International Conference on Embedded
networked sensor systems (SenSys), pages 81-94, 2004.
6. S.S. Kulkarni, L. Wang, “MNP: Multihop Network Reprogramming Service for Sen-
sor Networks,” In IEEE International Conference on Distributed Computing Systems,
7. S.S. Kulkarni, and M. Arumugam, “Infuse: A TDMA Based Data Dissemination
Protocol for Sensor Networks,” In Conference on Embedded Networked Sensor Sys-
8. P.E. Lanigan, R. Gandhi, and P. Narasimhan, “Sluice: Secure Dissemination of Code
Updates in Sensor Networks,” In the 26th Intl. Conference on Distributed Computing
9. P. Levis, N. Lee, M. Welsh, and D. Culler, “TOSSIM: Accurate and Scalable Sim-
ulation of Entire TinyOS Applications,” In International Conference on Embedded
networked sensor systems (SenSys), 2003.
10. P. Levis, N. Patel, S. Shenker, and D. Culler, “Trickle: A Self-regulating Al-
gorithm for Code Propagation and Maintenance in Wireless Sensor Networks,”
In USENIX/ACM Symposium on Networked Systems Design and Implementation
11. P. Levis, and D. Culler, “Mate: A Tiny Virtual Machine for Sensor Networks,”
International Conference on Architectural Support for Programming Languages and
Operating Systems (ASPLOS), pages 85–95, 2002.
12. W. Li, Y. Zhang, J. Yang, and J. Zheng, “UCC: Update-Conscious Compilation for
Energy Efficiency in Wireless Sensor Networks,” In ACM Programming Languages
Design and Implementation (PLDI), 2007.
13. T. Liu, C.M. Sadler, P. Zhang, and M. Martonosi, “Implementing Software on
Resource-Constrained Mobile Sensors: Experiences with Impala and ZebraNet,” In
International Conference on Mobile Systems, Applications, and Services, 2004.
14. R.K. Panta, I. Khalil, and S. Bagchi, “Stream: Low Overhead Wireless Repro-
gramming for Sensor Networks,” IEEE Conference on Computer Communications
15. J. Polastre, R. Szewczyk, and D. Culler, “Telos: Enabling Ultra-Low Power Wire-
less Research,” IPSN’05, pages 364-369, 2005.
16. N. Reijers, K. Langendoen, “Efficient Code Distribution in Wireless Sensor Net-
works,” In ACM Workshop on Wireless Sensor Networks and Applications (WSNA),
17. J. Steffan, L. Fiege, M. Cilia, A. Buchman, “Towards Multi-Purpose Wireless Sen-
sor Networks,” In the 2005 Systems Communications, pages 336-341, 2005.
18. TinyOS website. http://www.tinyos.net/
19. MICAz Wireless Measurement System. http://www.xbow.com/.
20. Y. Yu, L. J. Rittle, V. Bhandari, and J. B. LeBrun, “Supporting Concurrent Ap-
plications in Wireless Sensor Networks,” In International Conference on Embedded
networked sensor systems (SenSys), pages 139-152, 2006.
21. X. Zheng, B. Sarikaya, “Code Dissemination in Sensor Networks with MDeluge,”
In Sensor and Ad Hoc Communications and Networks (Secon), pages 661-666, 2006.