1 第 2 章 ieee 802.11 网络 石高涛 [email protected] 天津大学计算机科学与技术学院

67
1 第2第 IEEE 802.11 第第 石石石 [email protected] 石石石石石石石石石石石石石石

Upload: aleesha-greene

Post on 23-Dec-2015

349 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

1

第 2 章IEEE 802.11 网络

石高涛[email protected]

天津大学计算机科学与技术学院

Page 2: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

2

提纲

• 网络结构与协议家族• WiFi网络移动性支持• 无线网络MAC协议• IEEE 802.11与帧格式• WiFi能量管理与拥塞避免

Page 3: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

3

网络结构与协议家族

Page 4: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

44

802.11 Architecture – Two modes

Page 5: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

5

基于无线路由器的 WiFi 网络

Page 6: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

6

WiFi Direct• 2010 年 10 月, Wi-Fi Alliance ( Wi-Fi 联

盟)发布 Wi-Fi Direct 白皮书,• Wi-Fi Direct 标准是指允许无线网络中的设

备无需通过无线路由器即可相互连接。• 与蓝牙技术类似,这种标准允许无线设备以

点对点形式互连,而且在传输速度与传输距离方面则比蓝牙有大幅提升。

Page 7: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

77

Applications

Single Hop (including directed connected)• Home networks• Enterprise networks (e.g., offices, labs, etc.)• Outdoor areas (e.g., cities, parks, etc.)

Multi-hops• Ad Hoc network of small groups (e.g.,aircrafts)• Balloon networks (Space Data Inc.)• Mesh networks (e.g., routers on lamp-posts)

Page 8: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

88

IEEE 802.11 in OSI Model

Wireless

Page 9: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

9

IEEE 802.11 协议栈

Page 10: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

10

PHY spec• Infrared PHY (No products !)

– diffuse infrared– 1 and 2Mbps

• Radio PHY – Frequency hopping PHY– Direct Sequence PHY– CCA (clear channel assessment) - how to

sense a channel is clear:• energy level is above a threshold• can detect a signal• use both

Page 11: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

Frequency Bands- ISM

ExtremelyLow

VeryLow

Low Medium High VeryHigh

UltraHigh

SuperHigh

Infrared VisibleLight

Ultra-violet

X-Rays

AudioAM Broadcast

Short Wave Radio FM BroadcastTelevision Infrared wireless LAN

902 - 928 MHz26 MHz

Cellular (840MHz)NPCS (1.9GHz)

2.4 - 2.4835 GHz

83.5 MHz(IEEE 802.11)

5 GHz(IEEE 802.11)

HyperLANHyperLAN2

• Industrial, Scientific, and Medical (ISM) bands• Unlicensed, 22 MHz channel bandwidth

Page 12: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

1212Wireless LANsWireless LANs Prof. F. TobagiProf. F. Tobagi

802.11 DSSS and 802.11b PHY Specifications802.11 DSSS and 802.11b PHY Specifications

Frequency and rate in the standard

• 802.11 specifies 1 & 2 Mbps

• 802.11b specifies additional 5.5 & 11 Mbps rates

MAC Layer

2.4 GHz2.4 GHz

FHSSFHSS

1 Mbps

2 Mbps

2.4 GHz2.4 GHz

DSSSDSSS

1 Mbps

2 Mbps

InfraredInfrared

IRIR

1 Mbps

2 Mbps

5 GHz5 GHz

OFDMOFDM6, 9, 12,

18, 24, 36,

48, 54 Mbps

2.4 GHz2.4 GHz

DSSSDSSS

5.5 Mbps

11 Mbps

IEEE 802.11 IEEE 802.11a IEEE 802.11b

PH

Y L

ayer

Page 13: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

Data Rates• The data rates supported by 802.11b standard

1, 2, 5.5 and 11Mbps• The data rates supported by 802.11g standard

1, 2 ,5.5, 11, 6, 9, 12, 18, 24, 36, 48 and 54• The data rates supported by 802.11a standard

6, 12 and 24Mbps are mandatory and9, 18, 36, 48 and 54Mbps are optional

• AP and IBSS creators announce set of Basic rates and supported rates in the Beacons and Probe Response packets.

• Station announces supported rate information in Probe Request and (Re) Association packets

Page 14: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

14

Direct Sequence Spread Spectrum

Page 15: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

15

• Each bit represented by multiple bits using spreading code

• Spreading code spreads signal across wider frequency band– In proportion to number of bits used– 10 bit spreading code spreads signal across 10 times

bandwidth of 1 bit code

• One method:– Combine input with spreading code using XOR– Input bit 1 inverts spreading code bit– Input zero bit doesn’t alter spreading code bit

11-chip Barker sequence in 802.11

Direct Sequence Spread Spectrum

Page 16: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

16

Direct Sequence Spread Spectrum

• In a nutshell, the data stream is combined is via an XOR function with a high-speed pseudo-random numerical sequence (PN)

• The PRN specified by 802.11 is an 11 chip Barker Code

Page 17: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

17

Direct Sequence Spread Spectrum

Page 18: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

18

Direct Sequence Spread Spectrum Example

Page 19: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

19

CCA (Clear Channel Assessment)

• CCA mechanism is used to determine when it is OK to transmit by a station.

• Energy Detection– A number of energy samples will be collected for the estima

te over sensing time.– Using these samples, the energy detection CCA mechanis

m estimates the power of the signal observed and compares the estimate to a threshold.

• Energy detection threshold is a function of Tx power– Tx power > 100 mW: -80 dBm (-76 dBm for 802.11b)– Tx power > 50 mW: -76 dBm (-73 dBm for 802.11b)– Tx power 50 mW: -70 dBm

• The CCA detection time is set to 15 s

Page 20: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

20

WiFi网络移动性支持

Page 21: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

21

Roaming in 802.11

Page 22: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

22

Roaming Approach• Station decides that link to its current AP is poor• station uses scanning function to find another AP• station sends Reassociation Request to new AP• if Reassociation Response is successful

– then station has roamed to the new AP– else station scans for another AP

• if AP accepts Reassociation Request– AP indicates Reassociation to the Distribution Sy

stem– Distribution System information is updated– normally old AP is notified thru distributation sys

tem

Page 23: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

23

Scanning• Scanning required for many functions

– finding and joining a network– finding a new AP while roaming– initializing an ad hoc network

• 802.11 MAC uses a common mechanism– Passive scanning

• by listening for Beacons– Active Scanning

• probe + response

Page 24: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

24

Active scanning

Steps to Association:

Station sends ProbeAPs send Probe Respons

eStation selects best AP:Station sends Association

Request to select APAP sends Association Re

sponse

Page 25: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

25

802.11b Physical Channels• 11 partially overlapping channels

– 11 channels, each 22MHz wide, placed 5MHz apart

– Channel 1 is placed at center freq. 2.412 GHz, Channel 2 at 2.417 GHz, and so on

– Channels 1, 6 & 11 is the only set of three nonoverlapping channels

Page 26: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

26

IEEE 802.11 Handoff Procedure

• The overall handoff delay consists of the following components: – channel switching time, (4.8 ms)– Channel dwell time,(100 ms) – authentication delay and re-association delay. a

(few ms)

Page 27: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

27

Fast Handoff with Null Dwell Time

Xi Chen and Daji Qiao, "HaND: Fast Handoff with Null Dwell Time for IEEE 802.11 Networks," IEEE InfoCom 2010

Page 28: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

28

无线网络MAC协议

Page 29: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

29

Multiple Access Control (MAC) Protocols

• MAC protocol: coordinates transmissions from different stations to minimize/avoid collisions

– (a) Channel Partitioning MAC protocols: TDMA, FDMA, CDMA

– (b) Random Access MAC protocols: CSMA, MACA

– (c) “Taking turns” MAC protocols: polling

• Goal: efficient, fair, simple, decentralized

Page 30: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

30

Wired Vs Wireless Media Access

Both are on shared media.Then, what’s really the problem ?

Page 31: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

31

The Trivial Solution

• Transmit and pray– Plenty of collisions --> poor throughput at high

load

AA CCBB

collision

Page 32: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

32

The Simple Fix

• Transmit and pray– Plenty of collisions --> poor throughput at high

load

• Listen before you talk– Carrier sense multiple access (CSMA)– Defer transmission when signal on channel

AA CCBB

Don’ttransmit

Don’ttransmit

Can collisions still occur?Can collisions still occur?

Page 33: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

3333

CSMA collisions

Collisions can still occur:Propagation delay non-zero between transmitters

When collision:Entire packet transmission time wasted

spatial layout of nodes

note:Role of distance & propagation delay in determining collision probability

Page 34: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

34

CSMA/CD (Collision Detection)• Keep listening to channel

– While transmitting

• If (Transmitted_Signal != Sensed_Signal) Sender knows it’s a Collision ABORT

Page 35: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

35

2 Observations on CSMA/CD

• Transmitter can send/listen concurrently– If (Transmitted - Sensed = null)? Then succes

s

• The signal is identical at Tx and Rx– Non-dispersive

Unfortunately …Both observations do not hold for wireless Because …………

Page 36: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

36

A B

C D

Distance

Signalpower

A cannot send and listen in parallel

Signal not same at different locations

Wireless Medium Access Control

Page 37: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

37

Collision Detection Difficult

• Signal reception based on SINR

– Transmitter can only hear itself

– Cannot determine signal quality at receiver

A CD

B

Page 38: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

38

The Emergence of MACA, MACAW, & 802.11

• Wireless MAC proved to be non-trivial

• 1992 - research by Karn (MACA)

• 1994 - research by Bhargavan (MACAW)

• Led to IEEE 802.11 committee– The standard was ratified in 1999

Page 39: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

39

IEEE 802.11与帧格式

Page 40: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

40

Basic MAC Features• DCF: Carrier sense multiple access with collisio

n avoidance (CSMA/CA) based– based on carrier sense function in PHY called

Clear Channel Assessment (CCA)– CSMA/CA+ACK for unicast frames, with MAC l

evel recovery– parameterized use of RTS/CTS to protect agai

nst hidden nodes– frame formats to support both infrastructure a

nd ad-hoc networks• PCF (option, not been widely implemented)

– centralized, polling based– restricted to infrastructure network

Page 41: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

41

Frame Format

Frame Control Field

• Addressing: Address 1 Address 2 Address 3 Address 4

– Ad hoc: DA SA BSSID -– From AP: DA BSSID SA -– To AP: BSSID SA DA - – AP to AP: RA TA DA SA

Page 42: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

42

CSMA/CA+ACK: 4-way handshake

• MAC headers format differs per type– control frames: RTS, CTS, ACK– management frames, e.g. beacon, probe/probe

response, (re)-association request/response,– data frames

Page 43: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

4343

CTS = Clear To Send

RTS = Request To Send

IEEE 802.11

D

Y

S

M

K

RTS

CTS

X

Carrier sense multiple access with collision avoidance (CSMA/CA)

Page 44: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

4444

IEEE 802.11

D

Y

S

X

M

Ksilenced

silenced

silenced

silencedData

ACK

Carrier sense multiple access with collision avoidance (CSMA/CA)

Page 45: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

45

802.11 Steps

• All nodes choose a random number– R = rand (0, CW_min)

• Each node counts down R– Continue carrier sensing while counting down– Once carrier busy, freeze countdown

• Whoever reaches ZERO transmits RTS– Neighbors freeze countdown, decode RTS– RTS contains (CTS + DATA + ACK) duration = T_co

mm– Neighbors set NAV = T_comm

• Remains silent for NAV time

Page 46: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

4646

802.11 Steps

• Receiver replies with CTS– Also contains (DATA + ACK) duration.– Neighbors update NAV again

• Tx sends DATA, Rx acknowledges with ACK– After ACK, everyone initiates remaining countdown– Tx chooses new R = rand (0, CW_min)

• If RTS or DATA collides (i.e., no CTS/ACK returns)– Indicates collision– RTS chooses new random no. R1 = rand (0, 2*CW_mi

n)– Note Exponential Backoff Ri = rand (0, 2^i * CW_min)– Once successful transmission, reset to rand(0, CW_

min)

Page 47: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

47

But is that enough?

Page 48: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

48

RTS/CTS• Does it solve hidden terminals ?

– Assuming carrier sensing zone = communication zone

C

F

A B

E

D

CTS

RTS

E does not receive CTS successfully Can later initiate transmission to D.Hidden terminal problem remains.

E does not receive CTS successfully Can later initiate transmission to D.Hidden terminal problem remains.

CTS

Page 49: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

49

Hidden Terminal Problem• How about increasing carrier sense range

??– E will defer on sensing carrier no collision

!!!

CB DData

A

E

CTS

RTSF

Page 50: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

50

Hidden Terminal Problem• But what if barriers/obstructions ??

– E doesn’t hear C Carrier sensing does not help

CB DData

A

EF

CTS

RTS

Page 51: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

51

Exposed Terminal• B should be able to transmit to A

– RTS prevents this

CA B

E

D

CTSRTS

Page 52: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

52

Exposed Terminal• B should be able to transmit to A

– Carrier sensing makes the situation worse

CA B

E

D

CTSRTS

Page 53: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

53

Thoughts !• 802.11 does not solve HT/ET completely

– Only alleviates the problem through RTS/CTS and recommends larger CS zone

• Large CS zone aggravates exposed terminals – Spatial reuse reduces A tradeoff– RTS/CTS packets also consume bandwidth– Moreover, backing off mechanism is also wasteful

The search for the best MAC protocol is still on. However, 802.11 is being optimized too.

Thus, wireless MAC research still alive

Page 54: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

54

WiFi能量管理与拥塞避免

Page 55: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

55

Limited Power in Mobile Devices

WLAN

Internet

Access Point (AP)

WiFi Phone

LaptopPDA

YouTube Servers

Windows/Real Media Server

Question: Can we reduce power consumption of Wireless Network Interface while satisfying the QoS requirement?

Web Server

Wireless NetworkInterface

is a major powerconsuming source!

Page 56: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

56

Power Management in 802.11• A station can be in one of three states: - Transmitter on - Receiver only on - Dozing: Both transmitter and receivers off• Access point (AP) buffers traffic for dozing

stations• AP announces which stations have frames

buffered. Traffic indication map included in each beacon. All multicasts/broadcasts are buffered.

• Dozing stations wake up to listen to the beacon. If there is data waiting for it, the station sends a poll frame to get the data.

Page 57: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

57

PSM Implementation at AP• Most APs implemented PSM packet delivery in

one of two ways: – Normal: Buffered PSM packets at the tail of the tran

smission queue are enqueued– High priority: Buffered PSM packets are queued the

packets in a separate transmission queue with a different priority.

NAPman: Network-Assisted Power Management for WiFi Devices. Eric Rozner. MobiSys, 2010.

Page 58: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

58

DozyAP: Power-Efficient Wi-Fi Tethering

[MOBISYS '12] DozyAP: Power-Efficient Wi-Fi Tethering

Page 59: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

59

What is Wi-Fi Tethering

Sharing a cellular data connection via Wi-Fi An Internet-capable mobile phone acts as a Soft

Access Point (SoftAP) Also known as “Mobile Hotspot”

soft access point (a.k.a., mobile hotspot)

[MOBISYS '12] DozyAP: Power-Efficient Wi-Fi Tethering

Page 60: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

60

Nexus One(Android)

HTC HD7(WP)

iPhone 4(iOS)

Wi-Fi Tethering is a "Battery Killer"

Wi-Fi tethering disabled Wi-Fi tethering enabled

(idle)

Power Battery Life Power Battery Life

Nexus One 20 mW 259 hours 270 mW 19 hours

HTC HD7 32 mW 150 hours 302 mW 16 hours

iPhone 4 22 mW 247 hours 333 mW 16 hours

Even when idle, battery life is reduced from days to hours Practical usage will draw battery more quickly

Intuitively, the Wi-Fi interface should be put to sleep when the Wi-Fi network is idle

Page 61: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

61

Sources of Idle Time

Network traffic is bursty and idle for most of time Speed discrepancy between cellular and Wi-Fi

Wi-Fi Cellular

up to 54Mbps for 802.11a/gup to 600Mbps for 802.11n

up to 2Mbps for 3GUp to 100Mbps for LTE 4G

Many opportunities SoftAP could and should sleep !

[MOBISYS '12] DozyAP: Power-Efficient Wi-Fi Tethering

Page 62: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

62

Two way hand-shake protocol Sleep request Sleep response

SoftAP sleeps only if receiving sleep response

Sleep Request-Response Protocol

Ethernet Header(type = 0xffff)

TypeSequence Number

Sleep Duration

The Sleep “Request-Response” Protocol

0x1: sleep request0x2: sleep response

t0

t1

idle > threshold

t2

t3

sleep

any buffered data

YesNo

any delayeddata

YesNo

data

data

sleep request

sleep response

sleep request

sleep response data

SoftAP Client

Page 63: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

63

Congestion Avoidance:IEEE 802.11 DCF

• Before transmitting a packet, randomly choose a backoff interval in the range [0,cw]– cw is the contention window

• Direct access when medium is sensed free longer than DIFS, otherwise defer and backoff

• “Count down” the backoff interval when medium is idle– Count-down is suspended if medium becom

es busy• When backoff interval reaches 0, transmit pack

et (or RTS)

Page 64: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

64

DCF Example (count down)

data

waitB1 = 5

B2 = 15

B1 = 25

B2 = 20

data

wait

B1 and B2 are backoff intervalsat nodes 1 and 2

Let cw = 31

B2 = 10

Page 65: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

65

Congestion Avoidance

• The time spent counting down backoff intervals contributes to MAC overhead

• Choosing a large cw leads to large backoff intervals and can result in larger overhead

• Choosing a small cw leads to a larger number of collisions (more likely that two nodes count down to 0 simultaneously)

Page 66: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

66

Congestion Control

• Since the number of nodes attempting to transmit simultaneously may change with time, some mechanism to manage congestion is needed

• IEEE 802.11 DCF: Congestion control achieved by dynamically adjusting the contention window cw

Page 67: 1 第 2 章 IEEE 802.11 网络 石高涛 shgt@tju.edu.cn 天津大学计算机科学与技术学院

67

Binary Exponential Backoff in DCF

• When a node fails to receive CTS in response to its RTS, it increases the contention window

– cw is doubled (up to an upper bound – typically 5 times)

• When a node successfully completes a data transfer, it restores cw to CWmin