Synchronising Energy Harvesting and Data Packets in a Wireless Sensor

: We consider a wireless sensor node that gathers energy through harvesting and reaps data through sensing. The node has a wireless transmitter that sends out a data packet whenever there is at least one “energy packet” and one “data packet”, where an energy packet represents the amount of accumulated energy at the node that can allow the transmission of a data packet. We show that such a system is unstable when both the energy storage space and the data backlog buffer approach inﬁnity, and we obtain the stable stationary solution when both buffers are ﬁnite. We then show that if a single energy packet is not sufﬁcient to transmit a data packet, there are conditions under which the system is stable, and we provide the explicit expression for the joint probability distribution of the number of energy and data packets in the system. Since the two ﬂows of energy and data can be viewed as ﬂows that are instantaneously synchronised, this paper also provides a mathematical analysis of a fundamental problem in computer science related to the stability of the “join” synchronisation primitive.


Introduction
New applications of information technology such as the smart grid, remote and unattended sensors for monitoring or security [1,2] require that computation and communications occur without human intervention to replace batteries and without using the power mains, while spam and network attacks exacerbate the use of energy [3] in communications.At the same time, the consumption of electricity by ICT worldwide in 2012 exceeded 4.7% of the total consumption of electricity and approached 1.7% of the worldwide CO 2 emissions [4].Thus there is a strong motivation in thrift energy use for ICT and also to rely increasingly on energy harvesting [5,6], which can occur from mechanical vibrations, heat capture and the use of ambient natural or artificial light.
Thus this paper focuses on computer communication nodes whose energy needs are met by a combination of rechargeable storage batteries (or capacitors) fed by energy harvesting, together with a possible connection to the mains as a back-up when the harvesting cannot take place and the batteries are depleted.Much work in recent years has been devoted to energy savings and energy harvesting in wireless communications [7][8][9][10].Smart techniques have been suggested to adapt transmission to the energy and channel conditions so as to save energy and adapt the transmission power cooperatively so as to minimise the energy consumption per successfully transmitted packet [11][12][13][14][15][16].Specifically in this article we study a node that has a data storage backlog (i.e., "data buffer") and has an energy storage device (i.e., "energy buffer").
The arrival of energy and of data packets to the nodes are both random processes: energy flows in at random through energy harvesting.Data accumulates into the node, also at random, through sensing.Just like data is measured in terms of discrete data packets, energy is also quantified or measured in discrete units of "energy packets" [17][18][19], so that an energy packet is defined as the minimum amount of energy needed to transmit a single data packet.Ideally the energy flow into the device, expressed as discrete units of energy per unit time, should somehow balance the flow of data packets that are being generated and then assembled (for instance based on sensing) so that packet transmission is not held up.Thus energy harvesting should ideally match the needs of the data transmission workload.
However, within this framework we show the counterintuitive result that if the flows of energy and of data packets are exactly balanced, the system exhibits an unstable behaviour such that both the backlog of packets and the amount of stored energy saturate their respective buffers while the effective work carried out by the transmitter tends to zero.We also derive results concerning the performance of the system when the energy and work flows are unbalanced.In reality, all buffers are of finite capacity, so we thoroughly study the finite capacity case.This paper presents a complete analysis of this problem and in the process, we address a fundamental problem in computer science regarding the stability of the join synchronisation primitive [20][21][22] when the synchronisation time is negligibly small.This can also to apply to situations when data packets from voice or video arrive from the same source, but over distinct paths in a network, to an output Codec (decoder) at a receiving node or end user, and need to be synchronised and re-ordered before they are delivered to the end user [23].

System Model
Consider a system that at some time t contains K(t) packets to transmit and M (t) energy packets in its storage.We use the term "energy packet" [17,18] along the terminology developed in some recent work where energy is assumed to be composed of discrete units.We assume that an energy packet is exactly the amount of energy needed to transmit a data packet.Assume also that the system has a data buffer of size B data packets, while its energy storage device can store up to E energy packets.The state of the system is then described by the pair (K(t), M (t)) and we shall be interested in its probability distribution p(n, m, t) = P r[K(t) = n, M (t) = m)], which will be analysed using standard methods that are usually associated with queueing networks [24,25].
The formation of packets and their placement in the packet buffer is assumed to follow a Poisson process of rate λ while the energy packets are also assumed to arrive at random into the energy storage device (e.g., a capacitor or rechargeable battery) as a Poisson process of rate Λ.Note that Λ would correspond to some rate of a joules per second, where a is the number of joules required to transmit one packet.
In such electronic systems, the rate at which energy is harvested is slow compared with the rate at which packets can be transmitted by the electronic device.For instance, it may take many milliseconds to get enough energy from the harvester while it may just take a few microseconds, or more likely a few nanoseconds, to transmit a packet.Similarly, in such a device the rate at which packets are formed must not exceed the rate at which energy is being harvested.Note that an energy packet is exactly the amount of energy needed to transmit a packet.We can assume that if the energy needed is available, the time needed for the transmission of a packet is negligible compared with the inter-arrival times of energy packets and data packets to the device.As a consequence, if the system perchance enters some state (K(t), M (t)) with K(t) > 0, M (t) > 0, then it will instantaneously (in zero time) transit to the either the state (0, Thus we only need to consider for p(n, m, t) the state space S of pairs of integers (n, m): S = { (0, 0), (n, 0), (0, m) : n > 0, m > 0 } (1)

The System without Energy Storage
Consider a system that stores packets in buffer of infinite capacity but has no means to store energy such that if energy is harvested but not immediately consumed, it is immediately lost, i.e., E = 0.In this case, the data buffer behaves as a queue with Poisson arrivals, and exponentially distributed service times of rate Λ [26].Note that in this case, the arrival corresponds to the data packets, while the "services" are in fact the arrivals of energy packets.We have also assumed that the transmission time of a data packet, typically in nanoseconds, is extremely short compared with the other times involved (packet inter-arrival times for both data and energy packets), since both the data gathering or sensing process and the energy harvesting process will take much longer.For instance, if sensing is related to temperature, we will be dealing of successive minutes before a change of temperature is sensed, and if we are sensing human movement we would need tens of milliseconds to note any changes due to the speed at which people move.Energy harvesting will also be relatively slow simply because of the very minute amount of energy that can be collected.
Thus, if Λ ≥ λ, the throughput of data packets is simply the arrival rate of packets.Furthermore, when Λ > λ, then the data packet buffer will have a queue length b(t) whose probability distribution p d (n, t) = P r[b(t) = n] is given in steady state by: The energy wastage by this system in steady state is then: as intuitively expected.

The System without Data Storage
Similarly we can consider the opposite case, where the system is able to store energy in a battery of infinite capacity but unable to store data packets, so that if a data packet arrives when there is no available energy then that data packet is simply lost, i.e., B = 0.
Then the probability distribution p e (m, t) ≡ P r[e(t) = m] for the variable e(t) representing the number of energy packets that are currently stored in the system, and in steady state it will be given by: if Λ < λ, when the energy production rate is less than the data packet arrival rate.The equation below gives the steady state loss rate of data packets that arrive to the system, cannot be stored and are therefore discarded rather than transmitted because there is no energy available:

The System with Finite Capacity Energy and Data Buffers
When both the data buffer and the energy storage capacity are non-zero, the analysis does not fit into a known standard model but it is straightforward to carry out.Let us just write the balance equations for p(n, m, t) in steady state so that we may drop the dependency on t and just write p(n, m) = lim t→∞ P r[K(t) = n, M (t) = m], assuming that the equilibrium equation actually exists, which should be, since we are dealing with finite buffer and energy capacity and hence the model is a finite Markov chain.
The balance equations are as follows.The first one deals with what happens around the state (0, 0), which can be reached if either there was just one data packet and it was transmitted as soon as an energy packet arrived, or there was one energy packet and it was consumed as soon as a data packet arrived: For 0 < n < B we have: while: We note that these equations have a solution of the form: where C d is a constant.Similarly for the energy storage system we will have for 0 < m < E: while: We note that these equations have a solution of the form: for some constant C e .Since the Markov chain with state probabilities {p(n, m, t) : (n, m) ∈ S; t ≥ 0} is irreducible and aperiodic, the stationary probability distribution exists and is unique, hence C e = C d = p(0, 0) and: and since β = (α) −1 we have: Hence:
Thus the marginal probabilities for the queue length of data packets is and similarly p e (m) = p(0, m), m > 0, while and: or

Energy Wastage and Data Packet Loss with Finite Storage Capacities
When the energy storage capacity is finite, or the data packet buffer is finite, as with the case we studied earlier where the buffers were of zero size, we are bound to have some level of energy loss or of data packet loss.The loss rates L e , L d in energy and data packets per second, respectively, can be easily computed as: so that after some algebra we get: (31)

When Buffer Sizes Are Very Large
Now if α < 1, so that energy is more plentiful than needed, we see that if B or E or both tend to infinity, then L e → Λ − λ, while L d → 0, as would be expected.
Similarly when β < 1 or α > 1, then when B or E or both tend to infinity, we have L d → λ − Λ, while L d → 0.

When Energy Supply Exactly Matches the Data Flow
An interesting case arises when the energy packets balance the data packets exactly, i.e., α = β = 1 or λ = Λ.In this case we have: which obviously tends to zero when B or E or both tend to infinity.

The Case with Infinite Data Buffer and Finite Energy Buffer
Now assume that E < ∞ (finite energy buffer) and let the data buffer be unlimited, i.e., B → ∞.In this case we see from Equation ( 6) that as long as α < 1, and of course β > 1 so that the supply of harvested energy exceeds the needs of the flow of data packets, then: so that the average number of data packets waiting to be transmitted is: We see as expected that P i D decreases as α becomes smaller, and also as E becomes larger.

When the Data Buffer Is Finite and the Energy Buffer Is Infinite
Now assume that B < ∞ (finite data buffer) and let the energy buffer be unlimited, i.e., E → ∞.We see from Equation (6) that if β < 1, and of course α > 1 so that the supply of harvested energy is less than the needs of the flow of data packets, then: so that the average number of energy packets that are waiting to be used is: and we see that Π E decreases as β decreases, and also decreases when B increases for β < 1.

System Stability and Instability
The stability question for the considered system is of interest when the data and energy storage buffers are unlimited.In this case it is of interest to determine whether the backlog of data packets, or the backlog of stored energy, or both, remain finite or not and under what circumstances.Obviously the question does not arise if we consider a finite time horizon, since starting from an empty system at t = 0, i.e., with p(0, 0, 0) = 1, the probability that the backlog is infinite for any finite t is simply zero because of the Poisson arrivals assumption for both the data and the energy packets.Definition 1.We will say that the system is stable if as t → ∞, and for B → ∞ and E → ∞, the probability that the backlog of data and energy packets remains finite with probability one.Otherwise the system will be said to be unstable.Definition 2. The system is stable with respect to data packets (or energy packets) if the number of data packets (or energy packets) is finite with probability one as t → ∞, B → ∞ and E → ∞.Otherwise we say that the system is unstable with respect to the data packets (or energy packets).Now for a finite G and H with 0 ≤ G < B and 0 ≤ H < E, let us define the probabilities that the respective backlogs of data and energy packets do not exceed G and H, respectively, in steady state: so that using our previous results from Section 5.1, we have: leading directly to the following results.
Theorem 1.If β > 1, and hence α < 1, we see from Equation (41) that as E → ∞ and B → ∞, P d (G) → 1 for all finite G, and the system is stable with respect to the data packets.However for β > 1 and α < 1, we see from Equation (42) that P e (H) → 0 for all finite H, and the system is unstable with respect to the energy packets.
Theorem 2. If β < 1, and hence α > 1, we see from Equation (42) that as E → ∞ and B → ∞, P e (H) → 1 for all finite H, and the system is stable with respect to the energy packets.However under the same conditions, Equation (41) indicates that P d (G) → 0 for all finite G, hence the system is unstable with respect to the data packets.
These two results now tell us the following: Corollary 1.If λ = Λ so that either α > 1 or β > 1, it follows that the system is unstable and when the data and energy buffers are unlimited, in steady state either the number of data packets or the number of energy packets is unbounded with probability one.

Stability and Instability When λ = Λ
Intuitively, one can imagine that the best operating conditions are when both of the resources, energy and data packets, are flowing into the system at equal rates so that the energy is exactly the amount needed for packet transmission, and the packets consume all the energy in the system.In fact, a more careful analysis tells us that things are somewhat complicated.
On the one hand, we see that when λ = Λ or αβ = 1, the expression for p(0, 0) is an indeterminate form, so that we apply L'Hôpital's rule and take the derivative of the numerator and denominator to obtain: As a consequence we get the following result: and either E → ∞ or B → ∞, or both, then p(0, 0) → 0, so that both p(n, 0) → 0 and p(0, m) → 0 for all finite (n, m).
Also, Equations ( 41) and (42) at α = 1 are indeterminate forms, such that applying L'Hôpital's rule we obtain: Hence, we can compute the average values of the data < D > and energy < E > backlog for α = 1 in a simple manner.
Theorem 4. If α = 1 then: Thus, as B → ∞ the average data backlog tends to infinity, and when E → ∞ the average backlog of energy tends to infinity.
We can also write: which tells us that: Theorem 5.For any finite G and H when Λ = λ, as B and E tend to infinity, the probability that the data and energy backlogs remain finite tends to zero.

A Single Harvesting Node with Data Packet Retransmission
Clearly once an energy packet has been used to transmit a data packet, it cannot be forwarded to some other node since it has been used up.On the other hand, we may need to retransmit the same data packet if an error is detected during the transmission, or if we wish to reduce the probability of packet errors by sending several duplicates.Such situations lead to interesting modelling issues that we will dwell on in this section.Let λ and Λ be the arrival rates of data and energy packets, respectively.Consider a single harvesting and transmission node, and suppose that: • If a data packet is waiting in queue and an energy packet arrives such that the data packet can be transmitted, then with probability π one energy packet will not suffice and the data packet remains in the node.When another energy packet arrives at some later time, the process will repeat itself independently of the previous event.
• Also, if a data packet arrives to the node when one or more energy packets are waiting, then it is immediately transmitted but the transmission may be unsuccessful and another energy packet will be needed with probability p.This process may be repeated independently of the previous outcome with the same probabilities of success (1 − p) and failure p.
Now we see that the state space is still S = {(0, 0), (n, 0), (0, m) : n, m ≥ 1} but the possible state transitions differ from those of the previous section.We still have the following state transition rates: • -λ : f or (n, 0) → (n + 1, 0), n ≥ 0, when a data packet arrives, and • -Λ : f or (0, m) → (0, m + 1), m ≥ 0, when an energy packet arrives.Also, when an energy packet arrives to an empty energy buffer, we will have: • -Λπ : f or (n, 0) → (n, 0), n ≥ 1, because upon arrival of an energy packet to an empty energy buffer, if the data packet transmission is immediately followed by the request for another data packet transmission with probability π, then the new data packet will not be transmitted due to the lack of an energy packet and will simply replace the previous one.However, if the data packet transmission (caused by the arrival of an energy packet) is not followed by another data packet transmission request, which occurs with probability (1 − π), then we have the transitions: and we will also have the transition: • -λp : f or (0, 1) → (1, 0), when a data packet arrives, because the energy packet in queue serves the transmission of the arriving energy data packet, an additional data packet transmission is needed with probability p, and the data packet will have to wait for another energy packet to arrive.
Finally, there will be a set of transitions starting from states of the form (0, m), m > 0, when the arrival of a data packet results in a sequence of k successive repetitions of data packets arriving to the node with probability p k (1 − p) where m ≥ k ≥ 0, namely: and finally in the last case below, the arriving data packet reduces the number of energy packets by 1 and generates one additional data packet that is also transmitted, then there may be another data packet transmission request and so on, but when all the energy packets are depleted, the m − th and final transmission request cannot be satisfied and the system moves into state (1, 0) having depleted all its energy packets and having one final data packet waiting to be transmitted: • -λp m : f or (0, m) → (1, 0), i.e., k = m, and notice that for any m > 0 the sum of these probabilities is one: The above transitions lead to the equilibrium equations: Regarding the stability of this system, we cannot use results such as the conditions of Foster-Pakes-Tweedie [27] because we are dealing with two (or more in the network case) "queues", namely the energy packet backlog and the data packet backlog.However, we are able to prove the following useful result.which completes the proof.
Remark 1.Based on the above results, we notice that: • The probability that the data queue is empty can be obtained as: • The probability that the data queue is non-empty is: The probability that the data queue is either full or empty is then obviously: