Energy Efﬁciency and Payload Size Optimization for Wireless Sensor Networks Employing Convolutional Coding

—This paper studies the impact of the payload size in the energy efﬁciency of a point-to-point link in a wireless sensor network using convolutional codes. Two channel models are considered to represent distinct conditions with respect to the severity of the fading: AWGN, which only accounts for the large-scale effects; and Rayleigh, encompassing both small-scale and large-scale effects in a scenario without line-of-sight. In this context, signal-to-noise ratio, code rate and the payload size are optimized. The numeric results obtained through simulations show that there is an optimal payload size, which depends on the transmission range, and provides gains in the overall energy efﬁciency. More importantly, these energy efﬁciency gains obtained by the optimization of the payload size are higher than those observed by the optimization of the SNR and code rate, and more present in shorter transmission distances. Finally, results also show that different optimal values are obtained if the optimization problem focus on minimizing the energy consumption or maximizing the energy efﬁciency.


I. INTRODUCTION
Typically, the development of wireless communication systems over the past years focused on performance improvements based on increasing the data transmission rate, at the cost of higher energy consumption [1].Wireless sensor networks (WSNs), as well as the growing development of the Internet of Things (IoT), have significantly contributed to bring the energy efficiency as one of the main focus in modern communication solutions, given that environmental and economic motivations converge in these scenarios dominated by batterypowered devices [2].
Moreover, most wireless sensor devices employ some forward error correction (FEC) technique, which brings reliability gains at the cost of higher energy consumption.As a matter of fact, the choice for a given coding technique directly impacts the energy efficiency [3].One of the most common FEC schemes is the BCH code, which is a generalization of the Hamming code and is flexible enough to provide a large set of code rates [4].For instance, [3] analyzes the energy consumption of WSNs by taking the transmit power, RF circuitry and baseband operations for coding and decoding into account.Then, the BCH encoding is employed to allow the optimization of the code rate in conjunction with the proper adaptation of the signal-to-noise ratio (SNR).In addition, an energy efficiency analysis can be found in [5], which also employs BCH codes, but with fixed code rate, once the goal is to optimize the payload size.However, the analysis in [5] did not consider the power consumption of the circuits to transmit and receive.
Convolutional codes are also widely employed in practical communication devices due to their capability of improving reliability, with affordable encoding/decoding complexity [4].For instance, many commercial solutions already implement hard-decision convolutional encoders [6]- [8], which offer a good compromise between complexity and error correction efficiency [9], especially in WSNs for which low energy consumption and low computational complexity are highly desirable.Then, an optimization goal similar to [3], [5] can be found in [10] employing convolutional codes, further extended in [11] in order to consider multiple hops.Moreover, the study in [10], [11] focus on an underwater transmission context, which brings several different characteristics when compared to the wireless terrestrial transmission, leading to different results in terms of the system optimization.However, let us remark that the focus of [3], [10], [11] is on the minimization of the energy consumption, which is not necessarily the same as to maximize the energy efficiency, which balances energy and throughput in a single metric.
In addition, the correction capability of the employed FEC is often not enough, and it becomes necessary to combine retransmission techniques to the FEC codes, usually known as hybrid automatic repeat request (HARQ) schemes [12].In the literature, some examples studying the energy efficiency of HARQ employing convolutional codes can be found in [13]- [15].However, the RF circuitry energy consumption and the baseband processing are not considered by these works.Furthermore, the energy efficiency of some different HARQ techniques are studied in [16] in the Nakagami-m channel, which shows that code rate optimization is critical to maximize the energy efficiency, while the use of HARQ substantially extends the communication range.
However, we observe that little has been devoted to the investigation of an optimal payload size in order to maximize the energy efficiency.In the literature, we can find some examples devoted to specific scenarios, as in [17]- [20].For instance, [17] considers a wireless body area network (WBAN) and optimizes the payload size in order to maximize the energy efficiency of cooperative and non-cooperative techniques, given the specific channel characteristics of WBANs.Moreover, a cognitive radio (CR) network for IoT is investigated in [18], focusing on more specific challenges such as the overhead energy consumption due to channel sensing and channel handoff.Then, the authors propose low complexity algorithms in order to find the optimal packet size that maximizes the energy efficiency in such context.In a smart grid scenario, the work in [19] optimizes the packet size focusing on a prolonged network lifetime and energy efficiency.In addition, the authors in [20] study a slotted IEEE 802.15.4 network, addressing multiple access issues to optimize the payload size.Common to these works is that the energy consumption is modeled according to the channel capacity, which implies in theoretical capacity-achieving FEC codes.Nevertheless, as previously discussed, the encoding/decoding processing costs should not be left out of the energy consumption budget, as in [17]- [20].
In this paper we study HARQ techniques employing convolutional codes in a WSN.Unlike previous works (e.g., [3], [5], [10], [13]- [16]), the focus is to optimize the payload size in order to maximize the energy efficiency, in a scenario that also allows optimizing the code rate of the convolutional codes, as well as the SNR of the transmission link.Moreover, unlike [5], [17]- [20], the energy consumption model used here considers the transmission cost of the RF electronic circuits, the cost of encoding and decoding the frames using practical FEC codes, as well as the possibility of retransmissions.In addition, trying to represent scenarios with different characteristics regarding the severity of the communication link, two models are considered for the channel: AWGN and Rayleigh.
Our results show that there is an optimal payload size that maximizes energy efficiency, which depends on the transmission range of the link.Moreover, larger optimum payload sizes are observed for AWGN channels compared to Rayleigh.In addition, we also show that the optimization of the payload size plays a major role into the energy efficiency optimization, with the increase in the energy efficiency of the system being higher than that observed by the optimization of the SNR and the code rate, and more relevant in shorter transmission distances, typical for the WSNs taken in consideration.Finally, we also compare two optimization goals: i.) to maximize the energy efficiency; and ii.) to minimize the average energy consumption.As a result, different optimal values are obtained for these two cases, since the energy efficiency metric also takes the data rate into account, so that there is a tradeoff between increasing power to increase the throughput, and decreasing power to decrease the energy consumption.
The remainder of this paper is organized as follows.Section II presents the system model, while the energy consumption is discussed in Section III.Section IV presents the proposed joint optimization of the SNR, code rate and payload size, and Section V brings some simulation results.Finally, Section VI concludes the paper.

II. SYSTEM MODEL
In this section we discuss the wireless communication model, as well as the employed FEC codes.Moreover, two channel models are considered: i.) AWGN, which describes a virtually static communication scenario in which fading is actually disregarded; and ii.) fast-fading Rayleigh distribution, in which the channel randomly changes for each information symbol of the transmitted frame.The fast-fading assumption is motivated by frequency hopping techniques [21], which are typical in, e.g., ZigBee devices [22].

A. Wireless Communication Model
Let us consider a point-to-point communication between two nodes through a wireless link.The frame received by the destination can be written as [21] where P denotes the transmit power, κ is the path-loss, x is the unit variance vector of transmitted symbols, and w is the additive white Gaussian noise.Moreover, h denotes the channel fading coefficient, with zero-mean and unit variance; in which h = 1 for the case of the AWGN channel, or follows a Rayleigh distribution otherwise.Following a log-distance path-loss model, κ is given by [21] where d is the distance between the transmitter and the receiver, α is the path-loss exponent, and A 0 is a constant that encompasses the total antenna gain G, the wavelength λ = 3 • 10 8 /f c , with f c being the carrier frequency, the link margin M l and the noise figure at the receiver N f .Then, the instantaneous SNR at the receiver can be written as such that γ = κP σ 2 w represents the average SNR, where σ 2 w = N 0 B is the noise power, with N 0 being the thermal noise unilateral power spectral density and B the system bandwidth.
Moreover, since many existing RF devices targeting lowpower and low data rate applications employ binary modulations [8], [23], [24], we focus our analysis to the case of binary phase-shift keying (BPSK) in order to write the bit error rate (BER) of the system.Then, in the AWGN channel the BER is given by [25] in which erfc represents the complementary error function, defined as erfc(z function of |h| 2 and has an exponential distribution [27] with average γ and probability density function (pdf) defined by Thus, the BER in Rayleigh fast-fading considering a BPSK modulation is given by [25]

B. Forward Error Correcting (FEC) Codes
In order to improve performance in the wireless communication link, it is common to employ FEC codes to reduce the BER.As in commercial devices such as [8], [23], we employ convolutional encoding.Thus, we define r = k/n as the code rate, representing that k information bits are encoded into n coded bits, with n−k representing the number of redundant bits.Moreover, we assume that each frame is modeled according to Fig. 1, being composed of an overhead for control and synchronization that lasts the equivalent of O bits periods, of H bits of header, and of L bits of payload.In addition, since the header is usually very small compared to the payload, we follow [3] and consider that only the payload is encoded, being divided into rL bits of data and additional (1 − r)L bits due to encoding.
Therefore, following [25] we can write the frame error rate (FER) of the communication using convolutional codes as where P b (γ) is the BER of the uncoded transmission, given by either (4) or ( 6), and P e (γ) is the BER of the payload after decoding, which can be bounded by [25] in which β δ is the information weight of the codewords that are at a distance δ of the all zero codeword and δ free is the minimum distance of the code.Finally, P 2 is the error probability of the maximum likelihood decoder, given by [25] , if δ is even.
(9) Moreover, we consider that each packet transmitted in the forward direction is followed by a feedback packet composed of F bits, informing whether the decoding was successful or not, and which also allows the request for retransmissions [21].
In order to simplify the mathematical analysis, we consider that retransmissions occur until a frame is successfully decoded 1 and we denote the number of transmission attempts by τ , which is a random variable whose average value can be written as [3] Finally, the average transmit time for each bit sent in the forward direction can be written as [3] where R b denotes the bit rate, while the feedback time per payload bit is

III. ENERGY CONSUMPTION
In this section we first start with the energy consumption associated with RF operations at the transmitter in Section III-A, followed by the energy consumed by encoding/decoding operations in Section III-B.Moreover, Section III-C computes the average total energy consumption, while the energy efficiency is defined in Section III-D.

A. Energy Consumed at the Transmitter -RF
Initially, we assume that the transmitter is in a low energy consumption mode and it has to be initialized prior to make any transmission.Then, we denote by ε st the total energy spent at this step.Moreover, the energy spent by preprocessing operations of each bit in the forward direction can be written as a function of the average transmit time, so that where P el,tx denotes the power consumption of the RF electronic components at the transmitter.
Similarly, the electromagnetic radiation energy consumption of each bit can be written as a function of the power consumption of the power amplifier (PA), denoted by P PA , and the average transmit time.Thus, where P PA = ξ/η P is a function of the transmit power (P ), the peak-to-average power ratio (PAPR) at the PA output (ξ), and the drain efficiency of the amplifier (η), typically in the order of 35% for class-B PAs [28].Then, in terms of the average SNR at the decision stage of the receiver, we can rewrite P PA as [3] recalling that A 0 is a constant in (2).Finally, each feedback frame lasts F/R b seconds, during which the RF electronic components of the transceiver consume P el,rx Watts, so that the energy per bit used to decode a corresponding feedback frame is [3]

B. Energy Consumption for Encoding and Decoding
At the encoder side, each encoding procedure involves J different types of arithmetic operations, consuming ε j Joules and being executed υ enc j (r) times during the employed encoding algorithm.Considering that the encoding is performed for the rL bits of data and that the calculations are executed by a arithmetic processing unit (APU), the energy consumption of the j-th operation is modeled by [29], so that ε j = V dd I 0 ∆t j (17) in which V dd is the operation voltage, I 0 is the average current during the execution of the arithmetic calculations, which depends on the operation frequency f APU , and ∆t j is the time needed to execute the j-th operation, defined in terms of the number of clock cycles (c j ) as ∆t j = c j /f APU , yielding [3] Similarly, the energy consumption for decoding, ε dec , can be obtained based on (18) simply replacing υ enc j (r) by υ dec j (r).The operations required by the encoder usually involve a set of binary additions.Then, denoting the memory order of the convolutional encoder by ν we can write [4] which is many times less than the order of magnitude of the operations required for decoding [10], as follows.
At the decoder, we consider the hard-decision Viterbi algorithm, which is a maximum likelihood algorithm with low complexity [4].The Viterbi algorithm requires a set of binary comparisons, additions and integer comparisons, whose number of operations, considering a conventional trellis, are respectively given by [30]

C. Average Total Energy Consumption
Considering the elements defined in Sections III-A and III-B, here we define the average energy consumption of the point-to-point communication, considering both transmitter and receiver sides.Starting with the transmitter we have that which already takes the energy consumption to receive the corresponding feedback frame into account.Moreover, notice that start-up and encoding procedures are done only once per information packet, while the energy consumption of the electronic components, the PA and to process the feedback frames depends on the number of transmission attempts.Similarly, we can write the energy consumption at the receiver as where baseband processing is required at each transmission attempt, so that all terms except ε st are multiplied by τ .Then, defining P el = P el,tx + P el,rx as the total power consumption of the electronic components to simplify the notation, we can write total energy consumption ε b = ε tx + ε rx as being (24) whose average value depends on the average of τ , given by (10), so that the average total energy consumption yields

D. Energy Efficiency
We define the energy efficiency as the ratio between the system throughput, in bps/Hz, and the average total energy consumption, in J [2].Thus, written in terms of bits/J/Hz.The system throughput is associated with the effective transmission rate of information (corresponding to the rL bits of information of the payload).Therefore, we define Then, combining ( 25) and ( 27), after a few algebraic manipulations, we have that Codes from [31] 5: while cod ≤ |Rn| do 6: Input: r, ν 7: Compute Pf(γ), using (7) 8: Compute εb using ( 13)-( i ← 1; γi ← 0; η EE ← 0 initialization 10: while (γi ≤ γmax) do

IV. OPTIMIZATION OF THE SNR, CODE RATE AND PAYLOAD SIZE
Our main goal is to maximize the energy efficiency of the system.To that end, we jointly optimize three system parameters: the SNR, the code rate and the payload size.Let us remark that the optimization of the energy efficiency is different from previous works in the literature, as e.g.[3], [10], which focus on the minimization of the average total consumed energy.In order to investigate the impact of the differences between both approaches, we propose an algorithm to maximize η EE in Section IV-A, while for comparison purposes we formalize the minimization of εb in Section IV-B.

A. Maximization of η EE
First, let us denote the family of codes with the same n by R n , and the set of possible payload sizes by L.Then, the optimal SNR for a given code with rate r ∈ R n , payload size L ∈ L, communicating at a distance d between the transmitter and the receiver can be written as where we consider that the nodes are constrained by a peak power limit denoted by P max , which implies in a maximal SNR Then, using the set of optimal SNRs given by ( 29), we can obtain the optimal code rate for a codeword with payload size L ∈ L as Finally, the optimal payload size, which is a function of the transmit distance d, is given by The detailed operation of the optimization can be found in Algorithm 1.As we can observe, the optimization receives as inputs R n , L, γmax , and d, which is followed by the computation of the FER (line 7) and the total energy consumption (line 8).Then, the first optimization loop is to compute the energy efficiency as a function of the SNR, so that the optimal γ is obtained in line 13, which is a function of r, L and d.Next, we compute the average number of transmission attempts (line 19) and the average total consumed energy (line 20), using the optimal SNRs set.In the sequence, the optimal code rate r is obtained in line 24, which is a function of L and d.Finally, the optimal payload size L is obtained as a function of the transmit distance in line 38.
Notice that lines 22 and 33 establish the stop criteria d max and L max , which depend on the particular scenario of interest.Finally, let us remark that the computational cost involved in the proposed algorithm is very low, since in practice the sets L and R n are of small size.Therefore, the proposed optimization may run in real-time in devices with limited hardware resources.

B. Minimization of εb
For the sake of performance comparison, let us consider the optimization of the SNR, the code rate and the payload size in order to minimize εb , similar to the frameworks in [3], [10].Then, we can first write the optimal SNR that minimizes the energy consumption as while the optimal code rate for a codeword with payload size Finally, the optimal payload size as a function of the transmit distance is given by  Let us remark that the optimization procedure is similar to that in Algorithm 1, replacing η EE by εb accordingly.

V. NUMERICAL RESULTS
In this section we present some numerical examples to show the impact of the joint optimization of the SNR, code rate and payload size in a WSN scenario.The employed system parameters are listed in Table I, for which we emphasize that additions and comparison operations, both integer and binary, are assumed to use only one processor clock.Moreover, for the cases where the payload is not optimized, we consider that L = 1024 bits.In addition, we employ the set of convolutional codes with ν = 6 listed in [31], which provides a wide range of practical code rates.

A. Optimization of the SNR and Code Rate
First, Fig. 2 shows the energy efficiency as a function of the SNR for AWGN and Rayleigh channels, without the optimization of the code rate and payload size.Notice that, at low SNR, a higher number of transmission attempts becomes necessary until decoding is successful, so that the energy efficiency is very small.On the other hand, at high SNR, the number of retransmissions is small; however, the energy consumption is high due to the increased irradiated power.If we look at the SNR that minimizes the energy consumption, as in [3], we obtain slightly different optimal SNRs, as Fig. 3 shows for an identical scenario.To better visualize these differences, Fig. 4 plots the optimal SNR that maximizes the energy efficiency (γ ), in red, and that which minimizes the energy consumption (γ ), in blue.As we can observe, γ is slightly higher than γ due to the fact that the energy efficiency also takes the data rate into account, so that there is a trade-off between increasing power to increase T in (27), and decreasing power to decrease εb in (24).Moreover, we can also observe that, for the same code rate, the optimal SNR is lower for the AWGN channel than for Rayleigh.The practical implication of the difference observed in Fig. 4 is that increasing the transmit power a little bit beyond Code Rate (r) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Optimal SNR [dB]
the point that is optimal in terms of energy consumption is actually better, since it allows to transmit more bits with the same amount of Joules, which may be counterintuitive.Such conclusion is interesting since many approaches in the literature rely on minimizing the energy consumption as a means to increase the energy efficiency.However, Fig. 4 shows that these two approaches are not the same.
Yet, it is also worth noting that the optimal SNR depends on the employed code rate.For instance, Fig. 5 plots the optimal SNR (considering both γ and γ ) as a function of r for AWGN (left) and Rayleigh (right).As the figure highlights, there always exists a pair (γ, r) that must be jointly optimized to either maximize η EE or minimize εb .Fig. 6 complements this analysis by plotting γ as a function of d for different fixed code rates.Moreover, the cases with the joint optimization of (γ , r ) and (γ , r ) are also shown.As we can observe, as γ decreases with d, r also decreases to compensate a higher average number of retransmissions, as we will show in the following, which is an attempt to counterbalance the costs associated with the irradiated power and the electronic components power consumption.
The average number of retransmissions, τ , is illustrated by Fig. 7 in the case of the joint optimization of (γ , r ) and (γ , r ).As we can observe, τ increases with the transmit range, but it remains lower than two up to d = 500 m, for both optimization goals.It is worth noting that τ is not a strictly increasing function with respect to d since the system conditions are not exactly the same for every point of Fig. 7, which makes the analysis more complex since the optimal code rate and SNR are constantly being adapted, which reflects in different average number of retransmissions.For example, looking at the optimization of η EE in the Rayleigh channel we observe a seemingly unexpected decrease in τ when d increases from 150 m to 200 m.This occurs because the optimal SNR decreases smoothly from 5.8 dB to 5.2 dB in this part of the curve, while the optimal code rate decreases  more abruptly from r = 2 3 to r = 1 2 .Similarly, when d increases from 350 m to 400 m, γ decreases from 5 dB to 4.8 dB, while r decreases from 1  2 to 1 3 .Therefore, we can conclude that the oscillations in τ are usually associated with the choice for a new optimal code rate.
Next, Fig. 8 shows the throughput (T ) and the average energy consumption (ε b ) as a function of d for AWGN and Rayleigh channels.In both cases, γ and are optimized, while the payload size is fixed at L = 1024 bits.As the figure shows, the throughput decreases faster for the Rayleigh channel than for AWGN, while the average energy consumption increases similarly for both channels.Therefore, we observe that there are two simultaneous drawbacks in terms of energy efficiency in the Rayleigh channel, once both the transmit power and the number of retransmissions increase with the distance, while τ is more or less constant for the AWGN channel, and only the transmit power increases with d.

B. Optimization of the Payload Size
Fig. 9 illustrates the effect of the payload size in the energy efficiency of the system, with d = {100, 300, 500} m.As it can be observed, there exists an optimal payload size for each transmit distance, which changes depending on the channel severity (AWGN or Rayleigh).The average energy consumption as a function of the payload size displays a similar shape, with an optimal payload size for each transmit distance, whose curves we omit here for the sake of brevity.Instead, we plot in Fig. 10 the optimal payload size that maximizes the energy efficiency, L , as well as the optimal payload size that minimizes the average energy consumption, L , as a function of the transmit range.As we can notice, both L and L decrease while d increases in case of the AWGN channel, while the optimal payload sizes have a more complex interaction with the SNR and the code rate in the case of the Rayleigh channel.It can be also noticed that η EE is maximized for larger values of L in the AWGN than in the Rayleigh channel, which is due to the less severe environment which makes retransmissions less often.When d > 250 m, L becomes approximately constant, with 448 bits for Rayleigh and 1728 bits for AWGN, while for the same transmit range L is much larger for Rayleigh but is the same 1728 bits the for AWGN channel.It becomes clear that the optimization objective plays a great role in the optimum payload size determination in the case of a Rayleigh fading channel.Finally, Fig. 11 plots the energy efficiency as a function of the distance between the transmitter and the receiver for AWGN (top) and Rayleigh (bottom) considering three optimization scenarios: i.) full optimization of η EE , choosing the best SNR, code rate and payload size; ii.) optimization of the SNR and code rate, with fixed payload size at L = 128 bits; iii.) optimization of the SNR only, with code rate fixed at r = 2/3 and payload size fixed at L = 128 bits.The payload size of 128 bits is considered here based on the IEEE 802.15.4 standard [32].As we can notice from the figures, the optimization of the code rate is more significant to improve the energy efficiency for shorter transmission distances, especially in the Rayleigh channel where such improvements are significant up to a link distance of d = 100 m.Nevertheless, the optimization of the payload size can be observed as even more important in terms of the energy efficiency, and for relatively short transmit ranges for both channels.Moreover, it is also important to highlight the difference between the scales of both figures, given that the energy efficiency in Rayleigh is considerably smaller than in AWGN.

VI. CONCLUSIONS
This paper studied the impact of the payload size optimization in a WSN scenario.The employed simulation framework considers the power consumption for packet transmission, of the electronic circuits associated with RF signals, and the baseband energy consumption for coding and decoding.In addition, different scenarios were considered in which SNR and convolutional code rate optimization, combined with the adaptation of the payload size, are allowed.The results show that there is an optimum payload size that maximizes energy efficiency, which depends on the transmit range and the channel model, where η EE is maximized with larger values for L in the AWGN compared with the Rayleigh channel.Moreover, the optimization of L brings an expressive increase in the energy efficiency of the system, higher than that observed by SNR optimization and code rate, and more relevant in shorter transmission distances, which are the typical ranges of WSNs.

Fig. 5 .
Fig. 5. Optimal SNR as a function of the code rate for link distances of d ∈ {50, 200} m, considering AWGN and Rayleigh channels, in the cases of optimization to maximize the energy efficiency and to minimize the energy consumption.

Fig. 8 .
Fig. 8. Throughput (T ) and average energy consumption (ε b ) as a function of d for AWGN and Rayleigh channels.

Fig. 11 .
Fig.11.Energy efficiency for AWGN and Rayleigh channels with: i.) full optimization: SNR, code rate and payload size; ii.) optimization of the SNR and code rate with payload size fixed at L = 128 bits; iii.) optimization of the SNR with code rate fixed at r = 2/3 and payload size fixed at L = 128 bits.
Algorithm 1 Optimization of the SNR, Code Rate and Payload Size Input: Rn, L, γmax, d 1: l ← 1 index for the set of payload sizes 2: while l ≤ |L| do Fig. 7. Average number of retransmissions considering the joint optimization of the SNR and code rate, for AWGN and Rayleigh channels, with a fixed payload of L = 1024 bits.