Towards Improving TSCH Energy Efficiency: An Analytical Approach to a Practical Implementation

The IEEE 802.15.4-2015 standard defines a number of Medium Access Control (MAC) layer protocols for low power wireless communications, which are desirable for energy-constrained Internet of Things (IoT) devices. Originally defined in the IEEE 802.15.4e amendment, the Time Slotted Channel Hopping (TSCH) has recently been attracting attention from the research community due to its reduced contention (time scheduling) and robustness against fading (channel hopping). However, it requires a certain level of synchronization between the nodes, which can increase the energy consumption. In this work, we implement the Guard Beacon (GB) strategy, aiming at reducing the guard time usually implemented to compensate for imperfect synchronization. Moreover, besides presenting a realistic energy consumption model for a Contiki Operating System-based TSCH network, we show through analytical and practical results that, without the proposed scheme, the power consumption can be more than 13% higher.


Introduction
Energy efficiency is a mandatory requirement in the scope of Wireless Sensor Networks (WSNs), since these kind of networks are usually composed of battery-powered devices, whose batteries are not always easily replaceable [1,2]. For instance, one can mention either the lack of natural and economic resources or the harsh environments where many of such WSNs are placed as impairments for battery replacement [3]. Thus, it becomes of fundamental importance to spend efforts towards reducing the network energy consumption, extending its lifetime as much as possible [2].
The power consumption of massive Internet of Things (IoT) hardware is mainly attributed to the Microcontroller Unit (MCU) and to the transmitter/receiver chains. Many of the existing low-power radio transceivers typically operate with~30 mW when in the listening mode, with a slight consumption increase when transmitting. However, regardless of the operating mode, the transceiver-related consumption turns out to be much higher than the MCU consumption [4]. Moreover, the software implementation is usually optimized to keep the MCU sleeping when it is not required. However, low-power radios require energy-concerned Medium Access Control (MAC) protocols. Traditional MAC protocols, such as Carrier Sense Multiple Access (CSMA), require uninterrupted channel sensing and are consequently not suitable for energy-constrained devices, being capable of completely draining the devices' battery in a matter of days if not associated with Radio Duty Cycling (RDC) mechanisms [5]. on [22], an improved model with a more up-to-date set of time slots and states was proposed, also adopting more recent hardware and firmware, and whose output accurately matches the experimental results.  Contiki is a very popular OS within the community, since it has a low memory footprint, implements several standards, has a good hardware support and is backed by both industry and academia, with more than 2000 forks, almost 500 watchers and 3000 stars on its official GitHub repository [24] (Codebase: https: //github.com/contiki-os/contiki). Additionally, it has a TSCH and IPv6 over the TSCH mode of IEEE 802. 15.4e (6TiSCH) implementation [5], a full low-power IP networking (IPv6 over Low-Power Wireless Personal Area Networks (6LoWPAN), RPL, Constrained Application Protocol (CoAP), and Message Queuing Telemetry Transport (MQTT)) and tools for software-based energy estimation (Energest and Powertrace [25]). However, by employing the Contiki OS together with its Powertrace [25] and Energest power profile, one can notice that the energy consumption of the nodes on a TSCH-based network is significantly different from the analytical models from [22,23]. Additionally, as reported in [10], the guard time length needs to be carefully adjusted aiming at properly satisfying the inherent trade-off between reliability and energy consumption. Finally, to the best of our knowledge none of the aforementioned works proposed a beaconing mechanism focused on guard time reduction. Thus, the contributions of this paper are twofold: • We resort to the Guard Beacon strategy aiming at reducing the guard time of a TSCH-based network.
Our results indicate that the standard Contiki's TSCH implementation [24] power consumption is up to 13.05% higher than when our scheme is implemented; • We perform a set of measurements on the Contiki's TSCH timing, which allows us to provide a more updated set of time slots and states then the ones from [22], also including the Guard Beacon strategy. The model accuracy is verified by comparing the analytical results to the ones obtained from the Contiki's Powertrace and Energest tools, which presents a close match regardless of the guard time length or the packet sizes.
The rest of this work is organized as follows. Section 2 presents the IEEE 802.15.4.e standard and its operating principles. The proposed energy consumption model is presented in Section 3. Section 4 presents and discusses some analytical and experimental results for a Texas Instruments CC2650 Launchpad hardware platform. Finally, Section 5 concludes the paper.

Time Slotted Channel Hopping-TSCH
The Time Slotted Channel Hopping scheme is introduced in the IEEE 802.15.4e standard, aiming at increasing reliability and robustness [6]. In a TSCH-based network as the one illustrated in Figure 1, each transmitter-receiver pair is assigned with a fixed-size timeslot, in a Time-Division Multiple Access (TDMA) fashion that follows a predefined schedule. Moreover, there are N c = 16 independent channels available for communication, where the channel index f assigned to establish a connection is pseudo-randomly determined as where ch offset is a parameter that allows different channels to be used at the same timeslot for different slotframes, ASN stands for the absolute slot number (i.e., the total number of elapsed timeslots since the network establishment), N c is the number of available channels, mod is the modulo operation and F mapp is a lookup table that contains a predefined sequence of channels. A sensor node is then able to join a TSCH network after successfully receiving an Enhanced Beacon frame containing the following set of information: (i) the timeslot duration; (ii) the number of timeslots in a slotframe; (iii) synchronization-related data; (iv) the channel hopping sequence [6]. Each TSCH timeslot can be of six different types; namely [23]: TxDataRxAck (unicast transmission), TxData (broadcast transmission), RxDataTxAck (unicast reception), RxData (broadcast reception), Idle (indefinitely waiting for a frame) and Sleep (sleep mode). Figure 2 illustrates the unicast communication process by illustrating the TxDataRxAck ↔ RxDataTxAck transaction.  In the aforementioned transaction, the receiver initially waits the time period TsRxOffset and then turns its radio on. The upcoming phase is the Packet Guard Time (PGT), which lasts for a predefined amount of time, and has the purpose of encompassing possible synchronization issues. Note that the definition of PGT establishes a trade-off between error probability (which is reduced for large values of PGT) and energy consumption (which increases for large values of PGT). In case a frame does not arrive within the PGT period, the device goes to the sleep mode for the remainder of the timeslot. However, if a valid packet is received, the node waits TsTxAckDelay after receiving the last byte of the frame, and then becomes active to send an Acknowledgment (ACK) message to the transmitter.
The transmitter node, in turn, initially expends TsTxOffset preparing the data to be transmitted and properly configuring the radio parameters. After that, the radio switches on and starts sending the packet. After the transmission, there is a period of TsRxAckDelay where the transmitter is preparing to receive the ACK from the receiver node. Due to potential synchronization errors, there is also a transmitter-side Acknowledgment Guard Time (AGT), where the transmitter keeps waiting for the incoming ACK.
Usually, due to interference and consumption concerns, sensor nodes in WSNs operate under low duty-cycle policies, typically lower than 1% [23,26]. Thus, one could expect the devices to frequently be either in the Sleep or the Idle modes. As a result, regardless the fact that the power employed in Sleep/Idle modes is considerable lower than that in the active modes, the large amount of time spent in such states leads to an energy consumption that cannot be neglected [23]. Moreover, since the receivers do not know exactly when the transmitter will send a packet, they are expected to keep their radios active during the entire RxDataTxAck and RxData windows upon being assigned to those states, awaiting the predetermined PGT guard time. Thus, it becomes important to model the influence of PGT on both energy consumption and reliability, such that this parameter can be properly adjusted aiming at meeting the application requirements.

Energy Consumption Model
The availability of an analytical energy consumption model is an important feature that can guide network designers to properly define and adjust the network parameters, subjected to the application requirements. In a practical WSN implementation, however, although the energy consumption is fundamentally dependent on the MCU and the radio consumptions, the overall consumption model varies depending on the platform in use. In this sense, even though recent works have modeled the energy consumption of a TSCH-based network [22,23], their proposed models are valid to the OpenWSN OS only, not accurately estimating the consumption of a Contiki OS TSCH implementation running on a CC2650 hardware platform, as will be seen in the results presented in Section 4.
It becomes then important to evaluate the energy consumption of a Contiki OS-based TSCH network, since it is widely adopted in the WSNs scope [5,24].

Energy Consumption of a CC2650 Running Contiki OS
Contiki OS has a TSCH and 6TiSCH implementation [5], a full low-power IP networking (6LoWPAN, RPL, CoAP and MQTT) and tools for software-based energy estimation, namely Energest and Powertrace [25]. Energest tracks the time the hardware components become active, such as radio or MCU, and Powertrace is responsible for reporting those values. Upon having knowledge about the power consumption of each component, one can then estimate the overall device energy consumption.
Aiming at obtaining an analytical model for the power consumption, one needs to assess the timing of each hardware component for every type of slot. We then develop a General Purpose Input/Output (GPIO) state logic inside the TSCH DEBUG Macros from the Contiki TSCH implementation, which can be tracked by connecting a logic analyzer to the CC2650 (see Figure 3). The set S of all the possible logic states is shown in Table 1. Note that each state ∈ S has an associated number, which is equivalent to the binary number represented by the output pins.
We also define the set of slot types as T = {RxDataTxAck, RxData, RxIdle, TxDataRxAck, TxData, Sleep}, such that the average power consumption for a given type ∈ T is calculated as where M ∈ {Rx, Tx, CPU, Idle} is the set of consumption modes, T slot represents the total time of a TSCH time slot and E mode,type corresponds to the energy consumed for a given mode and slot type, being calculated as where V is the input voltage, I mode is the current drawn at each mode and T type,state,mode is the time spent at each mode for a given state and type pair. Note that a given type does not necessarily have all the states from S neither necessarily operates under all the modes from M. In this situation, T state,mode is set to zero. Considering that type(t) represents the type whose t-th time slot has been assigned to, one can calculate the average power consumption for each mode as where Q is the total number of time slots. Figure 4 illustrates the procedure adopted to measure the timing properties of a given type, in this particular case a RxDataTxAck, which consists of computing the timing of each mode within the states belonging to that type. Since there is a deviation between different measures of the same 3-tuple (type,state,mode) due to reasons, such as multiple code branches (i.e., different execution paths) and variable duration of an operation (e.g., waking up the radio), we performed several different measures per (type,state,mode) aiming at obtaining an average value.
The average measured values for all the possible combinations of (type,state,mode) are presented in Tables 2 and 3, always for T slot = 15 ms. The sets of states within each type ∈ T is presented in Table 4, sorted in chronological order of occurrence.
It is worth mentioning that such values are significantly different from the values obtained in previous works. Such a difference is depicted in Figure 5, which compares the values measured in this work to the standard timeslot model defined by the IEEE 802.15.4e amendment, as previously shown in Figure 2. For instance, the event 0xA shows that the CPU becomes active before expected (at the end of the TsTxOffset period). Moreover, the receiver also becomes active far before the start of the PGT period, which leads to considerable differences in the overall energy consumption calculations.

The Guard Beacon Strategy
Aiming at reducing the Guard Time without compromising the synchronization, the so-called Guard Beacon scheme was proposed [9]. This strategy consists of sending a burst of several beacons instead of just a single beacon. The optimal number of beacons is shown to be [9] N opt = t a P l T b P s , where · the nearest integer rounding function, t a = K T 2 s σ 2 f + σ 2 τ + σ 2 θ , T s is the beacon interval, σ f is the estimated deviation of clock drift rate, σ τ is the estimated deviation of message delivery delay, σ θ is the estimated deviation of clock offset, P l is the power consumption for idle listening, T b is the beacon duration and P s is the power consumption for data transmission.
The sending time of the nth beacon, with n ∈ {1, . . . , N opt }, is given by [9] x n = where erf −1 (·) corresponds to the inverse error function. According to [9], the GB strategy can reduce the synchronization power consumption by~40%. This motivates us to implement such a strategy over the TSCH beaconing system [27]. Since the beacons required by GB do not carry any additional payload, our implementation considers the use of only two bytes per beacon: one to identify the frame as a beacon and the second one to carry the beacon number.
However, due to setup-related issues, in our implementation the number of adopted beacons is fixed and equal to 3 GBs (Even though the time spent to send one byte is 32 µs, the radio API only returns from a transmission after~500 µs. Since the standard Guard Time for a 15 ms timeslot is 1800 µs, the number of beacons is then upper limited to 3 GBs). Although this number does not necessarily represent the optimal number of GB from (5), we will show in Section 4 that it provides significant energy savings when compared to the Single Beacon strategy.
Another particularity of our proposal is to anticipate the transmission of the first GB, in order to increase the probability that at least one out of the three GBs is received by all the (multiple) nodes of the network. The idea behind this proposal comes from fact that the clock drifts of a dense network may occur in opposite directions (i.e., +10 ppm for a node and −12 ppm for another node with respect to the network clock source, for instance). Figure 6 illustrates the GB implementation. Similarly to Section 3.1, we compute the timing for each mode within a state for the types belonging to the GB-based set of types T GB = {RxGB, TxGB}. The results are also presented in Tables 2 and 3. Thus, the global average power consumption of a TSCH Network with the Guard Beacon strategy can be calculated with the sum of (4) for every mode ∈ M and every type ∈ T ∪ T GB . It is worth mentioning that, if a platform different from the CC2650 running the Contiki OS is considered, the only adaptation needed is a new measurement campaign, in order to obtain the values from Tables 2 and 3 for the new hardware. Additionally, in Figures 7 and 8, a comparison between the standard timeslot model defined by the IEEE 802.15.4e and the measured timing is shown for TxGB and RxGB slots, respectively.  Regarding the scalability of our proposal, the effect of increasing the number of nodes can be neglected for the following reasons: (i) the frequency of Enhanced Beacons is the same for our scheme and the standard TSCH implementation. The difference is that instead of sending one EB we send three GBs on the same timeslot. Thus, our scheme is as scalable as the standard TSCH implementation; (ii) despite an increase in the network traffic, the energy consumption model would not be affected by increasing the number of nodes. Note that the energy consumption model takes into account the number of received and transmitted frames, such that it remains valid regardless the number of nodes.
After closely investigating the outcomes of the entire set of modes and slot types, we realize that an analytical model based solely on the IEEE 802.15.4e standard does not encompass some unexpected behaviors, such as: 1. In a TxData or TxDataRxAck slot, the radio was supposed to enter in a sleep mode after finishing the packet transmission; however, it remains active for approximately an additional period of 370 µs; 2. Although there is no incoming Ack in a TxData slot, the receiver remains active for about 298 µs; 3. Upon receiving a packet, the receiver unnecessarily remains active for extra~275 µs in a RxData slot, regardless of the size of the received packet; 4. The CPU remains active after the end of the timeslot for approximately 11.7 ms in the TxDataRxAck timeslot and about 9.76 ms for RxDataTxAck.
Thus, incorporating such odd behaviors into our energy consumption model plays an important role towards improving its accuracy, as we show in Section 4.

Performance Evaluation
This section presents some analytical and experimental results obtained from a 2-node Contiki TSCH Network using Texas Instruments CC2650 Launchpads. The simulation parameters are given in Table 5.  [4] 1 µA The two-node network generates a log with information regarding the TSCH operation, which gives us information about the total number of timeslots, and the number of slots of each type, which can be used to calculate the analytical global average power consumption from (4). The log also contains the Contiki's Powertrace and Energest tools' data, so that one can calculate the numerical global average power consumption. In what follows, two different scenarios are evaluated: the first one without the GB strategy while varying the EB period (TS); the second one with the Guard Beacon strategy with the same range of EB Periods.
The global average power consumptions for the two aforementioned scenarios while considering different EB transmission periods and the minimum achievable guard times are shown in Figure 9. As expected, it can be seen that the GB strategy improves the energy efficiency for all the EB transmission periods, since it can operate at lower guard times when compared to the standard Contiki's TSCH implementation. On the right axis, the amount of extra power spent by the standard TSCH implementation is shown. For instance, when TS = 60 s and the GB strategy is not in use, 13.05% more power is needed. Figure 10 shows the detailed average power consumption of mode ∈ {Rx, CPU} for TS = 120 s. The consumptions for mode ∈ {Tx, Idle} the are barely visible in this scale, so that we opt for omitting their legend. As one could expect from inspecting Figure 9 for TS = 120 s, the lowest possible power consumption occurs for the GB enabled scenario, with a Guard Time of 1000 µs. For a GB disabled scenario the most energy efficient scenario for the same TS occurs at 1800 µs, while consuming 12.67% more power than when the GB technique is in use. It can be seen that for the same guard times, both strategies have roughly the same CPU, Rx and overall power consumption. Again, the key factor that improves the energy efficiency is the lower guard times achieved by the GB enabled scenario.  The same analysis is shown in Figure 11, for TS = 60 s, where the standard TSCH implementation consumes 13.05% more energy than the GB enabled scenario. Moreover, as seen in Figure 9 for TS = 60 s, with the GB technique the system can operate with a 400 µs guard time, which results in an average power consumption of less than 1 mW, the most energy efficient among all the analyzed scenarios. Now, aiming at evaluating the accuracy of our analytical energy consumption model, we compare it with practical results. In Figure 12 we present the detailed average power consumption of mode ∈ {Rx, CPU} for TS = 60 s without the GB strategy implemented. It can be seen that there is a good match; however, the calculated overall power consumption is lower than the results obtained from the Contiki Powertrace tool. The same analysis is done in Figure 13, now with the GB technique in use. Again we see a good match, but with lower power consumption values obtained from the analytical equations.   In order to investigate the differences from Figures 12 and 13, the analytical and practical results of every mode for TS = 60 s are presented in Figure 14, for both Guard Beacon-enabled and disabled scenarios. We can draw some conclusions: 1. Corroborating the results from Figures 10 and 11, the power consumptions of each mode for GB On and Off scenarios are almost the same; 2. When the Guard Beacon strategy is implemented, energy savings can be achieved by considerably reducing the guard time; 3. The difference between experimental and analytical values is mainly due to the CPU power consumption, since the analytical model does not encompass the CPU states outside the TSCH code.    Finally, in order to illustrate the energy savings, in Figure 15 we plot the lifetime of a TSCH-based CC2650 Launchpad platform, powered by a 3000 mAh 3 V battery, for both GB enabled and GB disabled strategies. The same guard time interval is considered. It can be seen that, to the left of the dashed vertical line, only the GB enabled nodes can operate. Thus, the GB strategy can improve the lifetime by 12.93%, which means that a node would operate up to 48 days more when compared to a TSCH node that does not employs the GB scheme.

Conclusions
In this work we proposed a guard time reduction for the Contiki OS TSCH implementation by employing the Guard Beacon strategy. Additionally, an analytical model for the nodes' power consumption was derived. We compared the results obtained from the analytical equations and from the Contiki Powertrace tool, which supported the proposed model. Although the equations cannot predict the CPU power consumption outside the TSCH code, it was shown that the model has great accuracy for all the analyzed scenarios. The GB strategy improved the TSCH energy efficiency, since the power consumptions of each mode for GB On and Off scenarios are almost the same, but a guard time reduction up to 66.7% is provided, so that without the strategy the nodes would consume up to 13.05% more power. In terms of battery lifetime, the Guard Beacon approach provided a 48 days extension when considering a 3000 mAh 3 V battery, or 12.93% improvement on the lifetime.
As future work, the impact of the Guard Beacon strategy on the TSCH rendezvous process can be assessed, aiming at reducing the network joining time, which could lead to important energy savings. Additionally, the Guard Beacon strategy could be added to the schemes proposed in [8,14], increasing the energy efficiency even further. Moreover, multi-hop TSCH networks could benefit both from the schemes proposed in [11,13] and the Guard Beacon strategy, so that even lower guard times could be achieved, as well as lower EB sending rates.