Vous êtes sur la page 1sur 45

Week 4: Media Access Coordination and

Contention

Joseph Camp
Associate Professor, SMU
EE 5377/7377: Embedded Wireless Design Lab
Sep. 14/16, 2015

Joseph Camp

Rice Networks Group

Overview
Survey MAC Solutions
Contention and Binary Exponential Backoff
Different Qualities of Service
Throughput Sharing Impact on DCF Mechanism Caused By:
Information Asymmetries
Channel Asymmetries

Joseph Camp

SMU

Introduction to Media Access (MAC)


Definition: Algorithm or protocol by which nodes arbitrate
use of the physical medium
But intuitively, what is a MAC?
Our Focus

Joseph Camp

SMU

Wireless Media Access Example 1


Consider this simple example:
C

B
What will happen here? (I am purposely being vague)
Joseph Camp

SMU

Collision
One result could be collision, where data arrives at the same
time
Data A
C

Data B

B
How could this be avoided?
Joseph Camp

SMU

Collision
One or more nodes try to transmit a packet simultaneously
Receiver is not able to untangle the result
Wireless channel wasted for the duration of the overlapping
packets

Joseph Camp

Wasted Channel Resources

SMU

Wireless Media Access Example 2


OR this example:
A

What will happen here? (Again, purposely vague)


Joseph Camp

SMU

Spatial Reuse
One result could be spatial reuse where two packets can be
transmitted at the same time
A

Data A

Data C

What are the requirements for this?


Is this desirable?
Joseph Camp

SMU

Types of Media Access Protocols


Fundamentally, a division of available resources to allow
users to share the medium (assuming a broadcast medium)
What do you mean by protocols? Just a set of rules
Types of MAC Protocols
Channel or frequency division

Taking-turns protocols (polling)


Random access protocols
Joseph Camp

SMU

A MACs Goal
For a channel capacity of R bps, what if:
1 node transmitting?
M nodes transmitting?

Joseph Camp

SMU

A MACs Goal
For a channel capacity of R bps, what if:
1 node transmitting? Ideally, node would achieve R bps
M nodes transmitting? M nodes each receive ~ R/M
Decentralized so that one node cant bring down entire
system
Simple, so easy to implement

Joseph Camp

SMU

Type 1: Channel Partitioning


Frequency Division Multiplexing

Time Division Multiplexing

Joseph Camp

SMU

Type 2: Taking Turns (Polling)


Scheduling or polling is used to prevent collisions
Used in IEEE 802.16 and cellular
Issues:
Efficiency?
Who decides?
Multi-hop dependencies?

Joseph Camp

SMU

Type 3: Random Access


Selected time to transmit has random component and can
include carrier sense and other mechanisms
Used in IEEE 802.11 and mesh networks
Issues:
Dealing with collisions
Maximizing spatial reuse
Fairness of nodes

Joseph Camp

SMU

Random Access Sample Timeline


C represents collisions
E represents empty slot
S represents success

Joseph Camp

SMU

History of Aloha
Scenario: Univ. of Hawaii, 1970
Packet Radio
Used to connect far-flung campuses on different islands
Application: Teletype requiring only 80 characters/second

Joseph Camp

SMU

Aloha Protocol
Immediately transmit arriving packet
No sensing, no scheduling, no rate limiting,

Receivers ACK all packets


If no ACK received, then wait a random time and retransmit
No ACK could be because of collisions or channel losses
Later: binary exponential backoff was added where random number
chosen between [0..2N] where N = number of retries

Main difference between Aloha and WiFi?


Carrier sense and collision avoidance
Joseph Camp

SMU

WiFis Binary Exponential Backoff


Each node selects a random backoff number
Waits that number of IDLE slots monitoring the channel
If channel becomes busy, freeze the timer until a DIFS
idle period, then start counting down again
When backoff counter reaches zero, transmit
Specifics of 802.11 where CW = contention window
Random number selected from [0,CW], starts at 15
If no CTS or ACK, increase to 2*CW+1 (31, 63, 127)
Reset to 15 on successful transmission

Data Transmission from Node A to B


CWA

ACK

DIFS

DATAA
DIFS

ACKB
SIFS

CW Contention Window. Starts only after DIFS


Random number r picked form range [0,CW]
CWmin min. value of contention window (usually 15)
CW grows exponentially after collisions
r can be decremented only in idle periods

CWmax max value of contention window (usually 1023)

InterFrame Spacing (IFS)


WiFi Standard

Slot time (s) DIFS (s)

IEEE 802.11-1997 (FHSS)

50

128

IEEE 802.11-1997 (DSSS)

50

50

IEEE 802.11b

20

50

IEEE 802.11a

34

IEEE 802.11g

9 or 20

28 or 50

IEEE 802.11n (2.4 GHz)

9 or 20

28 or 50

IEEE 802.11n (5 GHz)

34

IEEE 802.11ac (5 GHz)

34

DCF (DIFS) = SIFS + (2 * Slot Time)


Short (SIFS) reqd for turn around of Tx/Rx & Rx/Tx
Arbitration (AIFS) = AIFSN[AC] * slot time + SIFS
Relevant in 802.11e

Data Transmission from Node A to B


CWA

ACK

DIFS

DATAA
DIFS

ACKB
SIFS

What if a node C wanted to send data while A was


transmitting?
What if node C wanted to send data to B?
What about during SIFS?
What if after ACK, more than one say B,C,D,E nodes
are waiting to transmit data?

Example Contention: C and A both tx


DIFS

ACK

DATAA
DIFS

ACKB

DATAC

SIFS

In this example, who is sending and what did they


choose as their random variables for contention?
Answer: rA = 4 and rC = 6

What if rA and rC had both been picked as 4 ?


What if rA and rC collided and DATAA length was 10
while DATAC length were 15 ?

Example Collision: C and A both tx


DATAC
ACK

DATAA
DIFS

Length (DATAA) = 10 Slot times


Length (DATAC) = 15 Slot times
CW after Collision 1 -> 0 31
If really unlucky:
CW after Collision 2 -> 0 63
CW after Collision 3 -> 0 127

SIFS
DIFS

Network Allocation Vector (NAV)


Information in header allows virtual carrier sensing
STAA

DATA

ACK

STAB

STAC

ACK
SIFS

DIFS

DIFS
NAVB and C

IEEE 802.11e: Quality of Service


Enhanced Distributed Channel Access (EDCA)
Higher priority traffic better chance of being tx than lower class

Access Classes (AC) have different:


Contention window behavior & Arbitration (AIFS)

Access Class (AC)

CWmin

CWmax

AIFSN

Background (AC_BK)

15

1023

Best Effort (AC_BE)

15

1023

Video (AC_VI)

15

Voice (AC_VO)

Legacy DCF

15

1023

Not All Scenarios are like Case 1 and 2:


A

Ab
Aa

B Aa
b
b
a

a
A

(1)
AB

Ba
ab
(2)
AB

AB

Ab
B
b
b
B

Aa
a
A

ab
(3)
AB

AB

Ab
B Aa
b
b
a

Ba

B
b
b

(4)
B

B
Ab

Aa
a

Ba

B Aa
b
b
a

(5)
A

ab
(6)

B
b

B Aa
b
b
a

Aa
a
(7)
A

Ba
ab
(8)

B
b
b
B

Ab
Aa
a

Ba
(9)

B Aa
b
a
b

ab
(10)

B
b

Aa
a

Ba
(11)

B Aa
b
b
a

Ba
ab
(12)

B
b
b

Scenario Classification
Senders Connected (SC): scenarios 2-7, where senders of
each flow are in radio range.
Asymmetric Incomplete State (AIS), scenarios 11 and 12,
where senders are disconnected, asymmetric connections
between the two flows.
Symmetric Incomplete State (SIS), scenario 8, 9 and 10,
where senders are disconnected, symmetric connections
between the two flows.

Not All Scenarios are like Case 1 and 2:


Green: Sender Connected
A

Ab
Aa

B Aa
b
b
a

a
A

(1)
AB

Ba
ab
(2)
AB

AB

Ab
B
b
b
B

Aa
a
A

ab
(3)
AB

AB

Ab
B Aa
b
b
a

Ba

B
b
b

(4)
B

B
Ab

Aa
a

Ba

B Aa
b
b
a

(5)
A

ab
(6)

B
b

B Aa
b
b
a

Aa
a
(7)
A

Ba
ab
(8)

B
b
b
B

Ab
Aa
a

Ba

Yellow:
Symmetric
(9)
Incomplete State

B Aa
b
a
b

ab
(10)

B
b

Aa
a

Ba

B Aa
b
b
a

Ba

ab
Red:
(11) Asymmetric(12)
Incomplete State

B
b
b

Throughput Sharing with CSMA/CA


Observations:
SC-No fairness
problem.
AIS-Both short-term
and long-term fairness
problems.
SIS-Long-term fair,
short-term unfair.
Root cause: different
information about the
channel.

DCF with Asymmetric Channels


Observed that prior models fail to
capture the performance of competing
urban 802.11 flows due to simplifications
Simplification 1: Binary channel model
802.11 [Bianchi00] and extensions [Garetto05], modeling
MAC behavior with ideal channels (collision with loss)

DCF with Asymmetric Channels


Observed that prior models fail to
capture the performance of competing
urban 802.11 flows due to simplifications
Simplification 2: Topological Symmetry
Physical layer capture measurements [Kochut04, Lee07,
Judd07], none incorporated into 802.11 MAC models

Hidden Terminals

Physical layer capture

Objective
Topological
Asymmetries

Channel
Asymmetries

Jointly consider topological and channel asymmetries


to model competing urban 802.11 flows
Precisely: Given a time-varying channel and traffic matrix,
predict MAC-level throughput and understand the
aforementioned factors leading to its performance

Methodology
In-lab experiments to inform model of wireless adapter
behavior
Capture and packet loss probability based on SNR
Develop analytical model to model MAC-level throughput of
competing flows
Considers all possible capture behaviors
Design a set of urban experiments for model validation and
understanding role of realistic channel conditions on
asymmetries
Apply the model to understand how to improve
performance

Informing the Model


Role of packet size in capture
and packet loss probability
In-lab Measurements: 16
combinations (4 rates x 4 sizes)

Choice of packet size alone can


require up to 8 dB greater
relative SNR to capture

8 dB

Markov Model
Inputs: SNR matrix between nodes and traffic matrix
Output: MAC-level throughput of flows
Both access mechanisms modeled
Joint backoff state evolution
Idle (), single access (TS), overlapping access (T)

Modeled as a renewal-reward process


T = sum(P[success]*stationary distribution)/Average event
duration

Possible Capture Relationships

Four combinations per flow


Forward Traffic Capture
Reverse Traffic Capture
Reverse traffic capture not
included in prior models
Not carrier sensed

Forward B Reverse B
Reverse A Forward A

Overlapping Access State (T)


Three capture results - win,
lose, or no capture
(probabilistic)

Simple Example

Basic access (RTS/CTS disabled) with asymmetric


connectivity
Non-overlapping transmissions symmetric
E.g., Only A tx = i(1-j)fA(1 lA)
Sender A tx, and Sender B no tx for fA slots, no loss

When both A & B tx, a only receives from A but b


receives from A & B
Depends on capture relationships
Notation of capture probability: CXYx,D

Xs data (D) pkt over Ys pkt at rx x

Timeline/Table

Many more cases for 4-way handshake (with RTS)


P is the probablity packets overlap (state T)
SXY is the probability X sends before Y

Predictive Power of Model


With four-way handshake, reverse traffic capture plays a
much larger role in the throughput sharing
... + Reverse
... + Forward
Reverse + Forward (against reverse
(against reverse
Capture
traffic of a)
traffic of a)

...
+

...
+

Set of Urban Experiments


For model validation
Multiple subtopologies used to
validate model
Understand realistic
channel fluctuations
Resulting throughput
sharing properties
Even small-scale
fluctuations have large
impact on sharing

TFA Network: http://tfa.rice.edu

Channel vs. Information Asymmetries


With idealized channels, B
achieves nearly zero
throughput [Garetto05]
Examining this group of
nodes over a month of
experiments
Throughput sharing vastly
different
Equal in some cases,
opposite of what prior
model predicts

Small-scale Fade Flips Throughput Sharing


Minimum throughput sharing
difference (Day 1)
Maximum throughput sharing
difference (Day 2)
Examine channel conditions:
Rx b able to reverse capture in both cases
Tx B captures only on min. difference day

Model and Experimentation:


Only one dB in channel fade (Bb
vs. Ab) causes profile inversion*

*Similar bi-modal shift occurs for symmetric case.

Cause of Bi-Modal Shift

From -1.6 to -0.6


Examine channel conditions:
Rx b able to reverse capture in both cases
Tx B captures only with minimum
difference

Lab 3: Contention Windows


Part I: Downloading the 802.11 design and preparation
Part II: Fixed window size. Two different groups have two
different fixed window sizes to two different mobile
phones. Downloads begin at same time.
Part III: Change window size according to different traffic
types.
Part IV: Measurement portion (low vs. high contention
window sizes, then low/low, high/high, clean channel) +
Lab Report
Joseph Camp

SMU

Anonymous Surveys
Semi-weekly anonymous surveys will help me to get
feedback from you about how the course is going
Write any question that you may have about the material or
course
Anything that could be improved upon
Any other feedback that you might deem relevant

Vous aimerez peut-être aussi