Supporting Deadline Monotonic Policy over 802.11 MAC Layer Service Time Distribution Inès El Korbi Ecole Nationale des Sciences de l’Informatique Université de la Manouba, 2010 Tunisia ines.korbi@gmail.com Abstract In this paper, we propose a real time scheduling policy over 802.11 DCF protocol called Deadline Monotonic (DM). We evaluate the performance 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 results using the ns-2 network simulator. 1. Introduction The IEEE 802.11 wireless LANs [1] become more and more reliable to support applications with Quality of Service (QoS) requirements. Indeed, the IEEE 802.11e standard [2] was recently proposed to offer service differentiation over 802.11. 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 interframe space (DIFS) after a successful transmission or an extended interframe 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. The IEEE 802.11e standard proposes the Enhanced Distributed Channel Access (EDCA) as an extension for DCF. Leila Azouz Saidane Ecole Nationale des Sciences de l’Informatique Université de la Manouba, 2010 Tunisia leila.saidane@ensi.rnu.tn 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 interframe 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 Deadline Monotonic (DM) policy [7] to schedule real time flows over 802.11. To support the DM policy over 802.11, we introduce a distributed scheduling and a new medium access backoff policies. We then propose a Markov chain based analytical model to evaluate the performance of DM for a simple scenario where two stations with different deadline constraints contend for the channel. 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 against simulation results using the ns-2 network simulator [8]. The rest of this paper is organized as follows. In section 2, we present the distributed scheduling and the new medium access backoff policy to support DM over 802.11. In section 3, we present the mathematical model based on the Markov chains analysis. Section 4 evaluates the service time distribution and presents analytical and simulation results. Finally, we conclude the paper and present our future work in Section 5. 2. Supporting DM policy over 802.11 The Deadline Monotonic policy (DM) [7] is a real time scheduling policy that assigns static priorities to flow packets according to their deadlines; the packet with the small deadline being assigned the highest priority. 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. 2.1. Distributed Scheduling Deadline(HOL (Si)) is the HOL packet deadline of node Si. Hence, when Si has to transmit its HOL packet with a delay bound Di , it selects a BAB in the contention window [0, CWmin − 1] and computes the WHole Backoff (W HB) value as follows: W HB(Si) = DM SB(Si) + BAB(Si) (2) To realize a distributed scheduling over 802.11, we introduce a broadcast priority mechanism similar to [5]. Indeed, each station maintains a local scheduling table with entries for HOL packets of all other stations. Each entry in the scheduling table of node Si comprises two fields (Sj, Dj) where Sj is the source node MAC address and Dj is the deadline of the HOL packet of Sj. When a node Si transmits a DATA packet, it piggybacks the deadline of its HOL packet. The nodes hearing the DATA packet add an entry for Si 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 Si using the information in the ACK packet. The station Si decrements its W HB whenever it senses an idle slot. Each time, the channel is sensed busy, Si reinitializes its DM SB as in equation (1). Indeed, if a successful transmission is heard, all the stations reevaluate their DM SB when hearing a correct ACK and add the new DM SB value to their current BAB. Whereas, if a collision is heard, all the stations will reinitialize their DM SB and add it to their current BAB to allow colliding stations transmitting with the same priority as for their first transmission attempt. Si transmits when its W HB reaches 0. If the transmission fails, Si doubles its contention window size, selects a BAB in the new window CW and repeats the above procedure until the packet is successfully transmitted or dropped. 2.2. DM medium access backoff policy 3. Mathematical Model of the DM policy over 802.11 Let’s consider two stations S1 and S2 transmitting flows with different delay bounds D1 and D2 such as D1 < D2, and generate two packets at time instants t1 and t2. If S2 had the same delay bound as S1, its packet would have been generated at time t2 such as t2 = t2 + D21, where D21 = (D2 − D1). At that time S1 and S2 would have the same priority and transmit their packets according to the 802.11 protocol. Hence, when S2 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 be decremented. Thus to support DM over 802.11, each station uses a new backoff policy where the backoff is: • The random backoff selected in [0, CW −1], according to 802.11 DCF, referred as the BAsic Backoff (BAB). • The DM Shifting Backoff (DM SB): corresponds to the additional backoff slots that a station with low priority adds to its BAB to have the same priority as the station with the highest priority. Whenever a station Si sends an ACK or hears an ACK on the channel its DM SB is reevaluated as follows: DM SB(Si) = Deadline(HOL (Si)) − DTmin (Si) (1) Where DTmin (Si) is the minimum of the HOL packet deadlines present in Si scheduling table and We propose a mathematical model to evaluate the performance of the DM policy using Markov chains analysis [3]. We consider the following assumptions: 1) The system under study comprises two stations S1 and S2, such as Si transmits a flow F i having a deadline Di. We have D1 < D2 and D21 = (D2 − D1). 2) We operate in saturation conditions: stations have always packets to transmit [3]. 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. 4) We are in stationary conditions: the stations have already sent one packet to each other. Using the above assumptions, we represent in figure 1 the Markov chain modeling station S1 where each state is described by (R, i, i − j, −D21) : • R : takes two values S2s and S2c . When R = S2s , station S2 is decrementing its DM SB during D21 slots. When R = S2c , S2 contends for the channel. • i : the value of the BAB selected by S1 in [0, W − 1]. Figure 1. Markov Chain modeling station S1 • (i − j) : the current backoff value of S1. • (−D21) : We choose the negative notation for S1 to express the fact that S2 has a positive DM SB equals to D21 and DM SB (S1) = 0. When S1 is one of the states (S2s , i, i − j, −D21), i = 0.. (W − 1), j = min(max(0, i−1), D21−1), S2 is decrementing its DM SB and doesn’t contend for the channel. When S1 is in one of the states (S2c , i, i − D21, −D21), i = D21..W − 1, S2 contends for the channel. Figure 2 represents the Markov Chain modeling station S2. Each state of S2 Markov chain is represented by the quadruplet (i, k, D21 − j, D21) where: • i : refers to the BAB selected by S2. - ξ1 : the set of states of S1 for which S2 does not contend (states colored in blue in figure 1). ξ1 = (S2s , i, i − j, −D21)i=0..W −1,j=0.. min(max(0,i−1),D21 −1) - ξ2 : the set of states of S2 where S2 does not contend for the channel (states colored in blue in figure 2). ξ2 = (i, i, D21 − j, D21)i=0..W −1,j=0..D21−1 According to figures 1 and 2, when S1 is in one of the states of ξ1 , S2 is obligatory in of the states of ξ2 . Similarly, when S1 is in one of the states of γ1 , S2 is obligatory in of the states of γ2 . Thus, S1 and S2 are blocked with these probabilities: τ11 = Pr [S1 transmits /ξ1 ] = • k : refers to the current BAB value. • D21 − j : refers to the current DM SB of S2. When S2 is in one of the states (i, i, D21 − j, D21), i = 0..W − 1, j = 0..D21 − 1, S2 is decrementing its DM SB. If S2 is in one of the states (i, i, 0, D21), i = 2..W − 1, it has decremented its DM SB and begins decrementing its BAB. Therefore, each station Markov chain states can be divided in two groups: (S2s ,0,0,−D21) π1 min(max(0,i−1),D21−1) W −1 i=0 (3) (S2s ,i,i−j,−D21) π1 j=0 τ12 = Pr [S1 transmits /γ1 ] = (S2c ,D21,0,−D21) π1 W −1 (4) (S2c ,i,i−D21,−D21) π1 i=D21 τ22 = Pr [S2 transmits /γ2 ] = (i,0,0,D21) W −1 i=0 π2 (i,i,0,D21) π2 W −1 + (5) (i,i−1,0,D21) π2 i=2 (R,i,i−j,−D21) (i,k,i−j,D21) where π1 (respectively π2 ) is the probability of the state (R, i, i − j, −D21) (respectively the one of the state (i, k, i − j, D21)) in the sta(R,i,i−j,−D21) (respectively tionary conditions and Π1 = π1 (i,k,i−j,D21) - γ2 : the set of states of S2, where S2 contends for the ) is the probability vector of S1 (reΠ2 = π2 channel (states colored in pink in figure 2). spectively the one of S2). The blocking probabilities allow γ2 = (i, i, 0, D21)i=0..W −1 ∪ (i, i − 1, 0, D21)i=2..W −1 deducing the transition probability matrix Pi , for station Si. - γ1 : the set of states of station S1 for which S2 contends for the channel (states colored in pink in figure 1). γ1 = (S2c , i, i − D21, −D21)i=D21..W −1 Figure 2. Markov Chain modeling station S2 3.2. Transition probability matrix of S2 Hence, we can evaluate the state probabilities of each station by solving the following system [6]: Π i P i = Πi j j πi = 1 Let P2 be the transition probability matrix of S2. The transitions probabilities of S2 are: (6) P2 {(i, i, D21 − j, D21) , (i, i, D21 − (j + 1), D21)} = 1 − τ11 , i = 0..W − 1, j = 0.. (D21 − 1) (14) P2 {(i, i, D21 − j, D21) , (i, i, D21, D21)} = τ11 , (15) i = 0..W − 1, j = 0..(D21 − 1) 3.1. Transition probability matrix of S1 Let P1 be the transition probability matrix of S1. P1 {i, j} is the probability to transit from state i to state j. So: P1 {(S2s , i, i − j, −D21) , (S2s , i, i − (j + 1) , −D21)} = 1, (7) i = 2..W − 1, j = 0.. min (max (0, i − 2) , D21 − 2) P1 {(S2s , i, i − D21 + 1, −D21) , (S2c , i, i − D21, −D21)} (8) = 1, i = D21..W − 1 P1 {(S2 , i, 1, −D21) , (S2 , 0, 0, −D21)} = 1, i = 1.. min (W − 1, D21 − 1) s s (9) P1 {(S2 , i, i − D21, −D21) , (S2 , i − 1, i − 1 − D21, −D21)} = 1 − τ22 , i = D21 + 1..W − 1 (10) c s P1 {(S2 , i, i − D21, −D21) , (S2 , i − D21, i − D21, −D21)} = τ22 , i = D21 + 1..W − 1 (11) s s P1 {(S2 , 0, 0, −D21) , (S2 , i, i, −D21)} (12) 1 , i = 0..W − 1 = W c c If (D21 < W ) then: P1 {(S2c , D21, 0, −D21) , (S2s , i, i, −D21)} 1 , i = 0..W − 1 = W (13) By replacing P1 and Π1 in (6) and solving the resulting sys(R,i,i−j−D21) tem, we can express π1 as a function of τ22 , where τ22 is given by (5). P2 {(i, i, 0, D21) , (i, i − 1, 0, D21)} = 1 − τ12 , i = 2..W − 1 (16) P2 {(1, 1, 0, D21) , (0, 0, 0, D21)} = 1 − τ12 (17) P2 {(i, i, 0, D21) , (i, i, D21, D21)} = τ12 , i = 1..W − 1 (18) P2 {(i, i − 1, 0, D21) , (i − 1, i − 1, D21, D21)} = τ12 , i = 2..W − 1 (19) P2 {(i, i − 1, 0, D21) , (i − 1, i − 2, 0, D21)} = 1 − τ12 , i = 3..W − 1 (20) P2 {(0, 0, 0, D21) , (i, i, D21, D21)} = i = 0..W − 1 1 W , (21) Replacing P2 and Π2 in (6) and solving the resulting sys(i,k,D21−j,D21) tem, we can express π2 as a function of τ11 and τ12 given respectively by (3) and (4). Moreover, by re(R,i,i−j,D21) (i,k,D21−j,D21) placing π1 and π2 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) We deduce from (22) expressions of τ11 , τ12 and τ22 . 4.2. Z-transform of S2 service time 4. Service time Analysis Let T S2 (Z) be the Z-transform of station S2 service time. We define: H2(i,k,D21−j,−D21) (Z): The Z-transform of the time already elapsed from the instant S2 selects a basic backoff in [0, W − 1] (i.e. being in one of the states (i, i, D21, D21)) to the time it is found in the state (i, k, D21 − j, −D21) , and: In this section, we propose to evaluate the Z-Transform of the MAC layer service time [4] 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 [3], [4]. As Te is the smallest duration event, the duration of all events will be given by Tevent Te . H2(i,i,D21,D21) (Z) = 4.1. Z-transform of S1 service time To evaluate the Z-transform of station S1 service time T S1 (Z), we define: H1(R,i,i−j,−D21) (Z) : The Z-transform of the time already elapsed from the instant S1 selects a basic backoff in [0, W − 1] to the time it is found in the state (R, i, i − j, −D21) . We have: H1(S2s ,W −1,W −1−j,−D21) (Z) = H1(S2s ,i,i,−D21) (Z) = 1 Z, i = (W − D21) .. (W − 2) W H1(S2s ,i,i,−D21) (Z) = τ22 Z 1 +W 1 j Z , j = 0..D21 W T T se (24) , i = 1.. max (0, (W − 1 − D21)) (25) (26) (Z) = Z H1 (Z) H1 + (1 − τ22 ) ZH1(S2c ,i+1,i+1−D21,−D21) (Z) , i = D21..W − 2 (27) 1 H1(S2s ,0,0,−D21) (Z) = W min(W −1,D21−1) (28) + H1(S2s ,i,1,−D21) (Z) (S2c ,i,i−D21,−D21) D21 (S2s ,i,i,−D21) i=1 If the station S1 transmission state is (S2 , 0, 0, −D21) , the transmission will be successful (S2 is decrementing its DM SB). Whereas when the station S1 transmission state is (S2c , D21, 0, −D21), the transmission occurs successfully only if S2 doesn’t transmit. After m retransmission attempts, if the packet is not acknowledged, it will be dropped. Hence: s 1 W , i = 0 and i = W − 1 1 W + τ12 Z T Ts e T S1 (Z) = τ22 Z Tc Te (31) j To compute H2(i,i,D21−j,D21) (Z) , we define Tdec (Z) , such as: 0 Tdec (Z)=1 j Tdec (Z)= (32) (1 − τ11 ) Z 1 − τ11 Z T e Ts j−1 Tdec (Z) , j = 1..D21 + H1(S2s ,0,0,−D21) (Z) + (1 − τ22 ) H1(S2c ,D21,0,−D21) (Z) m i=0 τ22 Z T T ce H1 i (S2c ,D21,0,−D21) (Z) Z (33) So: j H2(i,i,D21−j,D21) (Z) = H2(i,i,D21−j+1,D21) (Z) Tdec (Z) , i = 0..W − 1, j = 1..D21 (34) H2(i,i−1,0,D21) (Z) = (1−τ12 )ZH2(i,i,0,D21) (Z) Ts 1−τ12 Z Te T D21 (Z) (35) dec + (1 − τ12 ) ZH2(i+1,i,0,D21) (Z) , i = 2..W − 1 We also have : H2(W −1,W −2,0,D21) (Z) = (1−τ12 )ZH2(W −1,W −1,0,D21) (Z) Ts 1−τ12 Z Te T D21 (Z) (36) dec H2(0,0,0,D21) (Z) = +H2(0,0,0,D21) (Z) (1−τ12 )ZH2(1,1,0,D21) (Z) Ts 1−τ12 Z Te T D21 (Z) (37) dec where H2(0,0,0,D21) (Z) is given by (30). Therefore: m+1 Tc T S2 (Z) = τ12 Z T e H2(0,0,0,D21) (Z) + (1 − τ12 ) Z T e Ts H2(0,0,0,D21) (Z) m i Tc τ12 Z T e H2(0,0,0,D21) (Z) m+1 H1(S2c ,D21,0,−D21) (Z) H1(i+1,i,0,D21) (Z) , i=0 (30) i = 1.. W − 2 (23) H1(S2c ,i+D21,i,−D21) (Z) H1(S2s ,i,i−j,−D21) (Z) = Z j H1(S2s ,i,i,−D21) (Z) , i = 1..W − 2, j = 1.. min(i − 1, D21 − 1) H2(i,i,D21,D21) (Z) = (38) 4.3. Service Time Distribution Ts Te (29) Service time distribution is obtained by inverting the service time Z transforms given by equation (29) and (38). But we are most interested in probabilistic service time bounds. (a) W=16 (b) W=32 (c) W=128 Figure 3. Complementary Service Time Distribution Probabilistic bounds on service time are derived by inverting the complementary service time Z transform [4] given by: 1 − T Si (Z) T Si (Z) = (39) 1−Z In figures 3(a) to 3(c), we depict analytical and simulations values of the Complementary service time distribution of both stations S1 and S2. 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 to determine the values of Te , Ts and Tc . Simulation results are obtained with ns-2.28 [8]. All the curves drop gradually to 0 as the delay increases. Station S1 curves drop to 0 faster than station S2 curves. Indeed, when W = 32 and D21 = 4, the probability that S1 service time exceeds 0.005s equals 0.28%. Whereas, station S2 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. Moreover, we notice that each time W doubles its size, S1 and S2 service time curves become closer. Indeed, when W becomes large, the BAB values increase and the (DM SB) becomes negligible compared to the basic backoff. The whole backoff values of S1 and S2 become near and their service time accordingly. 5. Conclusion In this paper we proposed to support the DM policy over 802.11. Therefore, we used a distributed scheduling algorithm and introduced a new medium access backoff policy. Then we proposed a mathematical model to evaluate the service time distribution of the DM policy for a scenario where two stations with different deadlines 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. In future works, we intend to generalize the DM analytical model to n stations transmitting flows with different deadlines. References [1] IEEE 802.11 WG, ”Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) specification”, IEEE 1999. [2] 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, Jan. 2005. [3] Bianchi, G., ”Performance Analysis of the IEEE 802.11 Distributed Coordination Function”, IEEE J-SAC Vol. 18 N. 3, Mar. 2000, pp. 535-547. [4] Engelstad, P.E. and Osterbo O.N., ”The Delay Distribution of IEEE 802.11e EDCA and 802.11 DCF”, In Proc. of the IPCC Conference, Arizona, Apr. 2006. [5] 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: Theory”, John Wiley, 1975. [7] Leung, J. Y. T., Whitehead, J, “On the Complexity of Fixed-Priority Scheduling of Periodic, Real-Time Tasks”, Performance Evaluation, Dec. 1982. [8] McCanne, S., Floyd, S., The network simulator NS-2, http://www.isi.edu/nsnam/ns/.