360 likes | 511 Views
Introduction to 802.11. Wireless LANs: 802.11. Supports both Asynchronous data transfer and time bound services Asynchronous: traffic insensitive to time - email, FTP Time bound services: sensitive to time - voice traffic Different MAC strategies to support these classes of traffic
E N D
Wireless LANs: 802.11 • Supports both Asynchronous data transfer and time bound services • Asynchronous: traffic insensitive to time - email, FTP • Time bound services: sensitive to time - voice traffic • Different MAC strategies to support these classes of traffic • Asynchronous traffic is supported through Distributed Co-ordination Function (DCF) • Time bound traffic is supported through Point Co-ordination Function (PCF) • DCF is mandatory, while PCF is optional
802.11 Terminologies • BSS: Basic service set • Group of stations under the direct control of a single co-ordination function • All stations in a BSS can directly communicate with each other, without any infrastructure • Extended BSS: Multiple interconnected access points have the same SSID • BSSID the MAC address of the access point • IBSS: BSS for ad hoc networks (without an access point) • SSID is selected by the node that starts the ad hoc network • BSSID is a random number generated by the node that starts the ad hoc network
802.11 Terminologies • Access Point (AP): • Similar to the base station in cellular network • Supports range extension by providing network connectivity between multiple BSSs • Multiple BSSs are connected together through a Distribution System (DS) • DS is similar to a backbone network • e.g., ethernet-based LAN • BSSs connected by a DS form an Extended Service Set (ESS)
802.11 Terminologies PORTAL: Acts as the gateway to other networks
802.11 MAC Sub-layer • Transmission medium can • Operate only in contention mode, called as Contention Period - CP • Alternate between contention & contention free modes • In contention free mode, the medium access is controlled by the AP • Contention Free mode is also known as Contention Free Period (CFP)
802.11 MAC Frames • Management Frames: Used for • Station association, dissociation, timing and synchronization, authentication • Control Frames: Used for • Handshaking during CP (RTS/CTS) • ACK frames during CP • Data Frames: Used for • Sending data during CP and CFP
802.11: DCF • Fundamental channel access method in 802.11 • Used by asynchronous data services • Basis for PCF • Based on CSMA/CA (Collision Avoidance) • Collision detection is not used, because a station cannot listen to the (air) channel for collisions when transmitting
Two basic challenges Because of interference, near by nodes cannot transmit at the same time objective: don’t transmit if some other node is transmitting (easier said than done) approach: listen to the channel before transmitting • Hidden node problem • The transmitter is unaware that another nodes is already transmitting, so the transmission fails • Exposed terminal • A transmitter is unaware than its transmission would succeed without causing any losses
802.11: DCF – Carrier Sensing • Two kinds of sensing • Physical carrier sensing • Takes place at the air interface • Detects signal strength from other sources • Virtual Carrier Sensing • Takes place at the MAC layer (explained shortly) • Channel is said to be idle only when both the sensing mechanisms report ‘idle’
802.11: DCF – Basic Operation • Inter frame space (IFS): Time interval between transmission of frames • Three IFS values are specified • DCF-IFS (DIFS) • PCF-IFS (PIFS) • Short-IFS (SIFS) • SIFS < PIFS < DIFS • Priority access to the medium is controlled through these three IFS intervals
802.11: DCF – Basic Operation • A station wanting to transmit, senses the medium • If it is idle, waits for DIFS interval, and senses again • If the medium is free, frame is transmitted • If the receiver gets the frame correctly, it sends an ACK to the sender after a SIFS interval
DCF – Basic Operation • If the medium is found to be busy either in step 1 or 2, back-off procedure is invoked • What is back-off? • How is idle detected? • Clear Channel Assessment • If the received signal strength exceeds the CCA, the channel is declared to be busy • Note that this does not require locking to the carrier, just signal strength • NAV (Network Allocation Vector) or virtual channel sensing • This required decoding transmissions
DCF – Virtual Carrier Sensing • The MAC header has the ‘duration’ field, which indicates for how long the sender wants to hold the medium • Other stations read this field, and adjust a parameter called ‘Network Allocation Vector’ (NAV) • NAV indicates the amount of time that must elapse until the channel can be sampled again for idle status • NAV value thus indirectly indicates if the channel is free at any given time • Using NAV value to determine channel status is called as ‘Virtual Carrier Sensing’
DCF – Data Transmission • Note: even if “other” cannot hear “destination,” it still considers the channel busy when the destination is transmitting the ACK
DCF with RTS/CTS • Sender cannot detect a collision during transmission • If a large frame is sent, and if collision occurs, then lot of channel BW is wasted • To prevent this waste, Request to Send (RTS) and Clear To Send (CTS) control frames are used • RTS/CTS helps a station to seize the channel for a short time; so, ideally, further collisions
DCF – RTS/CTS • A sender, after contending for the channel, sends a RTS frame • RTS/CTS frames are small (20 bytes), so in case of collision, less BW is wasted • All stations in the BSS, read the RTS frame and adjust their NAV accordingly • After SIFS amount of time, the destination responds to the RTS with a CTS frame
DCF – RTS/CTS • Stations modify their NAV on reading CTS • This helps to combat the “hidden terminal” problem (what is this?) • On receiving CTS, sender transmits the data frame after an interval of SIFS, which the receiver ACKs • RTS/CTS prevents BW waste, but • Creates additional delay under light loads • Causes collisions • It is unclear it RTS/CTS improves throughput
Bytes: 2 2 6 6 6 2 6 0-2312 4 Frame Frame Duration Sequence Addr 1 Addr 2 Addr 3 Addr 4 CRC Body Control ID Control 802.11 MAC Header Bits: 2 2 4 1 1 1 1 1 1 1 1 Protocol To From More Pwr More Type SubType Retry WEP Rsvd Version DS DS Frag Mgt Data Frame Control Field 802.11 MAC Frame
Frame sizes and contents MAC frames are called MPDU (MAC protocol Data Unit) • Frame formats • RTS (20B) • Frame control (2B) • Protocols version (2bits) (802.11 = 00, so if not 00, then the following means something different) • Type (2 bits)- management, control,data, reserved • subtype (4bits), e.g., control|RTS, management|beacon,… • To DS (DP) (1 bit) • From DS (1bit) • More frag (1b) • This is a Retry (1b) • Pwr mgt (1b) (=1 means the STA will go to power save (i.e., periodic sleep) after the frame is received) • More data (1b) – if a STA is in power save mode, then this is used to signify that more data is waiting, so maybe the STA should wake up and get the data!) • Protected frame (1b) (WEP, etc.) • Order (1b) • Duration / ID (2B) (but MSB is zero, so 15 bits for the duration) in microsec (rounded up) (ID is used in power save mode) • RA receiver address (6B) • TA transmitter address (6B) • FCS – CRC-32 (4B) • CTS (14B) • Frame control • Duration = duration in RTS – time to transmit CTS – 1 SIFS • RA (no transmit address) • FCS • ACK (14B) • Frame control • Duration = 0 unless it is an ACK one for several more frames of a fragmented packet • RA • FCS • Data frame 34B overhead • Frame control (2B) • Duration (2B) • Address 1 (6B) • Address 2 (6B) • Address 3 (6B) (homework, what are these addresses used for) • Sequence control 2B (for fragmenting) • Address 4 (6B) • Frame body, up to 2312B • FCS 4B
Physical Protocol Data Unit (802.11b) • PLCP (phy layer convergence protocol = phy with MAC frame inside) • PLCP preamble (144 bits) • SYNC (128b) – to let the physical layer acquire sync (transmitter actually begins transmitting before this. This period is called ramp up where the transmitter goes from 0 zero to full/desired power. This typically takes ~ 1us) • SFD (16b)– like a radio ID, IEEE 802.11 has SFD-F3A0hex • PLCP header (48 bits) • Signal (8b) – specifies the modulation used for the MAC frame • Service (8b) – reserved • Length (16b) in micro seconds (not MAC duration, So this seems to be ignored) • CRC (16b) • PLCP SYNC and header always take 192 us • MPDU (MAC protocol data unit) or PSDU (PLCP service Data unit)
Short PLCP (optional) • Preamble – 72 bits at 1 Mbps • PLCP header – 48 bits at 2Mbps • The preamble and header takes 96 us • MPDU / PSDU at 2, 5.5, … Mbps • Since the PLCP is sent at 2 Mbps, the channel must be able to support 2 or more Mbps • In practice the short header does not work well unless the channel is very good.
802.11 g • PLCP preamble and header are similar to 802.11b • PSDU • Long Training sequence • 1.6 us guard interval • Long training symbol (3.2 us) • Long training symbol (3.2us) (again) • Total = 8 us • OFDM signal • Guard interval 0.8 us (This is quite short) • Signal 3.2 us • Total 4 us • Transmitted at 6 Mbps OFDM modulation – which is the worst performing modulation – it has the same SNR-BER relationship at 9 and 12 Mbps. • Data • 6 us of quiet time (time to decode and error correct) to SIFS is 16 us
802.11 overhead • Four 192b from PLCP • At 1Mbps = 192 microsec so 768 microsec • 82B from RTS, CTS, ACK, data • 656 mic sec at 1Mbps • 328 micro sec at 2Mbps • 131 at 5Mbps • 60 at 11Mbps • 12 at 54Mbps • 1 DIFS, 3 SIFS, 4 propagation delays • 30 microsec + 3*20 micro + 4*2 microsec = 98 microsec • Total overhead time • 1552 mic sec at 1Mbps • 1194 micro sec at 2Mbps • 997 at 5Mbps • 925 at 11Mbps • 878 at 54Mbps • Data duration • 40B packet • 320 mic at 1Mbps => efficiency data duration over all duration = 17% • 160 2Mpbs => 11% • 64 => 6% • 29 => 3% • 6 at 54 Mbps => 0.6% • 1500B packet • 12000 mic at 1Mbps => 89% • 6000 2Mpbs => 83% • 2400 => 70% • 1090 => 54% • 222 at 54 Mbps => 20% • Small packets and high data rates are inefficient. Increasing packet size would help efficiency (similar things occur in wired TCP). • 802.11n and 802.16 can transmit multiple frames with one set of overhead
802.11 overhead w/o RTS/CTS • two 192b from PLCP • At 1Mbps = 192 microsec so 384 microsec • 14B from RTS, CTS, ACK, data • 112 mic sec at 1Mbps • 56 micro sec at 2Mbps • 22 at 5Mbps • 10 at 11Mbps • 2 at 54Mbps • 1 DIFS, 1 SIFS, 1 propagation delays • 30 microsec + 20 micro + 2 microsec = 52 microsec • Total overhead time • 548 mic sec at 1Mbps • 492 micro sec at 2Mbps • 458 at 5Mbps • 446 at 11Mbps • 438 at 54Mbps • Data duration • 40B packet • 320 mic at 1Mbps => efficiency data duration over all duration = 36% • 160 2Mpbs => 24% • 64 => 12% • 29 => 6% • 6 at 54 Mbps => 1% • 1500B packet • 12000 mic at 1Mbps => 96% • 6000 2Mpbs => 92% • 2400 => 83% • 1090 => 70% • 222 at 54 Mbps => 33%\ If the packet is smaller than RTSThreshold, then RTS/CTS are not used
(DCF – Fragmentation) • Large data units passed on by higher layers may be fragmented • Fragmentation increases transmission reliability • If data units are greater than a threshold, fragmentation is invoked
802.11: DCF – Basic Operation • A station wanting to transmit, senses the medium • If it is idle, waits for DIFS interval, and senses again • If the medium is free, frame is transmitted • If the receiver gets the frame correctly, it sends an ACK to the sender after a SIFS interval • If the medium is found to be busy either in step 1 or 2, back-off procedure is invoked
802.11: DCF – Back-Off • If the medium is found to be busy either in step 1 or 2, back-off procedure is invoked • When invoked, station waits until the medium is free for a DIFS time, and starts a random timer • Timer is decremented as long as the medium is free • If the medium becomes busy, the timer is frozen • Timer is decremented, when medium becomes free again for a DIFS time • When timer reaches zero, the frame is transmitted • Collisions are detected through a lack of ACK • If collision occurs, the doubles the size of the backoff window and repeats the back-off process
IEEE 802.11 Variants Standard 802.11 overhearing S1 S2 DATA DATA ACK R1 overhearing R2 Node S1 Layer State NAV DIFS BO DIFS BO remaining MAC time DATA frame from S2 ACK frame from R2 Receive PHY time T1 DATA frame to R1 Transmit time DIFS BO Busy DIFS BO Transmit
IEEE 802.11 Variants Stomp S1 S2 DATA ACK R1 R2 Layer State DIFS BO MAC time DATA frame from S2 Receive time PHY Decode PLCP header Transmit time DIFS BO
IEEE 802.11 Variants • Stomp SNRS1-S2 Red characters : channel usage information S1 knows S1 S2 SNRS1-R2 SNRS1-R1 SNRR1-S2 SNRS2-R2 Data-rate Data-rate SNRR1-R2 R1 R1 R2 Layer State DIFS BO BO remaining MAC time DATA frame from S2 Receive time PHY Decode PLCP header DATA frame to R1 Transmit time DIFS BO Transmit
Back-off (w/o RTS/CTS) start MAC receives a pkt CW = CWmin (e.g., 7) ShortTryCounter = 0 Rand(0,n) = Random integer between 0 and N Channel is busy Set BOtimer = slotTime*Rand(0,CW-1) Wait for idle channel If channel was not idle but no packet was decoded, set DIFStimer = EDIFS Channel is idle Set DIFStimer = DIFS Channel is busy Wait DIFS Channel is busy CW = min(1024, CW*2) DIFSTimer == 0 backoff TryCounter < MaxNumTries BOTimer == 0 transmit ShortTryCounter++ Wait for ACK No ACK ACK done ShortTryCounter == MaxNumTries
Max number of transmissions • If an RTS fails to generate a CTS, then the Short Retry count is incremented, until is reaches the short_retry_limit • If RTS is received, the ShortRetryCount = 0 • If the pkt size is below RTSThreshold (so no RTS is transmitted), and fails to generate an ACK, then the Short retry count is incremented • When small data pkt is successful, the short retry count is reset to zero • If pkt size is above RTSThreshold and fails to result in an ACK, then the long retry is incremented. • If the pkt is successfully transmitted, then long retry count is reset to 0 • If a pkt is dropped due to too many failed attempts, the retry counters are set to zero
Using ACKs to increase data rate • Envelop analysis • Suppose that the pkt error prob for 10 Mbps is 0 and the pkt error prob for 20 Mbps is 0.25. • The effective data rate at 10 Mbps is 10 Mbps, and at 20, is 0.75*20 > 10, so 20 is better, even though there will be many losses and retransmissions. • When a transmission fails, it must wait DIFS and then back off • Suppose an empty channel • DIFS, Data, SIFS, ACK • If Fails, then wait, [0,7]*SlotTime and repeat the above • If Fails again, then wait, [0,13]*SlotTime and repeat the above • What is the effective data rate when 10Mbps is used vs 20Mbps? S=.00; T=1; DD = []; pp = [0:.001:.1]; for i=1:length(pp) p = pp(i); D = 0; for k=0:8 s = 0; for j = 1:k s = s + 7*2^j-1; end D = D + (1-p)^k*p*(s*S+T); end DD = [DD;D]; end figure;plot(pp,DD) S is the slot duration, T is the time to transmit a packet If D>2, then it is better to use a data rate with ½ the bit-rate Depending on S, the probability where this occurs can be quite small.