<<

Lecture 3.0

Introduction to 802.11 Wireless LANs

Quote from Matthew Gast - 802.11® Wireless Networks The Definitive Guide – apr. 2005, 2nd edition

At this point, there is no way to prevent the spread of Wi-Fi. In the years since the first edition of [his] book, wireless networking has gone from an interesting toy to a must-have technology. […] [Wireless networking] seems poised to continue its march towards the standard method of network connection, replacing "Where's the network jack?" with "Do you have Wi-Fi?" as the question to ask about network access. Giuseppe Bianchi

WLAN history

Original goal: Deploy “wireless ” First generation proprietary solutions (end ’80, begin ’90): WaveLAN (AT&T) HomeRF (Proxim) Abandoned by major chip makers (e.g. Intel: dismissed HomeRF in april 2001)

IEEE 802.11 Committee formed in 1990 Charter: specification of MAC and PHY for WLAN First standard: june 1997 1 and 2 Mbps operation Reference standard: september 1999 Multiple Physical Layers Two operative Industrial, Scientific & Medical (ISM) shared unlicensed band » 2.4 GHz: Legacy; 802.11b/g » 5 GHz: 802.11a

1999: Wireless Ethernet Compatibility Alliance (WECA) certification Later on named Wi-Fi Boosted 802.11 deployment!!

Giuseppe Bianchi

1 WLAN data rates Legacy 802.11 Work started in 1990; standardized in 1997 1 mbps & 2 mbps Standard Transfer Freq. Data The 1999 revolution: PHY layer Method Band Rates impressive achievements Mbps 802.11a: PHY for 5 GHz 802.11 legacy FHSS, 2.4 GHz, 1, 2 published in 1999 DSSS, IR Products available since early 2002 IR 802.11b: higher rate PHY for 2.4 GHz 802.11b DSSS, 2.4 GHz 1, 2, 5.5, Published in 1999 HR- 11 Products available since 1999 DSSS Interoperability tested (wifi) "802.11b+" DSSS, 2.4 GHz 1, 2, 5.5, non-standard HR- 11, 2003: extend 802.11b DSSS, 22, 33, (PBCC) 802.11g: OFDM for 2.4 GHz 44 802.11a OFDM 5.2, 5.5 6, 9, 12, Published in june 2003 GHz 18, 24, Products available, though no extensive 36, 48, interoperability testing yet 54 Backward compatibility with 802.11b Wi-Fi 802.11g DSSS, 2.4 GHz 1, 2, 5.5, HR- 11; 6, 9, DSSS, 12, 18, Ongoing standardization effort: 802.11n OFDM 24, 36, Launched in september 2003 48, 54 Minimum goal: 108 Mbps (but higher numbers considered)

Giuseppe Bianchi

Why multiple rates ? “Adaptive ” (?) coding /modulation

Example: 802.11a case

Giuseppe Bianchi

2 PHY distance /rate tradeoffs (open office)

140.0 5 GHz OFDM (.11a) 120.0 2.4 GHz OFDM (.11g) 100.0 2.4 GHz (.11b) 80.0

60.0 Distance (m) 40.0

20.0

0.0 1Mbps 5.5Mbps 6Mbps 11Mbps 12Mbps 24Mbps 36Mbps 54Mbps

Giuseppe Bianchi

Coverage performance Cisco Aironet 350 Access Point

11 Mb/s DSS from ~30 to ~45 mt

5.5 Mb/s DSS from ~45 to ~76 mt Configurable TX power: 50, 30, 20, 5, 1 mW 2 Mb/s DSS (100 mW outside Europe) from ~76 to ~107 mt

Greater TX power, faster battery consumptions!

Question: how to select transmission rate? (STA does not explicitly know its distance from AP) More later (implementation-dependent ☺)

Giuseppe Bianchi

3 WLAN NIC addresses

Same as Ethernet NIC 48 bits = 2 + 46 802 IEEE Ethernet & WLAN addresses do coexist 48 bit addresses undistinguishable, in a same (Layer-2) network role of typical AP = bridge 1 bit = individual/group » (to be precise: when the AP act as “portal” in 802.11 1 bit = universal/local nomenclature) 46 bit address

C:>arp -a 192.168.1.32 00-0a-e6-f8-03-ad dinamico 192.168.1.43 00-06-6e-00-32-1a dinamico 192.168.1.52 00-82-00-11-22-33 dinamico

AP AP

192.168.1.43 192.168.1.32 00:06:6e:00:32:1a 192.168.1.52 00:0a:e6:f8:03:ad 00:82:00:11:22:33 Giuseppe Bianchi

Protocol stack

802.11: “just” another 802 link layer ☺

DATA LINK LAYER LLC 802.2 Logical Link Control LLC sublayer

802 802.1 overview management 802.3 … 802.11 MAC DATA LINK LAYER & & MAC MAC sublayer architectureMAC bridging … …

802.3 … 802.11 802.11 802.11a 802.11b 802.11g PHY FSSS PHY DSSS PHY OFDM PHY HR-DSSS Extended PHYSICAL LAYER … PHY Rate PHY

Giuseppe Bianchi

4 802.11 MAC Data Frame MAC header: - 28 bytes (24 header + 4 FCS) or - 34 bytes (30 header + 4 FCS)

PHY IEEE 802.11 Data 0 - 2312 FCS

Frame Duration Sequence Frame Address 1 Address 2 Address 3 Address 4 Data check Control / ID Control sequence 2 2 6 6 6 26 0-2312 4

Protocol Fragment Type Sub Type info Sequence number version number 2 2 12 4 12

To From More Pwr More Sub Type Retry WEP Order DS DS Frag MNG Data 4 1 1 1 1 1 1 1 1

DETAILS AND EXPLANATION LATER ON Giuseppe Bianchi

Encapsulation 802.11 MAC frame: no “type” field (such as Ethernet II)!! LLC encapsulation mandatory

Identical To 802.3/LLC encapsulation

Giuseppe Bianchi

5 Why Ethernet Tunnel? (just needed in very special cases : IPX, AARP)

DESC SRC Len AA AA 03 00.00.00 Type P ETH/802.11 bridge

Some protocols DESC SRC Type P ????? 802.11/ETH MUST have this bridge Encapsulation: -Novell IPX DESC SRC Len AA AA 03 00.00.00 Type P (Type 0x8137) - Apple-Talk ARP (Type 0x80F3) Giuseppe Bianchi

Handling 802.11 frames

STA Ethernet-like driver AP interface Radio PC-Card supports virtually all protocol stacks PC-Card Radio PC-Card Radio PC-Card Hardware Hardware Radio Hardware Hardware Maximum Data limited to 1500 Hardware Hardware octets Hardware Hardware 802.11 frame format 802.11 frame format WMAC controller with WMAC controller with WMAC controller with WMAC controller with Station Firmware Frame translation Access Point Firmware Station Firmware Access Point Firmware (WNIC-STA) (WNIC-AP) (WNIC-STA) IEEE Std 802.1H (WNIC-AP) IEEE 802.3 frames: translated to 802.11 802.3 frame format 802.3 frame format Ethernet Types 8137 (Novell Bridge Platform IPX) and 80F3 (AARP) Driver Bridge Driver Platform Driver Driver Computer encapsulated via Ethernet Software Software Software Computer Software Software Software Tunnel (APDr) (STADr) (APDr) (STADr) All other Ethernet Types: Ethernet V2.0 / 802.3 encapsulated via RFC 1042 Ethernet V2.0 / 802.3 frame format SNAP frame format Protocol Stack Kernel Software (APK) Protocol Stack Kernel Software (APK)

Ethernet Transparent bridging to Ethernet Bridge Interface Bridge Ethernet Interface HardwareHardware

Giuseppe Bianchi

6 Lecture 3.1

802.11 Network Architecture And related addressing

Giuseppe Bianchi

Basic Service Set (BSS) group of stations that can communicate with each other

Infrastructure BSS Independent BSS (IBSS) or, simply, BSS Stations communicate directly Stations connected through AP with each other Typically interconnetted to a Smallest possible IBSS: 2 STA (wired) network infrastructure IBSS set up for a specific purpose and for short time (e.g. meeting) That’s why they are also called ad hoc networks Network infrastructure

AP

Giuseppe Bianchi

7 Frame Forwarding in a BSS

Network infrastructure

AP

BSS: AP = relay function IBSS: direct communication No direct communication allowed! between all pairs of STAs

Giuseppe Bianchi

Why AP = relay function ?

Management: Mobile stations do NOT neet to maintain neighbohr relationship with other MS in the area But only need to make sure they remain properly associated to the AP Association = get connected to (equivalent to plug-in a wire to a bridge ☺)

Power Saving: APs may assist MS in their power saving functions by buffering frames dedicated to a (sleeping) MS when it is in PS mode

Obvious disadvantage: use channel bandwidth twice…

Giuseppe Bianchi

8 Addressing in IBSS (ad hoc)

SA

DA

Frame Duration Address 1 Address 2 Address 3 Sequence Data FCS Control / ID DA SA BSSID Control SA = Source Address DA = Destination Address BSSID = Basic Service Set IDentifier used for filtering frames at reception (does the frame belong to OUR cell?) format: 6 bytes random MAC address with Universal/Local bit set to 1 Giuseppe Bianchi

Addressing in a BSS?

AP

SA

X DA

Giuseppe Bianchi

9 Addressing in a BSS!

Distribution system AP

SA DA

Frame must carry following info: 1) Destined to DA 2) But through the AP What is the most general addressing structure? Giuseppe Bianchi

Addressing in a BSS ( to AP)

Distribution system

AP Address 2 = wireless Tx Address 1 = wireless Rx BSSID Address 3 = dest

BSSID = AP MAC address

SA DA

Frame Duration Address 1 Address 2 Address 3 Sequence Data FCS Control / ID BSSID SA DA Control

1 0 Protocol To From More Pwr More Type Sub Type Retry WEP Order version DS DS Frag MNG Data 2 2 4 1 1 1 1 1 1 1 1 Giuseppe Bianchi

10 Addressing in a BSS ( from AP)

Distribution system AP Address 2 = wireless Tx Address 1 = wireless Rx BSSID Address 3 = src

SA DA

Frame Duration Address 1 Address 2 Address 3 Sequence Data FCS Control / ID DA BSSID SA Control

0 1 Protocol To From More Pwr More Type Sub Type Retry WEP Order version DS DS Frag MNG Data 2 2 4 1 1 1 1 1 1 1 1 Giuseppe Bianchi

From AP: do we really need 3 addresses ?

Distribution system AP

BSSID

SA DA

DA correctly receives frame, and send 802.11 ACK to … BSSID (wireless transmitted)

DA correctly receives frame, and send higher level ACK to … SA (actual transmitter)

Giuseppe Bianchi

11 Extended Service Set

BSS1

AP1

BSS2 BSS3 BSS4

AP2 AP3 AP4

ESS: created by merging different BSS through a network infrastructure (possibly overlapping BSS – to offer a continuous coverage area)

Stations within ESS MAY communicate each other via Layer 2 procedures APs acting as bridges MUST be on a same LAN or switched LAN or VLAN (no routers in between)

Giuseppe Bianchi

Service Set IDentifier (SSID)

IEEE 802.11 wireless LAN management frame name of the WLAN Fixed parameters (12 bytes) network Timestamp: 0x00000109EAB69185 Beacon Interval: 0,102400 [Seconds] Plain text (ascii), up to 32 char Capability Information: 0x0015 ...... 1 = ESS capabilities: Transmitter is an AP Assigned by the network ...... 0. = IBSS status: Transmitter belongs to a BSS administrator ...... 01.. = CFP participation capabilities: Point coordinator at AP for delivery and polling (0x0001) All BSS in a same ESS have ...... 1 .... = Privacy: AP/STA can support WEP same SSID ...... 0. .... = Short Preamble: Short preamble not allowed Typically (but not ...... 0...... = PBCC: PBCC modulation not allowed ...... 0...... = Channel Agility: Channel agility not in use necessarily) is .... .0...... = Short Slot Time: Short slot time not in use transmitted in periodic ..0...... = DSSS-OFDM: DSSS-OFDM modulation not allowed management frames Tagged parameters Tag Number: 0 (SSID parameter set) (beacon) Tag length: 4 Disabling SSID transmission = Tag interpretation: WLAN a (poor!) security mechanism Tag Number: 1 (Supported Rates) Typical: 1 broadcast beacon Tag length: 4 every 100 ms (configurable by Tag interpretation: Supported rates: 1,0(B) 2,0(B) 5,5 11,0 [Mbit/sec] sysadm) Tag Number: 6 (IBSS Parameter set) Beacon may transmit a LOT Tag length: 1 of other info (see example – a Tag interpretation: ATIM window 0x2 simple one!) Tag Number: 5 ((TIM) Traffic Indication Map) Tag length: 4 Tag interpretation: DTIM count 0, DTIM period 1, Bitmap control 0x0, (Bitmap suppressed)

Giuseppe Bianchi

12 The concept of Distribution System “Logical” architecture component Provides a “service” DSS = Distribution System Service

Standard does NOT say how it is implemented Specified only which functions it provides Association Disassociation Reassociation Integration Distribution Distribution An AP receives a frame on its air interface (e.g. STA 2) Association/disassociation It gives the message to the distribution service (DSS) of Registration/de-registration of a STA to an AP the DS Equivalent to “plugging/unplugging the wire” to a switch The DSS has the duty to deliver the frame to the proper destination (AP) DS uses this information to determine which AP send frames to Integration Reassociation Must allow the connection to non 802.11 LANs Though, in practice, non 802.11 LANs are Ethernet i.e. handling STA mobility in a same ESS! and no “real portals” are deployed Giuseppe Bianchi

DS, again

MSs in a same ESS need to 1) communicate each other 2) move through the ESS Distribution system (physical connectivity + logical service support)

AP1 AP2 AP3 IAPP/proprietary IAPP/proprietary

Association

Typical implementation (media) Standardization Switched Ethernet Backbone From 1997: tentative to standardize an IAPP But alternative “Distribution Medium” are Finalized as “working practice standard” in possible 802.11F (june 2003) E.g. Wireless Distribution System (WDS) Nobody cared! Plenty of proprietary solutions Implementation duties Must use APs from same vendor in whole ESS an AP must inform other APs of associated Current trends (2004+): MSs MAC addresses Centralized solutions (see Aruba, Cisco, Colubris) Include centralized management, too! Current attempt: convergence to CAPWAP? Giuseppe Bianchi

13 Addressing in an ESS Same approach ! Works in general , even if DA in different BSS

Distribution System AP AP

BSSID#1

DA DA

(unprecise! No portal here) idea: SA DS will be able to forward frame to dest (either if fixed or wireless MAC)

Frame Duration Address 1 Address 2 Address 3 Sequence Data FCS Control / ID BSSID#1 SA DA Control

1 0 Protocol To From More Pwr More Type Sub Type Retry WEP Order version DS DS Frag MNG Data 2 2 4 1 1 1 1 1 1 1 1 Giuseppe Bianchi

Addressing in an ESS Same approach ! Works in general , even if DA in different BSS

Distribution System AP AP

BSSID#2

SA DA

DA

Frame Duration Address 1 Address 2 Address 3 Sequence Data FCS Control / ID DA BSSID#2 SA Control

0 1 Protocol To From More Pwr More Type Sub Type Retry WEP Order version DS DS Frag MNG Data 2 2 4 1 1 1 1 1 1 1 1 Giuseppe Bianchi

14 Wireless Distribution System

AP1 AP2 AP3

DS medium: - not necessarily an ethernet backbone! - could be the 802.11 technology itself

Resulting AP = wireless bridge

Giuseppe Bianchi

Addressing within a WDS Wireless Distribution System

AP AP

TA RA

Address 4: initially forgotten? ☺ DA SA

Frame Duration Address 1 Address 2 Address 3 Sequence Address 4 Data FCS Control / ID RA TA DA Control SA

1 1 Protocol To From More Pwr More Type Sub Type Retry WEP Order version DS DS Frag MNG Data 2 2 4 1 1 1 1 1 1 1 1 Giuseppe Bianchi

15 Addressing : summary Receiver Transmitter Function To DS From DS Address 1 Address 2 Address 3 Address 4

IBSS 0 0 RA = DA SA BSSID N/A From AP 0 1 RA = DA BSSID SA N/A To AP 1 0 RA = BSSID SA DA N/A Wireless DS 1 1 RA TA DA SA

BSS Identifier (BSSID) unique identifier for a particular BSS. In an infrastructure BSSID it is the MAC address of the AP. In IBSS, it is random and locally administered by the starting station. (uniqueness) Transmitter Address (TA) MAC address of the station that transmit the frame to the wireless medium. Always an individual address. Receiver Address (RA) to which the frame is sent over wireless medium. Individual or Group. Source Address (SA) MAC address of the station who originated the frame. Always individual address. May not match TA because of the indirection performed by DS of an IEEE 802.11 WLAN. SA field is considered by higher layers. Destination Address (DA) Final destination . Individual or Group. May not match RA because of the indirection. Giuseppe Bianchi

Lecture 3.2

802.11 MAC CSMA/CA Distributed Coordination Function

Carrier Sense Multiple Access With Collision Avoidance

Giuseppe Bianchi

16 Wireless Medium Unreliability

11 Mbps 802.11b outdoor measurements - Roma 2 Campus - roof nodes Giuseppe Bianchi

Must rely on explicit ACKs

Successful DATA transmission: SENDER RECEIVER ONLY IF an ACK is received

ACK transmission provided by DATA MAC layer Immediate retransmission » Don’t get confused with higher layer rtx ACK

DATA-ACK exchange: Also called two-way handshake Or Basic Access Mechanism

Giuseppe Bianchi

17 Possible errors Three causes of insuccess PHY Error Receiver cannot synchronize with transmitted frame » preamble + SFD needed or cannot properly read Physical Layer Control Protocol (PLCP) header » PLCP header contains the essential information on employed rate » Without it receiver cannot know how to demodulate/decode received frame! CRC32 error MAC frame (MAC Header + Payload) CRC failures » The greater the rate, the higher the SNR required to correctly transmit ACK Error Transmitter does not receive ACK » ACK corrupted by PHY or CRC32 errors It IS an error: though data frame was correctly received, transmitted does not know » Introduce issue of duplicated frames at the receiver

PHY MAC header Payload FCS

Preamble SFD PLCP hdr

Giuseppe Bianchi

Wireless errors 11 Mbps 802.11b/g OUTDOOR measurements - Roma 2 Campus - roof nodes

802.11b@11Mbps 802.11g@6Mbps PHY errors CANNOT be reduced through automatic rate fallback mechanisms

An (apparent) paradox: 802.11b@11mbps outdoor outperforms 802.11g@6mbps !!! but it is NOT a paradox ☺ since most 802.11g errors are PHY (unrelated with rate)… Giuseppe Bianchi

18 Must forget Collision Detection!

One single RF circuitry Either TX or RX… Half-duplex

Even if two simultaneous TX+RX: large difference (100+ dB!) in TX/RX tx signal power Impossible to receive while transmitting STA On a same channel, of course rx Collision detection at sender: meaningless in wireless! Ethernet = collision detection at sender Wireless = large difference in the interference power between sender & receiver! Collision OCCURS AT THE RECEIVER A detects a very low interference (C is far) no “collision”

A B C B detects a disructive interference (C is near) collision occurs

Giuseppe Bianchi

Distributed Coordination Function Basics

Giuseppe Bianchi

19 802.11 MAC

Intended for Contention-Free Used for all other services, Services and used as basis for PCF

POINT COORDINATION FUNCTION PCF (polling)

DISTRIBUTED COORDINATION FUNCTION DCF (CSMA/CA)

PCF: baiscally never user / supported!! Giuseppe Bianchi

802.11 MAC evolution (802.11e, finalized in december 2005)

Intended for Used for service Contention-Free differentiation ☺ Dead Services (priorities) Legacy

HYBRID COORDINATION FUNCTION HCF HCF Controlled Enhanced Distributed PCF Channel Access ChannelAccess (polling) HCCA EDCA (scheduling) (prioritized CSMA)

DCF

All enhancements rely on DCF basic operation!

Giuseppe Bianchi

20 Carrier Sense Multiple Access Station may transmit ONLY IF senses channel IDLE for a DIFS time DIFS = Distributed Inter Frame Space Key idea: ACK replied after a SIFS < DIFS SIFS = Short Inter Frame Space Other stations will NOT be able to access the channel during the handshake Provides an atomic DATA-ACK transaction

Packet arrival DIFS TX DATA

RX SIFS ACK

Packet arrival OTHER DIFS OK! STA Must measure a whole DIFS Giuseppe Bianchi

DATA/ACK frame format

DATA frame: 28 (or 34) bytes + payload

Frame Duration Sequence Frame Address 1 Address 2 Address 3 Address 4 Data check Control / ID Control sequence 2 2 6 6 6 26 0-2312 4 0 0 1 0 0 0 0 0 x x xx x x x x Type = Data (10) SubType = Data (0000) Protocol To From More Pwr More Type Sub Type Retry WEP Order version DS DS Frag MNG Data 2 2 4 1 1 1 1 1 1 1 1

ACK frame: 14 bytes – No need for TA address (the station receiving the ACK knows who’s this from) !!

Frame Duration Frame Address (RA) check Control / ID sequence 2 26 4 Type = Control (01) 0 00 1 1 1 0 1 0 0 00 x 0 0 0 SubType = ACK (1101) Protocol To From More Pwr More Type Sub Type Retry WEP Order version DS DS Frag MNG Data 2 2 4 1 1 1 1 1 1 1 1 Giuseppe Bianchi

21 Grasping wi -fi (802.11b) numbers

DIFS = 50 µµµs SIFS = 10 µµµs Rationale: 1 SIFS + 2 slot-times Rationale: RX_TX turnaround time Slot time = 20 µs, more later The shortest possible!

(28+payload) [bytes] x 8 / TX_rate [mbps] = µs DATA PHY MAC header 24 (30) Payload FCS

128 16 48 DATA frame: TX time = f(rate) Preamble SFD PLCP hdr Impressive PHY overhead! 1 mbps DBPSK 192 µs per every single frame 192 µs Total data frame time (1500 bytes) @1 Mbps: 192+12224= 12416 µs » PHY+MAC overhead = 3.3% @11 Mbps: 192+ 1111.3 = 1303.3 µs ACK » PHY+MAC overhead = 16.% PHY ACK 14 Overhead increases for small frames! ACK frame: TX at basic rate 192 µs 112 µs Typically 1 mbps but 2 mbps possible… ACK frame duration (1mbps): 304 µs Giuseppe Bianchi

And when an ACK is “hidden ”?

Sender TX 1) Receiver RX STA defers STA SENDER RECEIVER

Receiver ACKs (after SIFS) 2) STA cannot hear… STA SENDER RECEIVER

STA tranmits 3) And destroys ACK! STA SENDER RECEIVER

DIFS STA TX! STA BUSY DETECT (DATA) SIFS ACK Giuseppe Bianchi

22 The Duration Field

Frame Duration Sequence Frame Address 1 Address 2 Address 3 Address 4 Data check Control / ID Control sequence 2 2 6 6 6 26 0-2312 4

# microseconds 0 When bit 15 = 1 NOT used as duration (used by power-saving frames to specify station ID) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Allows “Virtual Carrier Sensing” Other than physically sensing the channel, each station keeps a Network Allocation Vector (NAV) Continuously updates the NAV according to information read in the duration field of other frames

DIFS DATA SIFS ACK OTHER Physical carrier sensing Virtual carrier sensing STA NAV (data)

Giuseppe Bianchi

And when a terminal is “hidden ”?

STA RECEIVER SENDER

… this can be “solved” by increasing the sensitiveness of the Carrier Sense… Quite stupid, though (LOTS of side effects – out of the goals of this lecture)

… this can’s be “solved” The Hidden Terminal by any means! Problem SENDER and STA cannot hear each RECEIVER other SENDER transmits to RECEIVER STA wants to send a frame Not necessarily to RECEIVER… STA senses the channel IDLE Carrier Sense failure Collision occurs at RECEIVER SENDER Destroys a possibly very long STA TX!! Giuseppe Bianchi

23 The RTS/CTS solution Packet arrival DIFS TX RTS DATA

RX SIFS CTS SIFS SIFS ACK others NAV (RTS) NAV (CTS) RX

RTS CTS CTS RTS/CTS: carry the amount of time the channel data will be BUSY. Other stations may update a TX hidden Network Allocation Vector, and defer TX (Update NAV) even if they sense the channel idle (Virtual Carrier Sensing) Giuseppe Bianchi

RTS/CTS frames RTS frame: 20 bytes

Frame Duration Frame Address 1 (RA) Address 2 (TA) check Control / ID sequence 2 26 6 4 Type = Control (01) 0 00 1 1 0 1 1 0 0 00 x 0 0 0 SubType = RTS (1011) Protocol To From More Pwr More Type Sub Type Retry WEP Order version DS DS Frag MNG Data 2 2 4 1 1 1 1 1 1 1 1

CTS frame: 14 bytes (same as ACK)

Frame Duration Frame Address (RA) check Control / ID sequence 2 26 4 Type = Control (01) 0 00 1 1 1 0 0 0 0 00 x 0 0 0 SubType = CTS (1100) Protocol To From More Pwr More Type Sub Type Retry WEP Order version DS DS Frag MNG Data 2 2 4 1 1 1 1 1 1 1 1

Giuseppe Bianchi

24 RTS/CTS and performance

RTS/CTS cons: larger overhead RTS/CTS pros: reduced collision duration ESPECIALLY FOR LONG PACKETS Long packet > RTS_Threshold (configurable)

TODAY higher rates No more significant Giuseppe Bianchi

Issues with “duration ” reading “Duration” field in MAC header Coded at same rate as payload Must receive whole MAC frame correctly

11 mbps 5.5 mbps 2 mbps 1 mbps range range range range

TX C

11 Mbps tx C cannot read TX frame No way to know duration value RX

Giuseppe Bianchi

25 ACK may be hidden once again ! C hidden from RX Carrier sense remains IDLE during RX TX ACK NAV could not be updated May transmit after a DIFS Destroying ACK!

TX ACK transm C

RX

Giuseppe Bianchi

EIFS = protect ACK C cannot read data frame CRC32 error Most of PHY errors

11 mbps 5.5 mbps 2 mbps 1 mbps range range range range

TX C

11 Mbps tx If planning to transmit: No more after a DIFS RX But after a LONGER interval of time Sufficiently long to protect ACK transmission

Giuseppe Bianchi

26 EIFS

DIFS Source station Data Back-off Destination station ACK

SIFS Back-off Other stations receiving NAV Data frame correctly

Back-off Other stations receiving Data frame incorectly EIFS

Giuseppe Bianchi

Why backoff ?

DIFS DATA STA1 SIFS ACK

DIFS STA2

STA3 Collision!

RULE : when the channel is initially sensed BUSY, station defers transmission; THEN,when channel sensed IDLE again for a DIFS, defer transmission of a further random time (Collision Avoidance)

Giuseppe Bianchi

27 Slotted Backoff DIFS STA2 w=7 Extract random number in range (0, W-1) Decrement every slot-time σ w=5 STA3

Note: slot times are not physically delimited on the channel! Rather, they are logically identified by every STA

Slot-time values: 20 µs for DSSS (wi-fi) Accounts for: 1) RX_TX turnaround time 2) busy detect time 3) propagation delay

Giuseppe Bianchi

Backoff freezing

When STA is in backoff stage: It freezes the backoff counter as long as the channel is sensed BUSY It restarts decrementing the backoff as the channel is sensed IDLE for a DIFS period

STATION 1 DIFS DATA DIFS SIFS ACK

STATION 2 DIFS BUSY medium DIFS SIFS ACK 6 5 Frozen slot-time 4 3 2 1

Giuseppe Bianchi

28 Why backoff between consecutive tx ?

A listening station would never find a slot-time after the DIFS (necessary to decrement the backoff counter) Thus, it would remain stuck to the current backoff counter value forever!!

S 1 DIFS DATA DIFS DATA DIFS SIFS ACK SIFS ACK

S 2 DIFS BUSY medium DIFS BUSY medium DIFS 6 5 Frozen slot-time 4 3

Giuseppe Bianchi

Backoff rules First backoff value: Extract a uniform random number in range (0,CW min ) If unsuccessful TX: Extract a uniform random number in range (0,2×(CW min +1)-1) If unsuccessful TX: 2 Extract a uniform random number in range (0,2 ×(CW min +1)-1) m Etc up to 2 ×(CW min +1)-1 Exponential Backoff! For 802.11b: CWmin = 31 CWmax = 1023 (m=5)

Giuseppe Bianchi

29 Further backoff rules

Truncated exponential backoff After a number of attempts, transmission fails and frame is dropped Backoff process for new frame restarts from CWmin Protects against cannel capture unlikely when stations are in visibility, but may occur in the case of hidden stations Two retry limits suggested: Short retry limit (4), apply to frames below a given threshold Long retry limit (7), apply to frames above given threshold (loose) rationale: short frames are most likely generated bu realk time stations Of course not true in general; e.g. what about 40 bytes TCP ACKs?

Giuseppe Bianchi

DCF Overhead

Giuseppe Bianchi

30 802.11b parameters (summary )

PIFS used by Point Coordination Function - Time-bounded services - Polling scheme PCF Never deployed SIFS Slot Time Parameters DIFS ( µsec) CWmin CWmax (µsec) (µsec) 802.11b 10 50 20 31 1023 PHY Giuseppe Bianchi

DCF overhead E[ payload ] Sstation = ET[Frame_ Tx ]+ DIFS + CW min /2

TFrame_ Tx=T MPDU + SIFS + T ACK

TFrame_ Tx=+T RTS SIFS ++ T CTS SIFS + T MPDU + SIFS + T ACK

TMPDU = TPLCP + 8⋅ 28( + L /) RMPDU _Tx

TACK = TPLCP + 8⋅14 / RACK _Tx

TRTS = TPLCP + 8⋅ 20 / RRTS _Tx

TCTS = TPLCP + 8⋅14 / RCTS _Tx

Giuseppe Bianchi

31 Example : maximum achievable throughput for 802.11b

backoff DATA SIFS DIFS DATA ACK

Cycle time

Data Rate = 11 mbps; ACK rate = 1 mbps Data Rate = 11 mbps; ACK rate = 1 mbps Payload = 1500 bytes Payload = 576 bytes

TMPDU = 192 + 8⋅ 28( +1500 11/) ≈1303 TMPDU = 192 + 8⋅ 28( + 576 11/) ≈ 631

TACK = 192 + 8⋅14 1/ = 304 TACK = 192 + 8⋅14 1/ = 304 SIFS = 10 ; DIFS = 50 SIFS = 10 ; DIFS = 50 31 31 E[Backoff ] = × 20 = 310 E[Backoff ] = × 20 = 310 2 2 1500 ×8 576 ×8 Thr = = 07.6 Mbps Thr = = 53.3 Mbps 1303 +10 + 304 + 50 + 310 631 +10 + 304 + 50 + 310

REPEAT RESULTS FOR RTS/CTS Not viable (way too much overhead) at high rates! Giuseppe Bianchi

DCF overhead (802.11b)

RTS/CTS

Basic

RTS/CTS

Basic

0 2000 4000 6000 8000

Transmssion Time (usec)

DIFS Ave Backoff RTS+SIFS CTS+SIFS Payload+SIFS ACK

Giuseppe Bianchi

32 DCF overhead (802.11b)

1 0,9 t u p0,8 h g u0,7 ro h0,6 T d0,5 ze li 0,4 a rm0,3 o BAS-2M bps N0,2 RTS-2M bps 0,1 BAS-11M bps 0 RTS-11M bps 00 00 00 00 00 00 00 00 00 00 00 00 1 3 5 7 9 11 13 15 17 19 21 23 Payload Size (Bytes)

Giuseppe Bianchi

Lecture 3.3

802.11 MAC extras

Selected topics, and for BSS case only (no IBSS)

Giuseppe Bianchi

33 Why Fragmentation High Bit Error Rate (BER) increases with distance The longer the frame, the lower the successful TX probability High BER = high rtx overhead & increased rtx delay backoff window increase: cannot distinguish collision from tx error!!

Radio impairment

frame frame

frag0 frag1 frag2 frag3 frag4 frag5 Once again ☺: Fragmentation not Viable with Radio “modern” 802.11 rates not used impairment

frag0 frag1 frag1 frag2 frag3 frag4 frag5 A A A A A A C C C C C C K K K K K K Giuseppe Bianchi

Fragmentation splits message (MSDU) into Each fragment reserves several frames (MPDU) channel for next one NAV updated fragment by fragment Same fragment size except last one Missing ACK for fragment x Fragmentation burst release channel (automatic) Fragments separated by SIFS ACK_Timeout much longer that channel cannot be captured by SIFS! someone else Backoff Each fragment individually ACKed Restart from transmission of fragment x

DIFSRTS SIFS frag0 SIFS SIFS frag1 SIFS sender SIFS CTS ACK ACK receiver NAV (RTS) NAV (CTS) NAV(frag0) Other NAV(ACK) stations Giuseppe Bianchi t

34 Fragment and sequence numbers

DATA frame: 28 (or 34) bytes + payload

Frame Duration Sequence Frame Address 1 Address 2 Address 3 Address 4 Data check Control / ID Control sequence 2 2 6 6 6 26 0-2312 4

to fr P + prot typ subtype Wor ds ds S da Fragment Sequence Number number 4 12 More Retry Frag Fragment number 1 1 Increasing integer value 015 (max 16 fragments since 4 bits available) Essential for reassembly More Fragment bit (frame control field) set to: 1 for intermediate fragments 0 for last fragment Sequence Number Used to filter out duplicates Unlike Ethernet, hede duplicates are quite frequent! retransmissions are a main feature of the MAC Retry bit: helps to distingush retransmission Set to 0 at transmission of new frame Set to 1 at retransmissions

Giuseppe Bianchi

Power management beacons: Periodically transmitted Include timestamp To enable STA synchronization [….etc etc…]

Every beacon includes a “Traffic Indication Map” (TIM) Information element listing the stations for which UNICAST frames are buffered Bitmap!! (2008 bits = 251 bytes… transmission split over multiple beacons) A station may then issue a PS-Poll control frame to enable transmission Instead of duration, PS-Poll contains AID (Association IDentifier of the STA: 1…2007)

What about broadcast & multicast frames transmitted only after beacons containing a DTIM (Delivery TIM) 1 DTIM every X beacon (X configurable)

Giuseppe Bianchi

35 Power management - example

STA A

STA B

STA B has set ReceiveDTIM to false to minimize power consumption! …losing broadcast & multicast frames Giuseppe Bianchi

Point Coordination Function

Token-based access mechanism Polling Channel arbitration enforced PCF by a “point Coordinator” (PC) Typically the AP, but not necessarily Contention-free access DCF No collision on channel

PCF deployment: minimal!! PHY Optional part of the 802.11 specification As such, almost never deployed HCCA (802.11e) may be considered as PCF deployed on TOP of DCF PCF extension… Backward compatibility

Giuseppe Bianchi

36 PCF frame transfer

SIFS

Polling strategy: very elementary!! - send polling command to stations with increasing Association ID value… - (regardless whether they might have or not data to transmit)

Giuseppe Bianchi

Multi -rate operation

Rate selection: proprietary mechanism! Result: different chipsets operate widely different Two basic approaches Adjust rate according to measured link quality (SNR estimate) How link quality is computed is again proprietary! Adjust rate according to frame loss How many retries? Step used for rate reduction? Proprietary! Problem: large amount of collisions (interpreted as frame loss) forces rate adaptation

Giuseppe Bianchi

37 Performance Anomaly Question 1: Assume that throughput measured for a single 11 mbps greedy station is approx 6 mbps. What is per-STA throughput when two 11 mbps greedy stations compete? Answer 1: Approx 3 mbps (easy ☺)

Question 2: Assume that throughput measured for a single 2 mbps greedy station is approx 1.7 mbps. What is per-STA throughput when two 2 mbps greedy stations compete? Answer 2: Approx 0.85 mbps (easy ☺)

Question 3: What is per-STA throughput when one 11 mbps greedy station compete with one 2 mbps greedy station? Answer 3: ...

Giuseppe Bianchi

Understanding Answers 1&2 (neclect collision – indeed rare – just slightly reduce computed value) backoff Frozen backoff

STA 1 SIFS DIFS STA 2 SIFS DIFS ACK ACK

Cycle time E[ payload ] 1500 ×8 Thr ]1[ = Thr ]2[ = = E[cycle time ] TMPDU ]1[ + SIFS + ACK + DIFS + TMPDU ]2[ + SIFS + ACK + DIFS + E[backoff ]

Data Rate = 11 mbps; ACK rate = 1 mbps Data Rate = 2 mbps; ACK rate = 1 mbps Payload = 1500 bytes Payload = 1500 bytes

TMPDU = 192 + 8⋅ 28( +1500 11/) ≈ 1303 TMPDU = 192 + 8⋅ 28( +1500 2/) ≈ 6304

TACK = 192 + 8⋅14 1/ = 304 TACK = 192 + 8⋅14 1/ = 304 SIFS = 10 ; DIFS = 50 SIFS = 10 ; DIFS = 50 31 31 E[Backoff ] = ×20 = 310 E[Backoff ] = × 20 = 310 2 2 1500 ×8 1500 ×8 Thr = = 3.3 Mbps Thr = = 88.0 Mbps 2×(1303 +10 + 304 + 50 ) + 310 2 ×(6304 +10 + 304 + 50 ) + 310 Giuseppe Bianchi

38 Emerging “problem”: long -term fairness !

If you have understood the previous example, you easily realize that 802.11 provides FAIR access to stations in terms of EQUAL NUMBER of transmission opportunities in the long term!

STA1 STA2 STA2 STA1 STA2 STA1

But this is INDEPENDENT OF transmission speed!

Giuseppe Bianchi

Computing answer 3

Frozen backoff

STA (2mbps) SIFS DIFS STA 11 SIFS DIFS ACK ACK

Cycle time RESULT: SAME THROUGHPUT (in the long term)!! E[ payload ] Thr ]1[ = Thr ]2[ = = E[cycle time ] 1500 ×8 = = TMPDU ]1[ + SIFS + ACK + DIFS +TMPDU ]2[ + SIFS + ACK + DIFS + E[backoff ] 1500 ×8 = = 39.1 Mbps !!!!!! 6304 +1303 + 10(2 + 304 + 50 ) + 310

DRAMATIC CONSEQUENCE: throughput is limited by STA with slowest rate (lower that the maximum throughput achievable by the slow station)!! Giuseppe Bianchi

39 Performance anomaly into action

Why the network is soooo slow today? We’re so Close, we have a 54 mbps and “excellent” channel, and we get Less than 1 mbps …

Hahahahahah!! Poor channel, Rate-fallbacked @ 1mbps ☺ Giuseppe Bianchi

EDCA operation

See details in: G. Bianchi, I Tinnirello , and L. Scalia IEEE NETWORK Magazine July/Aug. 2005

Giuseppe Bianchi

40 Multiple queues

AP 4 “Access Categories” Mapping the 8 priority levels provided by 802.1p ACAC Best-BestBest-- ACAC Back-BackBack-- AC AC Different parameters efforteffort groundground VideoVideo VoiceVoice VirtualVirtual collisioncollision HandlerHandler Independently operated Wireless Channel Collide (virtually) each other!

Giuseppe Bianchi

Differentiation methods in IEEE 802.11e EDCA

Varying time to wait before channel access Different size of AIFS (arbitrary inter frame space) Varying the size of contention windows Different size of CWmin and CWmax Varying the amount of channel accessible time Different duration of TXOP

Giuseppe Bianchi

41 TXOP differentiation

Effective since it changes the holding time of the channel for each station Does not affect collisions

Giuseppe Bianchi

CWmin differentiation

Operates by changing the long-term fairness ratio The sharing of resources is inversly proposional to the employed CWmin value A station with CWmin/4 will have 4 transmission opportunities versus 1, in average Problem: small CWs increase collision level! Large N = large amount of collisions = = less effective differentiation = penalty in overall thr Giuseppe Bianchi

42 AIFS differentiation

Light traffic

“Protected” slots for green

Heavy traffic

“Protected” slots for green

% of protected slots INCREASES

Giuseppe Bianchi

43