Priority-based bandwidth allocation in wireless sensor networks

In Wireless Sensor Networks (WSN) a set of motes monitors the environment by measuring some physical phenomena such as humidity, light, temperature, vibrations. The coexistence of different data types arises the problem of assigning the network resources in a fair way by taking into account possible different priorities among the traffic streams. In this paper we propose an allocation control scheme which is easy to implement, meets the limited resources of sensor nodes, and does not require extra control traffic in the WSN. Our scheme is based on the idea that the motes maintain a window with the classes of the latest transmissions. We propose an analytical model and provide an algorithm to study the performance of this allocation scheme with respect to the throughput and the fairness achieved. The model is a continuous time Markov chain which is proved to be dynamically reversible (although not reversible) and admits a product-form equilibrium distribution.


INTRODUCTION
Wireless Sensor Networks (WSNs) are employed to collect data from an environment and send them to monitoring and control applications.Sensors are typically deployed in an environment and are responsible for sensing and measuring many physical phenomena such as temperature, humidity, pressure, radiation, air pollution levels, noise level but also more sophisticated events such as the number of people in an area or the movement of an object.Sensors themselves form a communication network which may be based on several architectures: all the nodes may implement the same wireless transmission protocol in order to form a decentralised adhoc network or there may be a hierarchical structure as in the cluster-tree topology [1,9].
It is often the case that the communication infrastructure formed by the sensors is used to transmit different types of data which may have different importance and priority.For instance in monitoring an environment the data associated with sensing vibrations may have higher priority than those measuring other phenomena such as the humidity since the former may indicate an earthquake or a tremor.Therefore, it appears natural that in the development of WSN protocols one should consider the assignment of the resources (frequency spectrum or bandwidth) according to the priorities of the sensed data.On the other hand, due to the limited amount of computational power and the limited energy supplies of the sensors, the design of protocols for the resource assignment should be as simple as possible and avoid energy loss due to heavy computations or packet collisions.
In this paper we address the problem of the bandwidth allocation among traffic classes with different priority by introducing a stateless protocol inspired by back-CHOKe [16].The main idea of our allocation control scheme, named Fair Allocation Control Window (FACW), is that each sensor maintains a control window of size N that stores the traffic classes of the latest packets that have been sent by its neighbours (i.e., the other sensors it can listen to) or by itself.Each traffic class c can be present in the window at most hc times, where higher values of hc correspond to higher traffic priority.When a sensor collects data with type c, it behaves as follows: if the number of c-classes in its window is less then hc then it transmits the packet, otherwise it waits a random time (or drop the packet) and retry later.If the packet is sent then the window is updated by inserting an object of class c according to a First-In-First-Out (FIFO) policy.We study the behaviour of this protocol under different scenarios.We propose a performance evaluation of the FACW protocol based on the assumption that the data packets are collected by the sensors according to independent Poisson processes.We present an exact model based on the analysis of a Continuous Time Markov Chain (CTMC) with finite state space.We show that the model is dynamically reversible [19,11,15,14], although not reversible, and give a closed form expression for its invariant measure.The stationary performance indices are expressed as functions of the normalising constant which is derived algorithmically according to a convolution algorithm.The availability of a numerically efficient approach for the performance evaluation allows for the parameterisation of a WSN without resorting to computationally expensive simulations.
Structure of the paper.In Section 2 we describe our bandwidth allocation control scheme.In Section 3 we present the performance evaluation of the protocol and give the algorithm for the computation of the performance indices.Section 4 shows our scheme at work under various scenarios.Section 5 discusses some related work.Finally, Section 6 concludes the paper.

PROTOCOL DESIGN
In this section we first introduce the design goals of the FACW protocol and then we describe how it works.

Design goals
The design of FACW aims at satisfying the following goals: 1. Stateless architecture.Due to the limited physical resources in the motes, we aim at reducing the computational cost and the memory usage at each mote.2. Localized behaviour.The protocol activities are based on local information and do not affect the whole system.3. Avoid transmissions of extra packets.Control packet transmission should be avoided in order to reduce the energy dissipation of the system 4. Fair bandwidth allocation among different traffic flows with the same priority.Our protocol aims at satisfying the max-min fairness criterion among different traffic flows with the same priority.We will discuss this objective in more details in Section 3, but intuitively we do not want that a flow with low requirements is slowed down while there exists another flow with the same priority which is using more resources [2,8]. 5. Flexible regulation of traffic priorities.The allocation of the bandwidth follows a soft-priority based scheme in order to prevent lower priority traffic flows to starve because of the presence of a greedy higher traffic flow.6. Easiness of implementation.The protocol must be easy to implement within the actual motes software.

FACW
The main idea of FACW is that data traffic in a WSN can be classified into a finite set of M classes K = {c1, c2, . . ., cM }.Each mote maintains a control window of size N in which the classes of the latest N transmissions (listened or performed) are stored.In the window, at most hc entries of class c can appear.We stress the fact that the window stores only the class identifier of a transmission and not the sent packet.So, if we assume a practical situation with 16 classes, each class can be encoded by 4 bits and hence a window can be stored in few bytes.In case the mote generates a packet of class c when in its window there are already hc entries of class c, the packet is rescheduled for transmission after a back-off time or is simply dropped.Otherwise, in case of generation of a class c packet and the number of c-entries in the window is strictly lower than hc, then the packet is sent and the window is updated according to a FIFO policy.It should be clear that larger window sizes imply a lower bandwidth usage, whereas lower values of N make the transmission more aggressive.The role of hc is that of modelling class priority.Allowing more entries of a class c in the control window reduces the probability of c-packet dropping/delaying and hence its priority is larger than that of a traffic class d with h d < hc.The initialisation of the window is arbitrary.If necessary, we can assume that there exists a class c of data traffic (e.g., the packets used for controlling the routing) that has hc = N and whose rate is slow.The presence of this class ensures that the starvation of all the other traffic classes never occurs because of the control window.
In the following sections we present a numerically tractable model that can be used to parametrise the protocol, i.e., decide the window size and the values of hc for c ∈ K.

PERFORMANCE EVALUATION
In this section we present a CTMC model of the FACW protocol.The numerical tractability of this protocol allows us to use it to set the parameters in the protocol implementation, i.e., the window size N and the values for the threshold hc for each traffic class c ∈ K.The model considers a single window and is subject to the following assumptions: • Packets are generated according to independent Poisson processes whose rates may depend on the window state.This allows us to model situations in which the mote modulates its harvesting rate according to the population of the control window.We can also deal with the case in which the class c packets which are not sent are delayed and hence the packet generation rate is increased because the sensor data production rate is summed to the packet retransmission rate.• We consider a network topology in which every mote senses the transmission of every other mote.This is a common assumption in tree-structured WSNs in which it is assumed that all the motes with the same parent interfere in their transmissions because they are relatively geographically close.This requirement is needed because here we aim to study the network performance and hence we assume that all the nodes share the same contention window.Nevertheless, if we are interested in the analysis of the performance of a single mote, this requirement is not needed.

CTMC model
We consider a set K = {c1, c2, . . ., cM } of M distinct traffic classes and assume that each node maintains a window W of size N storing the transmission classes of the most recent sensed data according to a FIFO policy.An arrival can be due to a sensor data harvesting or to a listening to another node transmission.We denote the state of the window by x = (x1, x2, . . ., xN ), where xi ∈ K, and let | x|c = N i=1 δx i =c be the total number of occurrences of class c in W. We assume that data of different traffic classes are generated according to independent Poisson processes whose rates λc(j), with c ∈ K and 1 ≤ j ≤ N , depend on the number of objects j = | x|c of class c that are present in the window.Clearly, the process X(t) that describes the state of W is a homogeneous continuous time Markov chain (CTMC) with finite state space.In the window there can be at most hc objects of class c, with c ∈ K.If hc = N then there is no constraint on the maximum number of objects of the same class in the window.Let x = (x1, . . ., xN ) be the state of the control window, then the transition rates in the CTMC infinitesimal generator are: for and | x|c < hc 0 otherwise.

Closed form stationary distribution
In this section we derive the stationary distribution of the stochastic process X(t).The state space of X(t) is S = { x ∈ K N : | x|c ≤ hc for all c ∈ K}.Notice that the state space of X(t) is finite and its transition graph is irreducible, and hence the CTMC has a unique limiting distribution independent of its initial state.
Theorem 1.The stationary distribution π( x) of X(t) for the FIFO policy is given by the following expression: where The proof of Theorem 1 is based on the following theoretical results.In [19,11,15,14] the authors study the notion of dynamic reversibility which generalises the well-known concept of reversibility by considering those CTMCs which are stochastically identical to their reversed process modulo a state renaming .More formally, if is an involution over the state space S of a CTMC X(t), X(t) is dynamically reversible with respect to if it is stochastically identical to its reversed process where the state names are changed according to .Dynamically reversible Markov chains are characterized by a set of detailed balance equations expressed in terms of the steady-state distribution π and the transition rates qij, for i, j ∈ S, of the Markov process.Proposition 1.A stationary CTMC with state space S is dynamically reversible with respect to a renaming on S if and only if there exists a set of positive real numbers πi summing to unity, with i ∈ S, such that the following system of detailed balance equations are satisfied: for all i, j ∈ S with i = j: πiqij = πjq (j) (i) and qi = q (i) .If such a solution πi exists then it is the stationary distribution of X(t).
The steady-state distribution of a dynamically reversible CTMC can be expressed in terms of the transition rates.Proposition 2. Let X(t) be a stationary CTMC with state space S which is dynamically reversible with respect to a renaming over S. Let i0 ∈ S be and arbitrary reference state.Let i ∈ S and i = in → in−1 → • • • → i1 → i0 be a chain of one-step transitions.Then where Ci 0 ∈ R + .
We are now in position to prove Theorem 1.
Proof of Theorem 1.The proof is structured as follows: we first make a claim about the fact that X(t) is dynamically reversible and then derive, under this assumption, Expression (1) of the stationary distribution.Finally, by using Proposition 1 we prove that the claim is true.
Claim 1.The process X(t) for the FIFO policy is dynamically reversible with respect to the renaming on S defined by ( x) = x R where x = (x1, . . ., xN ) and x R = (xN , . . ., x1).
We assume that hc = N for all the traffic classes c ∈ K.We will see later that this assumption does not limit the validity of this proof.Assuming Claim 1 we use Proposition 2 to derive the expression of the stationary distribution π.Let us take a reference state x0 = c N 1 the N -sized vector whose entries are all equal to c1, and let us derive the stationary probability of a general state x ∈ S. Consider the sequence of arrivals that starting from state x take the model to state x0 consisting in the arrival of exactly N objects of class c1.We denote this path as follows: where we have labelled the arrows with the arriving classes.Notice that the reversed path from x R 0 = c N 1 to x R = (xN , . . ., x1) exists in the same process and is formed by the arrival of the sequence of traffic classes x1, x2, . . .xN .Suppose that x has K ≤ N objects of class c1 in positions i1 < i2 < .. < iK ≤ N .The product of the rates in the forward path must take into account that the number of c1 in the window starts from K and keeps increasing a unity at each arrival with the exception of the case in which an object of class c1 is discarded.The c1 in position i k will be in position N after N − i k arrivals.The arrival N − i k + 1 will leave the same number of class c1 objects in the queue which is N − i k + 1 due to the arrival plus the k − 1 which are with index lower than i k .Therefore, the product of the rates of the forward path is: The product of the rates in the reversed path is: where the first factor is due to the arrivals of class c = c1 objects while the second is due to class c1 object arrival.Indeed if in x the objects of class c1 are present in position i k , 1 ≤ k ≤ K, this means that the i k -th arrival will be a c1.The number of occurrences of c1 in the window is N − i k + 1 (due to the previus i k − 1 arrivals) plus k − 1 due to the c1 objects already arrived.Using Proposition 2, by Equations ( 3) and (4), we can derive π( x): This says that if Claim 1 is true, then Equation ( 1) is the stationary distribution of X(t).Indeed, by Equation (1): and then by Equation ( 5) we can write proving that Equation ( 1) is indeed the stationary distribution of X(t).
Let us now prove that Claim 1 is true by using Proposition 1.We show that Equation (1) satisfies the detailed balance equations for the following models: 1. FIFO with hc = N for all c ∈ K, which is the case we used to derive the candidate expression, 2. FIFO with arbitrary 1 ≤ hc < N for some c ∈ K.
Let x ∈ S be (x1, . . .xN ).We distinguish two cases.Case 1.The detailed balance equation becomes: If xN = d, by substituting the expression (1) of π we obtain: In most practical applications, we are not interested in knowing the stationary probability of observing a state of X(t) since the transmission classes are temporally ordered in it.More often, we are interested in knowing the stationary probability of observing any state in which the number of occurrences of each class c1, . . ., cM are nc 1 , . . ., nc M whatever is their order.Corollary 1 provides an analytical expression for such an aggregated equilibrium probability.
Corollary 1.Let n = (nc 1 , . . ., nc M ) with 0 ≤ nc ≤ hc for all c ∈ K and c∈K nc = N .The stationary probability of observing the aggregated state with nc elements of class c for all c ∈ K is: where n belongs to the set of aggregated states SK,N = {n : In what follows we denote the normalising constant and the aggregated stationary distribution of the system model consisting of a set of traffic classes K and a window size N as GK,N and πK,N , respectively.
The marginal equilibrium distribution for each class is given by Lemma 1 and is expressed in terms of a ratio of the normalising constants of different models.
Lemma 1.The marginal stationary probability of observing exactly δ objects of class d ∈ K in the window, with 0 ≤ δ ≤ h d , is:

Performance indices
In this section we introduce a set of performance indices and show how to compute them efficiently provided that we can efficiently compute the normalising constant GK,N .The problem of the efficient computation of the normalising constant is considered in Section 3. The admission rate for a specific traffic class and the global admission rate can be computed as follow: Corollary 2. In steady-state, the admission rate for a traffic class d ∈ K is: and the global admission rate is: Proof.The proof follows straightforwardly from Lemma 1 by observing that X d K,N = λ d (0)π d K,N (0) .The rejection rate for a specific traffic class and the global rejection rate can be computed as follows: Corollary 3. In steady-state, the rejection rate for a traffic class d ∈ K is: and the global rejection rate is: Proof.The proof follows straightforwardly from Lemma 1 by observing that By applying Lemma 1 we can compute the expected number of objects of a given traffic class in the window when the model is in steady-state and the throughput for each class.
Corollary 4. In steady-state, the expected number of objects of class d ∈ K in the window is: Corollary 5.In steady-state the throughput for a traffic class d ∈ K is: Finally, we introduce an index to measure the fairness of the bandwidth allocation among the set of traffic classes.Definition 3. Let K1 ⊆ K be a subset of the traffic classes whose elements have the same priority.Assume that the arrival rates for the classes in K1 are independent of the state of the window, i.e., for any c ∈ K1, λc(j) = λc for all 0 ≤ j ≤ hc.The fairness index Φ cd of a class c with respect to a class d with c, d ∈ K1 is defined as follows: ) .The global fairness index for K1 is defined as: where λK 1 = c∈K 1 λc.
The next proposition states that when the fairness index is 0 we achieve the max-min fairness, i.e., a flow with low requirements is never slowed down while there exists another flow with the same priority which is using more resources [2].

Computation of the normalising constant
All the performance indices defined in the previous section can be computed efficiently provided that the normalising constant G is known.The expression for the normalising constant given by Theorem 1 is computationally expensive and prone to numerical instability problems.In this section we provide an efficient algorithm for computing the normalising constant based on its convolution property.The theoretical support of the algorithm is given by Lemma 2. We define τK ∈ N as the maximum number of slots that the traffic classes in K would occupy in an infinite size window, i.e., τK = c∈K hc .
Notice that, given a partition K1 and K2 of the set of traffic classes K, it clearly holds that τK = τK 1 + τK 2 .Lemma 2. Let K be the set of traffic classes and let K1 and K2 be a partition of K.Then, the normalising constant can be defined by the following recursive relation: Let us order the traffic classes c1, . . .cM ∈ K and let h = (hc 1 , . . ., hc M ).We compute the normalising constant as shown in Algorithm 1 where we use the convention that array positions start from 1 and empty products have value 1.
Notice that if K is a singleton, then the normalising constant G K,min(N,hc) can be computed easily as: Algorithm 1: Convolution algorithm {Compute GK 1 ,i for i = 1, . . .min(N, τK 1 ) and store the result in newcol(i + 1)};

APPLICATION
We study different configurations of FACW under two scenarios consisting of 20 classes of traffic types.In the first case (S1) the total packet generation rate is 58.45 with a standard deviation of 4.3364, while in the second (S2) we have the same total generation rate with a standard deviation of 1.3516.The arrival rates for S1 and S2 are shown in Table 1.In the following we assume λc(nc) = λc for all classes c ∈ K and 0 ≤ nc < hc.

Impact of window size on admitted flow
In this section we study the impact of the window size on the admitted flow and on the fairness index for the scenarios S1 and S2 assuming hc = 1, 2 for all c ∈ K (see Figures 1  and 3).Plots (a) show the total throughput with respect to a given window size, while plots (b) of these figures show the admitted rates for the slowest and the fastest classes as functions of the window size.We notice that, as desired, the fastest classes slow down much more quickly than those that are less aggressive, thus improving the fairness in the resource allocation.Plots (c) of Figures 1 and 3 show the fairness index.Notice that total fairness is achieved when we admit almost all the streams (window size 1) or when we block them all.Nevertheless, the absolute value is always below 1.4 in S1 and 2.5 in S2 which are reasonable low values.We will study in more details in Section 4.2 the impact of hc and of the window size on the fairness index.

Impact of hc on the fairness index
In this section we consider the scenario S1 and we assume T = 25.We configure the window size such that λ * is maximum under the constraint λ * < T .We study the system for hc = 1, . . ., 9 with c ∈ K.The results are shown in Table 2 and the plot of ΦK as function of hc is shown in Figure 2. We can see that the fairness is improved by larger values of hc but, in order to control the maximum throughput, it requires larger windows and hence more memory.Therefore, a trade-off between memory occupancy and desired fairness arises.

Competition among different priority traffic streams
In this part we study a scenario in which we consider two pairs of streams 1, 2 and 3, 4 in a setting with the following packet generation rates (6.0, 6.0, 18.0, 18.0, 3.8, 1.2, 1.5, 1.72, 1.12, 8.0) .Streams 1 and 2 (resp.3 and 4) have the same rates but the priority of 2 (resp.4) is higher than that of 1 (resp.3).We model this by setting h1 = h3 = 1 and h2 = h4 = 3.In Figure 4 we show the throughput of the four streams together with the total throughput.We notice that while with the increasing of the control window's size the total throughput obviously decreases, the reduction of the bandwidth assigned to the high priority traffic streams 2 and 4 is much slower than that experienced by the lower priority streams 1 and 3.

RELATED WORK
We discuss the works related to our contribution in two steps.First, we compare our approach with other works which address the problem of congestion control in WSNs (with or without priorities).Secondly, we compare our theoretical contribution in terms of CTMC analysis with respect to the literature.
The problem of bandwidth assignment in wireless sensor  [5] and the references therein).In [20] the authors introduce the Adaptive Rate Control (ARC)scheme.In this scheme each mote estimates the number of downstreams and the bandwidth is split proportionally among the local and router through traffic.The solutions proposed in [17,18] use control packets to avoid congestion.Another important contribution is the rate control scheme introduced in [6] where the authors consider a tree-structured network and each mote estimates the average rate at which packets can be sent and divide it by the number of children motes downstream obtaining the maximum flow associated with each child mote.In [10] the authors present the SPEED protocol to achieve soft real time communication in WSNs.SPEED exploits little knowledge about the network and provides a mechanism for the packet routing that allows for a fair delivery time for the data packets.All these congestion control schemes do not consider traffic priorities, and require the transmission of control packets (which may be done by piggybacking).In [12] the authors propose a probabilistic approach to control the bandwidth assignment in WSNs based on the IEEE 802.15.4 standard in a tree-structured WSN.The protocol aims at obtaining the fairness among the nodes rather than among the traffic types.Traffic priorities are considered in [3,4] that exploit earliest deadline first scheduling and priority queues, respectively.The protocols proposed in [3] require an accurate knowledge of the network topology and divide the motes into cell.Then, the communication intra-cell and extra-cell are handled in different ways.The scheme proposed in [4] simply proposes a priority scheduler for each mote.Although this allows a single node to use priority for its own transmission, the correlation among the motes is not taken into account.
From the point of view of the stochastic analysis, the most related works are those presented in [13,16].In [16] the authors introduce CHOKe, i.e., a congestion control mechanism that allows the approximate fair sharing of a bandwidth among a set of competing customers.The authors propose a model for the analysis of back-CHOKe which is based on maintaining a window with the latest N packets arrived at the bottleneck.The packets coming from a source which is present in the window are discarded.Packet arrivals occur according to independent homogeneous Poisson processes, i.e., the model is a continuous time version of King's model for the FIFO cache under the Independence Reference Model assumption (IRM) [13].With respect to these papers, we propose a more sophisticated model in which the window may contain a number of replicas that depends on the traffic    type.This is the key-feature that allows us to handle the traffic priority.Moreover, we give an efficient algorithm to compute the performance measures that implements a convolution on the finite state space of the CTMC.Indeed, the algorithm developed in [7] is not applicable to our model due to the possible presence of duplicated items in the window.Finally, with respect to the models studied in [13,7,16], we relax the requirements of the IRM by allowing the rate of the Poisson processes generating the data at the motes to depend on the window state.This can approximate the temporal correlation of packet generations.

CONCLUSION
In this paper we have proposed an allocation control scheme, named FACW, for the bandwidth assignment in WSNs.The FACW protocol is easy to implement, consumes few resources in the motes and does not require extra control traffic in the WSN.We showed that it is able to handle traffic streams with different priorities and can reach a good level of fairness among streams with the same priority.Its main idea consists in maintaining at each mote a window with the latest traffic types perceived and dropping packets of the types that have reached their maximum population in the window.Under the assumption of Poisson generated traffic, we have proposed a model which is analytically tractable and gave an algorithm to efficiently derive the performance indices.The model extends previous ones such as those developed for studying FIFO caches [13] and back-CHOKe [16] in two directions: it allows for multiple entries of the same object in the window (allowing to control the priority of the traffic streams), and it considers that the traffic generation rate may depend on the state of the window at a certain epoch.
Future works include providing an implementation of the protocol and performing simulations to assess the performance under more general scenarios including autocorrelated traffic and mote mobility.
) , which is an identity.If xN = d the detailed balance equation is trivially an identity since π( x) = π(xN , x1, . . ., xN−1) and also the transition rates are identical.Case 2. Let us consider now the case of 1 ≤ hc < N for some c.Observe that if there exists a transition from x to a different state due to the arrival of a class d, then | x| d < h d .If xN = d, this implies that also the reversed transition is possible and we already showed that the detailed balance equation is satisfied.If xN = d, then clearly | x|x N ≤ hx N that implies that the reversed transition is allowed since it occurs in a state with | x|x N − 1 objects of class xN .

4 . 1 (
Definition Admission rate).The admission rate for a traffic class c ∈ K is the rate associated with the event of transition from a state x in which | x|c = 0 to a state x with | x |c = 1 when the model is in steady-state.The global admission rate is the sum of the admission rates for each traffic class c ∈ K.Definition 2 (Rejection rate).The rejection rate for a traffic class c ∈ K is the rate associated with the event of rejecting the arrival of class c because the number of objects of class c in the window is hc.The global rejection rate is the sum of the rejection rates for each traffic class c ∈ K.

Figure 4 :
Figure 4: Throughput of classes with same rate but different priority.

Table 1 :
Arrival rates for scenarios S1 and S2

Table 2 :
Impact of hc on the fairness index networks have been addressed by a large number of papers (see