Probabilistic Analysis of a Buffer Overflow Duration in Data Transmission in Wireless Sensor Networks

One of the most important problems of data transmission in packet networks, in particular in wireless sensor networks, are periodic overflows of buffers accumulating packets directed to a given node. In the case of a buffer overflow, all new incoming packets are lost until the overflow condition terminates. From the point of view of network optimization, it is very important to know the probabilistic nature of this phenomenon, including the probability distribution of the duration of the buffer overflow period. In this article, a mathematical model of the node of a wireless sensor network with discrete time parameter is proposed. The model is governed by a finite-buffer discrete-time queueing system with geometrically distributed interarrival times and general distribution of processing times. A system of equations for the tail cumulative distribution function of the first buffer overflow period duration conditioned by the initial state of the accumulating buffer is derived. The solution of the corresponding system written for probability generating functions is found using the analytical approach based on the idea of embedded Markov chain and linear algebra. Corresponding result for next buffer overflow periods is obtained as well. Numerical study illustrating theoretical results is attached.


Introduction
Capacities of buffers accumulating incoming packets in computer and telecommunication network nodes, e.g., wireless sensor network (WSN) nodes or LAN routers, are limited. As a consequence, one of typical phenomena of packet processing by a network node, especially when the traffic is heavy, is buffer overflows resulting in packet losses. As long as the accumulating buffer is overflowing, all incoming packets are lost. This causes deterioration of key service parameters, like packet loss ratio, end-to-end delay and mean energy consumption [1,2]. Obviously, as one can say, when a network sensor is turned on and the traffic is small, the problem of energy saving appears since we have long idle times. From the other side, sensor nodes are equipped typically with very small buffers, so during a "catastrophic" period, when large data amount arrives at the sensor node, buffer overflows and packet losses occur. Hence [3], reducing the power consumption during the "normal" period and reducing buffer overflow durations during the "catastrophic" period are equally important. In single-hop wireless sensor networks the sensor measurement is sent directly to the base station (sink node). However, in multi-hop topology the information is transferred from sensor to sensor to the sink node collecting the traffic, using a multi-hop protocol [2]. Unexpected buffer overflows occurring on the route (at intermediate nodes) generate packet losses and significantly reduce the Quality of Service (QoS). In fact, in the literature, one can find many available schemes of the buffer constant service times is analyzed in [33]. The case of generally distributed service times is investigated in [34]. In [35], discrete time queueing models and their networks are studied.
In this paper, a system of equations for the tail CDF of the first buffer overflow period duration conditioned by the initial state of the accumulating buffer is derived. The solution of the corresponding system written for probability generating functions (PGFs for short) is found using the analytical approach based on the idea of embedded Markov chain and linear algebra. Corresponding results for next buffer overflow periods are obtained as well. The numerical study illustrating theoretical results is attached. Therefore, the first main contribution of the paper is compact-form analytical results obtained for the transient state of the system, describing its evolution at arbitrary time (slot). Typically, in queueing modeling, the empty system is assumed initially. Thus, the next contribution of the paper is in showing an essential dependence (usually ignored) of the buffer overflow duration on the initial buffer state of the system. The dependence is visible in the formulae and it is illustrated via numerical results.
The remaining part of the article is organized as follows. In Section 2, we give a precise mathematical description of the considered queueing model and introduce some nomenclature. In Section 3, a transient system of equations for the tail CDF of the first buffer overflow period duration, conditioned by the number of packets accumulated in the buffer before the starting moment, is built. Moreover, a corresponding system written for PGFs is found there. Section 4 contains the main analytical result, namely a compact-form solution of the last system obtained in the previous section. The result for next buffer overflow periods is stated in Section 5. In Section 6, numerical analysis is provided. A brief summary and conclusion can be found in Section 7.

Model Description
In this paper, we consider a discrete-time queueing model in which the incoming packets arrive according to interarrival times being geometrically distributed with parameter 0 < a < 1 (a binomial arrival process), so the probability that an interarrival time equals k (time slots) is where k ∈ {1, 2, ...}. The probability that an interarrival time exceeds k we denote by a k . Obviously The j-fold convolution of the sequence (a k ) with itself is defined as follows: and Processing times are assumed to be of general distribution, where b k stands for the probability that the service time lasts k time units, where ∑ ∞ k=1 b k = 1. The maximum system capacity is assumed to be N, so we have an accumulating buffer with N − 1 places and one place in service station. A natural processing discipline FIFO (First In First Out) is assumed.
In a single time slot, at most one job can arrive and one service can be finished. We accept the so-called arrival-first (AF) regime, at which if the arrival and departure appear at the same time (slot) an arrival takes precedence over a departure.
In this paper, we use the notation I{A} for the indicator (characteristic function) of the random event A.

Basic Equations for First Buffer Overflow Duration
In this section, we deal with the first buffer overflow duration γ 1 . We introduce the following notation for the conditional tail CDF of γ 1 : where k ≥ 1, n ∈ {0, ..., N − 1} and X 0 stands for the number of packets present in the buffer just before the starting epoch. Let us start with the case of the buffer being empty before the opening of the system (n = 0). Note that the corresponding CDFs for n = 0 and n = 1 are equal, i.e., so ∆ 0 (k) = ∆ 1 (k). Assume now that the system starts the operation with n ∈ {1, ..., N − 1} packets accumulated in the buffer. Let us denote by i (i ≥ 1) the first departure epoch after the opening of the system at time 0. In addition, if i ≥ 2, let r be the last arrival moment before i. As a result that departure epochs are Markov moments in the evolution of the considered system (due to memoryless property of geometric distribution of interarrival times), for fixed n the following random events are mutually exclusive: • Λ 1 (n) : the moment r is the arrival time of, at most, the (N − n − 1)th packet and the next packet enters the system after time i (the buffer does not become saturated before time i); • Λ 2 (n) : the moment r is the arrival time of, at most, the (N − n − 1)th packet and the next packet enters the system exactly at time i; • Λ 3 (n) : at time r the (N − n)th packet arrives, so the buffer overflow period begins at time r; • Λ 4 (n) : the first packet (after the opening of the system) arrives exactly at time i; • Λ 5 (n) : the first packet (after the opening of the system) arrives after time i.
Obviously, from the total probability law we get Let us note that the following representations are true: and Observe that in the case of (9) (if j = N − n − 1) and (11) (if n = N − 1), according to AF regime, in fact, degenerated "zero" buffer overflow periods occur at time i (the (N − n)th packet arrives and the service completes at this time).

Representation for Solution
In this section, we obtain an explicit solution of the system (21), (23) in a compact form. In [36], the idea of a potential of a random walk is considered. Namely, if the sequence (Y n ) is defined as follows: where n ≥ 1, and random variables X 1 , X 2 , ... are independent and identically distributed with τ k de f = P(X n = k), k ≥ 0, τ 0 > 0, then a sequence (R k ) defined in the following way: where is called the potential of the random walk (Y n ). The representation (25) can be used to find successive terms of the potential (R k ). Indeed, applying Maclaurin's expansion, we can write However, from the other side, successive terms of (R k ) can be found recursively, namely [36] where k ≥ 2.
The potential has interesting algebraic applications. In [36], the following system of infinitely many linear equations is studied: where ( δ n ) are unknowns and (τ n ) and (φ n ) are known sequences. It is proved that each solution of the system (29) can be represented in the following form: where β is a certain constant and (R k ) is the potential corresponding to the sequence (τ k ).
As it turns out, the idea of the potential can be applied in solving the system (21), (23); however, firstly, it must be written in another, equivalent, form.
Introduce the following substitution: Observe that now the Equations (21), (23) can be rewritten as follows: for n ∈ {1, ..., N − 1}, and where φ n (z) Let us note that (32) has the form similar to (29); however, two essential differences can be observed. Firstly, the sequences of unknowns and free terms depend on the argument z. Secondly, the number of equations in the system (32) is finite in comparing to (29). In consequence, the representation (30) for the solution must be used in a slightly different form, namely where β(z) is certain function of variable z and (R k ) is the potential corresponding to the sequence (τ k ) defined in (27) or (28). Next, the Equation (33) can be used for finding β(z) explicitly. Let us start with substituting n = 1 into (35). We get Next, substituting n = N and n = N − 1 into (35) and, moreover, applying (33), we can easily eliminate δ 1 (z) as follows: Returning to ∆ n (z) (by using the substitution (31)), we have In consequence, referring to (33), (37) and (38), we can formulate the following main result: The PGF of the tail CDF of the first buffer overflow duration γ 1 in the considered queueing system can be represented as follows: where n ∈ {0, ..., N − 1}, and the formulae for θ k (z), τ k and R k are given in (18), (22) and (27) (or, equivalently, in (28)), respectively.

The Case of Next Buffer Overflows
Let us denote by γ r the rth buffer overflow period duration (r ≥ 2). Observe that the following representation is true: where k ≥ 1. Indeed, the completion epoch of each buffer overflow period is a Markov moment in the evolution of the system. Therefore, the process of reaching each next buffer overflow period (beginning with the second one) is probabilistically identical as the one for the first period but with "initial" number of jobs accumulated in the buffer equal to N − 1. In consequence, if we put where r ≥ 2 and |z| < 1, then we obtain the following: Remark 1. The PGF ∆ (z) of the tail CDF of the rth buffer overflow duration γ r (r ≥ 2) in the considered queueing system can be expressed as where |z| < 1 and the formula for ∆ N−1 (z) is given in (39).

Numerical Study
In this section, we present the numerical study illustrating theoretical results. In particular, we are interested in the visualization of the impact on the distribution of the first buffer overflow duration for the following "input" parameters of the system: - the offered traffic load defined as the quotient of the mean service time and the mean interarrival time; -the number of jobs n accumulated in the buffer before the starting moment; the shape of the service (processing) time distribution; -the buffer size.
In computations, we consider three types of the processing time distribution: • geometric with fixed parameter b; • deterministic (constant) of duration B = const; • bounded discrete distribution, where the service time takes on finite number of possible values; dealing with the impact of the distribution skewness we analyze separately the following subcases of this type of distribution: with positive skewness (positive asymmetry); -with negative skewness (negative asymmetry).
In [37], an algorithm of numerical inversion of probability generating function is proposed. Namely, if F(z) = ∑ ∞ k=0 f k z k , where | f k | ≤ 1 and z ia a complex number, then f k for k = 1, 2, ... can be approximated by f k as follows: where r ∈ (0, 1). Moreover, We use the algorithm described above with r = 0.1 to invert the right side of the Formula (39) in Theorem 1.

Impact of the Type of Processing Distribution
We investigate the impact of the type of processing distribution on the distribution of the first buffer overflow duration. Assume that a = 0.25 so the mean interarrival time equals 4, and take N = 11. Moreover, let us analyze three different processing time distributions with the same mean equal to 3 (so = 0.75 < 1), namely geometric with parameter b = 1 3 = 0.333, deterministic with B = 3 and bounded discrete distribution defined as In Figures 1-3, conditional probabilities ∆ n (k) for k = 1, 2, ..., 6 are presented for n = 0, 5 and 10, respectively.
In Figures 4-6, the case of = 1.00 is visualized. Assuming the same values of a and N, we present results for three processing time distributions with the same mean equal to 4: geometric with parameter b = 1 4 = 0.250, deterministic with B = 4 and bounded discrete distribution defined as follows: Finally, the case of = 1.25 and the mean service time equal to 5 are presented in Figures 7-9. We take there geometric distribution with parameter b = 1 5 = 0.200, deterministic with B = 5 and bounded discrete distribution given by Evidently, as k increases, then the probability values ∆ n (k) = P{γ 1 ≥ k | X 0 = n} for fixed n decrease; however, the shape of this relationship depends on the type of processing distribution. The relationship between the initial buffer state and the processing distribution type is interesting. Figures 1, 4 and 7 show that there is the biggest difference in the case of geometric distribution, where a huge disproportion between values obtained for n = 0, 5 and n = 10 can be observed.

Impact of Skewness Type of the Processing Distribution
In this subsection, we investigate the effect of the statistical shape of the service type distribution on the tail of conditional distribution of the first buffer overflow duration in the considered model. Assume, as previously, that a = 0.25, N = 11, and accept a bounded discrete processing distribution. Consider three different types of this distribution in the case of = 1 (so with the same mean), namely and b k = 0 otherwise, for which the skewness equals 0; • distribution with positive skewness (positive asymmetry) of the form and b k = 0 otherwise, for which the skewness equals 0.629 > 0; • distribution with negative skewness (negative asymmetry) of the form and b k = 0 otherwise, for which the skewness equals −0.629 < 0.
Let us note that means are the same and equal to 3. The values of probabilities ∆ 3 (k) = P{γ 1 ≥ k | X 0 = 3} for k = 1, ..., 6 are presented in Table 1 and in Figure 10. It is probably a bit surprising that these probabilities are the highest for a symmetric distribution. In the case of positive and negative skewness for ks greater than or equal to 3, the probabilities are very close to zero.  Figure 10. Impact of skewness type on conditional probabilities ∆ 3 (k) for bounded discrete processing distribution and = 1.

Mean Buffer Overflow Duration in Dependence on Offered Load and Initial Buffer State
Let us study now the impact of the offered load and the initial buffer state n on the mean first buffer overflow duration. Let us note that the mean conditional first buffer overflow duration E n (γ 1 ) can be obtained just from the formula (39), namely Assume that N = 11 and a = 0.25, and analyze three different possibilities in the case of geometric-type processing distribution, namely b = 0.33 ( = 0.75 < 1), b = 0.25 ( = 1.00) and b = 0.20 ( = 1.25 > 1). The results are presented in Table 2 and visualized in Figure 11. Note that the values increase with increasing offered load. For a small and medium level of initial buffer state, the differences are small. For greater values of n compared to N, the differences are significant. For example, the average duration of the first buffer overflow period for the value of n = 10 increases almost twice as compared to the value obtained for n = 9.

Impact of System Size
Finally, in Table 3 and in Figure 12, the impact of the system size N on the duration of the first buffer overflow is illustrated for geometric processing distribution and system parameters kept the same as in the previous subsection. Here, n = N − 1 is assumed; therefore, we can illustrate in this case not only the first buffer overflow but also next ones. Indeed, due to the fact that after finishing each buffer overflow period the number of accumulated packets equals N − 1, this buffer state becomes an initial one for the second and next buffer overflow periods. The dependence on the offered load is similar to that analyzed in the previous case. The buffer overflow duration decreases with the increase of the declared buffer volume; however, the rate of this change is the most visible for small values of N. Generally, it shows that a large increase of the buffer capacity does not have an essential impact on the average number of lost packets, since mean buffer overflow durations do not differ significantly for large Ns. Mean buffer overflow duration Figure 11. Mean first buffer overflow duration in dependence on offered load and initial buffer state.

Conclusions
The possibility of probabilistic evaluation of the duration of the buffer overflow period is crucial in the evaluation of transmission quality and the network optimization process. The article proposes a probabilistic model for the functioning of a wireless sensor network node based on a queueing system with discrete time and a limited capacity of the buffer accumulating incoming data packets. Using the analytical approach based on the concept of the embedded Markov chain, the total probability formula and linear algebra, a compact representation for the PGF of the tail of the CDF of the first buffer overflow period is obtained, depending on the initial state of this buffer. As a simple conclusion, the appropriate formula is also found for the subsequent periods of buffer overflow. The numerical study examines the sensitivity of the buffer overflow time distribution on the packet arrival intensity, the type of service time distribution and the buffer filling level at the time of system start.
Funding: This research was funded by Silesian University of Technology, Gliwice, Poland.

Conflicts of Interest:
The author declares no conflict of interest.