1. Introduction
A typical wireless sensor network (WSN) consists of a head node with abundant computing and power resources and a large number of resource-constrained, battery-powered sensor nodes [
1,
2]. As the sensor nodes’ energy is strictly limited by the equipped batteries, minimizing their energy consumption is critical to the operation of the entire WSN; for instance, the lifetime of a WSN could be extended by up to 52% through the use of energy-efficient transmission algorithms and protocols [
3].
The number of message transmissions can be reduced by bundling several messages together and transmitting them in a common data frame or packet [
4,
5]. As data transmission modules consume the most energy [
6,
7], message bundling is considered an efficient technique for reducing the energy consumption of a sensor node [
8,
9]. However, message bundling not only increases the end-to-end (E2E) delay, but also reduces the synchronization accuracy [
10,
11,
12,
13,
14]. Various optimal message bundling schemes that investigate the relationship between message bundling and the E2E delay in the reduction of energy consumption have been proposed. However, in most of the work, the message bundling is considered together with, or as part of, other protocols and processes, such as routing [
8,
9], scheduling [
15], and query processing [
16]. Few of them focus on message bundling and its effect on energy consumption, both directly and independently.
In [
17], for the first time, we took into account time synchronization accuracy and E2E delays in optimal message bundling, where the energy consumption is indirectly minimized by maximizing the total number of bundled messages in a WSN through computationally feasible integer linear programming (ILP). Unlike most of the existing work, in this study, we purely focus on the optimal message bundling, independently from other protocols, such as routing and scheduling. Though the indirect minimization of the energy consumption dramatically simplifies the formulation of the optimal bundling, it cannot capture the negative effect of message bundling on the energy consumption, i.e., a higher probability of retransmissions due to the increased packet error rate (PER) [
6]. In this paper, we formulate the optimal bundling problem with a new objective function, thus directly modeling the total energy consumption of a WSN, to address the issue of the optimal message bundling scheme proposed in [
17], which takes into account both the positive and negative effects of message bundling on the energy consumption and, thereby, strikes the optimal balance between the number of bundled messages and the number of retransmissions given the link quality. We solve the resulting integer nonlinear programming (INLP) problem using a self-adaptive global-best harmony search (SGHS) [
18,
19].
As for the verification of the energy efficiency of message bundling schemes, the direct measurement of energy consumption through experiments with a real testbed would not be feasible because hardware-based energy measurement is too difficult to implement due to the significant number of modifications required for existing hardware [
20,
21] and the need for a dedicated circuit for the measurement [
22]. To make matters worse, the interconnection with measurement devices—such as oscilloscopes and digital multimeters—would make it challenging to guarantee that the targets are working under normal conditions. Emulation can provide an alternative solution in this regard; unlike simulation, emulation is based on software implementations (i.e., firmware in our case) that can run on original devices (i.e., WSN motes) without any modification, so experimental results from emulation are more convincing and credible than those from simulation. In addition, measuring energy consumption is more straightforward with emulation than with actual hardware. Therefore, in this paper, considering the diversity of WSN devices and the ease of measuring energy consumption, we verify the energy efficiency of the proposed bundling scheme through realistic experiments based on the Cooja emulator of Contiki-NG [
23].
The major contribution of our work in this paper is two-fold: First, we propose a new energy-efficient optimal message bundling scheme where we formulate the optimal message bundling based on an objective function modeling the total power consumption of the whole WSN. The proposed scheme, for the first time, enables us to directly minimize the energy consumption under the joint constraints of synchronization accuracy and E2E delay and to investigate the negative effects of message bundling—i.e., increased PER and the number of retransmissions—on the energy consumption. We also apply the advanced SGHS algorithm in order to solve the resulting INLP problem.
Second, we carry out a comparative analysis of the optimal bundling schemes, where we compare the energy consumption of the three different schemes—i.e., the proposed scheme, the ILP model of [
17], and the baseline of no bundling—based on the Contiki-NG and its Cooja emulator with eight different network topologies. We also calculate the power consumption of the three schemes based on a numerical analysis for the verification of the emulation results.
The rest of the paper is organized as follows: The objective function and constraints of the optimal bundling problem are described in
Section 2. The emulation process is discussed in
Section 3. The experimental results and related discussions are presented in
Section 4.
Section 5 concludes our work in this paper.
2. Energy-Efficient Optimal Message Bundling
In formulating the energy-efficient optimal message bundling problem, we consider a WSN consisting of one head node and
N sensor nodes. Each sensor node periodically generates a measurement message with length
during each measurement interval (MI). The length
of a packet bundling
messages at node
i (
) is given by
where
is the length of a packet header and, if it exists, a packet footer.
If node
i is not a leaf node and has
descendant nodes, as shown in
Figure 1, the period for generating a packet bundling
messages should be
from the conservation of traffic flows [
17]. Here, we assume that, at each non-leaf node, the messages of incoming packets are unbundled first and bundled again with the measurement messages generated at the node before being transmitted via outgoing packets.
2.1. Objective Function
Equation (
1) suggests that the energy-saving in message bundling mainly comes from the saved energy for
headers. To quantify the energy consumption in message bundling, we use the amount of energy required for the transmission of one
information bit based on the PER, i.e., the ratio of the number of unacknowledged packets to the total number of transferred packets, which is defined as follows [
6]:
where
is the energy consumption for transmitting one bit of data at a given output power level
.
can be obtained via
, where
, the transmission rate specified in the IEEE 802.15.4 standard, is 250 kbps. In [
6], the PER is empirically modeled as a function of the signal-to-noise ratio (SNR), i.e.,
where
= 0.0128 and
= −0.15. From Equations (
2) and (
3), we obtain:
The energy consumption for transmitting a packet bundling
messages at node
i is given by
Given the bundling number
and the number of descendant nodes
, the bundled packet transmission interval at node
i is given by
, during which the amount of energy
is consumed. Therefore, the average power consumption for packet transmission at node
i is given by
Note that the transmission of a bundled packet at a node causes the energy consumption for the reception of the corresponding packet at its destination node(s); there could be multiple destinations in the case of multicast and broadcast. However, the energy consumption for receiving a packet could be different from that for transmitting the same packet because the transceiver module in a typical WSN mote is designed with asymmetric current consumption. Considering this difference in current consumption for transmission and reception, we can obtain the average power consumption for packet reception at node
i under the assumption of a common supply voltage for all WSN nodes as follows:
where
is a ratio between current consumption for reception and transmission (i.e.,
) and
is a set of indexes of node
i’s child nodes. Therefore, the average power consumption at node
i is given by
As the average power consumption is stable and constant under periodic message generation at all nodes, we can minimize the energy consumption by minimizing the average power consumption. Therefore, we define the objective function of the energy-efficient optimal bundling problem as the total power consumption of the network, i.e.,
where
. Note that, if there are only
unicast transmissions in the WSN, Equation (
9) can be simplified as follows:
2.2. Bundling Constraints
Because 0 ≤ PER ≤ 1, the bundling number
in Equation (
3) with the values of
and
should satisfy the following condition:
In practical implementations, the maximum bundling number is also limited by the maximum payload length of the underlying protocols (e.g., 110 bytes in the IEEE 802.15.4 standard [
24]). Therefore, we constrain the bundling number
as follows:
where
is a user-defined minimum bundling number, which is typically 1, and
is the maximum bundling number determined by the ultimate payload length
and the message length
, i.e.,
2.3. Delay Constraints
While minimizing the energy consumption, we also need to meet the E2E delay and time synchronization accuracy requirements for time-sensitive applications and the proper operation of WSNs. In [
17], the joint constraints of E2E delay and time synchronization accuracy are formulated as follows:
where
is the E2E delay of node
i given by
is a user-defined E2E delay requirement, and
is another E2E delay requirement translated from the minimum time synchronization interval
through the function
, i.e.,
For detailed discussions on the joint constraints of E2E delay and time synchronization accuracy, readers are referred to [
17].
2.4. Integer Nonlinear Programming Model
With the objective function and the constraints in Equations (
10), (
12) and (
14), the energy-efficient optimal bundling can be formulated as the following INLP problem:
Note that, thanks to the objective function
modeling the total power consumption of the network, we can now directly minimize the energy consumption in the optimal bundling formulated in Equation (
17). The tradeoff of this direct minimization of the energy consumption is that, unlike the formulation in [
17], it results in the INLP problem. The details of the approach to solving the INLP problem will be discussed in
Section 4.1.
3. Cooja-Based Emulation
The rapid development of emulation technologies with ever-increasing computing power enables us to develop, run, test, and debug unmodified embedded software on our PC from chips to independent systems and complex multi-node networks. Unlike traditional network simulators, such as ns-2 [
25] and OMNeT++ [
26], an emulator can run firmware developed for physical devices (e.g., WSN motes), which eliminates the need for creating and maintaining separate simulation models, thereby resulting in credible experimental results [
27,
28]. Contiki-NG [
23] and TinyOS [
29,
30] are two popular operating systems (OSs) for WSN and Internet of Things (IoT) devices that provide emulators for the devices that they support.
Cooja is the emulator from Contiki-NG, the OS for next-generation IoT devices, which can provide a development and testing environment for WSN/IoT devices with a powerful graphical user interface (GUI) and network simulation capability [
23]. Cooja compiles Contiki-NG to a native platform as a shared library and loads the library via Java Native Interfaces (JNIs) to provide the loaded firmware with the same running environment as the actual devices (i.e., the emulation target). Experiments based on the Cooja emulator can enable more realistic investigations of the effect of optimal bundling on energy consumption than those based on network simulators. TinySim is an emulator from TinyOS, another competitive OS designed explicitly for power-constrained sensor nodes [
29,
30], but it is not comparable to Cooja in terms of features and functionalities, which is why even TinyOS developers use Cooja to run and test firmware developed with TinyOS.
Table 1 provides a short comparison between Contiki-NG and TinyOS.
Though Contiki-NG and TinyOS provide similar functionalities and protocol support, Contiki-NG has more active developer communities and abundant application scenarios from which one can expect more comprehensive technical support. Therefore, for the evaluation of the proposed optimal bundling algorithm, we chose Contiki-NG and Cooja.
One of the major strengths of Cooja is its ability to estimate the energy consumption of WSN motes without the actual deployment of a WSN; there are two options in this regard, i.e., Energest [
21], a Contiki-NG time recorder for energy estimation providing linear analysis mechanisms, and PowerTracker [
34], a Cooja plugin for energy monitoring. Of the two, because PowerTracker is tightly integrated into the Cooja emulator with the full support of a GUI, the energy consumption calculation is mainly based on the output from PowerTracker, while the data from Energest are used for cross-validation. As for the emulation target, the Z1 [
27,
35] platform is used to obtain reliable results from the energy consumption calculation based on the up-to-date and detailed data from its datasheet.
Table 2 summarizes the software and hardware components for the experiments based on the Cooja emulator.
Protocol Stack
Figure 2 shows the network protocol stack of the WSN motes based on NullNet, the minimal network layer of Contiki-NG [
36,
37].
We choose NullNet to minimize the effect of the complicated network layer protocols, including routing and encryption, in investigating the impact of message bundling on the energy consumption at sensor nodes, which ensures that most of the energy is used for bundled message transmissions. Likewise, in this paper, we also choose the simple carrier sense multiple access (CSMA) medium access control (MAC) protocol to isolate the effect of message bundling in our investigation of the energy consumption.
5. Conclusions
In this paper, we proposed a new energy-efficient optimal message bundling scheme for WSNs. Unlike the ILP model of [
17], where the energy consumption is indirectly reduced by maximizing the message bundling number, the proposed scheme directly minimizes the power consumption of sensor nodes by considering relayed traffic from descendant nodes, as well as self-generated traffic, under the same constraints of E2E delay and synchronization accuracy. We formulated the optimal message bundling problem based on the power consumption of the entire WSN as an INLP model, which can take into account both the positive and negative effects of message bundling on the energy consumption, including packet retransmissions, and used SGHS to find an optimal solution. The experimental results based on the Cooja emulator of Contiki-NG demonstrate that the proposed optimal bundling scheme saves up to 51.8% and 8.8% of the total energy consumption with respect to the baseline case of no message bundling and the state-of-the-art ILP model of [
17], respectively.
As a future extension of the current work, it is worth investigating an alternative formulation of the energy-efficient optimal bundling problem that enables analytical approaches (e.g., convex optimization), possibly with the approximation of the nonlinear objective function, given the complexity of the INLP model based on the nonlinear objective function for sensor nodes’ energy consumption and the solution procedure based on SGHS.