You are on page 1of 18

Medium Access Control: Part 5

Gaurav S. Kasbekar
Dept. of Electrical Engineering
IIT Bombay

1-1
Reference
 These are a modified version of slides by
Kurose and Ross available at:
http://ctas.poly.asu.edu/millard/CET459/lectno/K%
20-%20R%20stuff/index.html

1-2
Wi-Fi (802.11)
 Mobile nodes and Access Point
communicate over wireless channel (shared
medium)

Access
Point

Mobile
nodes

5-3
Wireless Link Characteristics
Differences from wired link ….

 Decreased signal strength: radio signal severely


attenuates as it propagates through air
 Shadow fading: obstructions in signal path (e.g.,
buildings, trees)
 Multipath fading: radio signal reflects off
objects, ground; multiple reflections with
different delays add up at receiver
 Mobility: of transmitter, receiver and/ or
objects in environment; so channel quality time-
varying

High bit error rates, fluctuating channel quality


5-4
Hidden Terminal Problem
C

A B C
B
A
A’s signal C’s signal
strength strength

 Obstruction between A,C


 Suppose A currently space
transmitting to B
 If C senses medium, will
 Hidden terminal problem
find it idle
can also be because of A
 If it transmits packet, and C being far apart
collision at B  instead of obstruction
 Carrier sensing not
always accurate
5-5
Unlicensed Band Operation
 Wi-Fi operates in Industrial, Scientific and
Medical (ISM) bands (around 2.4 GHz, 5 GHz)
 Originally meant for purposes other than telecom
(e.g., microwave ovens)
 Later unlicensed use by wireless devices (e.g., Wi-
Fi, Bluetooth) allowed
 Wi-Fi network must tolerate interference
from microwave ovens, etc., and other
networks operating close by
 Unlike cellular networks, which are protected from
interference by regulation

5-6
Acknowledgement Packets
 Bit error rate on wireless links very high
 Hidden terminal problem
 Heavy interference in ISM bands
 So link highly unreliable
 need ACK packets
 When destination receives an error-free
packet, it sends an ACK to source
 If source does not receive ACK, it knows
that packet must be retransmitted
 Different from transport layer ACKs
 Recall: no ACKs used in Ethernet
5-7
MAC Protocol in Wi-Fi
 Binary exponential backoff based algorithm like
Ethernet, but differences
 Collision Detection not implemented
 Reasons:
1) Received signal often several orders of
magnitude weaker than node’s own transmitted
signal
 Expensive hardware needed to detect it
2) Anyhow may be inaccurate due to hidden
terminals
 CSMA used
 inaccurate when hidden terminals present; works well
otherwise 5-8
MAC Protocol in Wi-Fi
 Since collision detection not implemented, all
nodes involved in collision transmit full
packets
 lot of time wasted per collision
 MAC protocol in Wi-Fi designed to minimize
collisions
 e.g., larger random backoff values than Ethernet,
not persistent
 Called CSMA/CA
 CA: Collision Avoidance

5-9
ACKs

 Suppose node A just finished transmitting


a data packet to B
 B needs to send ACK to A
 Nodes other than B may want to send data
packets
 Desirable to ensure that B’s ACK is
transmitted before the data packets
 Need to give priority to ACKs over data
packets

5-10
Priority to ACKs
 Node that wants to send a
data packet must wait for
at least time DIFS after
medium sensed idle
 end of DIFS followed by a
random backoff
 Node that wants to send an
ACK can send it once a time
SIFS elapses after medium
sensed idle
 SIFS < DIFS
 no random backoff used

5-11
802.11 CSMA/CA Algorithm
When node gets new packet:
3. Node starts transmitting
1. It senses channel. If when counter value
channel idle for DIFS, reaches zero
node starts to transmit
(can happen only when
packet.
channel idle)
If channel found busy
before DIFS elapses: 4. If ACK is received, node
is done with packet. If
2. Chooses a random
node has new packet,
backoff value K using
restarts from step 2.
binary exponential
backoff. If no ACK received,
repeats from step 2 with
Counts down this value
K chosen from a larger
once channel idle for DIFS.
interval.
Counter value remains frozen
when channel busy 5-12
Example

Ref: Tanenbaum, Chapter 4 5-13


Binary Exponential Backoff
 Random wait duration: K . ts
 where, ts is duration of one “slot”
 K is a random integer

 K selected uniformly at random from {0,1,


…, W-1}
 W: Contention Window
 Equal to CWmin at first transmission attempt
 Doubled after each unsuccessful transmission
up to CWmax
 Example values:
 CWmin = 16
 CWmax = 1024

 Larger backoff values than in CSMA/CD 5-14


Random Backoff Before First Attempt
 Random backoff used before transmission of even
first attempt of packets
 exception: no random backoff for first packet in a
sequence if medium found idle for DIFS duration
immediately upon sensing
• reduces delay if channel has been idle for some time
 Recall: in CSMA/CD, first attempt of every packet
initiated without random backoff as soon as
medium found free
 provides rate 𝑅 when only one node has pkts
 Reason for using random backoff in CSMA/CA:
 to prevent channel capture by a node with a sequence of
packets 5-15
Hidden Terminal Example

 H1 sending a data packet to AP


 Not received by H2
 H2 starts transmitting, causing collision at AP
 If data packet sent by H1 is large:
 high probability of collision
 lot of time wasted when collision occurs
RTS/ CTS Mechanism
 Short packets RTS,
CTS to reserve
medium
 Contain duration
required to send data
packet and ACK
 Other stations defer
access for that
duration
 If RTS collides, less
time wasted than if
large data packet had
collided

5-17
RTS/ CTS Mechanism
 RTS-CTS-DATA-ACK constitutes a single
exchange
 spaced apart by SIFS
 priority over new exchanges

 RTS-CTS exchange introduces delay


 typically used only for long data packets

5-18

You might also like