Professional Documents
Culture Documents
Contents
IEEE
WLAN, part 2
Medium Access Control (MAC)
Medium access control: Different nodes must gain access
to the shared medium (for instance a wireless channel) in
a controlled fashion (otherwise there will be collisions).
Access methods:
FDMA
FDMA
TDMA
TDMA
CDMA
CDMA
CSMA
CSMA
:
LLC
LLC
MAC
MAC
PHY
PHY
WLAN, part 2
CSMA/CD vs. CSMA/CA (1)
CSMA/CD (Collision Detection) is the MAC method used in
a wired LAN (Ethernet). Wired LAN stations can (whereas
wireless stations cannot) detect collisions.
Basic CSMA/CD operation:
1)
2)
3)
4)
CSMA/CD rule:
Backoff after collision
WLAN, part 2
CSMA/CD vs. CSMA/CA (2)
CSMA/CA (Collision Avoidance) is the MAC method used in
a wireless LAN. Wireless stations cannot detect collisions
(i.e. the whole packets will be transmitted anyway).
Basic CSMA/CA operation:
1)
2)
3)
4)
5)
CSMA/CA rule:
Backoff before
collision
WLAN, part 2
AP
wired LAN
CSMA:
One packet at a time
transmission in downlink
(from the AP) and uplink
(from a station) is similar.
WLAN, part 2
DCF (CSMA/CA) vs. PCF
Designed for contention-free services (delay-sensitive realtime services such as voice transmission), but has not been
implemented (yet)
Point Coordination
Function (PCF)
MAC
extent
Distributed Coordination Function (DCF)
based on CSMA/CA
WLAN, part 2
Wireless medium access (1)
Cyclic Redundancy
Check (CRC) is used
for error detection
Transmitted
frame
(A=>B)
DIFS
ACK
(B=>A)
SIFS
WLAN, part 2
Wireless medium access (2)
Earliest allowed
transmission time
of next frame
Transmitted
frame
(A=>B)
DIFS
ACK
(B=>A)
SIFS
DIFS
Next frame
(from any station)
WLAN, part 2
Wireless medium access (3)
Transmitted
frame
(A=>B)
DIFS
ACK
(B=>A)
SIFS
Next frame
DIFS
WLAN, part 2
Wireless medium access (4)
Information about the
length of the frame is
in the PHY header
Transmitted
frame
(A=>B)
DIFS
ACK
(B=>A)
SIFS
Next frame
DIFS
10
WLAN, part 2
Wireless medium access (5)
The two most important interframe spacing times are
SIFS and DIFS:
SIFS (Short Interframe Space) = 10 s (16 s)
DIFS (DCF Interframe Space) = 50 s (34 s)
802.11b
802.11g
11
WLAN, part 2
Wireless medium access (6)
Transmission is not
allowed as long as
NAV is non-zero
Transmitted
frame
ACK
NAV value is
given here
DIFS
NAV
SIFS
Next frame
DIFS
12
WLAN, part 2
Wireless medium access (7)
Transmitted
frame
Long transaction
ACK
ACK
NAV
DIFS
SIFS
DIFS
13
WLAN, part 2
NAV value is carried in MAC header
MPDU (MAC Protocol Data Unit)
Addr 1
Addr 2
Addr 3
Addr 4
(optional)
MAC payload
FCS
14
WLAN, part 2
Wireless medium access (8)
Channel was idle at
least DIFS seconds
Transmitted
frame
(A=>B)
DIFS
ACK
(B=>A)
SIFS
t > DIFS
Next frame
(from any station)
15
WLAN, part 2
Wireless medium access (9)
Channel was busy
when station wanted
to send frame
Transmitted
frame
(A=>B)
ACK
(B=>A)
Backoff
DIFS
SIFS
DIFS
Next
frame
16
WLAN, part 2
No backoff => collision is certain
Suppose that several stations (B and C in the figure) are
waiting to access the wireless medium.
When the channel becomes idle, these stations start
sending their packets at the same time => collision!
Station A
ACK
Station B
Collision!
Station C
DIFS
17
WLAN, part 2
Backoff => collision probability is reduced
Contending stations generate random backoff values bn.
Backoff counters count downwards, starting from bn.
When a counter reaches zero, the station is allowed to
send its frame. All other counters stop counting until the
channel becomes idle again.
Station A
ACK
Backoff
Station B
Remaining
backoff time
bn is large
Station C
DIFS
bn is small
18
WLAN, part 2
Contention window (CW) for 802.11b
If transmission of a frame was unsuccessful and the frame
is allowed to be retransmitted, before each retransmission
the Contention Window (CW) from which bn is chosen is
increased.
802.11b
CW
Initial attempt
DIFS
1st retransm.
DIFS
CW = 25-1 = 31 slots
(slot = 20 s)
CW = 26-1 = 63 slots
:
5th (and further)
retransmissions
DIFS
CW = 210-1
= 1023 slots
19
WLAN, part 2
Contention window (CW) for 802.11g
In the case of 802.11g operation, the initial CW length is
15 slots. The slot duration is 9 s. The backoff operation
of 802.11g is substantially faster than that of 802.11b.
802.11g
CW
Initial attempt
DIFS
1st retransm.
DIFS
CW = 24-1 = 15 slots
(slot = 9 s)
CW = 25-1 = 31 slots
:
6th (and further)
retransmissions
DIFS
CW = 210-1
= 1023 slots
20
WLAN, part 2
Selection of random backoff
From the number CW (= 15 / 31 1023 slots) the
random backoff bn (in terms of slots) is chosen in such a
way that bn is uniformly distributed between 0 CW.
Since it is unlikely that several stations will choose the
same value of bn, collisions are rare.
The next slides show wireless medium access in action.
The example involves four stations: A, B, C and D.
Sending a packet means Data+SIFS+ACK sequence.
Note how the backoff time may be split into several parts.
21
WLAN, part 2
Wireless medium access (1)
Station A
ACK
Defer
Station B
1
Station C
Contention
Window
Backoff
Defer
Station D
1) While station A is
sending a packet,
stations B and C also
wish to send packets,
but have to wait (defer
+ backoff)
2) Station C is
winner (backoff time
expires first) and starts
sending packet
DIFS
22
WLAN, part 2
Wireless medium access (2)
3) Station D
also wishes to
send a packet
Station A
4
Station B
Station C
ACK
4) However,
station B is
winner and
starts sending
packet
Defer
Station D
DIFS
DIFS
23
WLAN, part 2
Wireless medium access (3)
5) Station D
starts sending
packet. Now
there is no
competition.
Station A
Station B
ACK
Station C
Station D
DIFS
DIFS
24
WLAN, part 2
No shortcuts for any station
Transmitted
frame
(A=>B)
DIFS
Backoff
ACK
(B=>A)
SIFS
Next
frame
(A=>B)
DIFS
25
WLAN, part 2
ACK frame structure
Frame type = control
MPDU
FCS
No MAC
payload
0 0 1 0 1 0 1 1
26
WLAN, part 2
Usage of RTS & CTS
The RTS/CTS (Request/Clear To Send) scheme is used as
a countermeasure against the hidden node problem:
Hidden node problem:
WS 1
WS 1 and WS 2 can hear
the AP but not each other
=>
If WS 1 sends a packet, WS 2 does not
notice this (and vice versa) => collision!
AP
WS 2
27
WLAN, part 2
Reservation of medium using NAV
The RTS/CTS scheme makes use of SIFS-only and the
NAV (Network Allocation Vector) to reserve the medium:
SIFS
WS 1
RTS
Data frame
CTS
AP
SIFS
NAV in RTS
NAV in CTS
DIFS
ACK
SIFS
28
WLAN, part 2
Danger of collision only during RTS
WS 2 does not hear the RTS frame (and associated NAV),
but can hear the CTS frame (and associated NAV).
WS 1
RTS
AP
Data frame
CTS
ACK
Danger of collision
NAV in RTS
NAV in CTS
29
WLAN, part 2
Advantage of RTS & CTS (1)
Usage of RTS/CTS offers an advantage if the data frame
is very long compared to the RTS frame:
WS 1
AP
WS 1
AP
RTS
Data frame
CTS
(RTS/CTS used)
ACK
Data frame
30
WLAN, part 2
Advantage of RTS & CTS (2)
A long collision danger interval (previous slide) should
be avoided for the following reasons:
Larger probability of collision
Greater waste of capacity if a collision occurs and the
frame has to be retransmitted.
A threshold parameter (dot11RTSThreshold) can be set
in the wireless station. Frames shorter than this value
will be transmitted without using RTS/CTS.
31
WLAN, part 2
Fragmentation
Fragmentation makes use of the RTS/CTS scheme and the
NAV mechanism:
SIFS
WS 1
RTS
AP
SIFS
Frag 0
CTS
Frag 1
ACK 0
SIFS
DIFS
SIFS
ACK 1
SIFS
RTS
NAV in WS
NAV in AP
CTS
Frag 0
ACK 0
32
WLAN, part 2
Sequence control field
MPDU (MAC Protocol Data Unit)
Addr 1
Addr 2
Addr 3
Addr 4
(optional)
MAC payload
FCS
33
WLAN, part 2
Advantage of fragmentation
Transmitting long data frames should be avoided for the
following reasons:
Larger probability that the frame is erroneous
Greater waste of capacity if a frame error occurs and
the whole frame has to be retransmitted.
A threshold parameter (dot11FragmentationThreshold)
can be set in the wireless station. Frames longer than
this value will be transmitted using fragmentation.
34