A Feedback Approach for QoS-Enhanced MAC in Wireless Sensor Network

WSN as well as Wireless Multimedia Sensor Network (WMSN) has demands for QoS provision and differentiated service. The various types of data, such as video, voice, and network management, need to be periodically or best-effect transmitted. Since MAC layer forces the final physical medium accessing, it is the best choice to implement the QoS support for efficiency. This paper addresses the problem of QoS support in WSN from a renewed view of control theory and proposes FD-MAC architecture. By means of CSMA/CA, FD-MACdynamically adjusts contention widow size according to theMAC frames’ priorities and their actual QoS metrics. The architecture can be modeled as a linear time-invariant system by system identification, and Least-Beat controller is designed to drive the system output to the desired value, which means the ratio of actual QoS metrics can be controlled to a prefixed value. The higher priorities enjoy a comparatively lower node-to-node delay while the lower priorities can still operate without being oversacrificed.


Introduction
As the semiconductor developing, the embedded processor is getting more powerful and energy-saving, which makes WSN have the ability to do more than data collection and network transmission.The concern about QoS on multihop wireless network is necessary and supportable.
WSN has provided ability to sense and connect the physical environment and the cyber space.Moreover, in many fields such as target tracking in battlefields and rescue activity in earthquake ruins, the real-time data delivery from hot-points plays a more crucial role than the common data.Wireless Multimedia Sensor Network (WMSN) in which WSN node carries tiny cameras and microphones also requires QoS provision and differentiated service.The various types of data, such as video, voice, and network-management, need to be periodically or best-effect transmitted.Since MAC layer forces the final physical medium accessing, it is the best choice to implement the QoS support for efficiency.
Most existing WSN MAC protocols can be divided into two classes: Time Division Multiple Access-(TDMA-) based MAC and CSMA/CA-based MAC [1].Although TDMAbased MAC protocols have higher link utilization efficiency in heavy network load, they suffer from the problems of complex clock synchronization and lack of sensitivity to network traffic.On the contrary, many solutions have been proposed for the prioritized CSMA/CA-based MAC protocols in WSN for their simple implementation and acceptable performance, such as RCS-MAC [2], QS-MAC [3], PQ-MAC [4], EQ-MAC [5], Diff-MAC [6], and AMP-MAC [7].
To the best of our knowledge, in these researches, QoS is controlled by assigning different accessing priority to MAC frames and the accessing priority is enforced by adjusting the contention window.This is a subjective design and has been proved effective by simulations and experiments.Some researches have also proposed the adapted contention window (CW) according to the dynamic traffic [3,[5][6][7].Saxena et al. [3] and Yigitel et al. [6] both developed allin-one QoS-aware MAC protocols with common features of CW size and duty cycle adaptation.Their differences lie in the mechanics of CW adjustment approaches.Compared with QS-MAC proposed by Saxena   proposed by Yigitel et al. adjusts CW size continuously regardless of the neighboring nodes, so it chooses CW faster [8].However, all these papers are from the view of architecture realization without theoretically analyzing the system stability and dynamic performance.Can the multiqueueing architecture of MAC always converge or sometimes diverge?How long can the multiqueueing system reach the steady state and what factors will affect the system stability?In this paper, we are trying to address these problems from a renewed view of control theory and finally propose FD-MAC to support differentiated node-to-node delay control.Our FD-MAC improves the CW size control by system identification and Least-Beat controller design.Compared with Diff-MAC in Section 4, the convergence of system can be ensured and the jitter of output as well as oscillation is small.
We take Diff-MAC as competitor for two reasons: (1) Diff-MAC is an all-in-one MAC protocol including network layer adaptive fragmentation, adaptively duty-cycling to balance the energy consumption, as well as intranode and intraqueue prioritization feature.FD-MAC can be easily integrated with its CW size adjusting method without affecting other QoS features.(2) There are two classic service differentiation models for QoS control in conventional computer networks: integrated services (IntServ) and differentiated services (DiffServ).Lightweight and easy-to-implement DiffServ can easily be adapted to WSN in a multihop manner.Although papers have actually used DiffServ in adaptive contention window or duty cycle, Diff-MAC is the minority to point out that the essential of differentiated service in TDMA-based MAC is to treat each of these traffic classes differently by managing the resource sharing among them [8][9][10].The intention of Diff-MAC matches DiffServ well and FD-MAC also use proportional delay differentiation (PDD) in system modeling, which is one of the most important models in DiffServ.
The remainder of the paper is organized as follows: In Section 2, the architecture of FD-MAC is proposed and three compositions for the general QoS-enhanced MAC as well as our FD-MAC are reenforced and formulated.In Section 3, FD-MAC is modeled as a linear time-invariant system.The system order and parameters can be determined by system identification.Finally, a Least-Beat controller is designed to drive the FD-MAC to the desired output.In Section 4, the experiments show the dynamic and static statistics performances of FD-MAC as well as the comparison with Diff-MAC.

Feedback-Based Diff-MAC Architecture
2.1.Overview.The typical factors effecting QoS on the network layer are the end-to-end delay, throughput, bandwidth throttle, package drop rate, and so forth, which also exist in WSN.The data transmission is so important for the realtime surveillance in WSN/WMSN that this paper chooses end-to-end delay (also named as node-to-node delay) as the main QoS metric to drive our approach.Other QoS metricdriven methods are similar but just different in the bottleneck resources scheduling [11].
Because of the medium resource limitation and energy efficient features of WSN/WMSN, for every node, a major issue for FD-MAC is how to control the winning probability in the medium accessing contention.We reenforce and formulate three compositions for the general QoSenhanced MAC as well as our FD-MAC.They are Frame Classification, Performance Isolation, and Accessing Priority Control. Figure 1 shows the brief architecture of our FD-MAC.
(1) Frame Classification.According to four-layered network architecture of IEEE, the classification can be enforced at network layer, datalink layer, and physical layer.Correspondingly, there are datagram-based, packet-based, and frame-based classification methods.But, in WSN nodes, the resources starvation leads to an obscure boundary between network layer and application layer, especially for some Reduced Function Device (RFD).This paper uses a crosslayered classification; that is, different WSN applications are classified into different categories, and all the datagrams from the same application are marked by a flag called Priority Flag.This flag is passed cross the network so MAC layer can identify the priority of the frame encapsulation.
The classification strategy may be prefixed or dynamically negotiated and broadcasted by higher protocol, which is not in the scope of this paper.
(2) Performance Isolation.Queuing theory has been used to model and analyze WSN MAC frames transmission [12].To support differentiated service, frames of different categories are serviced in isolated queues waiting to be transmitted in the manner of First-In-First-Out (FIFO), as well as the frame receiving.The QoS feedback control is enforced on the sender node and the frame transmission procedure is shown as Figure 1.
(3) Accessing Priority Control.MAC frames are contending for medium accessing according to their priorities.Thanks to CSMA/CA mechanism, the accessing probability can be controlled by assigning different size of back-off windows.Our mechanism is to decrease the probability of collisions for high priority by enhancing other priorities' initial up boundary of back-off time.
Service Level Agreement (SLA) is a service contract between the service provider (either internal or external) and the end user which defines the service level expected from the service provider.Researchers [13,14] have brought out this concept in WSN.SLA is an application layer protocol which administrates, manages, and negotiates how to set QoS parameters.Supposing the applications' priorities are prefixed or set by SLA, we take the relative differentiated service and the proportional differentiation model to realize a differentiated service.On the one hand, the higher priority application, such as real-time voice and video transition, should suffer a relatively better QoS compared with other applications, which means a lower latency in this paper.On the other hand, the lower priority will not be oversacrificed and thus the fairness is also sustained.

System Modeling and Controller Design
3.1.Proportional Delay Differentiation.Suppose there are  types of frame categories in WSN.The control object is to maintain the actual QoS parameters to meet Generally,  and  are the consecutive integers.In this paper,   is the average node-to-node delay between the sender and receiver, and   is the priority parameter of class  set by SLA.The class with smaller  is higher priority and expects a lower delay.performs another random back-off in the range of [0,   − 1],  ≤  max − 1, where  is the time that the medium is consecutively sensed to be busy.After  max times of back-off, the current frame is discarded.Let   = min(2   min ,  max ),  = 0, . . .,  max − 1, where  min and  max are the predefined default parameters.This back-off protocol is known as binary exponential back-off (BEB).

Linear-Differ Binary Exponential
In order to provide the differentiated accessing probability, we design a Linear-Differ binary exponential back-off (LD-BEB) scheme by adopting different initial up boundary of back-off time dynamically, which is the system manipulation.At the th sampling time, the system input is To maximize the medium utilization, the initial up boundary of back-off time for the highest priority must always start with  min , which means  = 1.So X() has only  =  − 1 independent variables.During the th and +1th sampling time, the initial backoff time is randomly chosen in the range of [0,   () min − 1].Once the initial back-off time is set, this frame starts contention for medium accessing.If collision is detected, the back-off time is reset in the range of [0,   − 1] without recalculating   (): where  is the collision times consecutively detected.Notice that X() is not related to the back-off time resetting when the collision happens, which guarantees the fairness of different priorities.

System Modeling.
Figure 2 shows the control model of FD-MAC.Define   () and   desire as the normalized delay and normalized desired QoS value according to (1): Because of ∑  =1   () = 1 and ∑  =1   desire = 1, the system output also has  =  − 1 independent variables.Supposing E() is the deviation between the measured normalized delay and its desired value: The QoS controller operates by responding to the deviation, that is, adjusting the accessing probability by changing the up boundary of MAC frames' back-off time.Thus the proportional delay differentiation is sustained.Despite the uncertainty of medium accessing, the inherent self-stabilization of feedback mechanism liberates us from calculating the backoff time for every frame precisely.

System Identification and Validation.
The input and output of FD-MAC model are shown as in Figure 2. Strictly speaking, we require a discrete and nonlinear model for FD-MAC.However, such a nonlinear model is not amenable to the straightforward theoretical design and analysis.So the following linear model is used to approximate the system.Supposing -order could be precise enough, the corresponding difference equation is and the -domain transformation is where E() = [ 1 (),  2 (), . . .,  −1 ()]  is -order white noise sequence.Consider so ( 8) can be rewritten as where We take Recursive Least Square (RLS) algorithm to estimate the parameter matrix Θ and -test to determinate the system order. where P  is the covariance matrix, and  is the forgetting factor.Φ, Y are measured by QoS monitor.By selecting appropriate Θ0 and P 0 , we could get the estimation of parameter matrix.

3.4.2.
Determining System Order .Second, we need to determine the system order  by -test.We define a loss function () to describe the variance between the identified Ŷ and its measured value: where ‖ ⋅ ‖ is vector norm 2 and  is the sampling amount.Supposing  1 and  2 are the consecutive orders of system ( 2 >  1 ), then statistics variable  is constructed as follows: (1) Begin (2) Set  be the maximum possible order, that is,  =  max .

1) Establishing the null hypothesis:
There is no significant difference between () and ( − 1), when system order changes form  to  − 1; (2) Calculating statistics variable: From J, we can get  according to ( 15 If  is large enough, ( 1 ,  2 ) obeys -distribution: Algorithm 1 shows the pseudocode for ().
Then J = [(1), (2), . . ., ( max )]  is obtained, where () is the loss function value in -order system.Our experiments are operated by ZigBit 900 hardware module, which is a 784/868/915 MHz IEEE 802.15.4 OEM module.The details of FD-MAC hardware implementations are in Section 4.1.We deploy 20 ZigBit 900 nodes with the positions in the radius of 100 meters.The transmitted power is 1 mW,  min = 2 3 ,  max = 2 8 , and  max = 3.The average frame length is 105 bytes and the symbol rate is 256 kbps.The pseudorandom sequence is generated as (11) and   ( + 1) is taken as in Table 1.
Figure 3 shows the system identification results on different nodes.The upper subfigure shows the convergence of Θ and the lower subfigure shows the comparison between the measured value  1 () and the identified value ŷ1 ( + 1) = ΘΦ().
At each node, we sample 160 points for identification.According to Algorithm 2, set the significance level  = 5%; thus  0.05 (2, 154) ≈ 3.055.Because all the   (2, 3) <  0.05 (2, 154) (we only show 5 out of 20 nodes'   (2, 3) in Figure 3), there is no significant performance difference when the system order changes from 3 to 2. So the FD-MAC can be modeled as a second-order linear time-invariant system.Take Node 1 as an example; the estimation of Y( + 1) is As shown in Figure 3, Θ is different on different nodes and stabilized after about 25 seconds, which means the system model can be identified after 50 sampling cycles.Take Figure 3(a) as an example; Θ1 converges to [0.5174, −0.0372, 0.0251, 0.4736] on Node 1, so the system transfer function in -domain is From ( 18), the open loop zeros and poles of Node 1 are all in the unit circle, so the FD-MAC model on Node 1 is a stable system.Similarly, we can get that other WSN nodes in this configuration are stabilized as well.
Thanks to the Least-Beat Control approach, the system output can follow the input signal in very several sampling time and can limit the steady-state error to zero (zero steadystate error system).The typical input signal in -domain is as (20), such as unit-step function, unit-ramp function, and unit of acceleration function: So the deviation E in -domain is where F  () = 1 − F().In order to force the system as a zero steady-state error system, according to -transfer expirationvalue theorem, the system steady-state error is If E(∞) = 0, F  must have factor of (1 −  −1 )  .In actual WSN application, the priorities of frame flow are generally constant or lower-frequency changing, so unit-step function is used as the input signal for Y desire ; that is,  = 1.Put F() =  −1 into (19); there is According to (18),  (3) Multiqueueing Isolation.In AVR2025, MAC frames to be transmitted are buffered in a FIFO queue named NHLE-MAC-Queue.We improve this single queue into multiqueueing architecture.According to Priority Flag, the frames of different categories are pushed into the corresponding queues waiting to be transmitted.The receiving procedure is also improved to multiqueue architecture.

Experiments and Simulation
(4) Delay Calculation.Thanks to MAC API callback functions, once a frame is transmitted, a callback function will generate a software interruption.By means of this mechanism, the node-to-node delay can be measured by sender node.
We developed two groups of comparison experiments to evaluate the dynamic and static performances of FD-MAC on ZigBit 900.The parameters configuration is the same as that in Section 3.4.The dynamic property mainly concerns the QoS condition changing with the time on every node, and the static property concerns the system throughput and delay changing with the offered traffic from the view of statistics.

Dynamic Performance of FD-MAC. As shown in
Figure 4, the first group tests the dynamic performance of the FD-MAC.The -axis represents time in seconds.In the -axis direction, that is, vertical axis, Figures 4(a) and 4(b) are the corresponding average node-to-node delay and delay ratio of high priority (Class 1) and low priority (Class 2).Set  1 / 2 = 1/2, Y desire =  desire = 1/3, which means the delay of Class 1 should be half of Class 2. For the picture clearness, we only show the delay ratio of  1 ()/ 2 () without normalizing and only show 5 out of 20 nodes' statuses in -axis as well.The sampling time is 500 milliseconds.In order to test the dynamic performance of  FD-MAC compared with the CSMA/CA in IEEE 802.15.4,our experiment uses the controller off-and-then-on model.When the feedback controller is off, FD-MAC degenerates to the standard CSMA/CA.The experiment lasts 80 seconds and the feedback controller starts at about 25 seconds: (1) At the first 25 seconds, the feedback controller is closed and the initial up boundary of back-off time of each priority is the same.So there is no difference at the average node-to-node delay and the delay ratio is around the value of 1.
(2) When the controller operates after 25 seconds, the initial up boundary of back-off time is dynamically adjusted by the Least-Beat controller according to E().So the average node-to-node delay of different priority is distinguished and the delay ratio is converged to the expected value of 1/2.This proves that the FD-MAC architecture has the QoS-enhanced ability.
(3) Since we have modeled FD-MAC as a feedback control model, this controller off-and-then-on model is an equivalent of a step function signal.Figure 4 shows the stability and the convergence of FD-MAC outputs, that is, the actual delay ratio of Class 1 and Class 2. Taking control theory to describe the dynamic performance, the system setting time is nearly one sampling time and the steady-state error is nearly zero, which are coincident to the controller design.
The system output can converge to the set point in very short time (about 0.5 seconds) and barely has bias in steady state.This demonstrates both the theoretical basis and the feasibility of FD-MAC.

Static Statistics Performance of FD-MAC.
As shown in Figure 5, the second group tests the static statistics performance of the FD-MAC.The -axis represents the offered traffic per nodes.In the -axis direction, that is, vertical axis, Figures 5(a), 5(b), and 5(c) are the corresponding node-tonode delay, delay ratio, and frame throughput of high priority (Class 1) and low priority (Class 2).In the -axis direction, the values of  1 / 2 are set to be 1/3, 1/2, and 2/3 successively: (1) Obviously, the delay of high priority (Class 1) is lower than that without the controller, while the delay of low priority (Class 2) is higher than that without the controller.(2) Figure 5(a) shows that no matter what Y desire changes-that is, corresponding  1 / 2 varies from 0.33 to 0.5 and then to 0.66-the delay of high priority and low priority can be significantly differentiated.Figure 5(b) shows that the delay ratio always converges to the set points.This not only proves the validity of the FD-MAC again, but also reveals its robustness.(3) We use legends of "average delay in differentiated control" and "no differentiated control" to present the total average delay when the controller is action and inaction in Figure 5(a), that is, FD-MAC at different  1 / 2 and the standard CSMA/CA.The total average delay is the result of total delay divided by the total frame number, and the total delay is the cumulative summation of all the frame node-tonode delay.Comparing the total average delay in the circumstance of controller action and inaction, it is suggested that FD-MAC can also reduce the total average delay.(4) The FD-MAC not only works on the node-to-node delay, but also has impact on throughput.As shown in Figure 5(c), the throughput can also be distinguished.We use legends of "total throughput in differentiated control" and "no differentiated control" to present the total throughput when the controller is action and inaction.The total throughput is actually the value summation of high priority and low priority.
It is worth mentioning that, by calculation, the total throughput has no significant changes compared with those when the controller is inaction.This phenomenon implies that FD-MAC has no performance lost on the throughput.6(a) and throughput in Figure 6(b).Unlike the former two groups of hardware experiments, axis presents different MAC protocols.The value of  1 / 2 is set to 1/2; that is, Y desire =  desire = 1/3, and the related parameters are set according to Table 2.
(1) From the comparison between the groups of lines at -axis with  1 / 2 = 0.5 in Figures 5(a (2) FD-MAC outperforms Diff-MAC in tracking the desired value Y desire () for two reasons.First, without the analysis of the controlled object model, the designed controller could rarely match the feature of controlled object.Second, the control method used in [6] could hardly be considered as a proportional () control, because the deviation E() is only used as an on-off quantity to control whether to decrease or increase the CW size, but the quantities of changes are a prefixed value.The consequence is that the crucial resources, that is, the CW size, may not be swiftly adjusted to a proper value.Figures 7(b) and 7(c) show some clues for this.The improper CW size causes the jitter of delay ratio, and the bad-designed controller could not correct the error by providing a right increment and polarity for CW size, which in turn exacerbates the delay ratio.In the worst case, the delay ratio may diverge, which also induces the throughput degradation and total average delay enlargement.

Conclusion
In order to provide WSN QoS and the differentiated nodeto-node delay control, we propose a FD-MAC architecture by dynamically adjusting the medium accessing probability, which is enforced by adopting different initial up boundary of back-off time.The actual delay ratio is guaranteed to be a prefixed value by the Least-Beat control.By means of system identification, for every WSN node, the system can be modeled as a difference linear timeinvariant equation.So the specific controller can be designed to drive the system output to the desired value, which means that higher priority can enjoy comparatively lower delay while the lower priority can also operate without being oversacrificed.
The hardware experiments show that the FD-MAC operates effectively in providing proportional delay differentiation in IEEE 802.15.4 and the extended simulations also prove the effectiveness in IEEE 802.11 a/b as well.Compared with the CSMA/CA in IEEE 802.11 a/b and IEEE 802.15.4, the feedback control approach not only has a less average delay and the same throughput, but also has the advantages of QoS-enhanced ability.Compared with Diff-MAC, WSN has a better step response in FD-MAC, which reveals only 48% relative variance compared to that of Diff-MAC.
In the future work, we intend to adopt online system identification and self-adaptive control instead of the two separated offline steps, that is, "system identification and controller design."The extended tests in real WMSN environment that contains the real-time video/audio traffic are also underway.
et al., Diff-MAC delay QoS measurement

5 Figure 3 : 7 3. 5 .
Figure 3: Value convergence of matrix Θ and the comparison between identified value and the actual measurement.

Node 1 5 N
high priority Node 1 low priority Node 2 high priority Node 2 low priority Node 3 high priority Node 3 low priority Node 4 high priority Node 4 low priority Node 5 high priority Node 5 Average node-to-node delay Delay ratio Node 1 delay ratio Node 2 delay ratio Node 3 delay ratio Node 4 delay ratio Node 5 delay ratio  1 / 2 = 0.

Figure 4 :
Figure 4: The dynamic performance of the FD-MAC.

Figure 5 :
Figure 5: The static statistics performances under different desired point.
[16]interval of frame transmission obeys normal distribution with the average of −  / log(1 − ).(0 <  < 1) is the offered traffic[15], which is normalized by transmission data rate.That is,  =   /.(bit) is the average MAC frame length and  (bps) is data rate.The frame length in experiments follows Pareto distribution with the shape parameter of 1.1[16]and average of 105 * 8 bits.
4.1.Hardware Experiments for FD-MAC in IEEE 802.15.4.Our experiments are operated by ZigBit 900 hardware module with Atmel AVR2025 software package.ZigBit 900 is a 784/868/915 MHz IEEE 802.15.4 OEM module, which contains an ATmega1281V microcontroller and AT86RF212 RF transceiver.AVR2025 is a configurable MAC stack for ZigBit (2) Cross-Layered Classification.Every MAC frame contains a flag called Priority Flag representing its category.In our experiments, there are two types of MAC traffic.Actually, Y desire is set by the specific management command, which is encapsulated in MAC payload and broadcasted to all the nodes by coordinator.
There are also 20 nodes with the positions in a radius of 100 meters.The -axis still represents the offered traffic per nodes.-axis (vertical axis) represents node-tonode delay in Figure 4.2.Software Simulation and Comparison 4.2.1.Versatility of FD-MAC in IEEE 802.11 a/b.We further take OPNET to evaluate the FD-MAC in IEEE 802.11 a/b, as well as 802.15.4.