WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE...

64
WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno [email protected] Networking Course Honors on Computer Science University of the Western Cape 04 – Feb - 2013

Transcript of WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE...

Page 1: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi / IEEE 802.11 - WLAN

Lecturer: Carlos Rey-Moreno [email protected]

Networking CourseHonors on Computer Science

University of the Western Cape

04 – Feb - 2013

Page 2: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Why Wireless?A lot of pros...

↑ Less deployment cost● No need to bury infrastructure● Links can be easily and cheaply reused

↑ Deployment costs irrespective the distance

↑ Faster deployments

↑ Users can be nomadic and mobile

↑ Coverage in low density populated areas

↑ Less maintenance costs

Page 3: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Why Wireless?

Also some cons...

↓ Limited capacity

↓ Capacity degradation with increasing number of users

↓ Shared medium → Security problems

↓ QoS constraints

but still... ↑ more than ↓

Page 4: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Many technologies, many purposes

Focus on 802.11 (WiFi). It allows WLAN, WMAN & even WWAN at a very low-cost & low power consumption

Page 5: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Introduction to WLANs

● ¡ IEEE 802.11 = WLAN =WiFi!– Great success of the standard → Guarantees

compatibility among vendors

– Present worldwide, integrated in user devices

– Cheap, good and efficient

– Evolved during the years: 802.11n, 802.11ac

● In short / medium distance allows: – Wireless Local area networks indoors

– Wireless bridges between buildings

– Hot-Spots

– Wireless Internet Service Providers

Page 6: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Benefits of WLANs

● Wires disappear: flexibility, mobility and corporate image

● Networks deployment when it is not possible to use wires like parks

● Conventional LAN extension indoors & outdoors

● Low speed mobility without losing connection● Transparent for users, system and software

Page 7: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

A bit of history● 1979: 1st WLAN experiment (Switzerland, IBM)

● 1985: ISM bands regulation by FCC

● 1991: 1st works on WLAN over 1Mbps

● 1997: Release of the standard IEEE 802.11

● 1999: Release of the standards IEEE 802.11b (11 Mbps in 2.4 GHz) y 802.11a (54 Mbps in 5 GHZ)

● 2003: Release of the standard 802.11g (54 Mbps in 2.4 GHz)

● 2005: Release of the standard 802.11e (QoS)

● 2009: Release of the standard 802.11n (300Mbps)

Page 8: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Standards 802.11

Page 9: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Introduction

● Basic element of a WiFi network:– Station (STA): any laptop, PDA, smartphone etc. able

to use 802.11 technology

– Access Point (AP): Wi-Fi node that provides connectivity between STA connected to him and the rest of the network

– Wireless Medium: The way devices access to the, different PHY layers are defined (rates, frequency, modulations)

– Distribution System (DS): Logical component for the commutation of frames among APs connected to the same backbone.

Page 10: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Introduction

Page 11: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Introduction● Basic Service Set (BSS): Ways STAs can

communicate to each other:– Independent BSS: STAs communicate among

them directly. Known as Ad-hoc or Mesh Mode.

– Infrastructure BSS: STAs communicate through an AP. Known as Infrastructure Mode.

● Each BSS is defined by a Service Set Identifier (SSID)

● Many BSS can associate in a Extended Service Set (ESSID)

Page 12: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Introduction

Page 13: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Introduction● WiFi devices can be operated in one of these

modes:– Master (access point)

– Managed (also known as client or station)

– Ad-hoc (used for mesh networks)

– Monitor (not normally used for communications)

– Other proprietary non-802.11 modes (e.g. Mikrotik Nstreme or Ubiquiti AirMAX)

● Each mode has specific operating constraints, and radios may only operate in one mode at a time.

Source:WTKIT

Page 14: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi IntroductionMaster mode

Master mode (also called AP or infrastructure mode) is used to provide an infrastructure with an access point connecting different clients. The access point creates a network with a specified name (called the SSID) and channel, and offers network services on it. WiFi devices in master mode can only communicate with devices that are associated with it in managed mode.

Source:WTKIT

Page 15: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Introduction

Managed Mode

Managed mode is sometimes also referred to as client mode. Wireless devices in managed mode will join a network (specifying its SSID) created by a master, and will automatically change their channel to match it.

Clients using a given access point are said to be associated with it. Managed mode radios do not communicate with each other directly, and will only communicate with an associated master (and only with one at a time).

Source:WTKIT

Page 16: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Introduction

Ad-hoc Mode

Ad-hoc mode is used to create mesh networks with:● No master devices (APs)● Direct communication between neighbors

Devices must be in range of each other to communicate, and they must agree on a network name (SSID) and channel.

Source:WTKIT

Page 17: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Introduction

Monitor Mode

Monitor mode is used to passively listen to all radio traffic on a given channel. It is useful for:

● Analyzing problems on a wireless link

● Observing spectrum usage in the local area

● Performing security maintenance tasks

Source:WTKIT

Page 18: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Introduction

Source:WTKIT

Page 19: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi IntroductionModes of connecting APs

● Wired

● Wireless: Wireless Distribution System (WDS) protocol. Useful but with limitations

Page 20: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Standards 802.11

Page 21: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Standards 802.11

WLAN standards evolution● 1997: IEEE 802.11 is published

– MAC based in CSMA/CA

– 3 possible PHYs, rates 1 and 2 Mbps:● Infrared (IR)● Spread Spectrum by frequency hoping (FHSS)● Spread Spectrum by direct sequence (DSSS)

● From 1997 many extensions & recommendations for improving rate, security, performance, etc.

Page 22: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Standards 802.11

● IEEE802.11a – 5GHz band, up to 54 Mbps

● IEEE802.11b – 2,4GHz band, up to 11 Mbps.

● IEEE802.11c – Wireless bridges with 802.11.

● IEEE802.11d – 802.11 harmonization in different countries.

● IEEE802.11e – QoS support.

● IEEE802.11f – Interoperability among APs.

● IEEE802.11g – 2,4GHz band, up to 54 Mbps.

● IEEE802.11h – 802.11a adaptation to European regulation.

● IEEE802.11i – Security in 802.11 networks.

● IEEE802.11j – Extensions for Japan.

Page 23: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Standards 802.11● IEEE802.11k Exchange of capacity information.

● IEEE802.11m Maintenance, updates.

● IEEE802.11n MIMO, up to 300 Mbps, @2.4 & 5 GHz.

● IEEE802.11p Vehicle to vehicle communications

● IEEE802.11r Fast “Roaming”.

● IEEE802.11s Mesh networks.

● IEEE802.11T WPP test methods and metrics

● IEEE802.11u Interconnection with non-802 networks

● IEEE802.11v Wireless networks management.

● IEEE802.11w Protected management frames.

● IEEE802.11y Extension for USA.

Page 24: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

PHY Layer

● Tasks– Provide services to the MAC layer for

exchange of frames

– Exchanges frames with remote PHYs using different methods of modulation and coding

– Provide the MAC layer with information regarding the availability of the channel

Page 25: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

PHY Layer

● Architecture– PMD (Physical Medium Dependent): Real tools for

Tx/Rx in the physical medium. Clear Channel Assessment (CCA).

– PLCP (Physical Layer Convergence Procedure): Provide MAC layer with an unique interface independent of the specific PMD used.

Page 26: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

PHY Layer● 802.11. (1997) 3 possible PHYs, rates 1 and 2 Mbps:

– Infrared, IR. Discarded

– Spread Spectrum by freq hoping, FHSS. Discarded

– Spread Spectrum by direct sequence, DSSS. Active● 802.11a (1999) OFDM PHY; @5GHz. 6 – 54 Mbps.

● 802.11b (1999) HR/DSSS PHY; @2.4 GHz; 5.5/11 Mbps.

● 802.11g (2003) ERP PHY(Extended Rate PHY), includes the previous PHY with their rates; @ 2.4GHz:

– ERP-DSSS, ERP-HR/DSSS, ERP-OFDM● 802.11n (2009) Introduce MIMO, rates up to hundreds of Mbps

Page 27: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

PHY Layer

Compatibility of the standars

802.11a 802.11b 802.11g 802.11n

802.11a Yes Yes@5GHz

802.11b Yes Yes(slower)

[email protected]

802.11gYes

(slower) YesYes

@2.4GHz

802.11nYes

@5GHzYes

@2.4GHzYes

@2.4GHzYes

AP

CLIENT

Source:WTKIT

Page 28: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Channels● WiFi Channels

– 2.4 GHz (2.412-2.472 GHz)● 22 MHz width – 3 non-interferent channels

– 5 GHz (5.15-5.35 / 5.470-5.825 USA)● 20 MHz width – 8 non-interferent channels

WiFi devices must use the same channel in order to communicate with each other. Tx/Rx on the same channel → half dupplex

Source:WTKIT

Page 29: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Channels

● Central Freq only 5 MHz apart

● Channels 1, 6 and 11 non-interferent

Source:WTKIT

Page 30: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

WiFi Channel: Channel reuse

Source:WTKIT

Page 31: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Protocol Overhead

Data rates

Note that the “data rates” quoted in the WiFi specifications refer to the raw radio symbol rate, not the actual TCP/IP throughput rate. The difference is called protocol overhead, and is needed by the WiFi protocol to manage collisions, retransmissions, and general management of the link.

In the exercises you are going to be able to calculate the real data rate

Page 32: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

PHY Overhead

DSSS PHY (802.11)

Total PLCP Overhead = 192 μs

Page 33: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

PHY Overhead

HR/DSSS PHY (802.11b)

Two options:– Long Preamble → 192 μs PLCP Overhead

● Compatibility with 802.11

– Short Preamble → 96 μs PLCP Overhead

Page 34: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

PHY Overhead

OFDM PHY (802.11a)

Total PLCP Overhead = 24 μs

Page 35: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

PHY Overhead

ERP-OFDM PHY (802.11g)

Total PLCP Overhead = 26 μs

(20 μs Preamble + 6 μs Signal Extension)

Page 36: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

PHY Overhead

ERP-DSSS / ERP-CCK PHY (802.11g)

Total PLCP Overhead (Long Preamble) = 192 μs

Total PLCP Overhead (Short Preamble) = 96 μs

Page 37: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

ERP PHYNetwork with only 802.11g devices → ERP-OFDM

Network with both 802.11b & 802.11g devices. Both devices need to understand each other. That means:

– 11g devices must transmit at the maximum rate common to ALL the station those frames need to be understood by all the stations (ACK, RTS, CTS).

● ERP-DSSS PHY similar to DSSS PHY (same overhead)

● ERP-CCK PHY similar to HR/DSSS PHY (same overhead)

– Protection for activating detection in 11b devices before transmitting with ERP-OFDM. Two solutions:

● RTS/CTS (for more info go to slide 46)● CTS-to-self (for more info go to slide 47)

Page 38: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

ModulationsDifferent rates, because each symbol can transport, different amount of information

The more information a symbol can transport, the better the signal received must be in order to understand its content

Page 39: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer● The main goal of the MAC layer is controlling

the access the physical medium (air) to be as efficient as possible.

● Tasks:– Creation of the MAC frame

– Bridging

– Fragmentation / Re-ensambling

– Error check (via CRC)

– Medium access (CSMA / CA)

– Stations mobility

Page 40: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer Challenges● The fluctuation in the quality

of the RF link (noise,

interference, multipath...)

requires unicast data

frames to be confirmed.

Not forever → Acktimeout.

If expires, frame is ReTx

● Hidden nodes problem,

solved with the RTS/CTS

mechanism.

Page 41: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer. Coordination Types

● PCF (Point Coordination Function). Centralized. The CP (coordination point) reserves preiodically the channel for contention free phases during which it polls the stations. It has not been implemented

● DCF (Distributed Coordination Function). Distributed. Each station uses CSMA/CA and, optionally, RTS/CTS for accessing the channel. All the station, including the AP have the same rates. It is worldwide used

Page 42: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer (CSMA vs TDMA)

802.11 WiFi uses Carrier Sense Multiple Access (CSMA) to avoid transmission collisions. Before a node may transmit, it must first listen for transmissions from other radios. The node may only transmit when the channel becomes idle.

Other technologies (such as WiMAX, Nstreme, and AirMAX) use Time Division Multiple Access (TDMA) instead. TDMA divides access to a given channel into multiple time slots, and assigns these slots to each node on the network. Each mode transmits only in its assigned slot, thereby avoiding collisions.

Source:WTKIT

Page 43: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer. Temporization● IFS (Inter Frame Space): Separation times

among frames– SIFS (Short IFS): Separation between the end

of the reception and the Tx of the Ack.

– PIFS (PCF IFS): Used in PCF Mode ● PIFS=SIFS+SlotTime

– DIFS (DCF IFS): Used in DCF Mode● DIFS=PIFS+SlotTime=SIFS+2*SlotTime

The earlier you get access to the channel, the more data you will transmit

DSSS HR/DSSS OFDM ERP-DSSS ERP-CCK ERP-OFDM

SIFS 10 μs 10 μs 16 μs 10 μs 10 μs 10 μs

Page 44: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer. CSMA/CA● WiFi stations sense the channel until it is idle

● Once it is free, it waits DIFS without doing nothing

● After that, it waits a random time before transmitting. This time is defined an integer number of slots.

– The integer number is contained between 0 and the minimum Contention Window (CW_min) parameter.

– The length of each slot is called SlotTime.

The smallest the number & the shortest the SlotTime the least the MAC overhead

DSSS HR/DSSS OFDM ERP-DSSS ERP-CCK ERP-OFDM

SlotTime 20 μs 20 μs 9 μs 20 μs 20 μs 9 μs

CW_min 31 31 15 31 31 15

CW_max 1023 1023 1023 1023 1023 1023

Page 45: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer. CSMA / CA● If before the CW finishes, a frame is detected, the

CW countdown freezes.

● Once, the channel is idle again, it waits again DIFS and restart the countdown where the CW was frozen.

● When the CW arrives at zero, the frame is transmitted.

Page 46: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer. CSMA/CA● If the frame was unicast, the Transmitter starts its

AckTimeOut (DIFS+SIFS=2*SIFS+2*SlotTime) and waits for the Ack.

– Boradcast & multicast frame are not confirmed

● The Receiver receive the frame, checks its CRC while waits SIFS, once it is finished sends the Ack. Being SIFS < DIFS no collision is possible.

● If the Transmitter receive the ACK correctly and before the AckTimeout expires, the process is completed

Page 47: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer. CSMA / CA

● If the ACK does not arrive or arrives late, the CW_min is doubled, a new CW is obtained and the process restart.

● It the maximum number of ReTx is reached (7 by default, 4 in RTS/CTS mode), the frame is discarded and the process start again with Cwmin.

All this is considered MAC Overhead and is added to the PHY Overhead.

The more the number of STAs the bigger the MAC overhead

Page 48: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

MAC Layer. Fragmentation

● If a frame is too long, it can be fragmented and transmitted sequentially (each fragment is confirmed individually) separated by SIFS, so no other station can win the channel (but a bit more overhead is added).

Page 49: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Hidden Node● The hidden node problem is shown in the

figure below. Nodes 1 and 3 do not see each other so they do not detect the transmission from the other to 2 and a collision occurs.

● So, the basic CSMA/CA mode does not work.

Page 50: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

RTS / CTS

Page 51: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

RTS/CTS● RTS and CTS contains information about the total

duration of the transmission

● Virtual Carrier Detection: every station that may interfere listens either the RTS or the CTS and avoids transmitting during that period although it senses the channel idle

It is a good solution but it introduces even more MAC overhead

Page 52: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

CTS-to-self

● A better solution for 11b and 11g devices in the same network, but it also introduces MAC overhead. Sometimes it is not

supported

Page 53: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Frame Types. MAC header

● Frame Control: MAC control information, for all.

● Duration ID: only in RTS/CTS to activate the virtual carrier

● Sequence control: Use to identify different fragments

● Addresses: to bridge through the DS

– Address 1 & 2: Source and destination MACs

– Address 3: BSSID

– Address 4: Only used in Intra DS communication

● Frame body: Data to be transmitted

● FCS: Error check

Normal header 28 bytes, DS header 34 bytes → More overhead

Page 54: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

Frames Types

● Ack 14 bytes @ maximum common rate

● RTS or CTS 20 bytes @ maximum common rate

Page 55: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

55

Propagation time effects● ACKTimeout: We need to allow the ACK to arrive on time

● ACKTimeout

● As it is in the standard, many packets are retransmitted innecesarily because the ACKs do not arrive on time. Result

● In Basic mode the link would work very slowly● In RTS/CTS mode there would be no link

= SIFS+SlotTime+ACK+PLCP_Overhead

Page 56: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

56

Propagation time effects

ACKTimeout=ACKTimeout std+2δCTSTimeout=CTSTimeout std+2δ

Solution

δ= Propagation delay = distance [m] / speed of light [m/s]

Page 57: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

57

Collisions due to distance● CSMA/CA with depreciable propagation delay: If A and B are

two stations that wants to transmit a packet, both sense the channel and if its free after the contention windown countdown:

● They will collide if they transmit in the same slot● They will not collide if they transmit in different slots.

One will listen the other one and will freeze its countdown until the channel is free again

● CSMA/CA with non-depreciable propagation delay: If the propagation delay is too long (i.e. 200 ms), MANY slots pass since the transmission from A until B senses it. The odds of collision increase widely and performance decreases..

Page 58: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

58

Collisions due to the distance

Page 59: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

59

Collisions due to distance● Solution:

● In PtMP and Mesh ● In PtP

● Effect in the throughput → some overhead is introduced since a bigger SlotTime entails less effiency of the system

As Propagation delay= distance [m] / speed of light [m/s]. In PtMP:If SlotTime = 20 us → Max distance ~ 3 km

If SloTime = 9us → Max distance ~ 1'35 km

SlotTime=SlotTimestd+2δ

SlotTimestd+2δ>SlotTime>SlotTimestd+δ

Page 60: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

60

Summary protocol issues● Changes in ACKTimeout and CTSTimeout

● Changes in SlotTime (from 20 or 9 μs depending in the PHY) PtMP & Mesh: PtP:

● The changes in the ACKTimeout and CTSTimeout are now embedded in the new SlotTime

● By knowing the distance of the link you can caltulate the propagation delay and the new values of the parameters

● Atheros chipsets allow changing them that and the MP too

● Changing the SlotTime and not the ACKTimeout has side effects

ACKTimeout=ACKTimeout std+2δACKTimeout std=SIFS+SlotTime+ACK+PLCPOverhead

CTSTimeout=CTSTimeout std+2δ

ACKTimeout adjusted for 60 km

SlotTime=SlotTimestd+2δ SlotTime=SlotTimestd+δ

Page 61: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

61

Other Alternatives

● Polling → Mikrotik nstreme

● TDMA → Ubiquiti AirMAX● Keeping PHY OFDM● Disabling retransmisions and contention● Programing TDMA in the driver

● WiMAX is the obvious technology to do so, since has been create for that purpose. However, prices are much higher

Page 62: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

62

BondingBonding allows increasing the capacity by using two radios: one for Tx and the other one for Rx.

Page 63: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking
Page 64: WiFi / IEEE 802.11 - WLAN - University of the Western Capecreymoreno/csc730/WiFi.pdf · WiFi / IEEE 802.11 - WLAN Lecturer: Carlos Rey-Moreno carlos.reymoreno@gmail.com Networking

The content of this presentations has used materials from:

- F. Javier Simó-Reigadas @ URJC, Spain

- Wireless Training Kit @ http://wtkit.org

Thanks to them!