International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 MAC Layer Service Time Distribution of a Fixed Priority Real Time Scheduler over 802.11 Inès El Korbi Ecole Nationale des Sciences de l’Informatique Laboratoire Cristal Université de la Manouba, 2010 Tunisia ines.korbi@gmail.com Leila Azouz Saidane Ecole Nationale des Sciences de l’Informatique Laboratoire Cristal Université de la Manouba, 2010 Tunisia leila.saidane@ensi.rnu.tn Abstract In this paper, we propose to support a fixed priority real time scheduler over 802.11 protocol called Deadline Monotonic (DM). We evaluate the performances of this policy for a simple scenario where two stations with different delay constraints contend for the channel. For this scenario a Markov chain based analytical model is proposed. From the mathematical model, we derive the probability distribution of the packet service time at MAC layer. Analytical results are validated by simulation using the ns-2 network simulator. 1. Introduction The IEEE 802.11 wireless LANs [2] become more and more reliable to support applications with Quality of Service (QoS) requirements. Indeed, the IEEE 802.11e standard [3] was recently proposed to offer service differentiation over 802.11. The IEEE 802.11e standard proposes the Enhanced Distributed Channel Access (EDCA) as an extension for the 802.11 Distributed Coordination Function (DCF). With EDCA, each station maintains four priorities called Access Categories (ACs). Each access category is characterized by a minimum and a maximum contention window sizes and an Arbitration Inter Frame Space (AIFS). Even though the IEEE 802.11e protocol introduces service differentiation over 802.11, the granularity of service offered by 802.11e (4 priorities at most) can not satisfy the real time flows requirements (each flow is characterized by its own delay bound). Therefore, we propose in this paper a new medium access mechanism based on the fixed priority Deadline Monotonic (DM) policy [8] to schedule real time flows over 802.11. To support the DM policy over 802.11, we use a distributed scheduling and introduce a new medium access backoff policy. We then propose a Markov chain based analytical model to evaluate the performances of DM for a simple scenario where two stations with different deadline constraints contend for the channel. This configuration will reflect the behavior of DM over 802.11 and the mathematical model can be extended for more complex scenarios. 95 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 For the considered configuration, we evaluate for each station the MAC layer service time distribution. We can therefore derive the probability that the packet service time exceeds a certain value. Analytical results will be validated and extended by simulation using the ns-2 network simulator [9]. The rest of this paper is organized as follows. In section 2, we review the works related to our study. In section 3, we present the distributed scheduling and introduce the new medium access backoff policy to support DM over 802.11. In section 4, we present the mathematical model based on the Markov chains analysis. In section 5, we evaluate the service time distribution and present analytical and simulation results. Finally, we conclude the paper in section 6. 2. Related Works In the absence of a coordination point, the IEEE 802.11 defines the Distributed Coordination Function (DCF) based on the Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) protocol. In the DCF protocol, a station shall ensure that the channel is idle when it attempts to transmit. Then it selects a random backoff in the contention window [0 , CW − 1] , where CW is the current window size and takes its values between the minimum and the maximum contention window sizes. If the channel is sensed busy, the station suspends its backoff until the channel becomes idle for a Distributed Inter Frame Space (DIFS) after a successful transmission or an Extended Inter Frame Space (EIFS) after a collision. When the backoff reaches 0, the packet is transmitted. A packet is dropped if it collides after maximum retransmission attempts. Different works have been proposed to evaluate the performance of the 802.11 DCF. Indeed, Bianchi [1] proposed a Markov chain based analytical model to evaluate the saturation throughput of the 802.11 protocol. Probabilistic bounds on MAC layer service time were derived in [10]. The IEEE 802.11e performs service differentiation over 802.11 and aggregates the traffic into four access categories. In [4] and [5] Osterbo and Al. proposed to evaluate the performance of EDCA under saturated and non saturated conditions. Although the IEEE 802.11e EDCA classifies the traffic into four prioritized ACs, there is still no guarantee of real time transmission service. This is due to the lack of a satisfactory scheduling method for various delay-sensitive flows. In this paper, we focus on delay sensitive flows and propose to support the fixed priority Deadline Monotonic (DM) policy over 802.11 to schedule delay sensitive flows. For instance, we use a priority broadcast mechanism similar to [6] and introduce a new medium access backoff policy where the backoff value is inferred from the deadline information. 3. Supporting Deadline Monotonic Policy over 802.11 The Deadline Monotonic policy (DM) [8] is a real time scheduling policy that assigns static priorities to flows packets according to their deadlines; the packet with the small deadline being assigned the highest priority. Indeed, when flows packets arrive to a station, they are sorted by increasing order of their deadlines such as the Head of Line (HOL) packet has the shortest delay bound. The problem that occurs with the DCF is that all the stations share the same transmission medium and the HOL packets of all the stations will contend for the channel with the same priority even if they have different deadlines. 96 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 The idea of introducing DM over 802.11 is to allow stations having packets with short deadlines to access the channel with higher priority than those having packets with long deadlines. Providing such a QoS requires a distributed scheduling and a new medium access policy. 3.1. Distributed Scheduling To realize a distributed scheduling over 802.11, we introduce a broadcast priority mechanism similar to [6]. In each station, we focus on two packets: − The current packet: the packet being served. − The HOL packet: the packet at the head of the queue that will be transmitted after the service completion of the current packet. Each station maintains a local scheduling table with entries for HOL packets of all other stations. Each entry in the scheduling table of node S i comprises two fields (S k , Dk ) where S k is the source node MAC address (Address 2 field in DATA packet and RA field in the ACK packet) and Dk is the deadline of station S k HOL packet. To broadcast the HOL packet deadlines, we propose to use the DATA/ACK access mode. The deadline information requires two additional bytes to be encoded in DATA and ACK packets. When a node S i transmits a DATA packet, it piggybacks the deadline of its HOL packet. The nodes hearing the DATA packet add an entry for S i in their local scheduling tables by filling the corresponding fields. The receiver of the DATA packet copies the priority of the HOL packet in ACK before sending the ACK frame. All the stations that did not hear the DATA packet add an entry for S i using the information in the ACK packet. In the following, we propose a new medium access policy, where the backoff value is inferred from the packet deadline. 3.2. DM medium access backoff policy Let’s consider two stations S 1 and S 2 transmitting two flows with the same deadline D1 ( D1 is expressed as a number of 802.11 slots). The two stations having the same delay bounds can access the channel with the same priority using the native 802.11 DCF. Now, we suppose that S 1 and S 2 transmit flows with different delay bounds D1 and D2 such as D1 < D2 and generate two packets at time instants t 1 and t 2 . If S 2 had the same delay bound as S 1 , its packet would have been generated at time t' 2 such as t' 2 = t 2 + D21 , where D21 = (D2 − D1 ) . At that time S 1 and S 2 would have the same priority and transmit their packets according to the 802.11 protocol. Hence, when S 2 has a packet to transmit, it selects a 802.11 backoff, but suspends this backoff during D21 idle slots. The D21 slots elapsed, 802.11 backoff can therefore be decremented. Thus to support DM over 802.11, each station uses a new backoff policy where the backoff is given by: • The random backoff selected in [0 , CW − 1] , according to 802.11 DCF, called BAsic Backoff (BAB). • The DM Shifting Backoff (DMSB): corresponds to the additional backoff slots that a station with low priority (transmitting a packet with a large deadline) adds to its 97 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 BAB to have the same priority as the station with the highest priority (transmitting the packet with the shortest deadline). Whenever a station S i sends an ACK or hears an ACK on the channel its DMSB is reevaluated as follows: DMSB (S i ) = Deadline(HOL(S i ) − DTmin (S i )) (1) where DTmin (S i ) is the minimum of the HOL packet deadlines present in S i scheduling table and Deadline(HOL (S i )) is station S i HOL packet deadline. Hence, when S i has to transmit its HOL packet with a delay bound Di , it selects a BAB in the contention window [0 , CW min − 1] and computes the Whole Backoff (WHB) value as follows: WHB(S i ) = DMSB(S i ) + BAB(S i ) (2) The station S i decrements its WHB when it senses an idle slot. Now, we suppose that S i senses the channel busy. If a successful transmission is heard, then S i revaluates its DMSB when a correct ACK is heard. Then, S i adds the new DMSB value to its current BAB as in equation (2). Whereas, if a collision is heard, S i reinitializes its DMSB and adds it to its current BAB to allow colliding stations contending with the same priority as for their first transmission attempt. S i transmits when its WHB reaches 0. 4. Mathematical Model of the DM policy over 802.11 In the hereby section, we propose a mathematical model to evaluate the performance of the DM policy using Markov chains analysis [1]. We consider the following assumptions: 1) The system under study comprises two stations S 1 and S 2 , such as S i transmits a flow Fi having a deadline Di and D1 < D2 . We define D21 = (D2 − D1 ) as the difference between the two delay bounds. 2) We operate in saturation conditions: each station has immediately a packet available for transmission after the service completion of the previous packet [1]. 3) A station selects a BAB in a contention window [0 ,W − 1] . We consider that each station selects a 802.11 backoff in the same contention window of size W independently of the transmission attempt. This is a simplifying assumption to limit the complexity of the mathematical model. 4) We suppose that we are in stationary conditions, i.e. the two stations have already sent one packet to each other. Thus, the two stations have the same scheduling table. Each station S i will be modeled by a Markov chain representing the whole backoff (WHB) process. 98 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 4.1 Markov chain modeling station S1 Figure 1 represents the Markov chain modeling station S 1 . Figure 1: Markov chain modeling station S 1 The states of this Markov chain are described by the following quadruplet (R ,i ,i − j ,− D21 ) where: • R : takes two values ~ S 2 and S 2 . When R = ~ S 2 , station S 2 is decrementing its shifting backoff (DMSB) during D21 slots and wouldn’t contend for the channel. When R = S 2 , the D21 slots were elapsed and S 2 will contend for the channel at the same time as S 1 . • i : the value of the BAB selected by S 1 in [0 ,W − 1] . • (i − j ) : corresponds to the remaining backoff slots before reaching 0. D21 : corresponds to (D2 − D1 ) . We choose the negative notation − D 21 • to express the fact that S 2 and DMSB(S 1 ) = 0 . for S 1 has a positive ∆ΜΣΒ equals to D21 Initially S 1 selects a random BAB and is in one of the states (~ S 2 , i , i ,− D21 ) , i = 0..W − 1 . During (D21 − 1) slots, S 1 decrements its backoff with the probability 1 and moves to one of the states (~ S 2 , i , i − j ,− D21 ) , i = 0..W − 1 , j = min(max (0 , i − 1), D21 − 1) . Indeed during these slots, S 2 is decrementing its DMSB and wouldn’t contend for the channel. When S 1 th decrements its D21 slot it knows that henceforth, S 2 can contend for the channel (the D21 slots were elapsed). Hence, S 1 moves to one of the states (S 2 , i , i − D21 ,− D21 ) , i = D21 ..W − 1 . If the BAB initially selected by S 1 is smaller than D21 , then S 1 transmits when its backoff reaches 0. If S 2 transmits before S 1 backoff reaches 0, the next packet of S 2 will decrement another DMSB and S 1 will see the channel free again for D21 slots. 99 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 4.2 Markov chain modeling station S2 Figure 2 represents the Markov chain modeling station S 2 . Figure 2: Markov chain modeling station S 2 Each state of S 2 Markov chain is represented by the quadruplet (i , k , D21 − j , D21 ) where: • i : refers to the BAB value selected by S 2 in [0 ,W − 1] . • k : refers to the current BAB value. • D21 − j : refers to the current DMSB of S 2 , j in [0 , D 21 ] . • D21 : corresponds to (D2 − D1 ) . When S 2 selects a BAB, its DMSB equals D21 and is in one of states (i , i , D21 , D21 ) , i = 0..W − 1 . If S 2 observes the channel idle during D21 slots, it moves to one of the states (i ,i ,0 , D21 ) , i = 0..W − 1 , where it ends its shifting backoff. At that time, S 2 begins decrementing its basic backoff. If S 1 transmits from the state (i , i ,0 , D21 ) , S 2 reinitializes its shifting backoff and moves again to one of the states (i , i , D21 , D21 ) , i = 1..W − 1 . 4.3. Blocking probabilities in the Markov chains We notice from figure 1 that when S 1 is in one of the states (~ S 2 , i , i − j ,− D 21 ) , i = 0..W − 1 , j = min(max (0 , i − 1), D21 − 1) , it decrements its backoff with the probability 1. That means that when S 1 is in one of these states (~ S 2 , i , i − j ,− D21 ) , it knows that S 2 is decrementing its DMSB and is in one of the states (i , i , D 21 − j , D21 ) , i = 0..W − 1 , j = 0..(D21 − 1) . However, when S 1 is in one of the states (S 2 , i , i − D 21 ,− D21 ) , i = D21 ..(W − 1) , S 2 has already decremented its DMSB and can now contend for the channel by decrementing its basic backoff. In this case, will be in one of the states S2 (i ,i ,0 , D21 )i =0..W −1 ∪ (i ,i − 1,0 , D21 )i =2..W −1 . From the explanations above, each station Markov chain states can be divided in two groups: 100 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 − ξ 1 : the set of states of S 1 for which S 2 will not contend (blue states in figure 1). ξ 1 = {(~ S 2 ,i ,i − j ,− D21 ),i = 0..W − 1, j = 0.. min(max(0 ,i − 1), D21 − 1)} − γ 1 : the set of states of station S 1 for which S 2 can con contend and decrements its BAB (pink states in figure 1). γ 1 = {(S 2 , i , i − D 21 ,− D 21 ), i = D21 ..W − 1} − ξ 2 : the set of states of S 2 where S 2 does not contend for the channel (blue states in figure 2). ξ 2 = {(i ,i , D21 − j , D 21 ), i = 0..W − 1, j = 0..(D21 − 1)} − γ 2 : the set of states of S 2 , where S 2 contends for the channel (pink states in figure 2). γ 2 = {(i , i ,0 , D21 ),i = 0..W − 1 ∪ (i ,i − 1,0 , D21 ), i = 2..W − 1} Thus when S 1 is in one of the states of ξ 1 , S 2 is obligatory in of the states of ξ 2 . Similarly, when S 1 is in one of the states of γ 1 , S 2 is obligatory in of the states of γ 2 . When the station S 2 is in one states of ξ 2 , S 2 is blocked with the probability τ 11 , this probability corresponds to the probability that S 1 transmits given that it is in one of the states of ξ 1 . Thus: [ τ 11 = Pr S 1 transmits ξ 1 ] π 1(~ S2 ,0 ,0 ,− D21 ) = W −1 min ( max (0 ,i −1),D21 −1 ) (~ S 2 ,i ,i − j ,− D21 ) 1 i =0 j =0 ∑ (3) ∑π Where π 1( R ,i ,i − j ,− D21 ) is the probability that S 1 is in the state (R , i , i − j ,− D 21 ), in the stationary conditions and Π 1 = π 1( R ,i ,i − j ,− D21 ) is the probability vector of S 1 . We also define τ 12 , the probability that S 2 is blocked given that station S 1 is in one of the states of γ 1 . Hence: { } [ τ 12 = Pr S 1 transmits γ 1 ] = π 1(S 2 ,D21 ,0 ,− D21 ) W −1 ∑π (4) ( S 2 ,i ,i − D21 ,− D21 ) 1 i = D21 In the same way, when S 2 is in one of the states of ξ 2 , S 1 will decrement its backoff with the probability 1. Indeed, no one of the ξ 2 states corresponds to a transmission state (those states describe the shifting backoff decremented by S 2 ). However, when S 2 is in one of the states of γ 2 , it contends for the channel and S 1 is blocked with the probability τ 22 , such as: [ τ 22 = Pr S 2 transmits γ 2 ] = π 2(0 ,0 ,0 ,D21 ) W −1 ∑π i =0 (i ,i ,0 ,D21 ) 2 W −1 + ∑π (5) (i ,i −1,0 ,D21 ) 2 i =2 where π 2(i ,k ,D21 − j ,D21 ) is defined as the probability of the state (i , k , D21 − j , D21 ), in the stationary condition. Π 2 = π 2(i ,k ,D21 − j ,D21 ) is the probability vector of S 2 . { } 101 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 The blocking probabilities described above allow deducing the transition state probabilities and having the transition probability matrix Pi , for each station S i . Therefore, we can evaluate the state probabilities by solving the following system [7]: Π i Pi = Π i π ij = 1 j ∑ (6) 4.4. Transition probability matrix of S1 Let P1 be the transition probability matrix of S 1 and P1 {i , j} is the probability to transit from state i to state j . The transitions probabilities of station S 1 are: P1 {(~ S 2 ,i ,i − j ,− D21 ), (~ S 2 ,i ,i − ( j + 1),− D21 )} = 1,i = 2..W − 1, j = 0.. min(i − 2 , D21 − 2 ) P1 {(~ S 2 , i , i − D 21 + 1,− D 21 ), (S 2 , i , i − D21 ,− D21 )} = 1, i = D 21 ..(W − 1) P1 {(~ S 2 ,i ,1,− D21 ), (~ S 2 ,0 ,0 ,− D21 )} = 1, i = 1..(W − 1, D21 − 1) P1 {(S 2 , i , i − D21 ,− D21 ), (S 2 , (i − 1), (i − 1 − D21 ),− D 21 )} = 1 − τ 22 , i = (D 21 + 1)..W − 1 P1 {(S 2 ,i ,i − D21 ,− D21 ), (~ S 2 , (i − D21 ), (i − D21 ),− D21 )} = τ 22 , i = (D21 + 1)..W − 1 P1 {(~ S 2 ,0 ,0 ,− D21 ), (~ S 2 ,i ,i ,− D21 )} = (7) (8) (9) (10) (11) 1 ,i = 0..W − 1 W (12) 1 , i = 0..W − 1 W (13) If (D21 < W ) then: P1 {(S 2 , D21 ,0 ,− D21 ), (~ S 2 , i , i ,− D21 )} = By replacing P1 and Π 1 in (6) and solving the resulting system, we can express π 1( R ,i ,i − j ,− D21 ) as a function of τ 22 , where τ 22 is given by (5). 4.5. Transition probability matrix of S2 Let P2 be the transition probability matrix of S 2 . The transitions probabilities of S 2 are: P2 {(i , i , D21 − j , D21 ), (i , i , D21 − ( j + 1), D21 )} = 1 − τ 11 , i = 0..W − 1, j = 0..(D21 − 1) P2 {(i , i , D 21 − j , D21 ), (i , i , D21 , D21 )} = τ 11 , i = 0..W − 1, j = 0..(D21 − 1) P2 {(i , i ,0 , D21 ), (i , i − 1,0 , D21 )} = 1 − τ 12 , i = 2..W − 1 P2 {(1,1,0 , D 21 ), (0 ,0 ,0 , D21 )} = 1 − τ 12 P2 {(i , i ,0 , D21 ), (i , i , D 21 , D21 )} = τ 12 , i = 1..W − 1 P2 {(i , i − 1,0 , D21 ), (i − 1, i − 1, D 21 , D21 )} = τ 12 , i = 2..W − 1 102 (14) (15) (16) (17) (18) (19) International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 P2 {(i , i − 1,0 , D 21 ), (i − 1, i − 2 ,0 , D21 )} = 1 − τ 12 , i = 3..W − 1 1 , i = 0..W − 1 P2 {(0 ,0 ,0 , D 21 ), (i , i , D 21 , D 21 )} = W (20) (21) By replacing P2 and Π 2 in (6) and solving the resulting system, we can express π 2(i ,k ,D21 − j ,D21 ) as a function of τ 11 , τ 12 given respectively by equations (3), (4). Moreover, by replacing π 1( R ,i ,i − j ,− D21 ) and π 2(i ,k ,D21 − j ,D21 ) by their values, in equations (3), (4) and (5), we obtain a system of non linear equations as follows: τ 11 = f (τ 22 ) τ 12 = f (τ 22 ) τ 22 = f (τ 11 ,τ 12 ) under the constraint τ 11 > 0 ,τ 12 > 0 ,τ 22 > 0 ,τ 11 < 1,τ 12 < 1,τ 22 < 1 (22) Solving the above system (22), allows deducing the expressions of τ 11 , τ 12 and τ 22 , and deriving the state probabilities of S 1 and S 2 Markov chains. 5. Service Time Analysis In this section, we evaluate the MAC layer service time distribution of S 1 and S 2 , using the DM policy. The MAC layer service time is the time interval from the time instant that a packet becomes at the head of the queue and starts to contend for channel to the time instant that either the packet is acknowledged for a successful transmission or dropped. We propose to evaluate the Z-Transform of the MAC layer service time [10] to derive expressions of the service time distributions. The service time depends on the duration of an idle slot Te , the duration of a successful transmission Ts and the duration of a collision Tc [4], [10]. We have: ( = (T ) ) + EIFS Ts = TPHY + TMAC + T p + TD + SIFS + (TPHY + T ACK + TD ) + DIFS Tc PHY + TMAC + T p + TD (23) (24) where TPHY , TMAC and TACK are the durations of the PHY header, the MAC header and the ACK packet. TD is the time required to transmit the two bytes deadline information and T p is the time required to transmit the data payload. Stations hearing a collision wait during EIFS before resuming their packets. Tevent . Te As Te is the smallest duration event, the duration of all events will be given by 5.1. Z-transform of station S1 service time To evaluate the Z-transform of station S1 service time TS 1 (Z ) , we define: H 1( R ,i ,i − j ,− D21 ) (Z ) : The Z-transform of the time already elapsed from the instant S 1 selects a basic backoff in [0 ,W − 1] (i.e. being in one of the states (~ S 2 , i , i ,− D21 ) ) to the time it is found in the state (R , i , i − j ,− D 21 ) . 103 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 We evaluate H 1( R ,i ,i − j ,− D21 ) (Z ) for each state of S 1 Markov chain as follows: H 1(~ S 2 ,W −1,W −1− j ,− D21 ) (Z ) = 1 j Z , j = 0..D21 W (25) 1 Z , i = D 21 ..(W ..2 ) W Ts 1 T ( ) H 1(~ S 2 ,i ,i ,− D21 ) Z = τ 22 Z e H 1(~ S 2 ,i + D21 ,i ,− D21 ) (Z ) + W i = 1.. max(0 , (W − 1 − D21 )) H 1(~ S 2 ,i ,i ,− D21 ) (Z ) = (26) H 1(~ S 2 ,i ,i − j ,− D21 ) (Z ) = Z j H 1(~ S 2 ,i ,i ,− D21 ) (Z ), i = 1..W − 1, j = 1.. min(i − 1, D 21 − 1) H 1( S 2 ,i ,i − D21 ,− D21 ) (Z ) = Z D21 H 1( ~ S 2 ,i ,i ,− D21 ) (Z ) + (1 − τ 22 )Z H 1( S 2 ,i +1,i +1− D21 ,− D21 ) (Z ), i = D21 ..(W − 2 ) H 1(~ S 2 ,0 ,0 ,− D21 ) (Z ) = 1 + W min (W −1,D21 − 1) ∑ H 1( i =1 ~ S 2 ,i ,1,− D21 ) (Z ) (27) (28) (29) (30) If the station S 1 transmission state is (~ S 2 ,0 ,0 ,− D21 ) , the transmission will be successful since S 2 was decrementing its shifting backoff. Whereas when the station S 1 transmission state is (S 2 , D21 ,0 ,− D21 ) , the transmission occurs successfully only if S 2 doesn’t transmit with the probability (1 − τ 22 ) . Otherwise S 1 selects another backoff and tries another transmission. After m retransmissions, if the packet is not acknowledged, it will be dropped. TS 1 (Z ) = Z Ts Te (H 1( (Z )+ (1 − τ 22 )H 1(S2 ,D21 ,0 ,− D21 ) (Z ))∑ Z m ~ S 2 ,0 ,0 ,− D21 ) Tc T + Z e τ 22 H 1( S 2 ,D21 ,0 ,− D21 ) (Z ) i =0 m +1 Tc Te τ 22 H 1(C2 ,D21 ,0 ,− D21 ) (Z ) (31) 5.2. Z-transform of station S2 service time In the same way, we define TS 2 (Z ) , the Z-transform of station S 2 service time. We have: H 2(i ,k ,D21 − j ,D21 ) (Z ) : The Z-transform of the time already elapsed from the instant S 2 selects a basic backoff in [0 ,W − 1] (i.e. being in one of the states (i , i , D 21 , D 21 ) ) to the time it is found in the state (i , k , D 21 − j , D 21 ) . H 2(i ,i ,D21 ,D21 ) (Z ) = 104 1 , i = 0 and i = W − 1 W (32) International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 Ts 1 T + τ 12 Z e H 2(i +1,i ,0 ,D21 ) (Z ), i = 1..W − 2 H 2(i ,i ,D21 ,D21 ) (Z ) = W (33) j To compute H 2(i ,i ,D21 − j ,D21 ) (Z ) , we define Tdec (Z ) such as: 0 Tdec (Z ) = 1 (1 − τ 11 )Z j (Z ) = Tdec 1 − τ 11 Z So: (34) Ts Te , j = 1..D21 (35) j −1 (Z ) Tdec j (Z ), i = 0..W − 1, H 2(i ,i ,D21 − j ,D21 ) (Z ) = H 2(i ,i ,D21 − j +1,D21 ) (Z )Tdec j = 1..D21 , (i , j ) ≠ (0 , D 21 ) And: (36) H 2(i ,i −1,0 ,D21 ) (Z ) = (1 − τ 12 )ZH 2(i +1,i ,0 ,D21 ) (Z ) + (1 − τ 12 )ZH 2(i ,i ,0 ,D21 ) (Z ) 1 − τ 12 Z Ts Te , i = 2..W − 2 (37) D21 (Z ) Tdec H 2(W −1,W − 2 ,0 ,D21 ) (Z ) = (1 − τ 12 )ZH 2(W −1,W −1,0 ,D21 ) (Z ) 1 − τ 12 Z Ts Te , i = 2..W − 2 (38) D21 Tdec (Z ) D21 (Z ) H 2(0 ,0 ,0 ,D21 ) (Z ) = (1 − τ 11 )ZH 2(0 ,1,0 ,D21 ) (Z )Tdec + (1 − τ 12 )ZH 2(1,1,0 ,D21 ) (Z ) 1 − τ 12 Z Ts Te (39) D21 (Z ) Tdec Therefore, we can derive an expression of S 2 Z-transform service time as follows: Tc T TS 2 (Z ) = τ 12 Z e H 2(0 ,0 ,0 ,D21 ) (Z ) m +1 + (1 − τ 12 )Z Ts Te Tc T H 2(0 ,0 ,0 ,D21 ) (Z ) τ 12 Z e H 2(0 ,0 ,0 ,D21 ) (Z ) i =0 m ∑ (40) 5.3. Service Time Distribution Service time distribution is obtained by inverting the service time Z transforms given by equations (31) and (40). But we are most interested in tail behaviour in terms of service time bounds, i.e. the probability that the service time exceeds a certain value. Probabilistic bounds on service time can be derived by inverting the complementary service time Z transform [4] given by: 105 i International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 1 − TS i (Z ) ~ X i (Z ) = 1− Z (41) In figures 3(a) to 3(d), we depict analytical and simulation values of the Complementary service time distribution of both stations S 1 and S 2 . The curves are obtained for different values of the contention window size W and for different values of D21 ( D21 is given in slots). The stations transmit 512 bytes data payload packets and we use the 802.11.b parameters (given in table 1) to determine the values of Te , Ts and Tc . Simulation results are obtained with ns-2 network simulator [9]. Table 1: 1: 802.11 b parameters. Data Rate 11 Mb/s Slot 20 µs SIFS 10 µs DIFS 50 µs PHY Header 192 µs MAC Header 272 µs ACK 112 µs Short Retry Limit 7 All the curves drop gradually to 0 as the delay increases. Station S 1 curves drop to 0 faster than station S 2 curves. Indeed, when W = 32 and D 21 = 4 , the probability that S 1 service time exceeds 0.005s equals 0.28%. Whereas, station S 2 service time exceeds 0.005s with the probability of 5.67%. Thus, DM offers better service time guarantees for the flow with the highest priority. (a) W=16 106 (b) W=32 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 (c) W=64 (d) W=128 Figure 3: Complementary Service Time Distribution Moreover, we notice that each time W doubles its size, S 1 and S 2 service time curves become closer. Indeed, when W becomes large, the basic backoff values selected by S 1 and S 2 increase. Hence, the shifting backoff slots (DMSB) added by DM become negligible compared to the basic backoff. The whole backoff values (WHB ) of the two stations become near and their service time accordingly. 5.4. Extended Simulation Results In the above section, we considered a two station scenario where each station transmits a real time flow with a given delay bound. We showed that DM performs service differentiation over 802.11 and offers better service time bounds for the flow with the short deadline. In this section, we consider a five station scenario where each station transmits a real time flow with a characterized delay bound. For this scenario, we consider the default 802.11b minimum and maximum windows sizes ( CWmin = 32 , CWmax = 1024 ). Simulation results show that the delay bounds on service time decrease with the deadline bounds. Moreover, as the difference between flows deadlines increases, the difference between their delay bounds increases. 107 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 (a) D51=4 (c) D51=12 (b) D51=8 (d) D51=16 Figure 4: Complementary Service Time Distribution (Extended Simulation Results) 6. Conclusion In this paper we proposed to support the DM policy over 802.11 protocol. Therefore, we used a distributed scheduling algorithm and introduced a new medium access backoff policy. Then we proposed a mathematical model to evaluate the performance of the DM policy in terms of service time guarantees for a scenario where two stations with different delay bounds contend for the channel. Analytical and simulation results show that DM performs service differentiation over 802.11 and offers better service time guarantees for the flow having the small deadline. Moreover, as the difference between flows deadlines increases, the difference between their delay bounds increases. 7. References [1] Bianchi, G., ”Performance Analysis of the IEEE 802.11 Distributed Coordination Function”, IEEE J-SAC Vol. 18 N. 3, Mar. 2000, pp. 535-547. [2] IEEE 802.11 WG, ”Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) specification”, IEEE 1999. 108 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 [3] IEEE 802.11 WG, ”Draft Supplement to Part 11: Wireless Medium Access Control (MAC) and physical layer (PHY) specifications: Medium Access Control (MAC) Enhancements for Quality of Service (QoS)”, IEEE 802.11e/D13.0, Jan. 2005. [4] Engelstad, P.E. and Osterbo O.N., ”The Delay Distribution of IEEE 802.11e EDCA and 802.11 DCF”, Proceedings of the International Performance Computing and Communications Conference, Arizona, Apr. 2006. [5] Engelstad, P.E., Osterbo, O.N, “Delay and Throughput Analysis of IEEE 802.11e EDCA with Starvation Prediction”, In proceedings of the The IEEE Conference on Local Computer Networks , LCN’05 (2005). [6] Kanodia, V., Li, C., ”Distribted Priority Scheduling and Medium Access in Ad-hoc Networks”, ACM Wireless Networks, Volume 8, Nov. 2002. [6] Kleinrock, L., “Queuing Systems,Vol. 1”, John Wiley, 1975. [7] Kleinrock, L., “Queuing Systems,Vol. 1”, John Wiley, 1975. [8] Leung, J. Y. T., Whitehead, J, “On the Complexity of Fixed-Priority Scheduling of Periodic, Real- Time Tasks”, Performance Evaluation (Netherlands), pp. 237-250, Dec. 1982. [9] McCanne, S., Floyd, S., The network simulator - ns-2, http://www.isi.edu/nsnam/ns/. [10] Zhai, H., Kwon, Y., Fang, Y., .Performance Analysis of IEEE 802.11 MAC protocol in wireless LANs., Wireless Computer and Mobile Computing, 2004. Authors Inès El Korbi received the engineering degree and the Master degree in computer science in 2003 and 2005 respectively from l’Ecole Nationale des Sciences de l’Informatique (ENSI), Université de la Manouba, Tunisia. Currently she’s applying for a PHD degree. From 2004 she operates as a student researcher in cooperation projects between l’ENSI (Tunisia) and l’Institut National de Recherche en Informatique et en Automatique (INRIA) in France. Leila Azouz Saidane is Professor at l’ENSI, Tunisia. Her research interests include performance evaluation of QoS networks, wireless and sensor networks. From 2004, she initiates many cooperation projects between l’ENSI and l’INRIA in France. 109 International Journal of Software Engineering and Its Applications Vol. 2, No. 2, April, 2008 110