WiFi MAC Models David Malone November 2006, MACSI Hamilton Institute, NUIM, Ireland Talk outline • • • • • • Introducing the 802.11 CSMA/CA MAC. Finite load 802.11 model and its predictions. Issues with standard 802.11, leading to 802.11e. Finite load 802.11e model and its predictions. Beyond infrastructure mode networks. Why do these models work? Hamilton Institute, NUIM, Ireland 1 The 802.11 MAC Select Random Number in [0,31] Pause Counter Data Resume Counter Expires; Transmit Ack Decrement counter SIFS DIFS SIFS DIFS Figure 1: 802.11 MAC operation Hamilton Institute, NUIM, Ireland 2 802.11 MAC Summary • • • • • After transmission choose rand(0, CW − 1). Wait until medium idle for DIFS(50µs), While idle count down in slots (20µs). Transmission when counter gets to 0, ACK after SIFS (10µs). If ACK then CW = CWmin else CW∗ = 2. Ideally produces even distribution of packet transmission. Hamilton Institute, NUIM, Ireland 3 Modelling approaches • P-persistent: approximate the back-off distribution be a geometric with the same mean. Exemplified by Marco Conti and co-authors. • Asymptotic full system analysis: Bordenave, McDonald and Proutiere + Sharma, Ganesh and Key. • Bianchi’s mean-field Markov model: treat stations individually; network relationship between stations gives a set of coupling equations. In simplest form: constant transmission probability τ gives throughput S = nτ (1 − τ )n−1 , (1) 1 − p = (1 − τ )n−1 . (2) and collision probability Hamilton Institute, NUIM, Ireland 4 Mean-field Markov Overview Mean field approximation: each individual station’s impact on overall network is small. Assume a fixed probability of collision given attempted transmission p. Each station’s back-off counter then a Markov chain. Stationary distribution gives the probability the station attempts transmission in a typical slot τ (p). Network coupling then gives a system of equations relating all stations’ p and τ , which determines everything. Real-time quantities determined through a relation involving the average real-time that passes during a counter decrement. Following to appear in IEEE/ACM ToN (Duffy, Leith, Malone). Hamilton Institute, NUIM, Ireland 5 Mean-field Markov Model’s Chain (1−q)(1−p) (1−q)(1−p) (1−q) q(1−p)(1−p)(1−q) (1−q) (1−q) (0,0)e (0,1)e qp q(1−p) (1−q) (0, CW−2)e q q (0, CW−1)e q q(1−p)p 1 1 (0,0) (0,1) 1 (0, CW−2) (0, CW−1) q(1−p) p (1,0) 1 1 (1,1) 1 (1, 2CW−2) (1, 2CW−1) p Figure 2: Individual’s Markov Chain Hamilton Institute, NUIM, Ireland 6 Mean-field Markov Model Solution Stationary distribution of Markov chain gives: τ (p, q, W0, m) = η −1 2 2 q W0 q (1 − p) − , (1 − p)(1 − q)(1 − (1 − q)W0 ) 1−q (3) where η q(W0 +1) q 2 W0 (W0 +1) q 2 W0 = (1 − q) + 2(1−(1−q)W0 ) + 2(1−q) 1−(1−q)W0 + p(1 − q) − q(1 m−1 2 1−p−p(2p) W0 pq 2 +1 . + 2(1−q)(1−p) 2W0 − (1 − p) W 1−2p 1−(1−q) 0 Hamilton Institute, NUIM, Ireland − p)2 7 Network coupling For given loads q1, . . . , qn, define τj = τ (pj , qj , W0, m) and then n coupling equations: Y 1 − pi = (1 − τj ). j6=i Solve to determine (p1, τ1), . . . , (pn, τn). If all packets are the same length, L bytes taking TL time on the medium, then τi(1 − pi)L Qn . i=1(1 − τi )δ + (1 − i=1(1 − τi ))TL Si = Qn Hamilton Institute, NUIM, Ireland 8 Relating q to offered load • Taking lim models saturation. q→1 • For small buffers, a crude approximation: q = min(Expected slot length/mean inter-packet time, 1). • If packets arrive a Poisson manner with rate λl , then ql is 1 − exp(−λlExpected slot length). • Possible to produce a relation of this sort that uses conditional information. Hamilton Institute, NUIM, Ireland 9 Model Predictions 0.35 normalised throughput 0.3 0.25 16 stations (sim) (model unif) (model Pois) (model Cond) 20 stations (sim) (model unif) (model Pois) (model Cond) 24 stations (sim) (model unif) (model Pois) (model Cond) 0.2 0.15 0.1 0 0.2 0.4 0.6 0.8 1 1.2 normalised total offered load 1.4 1.6 Throughput as the traffic arrival rate is varied. Results for three load relationships (uniform, Poisson and conditional) shown. Hamilton Institute, NUIM, Ireland 10 Model Predictions 0.02 model class 1 model class 2 simulation normalised per-node throughput 0.018 0.016 0.014 0.012 0.01 0.008 0.006 0.004 0.002 0 0 0.5 1 1.5 2 total offered normalised load 2.5 3 Normalized per-station throughput, where n1 = 12, n2 = 24. The offered load of a class 2 station is 1/4 of a class 1 station. Hamilton Institute, NUIM, Ireland 11 TCP Upload Scenario Access Point Stations with competing TCP uploads Figure 3: Competing TCP uploads. Hamilton Institute, NUIM, Ireland 12 TCP Uploads 1.8 1.6 TCP throughput (Mbps) 1.4 1.2 1 0.8 0.6 0.4 0.2 0 1 2 3 4 5 6 7 8 9 10 Number of the upstream connection Figure 4: Competing TCP uploads, 10 stations (NS2 simulation, 802.11 MAC, 300s duration). Hamilton Institute, NUIM, Ireland 13 The 802.11e MAC The three most significant 802.11e MAC parameters on traffic prioritization are TXOP, W0 and AIFS. • • • • Four traffic classes per station. Station transmits for max duration TXOP (one packet without 802.11e). Per class, W0 is 2n, n ∈ {0, 1, . . .}. Per class, AIFS = DIFS + kδ, k ∈ {−2, −1, 0, 1, . . .}. Hamilton Institute, NUIM, Ireland 14 The 802.11 MAC Select Random Number in [0,W−1] 0 Pause Counter Data Resume Counter Expires; Transmit Ack Decrement counter SIFS AIFS SIFS AIFS Figure 5: 802.11 MAC operation Hamilton Institute, NUIM, Ireland 15 Existing 802.11e models Saturated 802.11e multi-class models. • R. Battiti and Bo Li, University of Trento Technical Report DIT-03-024 (2003). • J.W. Robinson and T.S. Randhawa, IEEE JSAC 22:5 (2004). • Z. Kong, D. H.K. Tsang, B. Bensaou and D. Gao, IEEE JSAC 22:10 (2004). Following (maybe!) to appear in IEEE Trans. Mob. Computing, with Clifford, Duffy, Foy, Leith and Malone. Hamilton Institute, NUIM, Ireland 16 Modelling 802.11e Added complications: Need hold states for AIF S. (1 − Ph = 1 + (1 − Hamilton Institute, NUIM, Ireland (1) Q n1 j=1(1 − τj ) Qn1 j=1(1 − Q n2 (2) j=1(1 − τj )) (1) Qn2 τj ) j=1(1 (2) D X PS−i 1 i=1 D X − τj )) . (4) PS−i 1 i=1 17 New coupling equations (1) 1 − pi = Y (1) (1 − τj )(Ph + (1 − Ph) j6=i 1− (2) pi (2) (1 − τj )) (5) j=1 = n1 Y (1 − j=1 Hamilton Institute, NUIM, Ireland n2 Y (1) τj ) Y (2) (1 − τj ). (6) j6=i 18 How good is it? 0.25 0.2 0.15 0.1 0.05 0.25 model class 1 model class 2 simulation 0.2 Per station throughput (Mbps) model class 1 model class 2 simulation Per station throughput (Mbps) Per station throughput (Mbps) 0.25 0.15 0.1 0.05 0 5 10 15 20 Total offered load (Mbps) (a) D = 0 25 30 0.2 0.15 0.1 0.05 0 0 model class 1 model class 2 simulation 0 0 5 10 15 20 Total offered load (Mbps) (b) D = 2 25 30 0 5 10 15 20 Total offered load (Mbps) 25 30 (c) D = 4 Throughput for a station in each class vs. offered load. 10 class 1 stations offering one quarter the load of 20 class 2 stations. Range of D values, the difference in AIFS between class 2 and class 1 (NS2 simulation and model predictions, 802.11e MAC, 11Mbps PHY, 100s duration. ). Hamilton Institute, NUIM, Ireland 19 How good is it? 0.25 0.2 0.15 0.1 0.05 0.25 model class 1 model class 2 simulation 0.2 Per station throughput (Mbps) model class 1 model class 2 simulation Per station throughput (Mbps) Per station throughput (Mbps) 0.25 0.15 0.1 0.05 0 5 10 (1) (d) W0 15 20 Total offered load (Mbps) (2) = 32, W0 25 30 = 16 0.2 0.15 0.1 0.05 0 0 model class 1 model class 2 simulation 0 0 5 (1) (e) W0 10 15 20 Total offered load (Mbps) (2) = 32, W0 25 30 = 64 0 5 (1) (f) W0 10 15 20 Total offered load (Mbps) (2) = 32,W0 25 30 = 256 Throughput for a station in each class vs. offered load. There are 10 class 1 stations each offering one quarter the load of 20 class 2 stations. Range of W0 values (NS2 simulation and model predictions, 802.11e MAC 11Mbps PHY, 100s duration). Hamilton Institute, NUIM, Ireland 20 How do you use it? 6 0.9 W1=1 W1=2 W1=4 W1=8 W1=16 W1=32 5 W1=1 W1=2 W1=4 W1=8 W1=16 W1=32 0.8 Ratio of lost traffic to offered load Throughput of Data Stations (Mbps) 0.7 4 3 2 0.6 0.5 0.4 0.3 0.2 1 0.1 0 0 0 5 10 Difference in AIFS (g) Data throughput 15 20 0 5 10 Difference in AIFS 15 20 (h) ACK loss 10 stations (1500 byte packets) and AP transmitting (60 byte packets) at half achieved data rate. Hamilton Institute, NUIM, Ireland 21 1.2 0.6 1 0.5 0.8 0.4 TCP Throughput (Mbps) TCP Throughput (Mbps) Does it work? 0.6 0.4 0.2 0.3 0.2 0.1 0 0 1 2 3 4 5 6 7 8 9 Number of the upstream connection 10 11 12 1 2 3 4 5 6 7 8 9 Number of the upstream connection 10 11 12 Competing TCP uploads, 12 stations experiment without and with prioritization (802.11e MAC, 300s duration). Hamilton Institute, NUIM, Ireland 22 Why stop with single infrastructure mode network? Basic behavior of individual stations is independent of the network in which they exist. Change the network coupling, change the network. Hamilton Institute, NUIM, Ireland 23 Typical mesh issue 0.4 0.35 throughput (Mbs) 0.3 0.25 0.2 0.15 NS 0.05 1 0 2 r0 NS r 0.1 0 5 10 15 #conversations 20 25 Example of aggregate throughput vs number of voice calls for the multi-hop 2 802.11b WLAN topology. Voice packets are transported between l11 and l12 , ..., lN by node r01/r02 which denotes a relay station with two radios. Hamilton Institute, NUIM, Ireland 24 Mesh Following in IEEE Comms. Letters (2006), (Duffy, Leith, Li and Malone). M distinct local zones on common frequency. For n ∈ {1, . . . , M } local stations Ln = {l1n, . . .} and relay stations Rn = {r0n, . . .}. Mean field gives for each station c ∈ Rn ∪ Ln: 1 − pc = Y (1 − τb). (7) b∈Rn ∪Ln , b6=c Q The stationary probability the medium is idle is pidle = b∈Rn∪Ln (1 − τb). The mean state length is En = pidleσ + L(1 − pidle), where each packet takes L seconds and idle slot-length is σ seconds. Added difficulty: for each n, l ∈ Ln, ql is given, but qr is not known a priori for each relay station. Hamilton Institute, NUIM, Ireland 25 Mesh The parameter qr is determined through relay traffic. • For each n, l ∈ Ln, a fixed route fl from its zone to a destination zone. fl = {l, s1 . . . , sm, d}. • If m = 0, then l and d are in the same zone and no relaying occurs. • We assume routes are predetermined by an appropriate wireless routing protocol. Hamilton Institute, NUIM, Ireland 26 Mesh For each s ∈ Ln ∪ Rn, let E(s) = En. For k ∈ {1, . . . , m} Let Ql,sk be offered load from l arriving at sk and Qsk be the total load offered to sk . From these we calculate: τs (1 − psk ) S sk = k En and then assume: X Ql,s k Ss Qsk+1 = Qsk k to calculate the load in the next network. Hamilton Institute, NUIM, Ireland 27 Buffering • Limitations of small buffers particularly apparent in mesh. • Need to introduce queue empty probability to model queue: rn. • Model queues as M/G/1. W0 E(B(p)) = (1 − p − p(2p)m). 2(1 − 2p) (8) rn = min(1, −B(pn) log(1 − qn)) (9) Simply replaces τ (p) relation. To appear, IEEE Comms. Letters (2007), (Duffy, Ganesh). Seeing some interaction between buffering and service. Hamilton Institute, NUIM, Ireland 28 Unfairness One conversation, N data stations 500 400 Conv. throughput, small buffer Data throughput, when conversation has small buffer Conv. throughput, large buffer Data throughput, when conversation has large buffer 64 kbps 350 400 250 300 200 200 <-- Mean delay, conv., large buffer 150 Delay (milli seconds) Throughput (kbps) 300 100 100 50 0 0 0 5 10 15 Number of data stations, N 20 25 Figure 6: N S packet-level simulation results and model predictions Hamilton Institute, NUIM, Ireland 29 Understanding the Models • • • • Models are inexact in several ways. Constant p replaces complex Markov chain with direct sum. Throughput relationship assumes independent. Do assumptions hold or are stationary distributions similar? Hamilton Institute, NUIM, Ireland 30 Is p constant? 0.06 0.05 0.3 Average P(col) P(col on 1st tx) P(col on 2nd tx) 1.0/32 1.0/64 0.25 0.2 Probability Probability 0.04 0.03 0.15 0.02 0.1 0.01 0.05 Average P(col) P(col on 1st tx) P(col on 2nd tx) 0 100 0 200 300 400 500 600 Offered Load (per station, pps, 496B UDP payload) (a) 2 Stations 700 800 40 60 80 100 120 140 160 180 Offered Load (per station, pps, 486B UDP payload) (b) 10 Stations Figure 7: Measured collision probabilities as offered load is varied. Hamilton Institute, NUIM, Ireland 31 Independence of Transmissions 4000 3500 Throughput (Kbps) 3000 2500 2000 1500 1000 500 Throughput (measured) Throughput (model) Throughput (model + measured Ts/Tc) Throughput (model + measured Ts/Tc/p) 0 2 4 6 8 Number of STA(s) 10 12 14 Figure 8: Overall throughput in a network of saturated stations as the number of stations is varied. The measured values are compared to model predictions. Hamilton Institute, NUIM, Ireland 32 Conclusions • 802.11/802.11e CSMA/CA models that are simple, solvable, yet complex enough to predict data throughput. • Model gives insight into 802.11 MAC behavior. • Model gives insight into effect of 802.11e parameters. • Prioritization schemes can now be designed quickly based on the model. • Extensible to network scenarios. • Interesting questions on buffering and foundations remain to be answered. Hamilton Institute, NUIM, Ireland 33