802.11 Wireless PHY and MAC

802.11 – Wireless PHY and
MAC
Stallings 502-507
Types of 802.11
• 802.11 Infrared
• 802.11 FHSS (frequency hopping spread
spectrum)
• 802.11 DSSS (direct sequence spread
spectrum)
• 802.11b HR-DSSS (HR = high rate)
• 802.11a OFDM (orthogonal frequency
division multiplexing)
Spread Spectrum
• Put the signal onto many frequencies, not just one.
• Two approach
– Frequency hopping (Hedy Lamarr)
• Pseudorandom number generator dictates which frequency to use.
• Stay at a frequency for a short “dwell time.”
– Direct sequence spread spectrum
• Each symbol is spread over many frequencies.
• 802.11b uses Barker code +1 –1 +1 +1 –1 +1 +1 +1 –1 –1 –1. If 1 is
to be sent, then +1 –1 +1 +1 –1 +1 +1 +1 –1 –1 –1 is sent to the
modulator. If 0 is to be sent, then -1 +1 -1 -1 +1 -1 -1 +1 +1 +1 +1 is
sent to the modulator. (Like CDMA?)
Collision Avoidance in 802.11
• Two approaches
– DCF (Distributed Coordination Function)
• No RTS/CTS
CSMA/CA (Carrier sense multiple access with collision
avoidance (not /CD = carrier detection which is very difficult
in wireless).
If a node wants to broadcast, it checks if the channel is idle for a
little while (DIFS).
If not, use binary exponential backoff in slot times (like
Ethernet).
If the channel is idle, it broadcasts. When the receiver gets the
frame, it check the CRC and if all is ok, it transmits an ACK.
If the source fails to get an ACK, it will resend the (after getting
control of the channel again).
Collision Avoidance in 802.11
• DCF – problems
(is DCF better than Aloha?)
– It is possible that two nodes are listening at the same time. But this is not
very likely if there is not too much traffic. Remember, propagation delay
is very small.
– The hidden node problem. Suppose that node A want to transmit to node B
and while node C is transmitting to node B…..
A
B
C
Collision Avoidance in 802.11
• DCF with RTS/CTS
– Suppose that node C wants to transmit to node B.
• First, C broadcast a RTS (request to send).
• If B is not currently hearing another broadcast (i.e., B gets the
RTS), then B broadcasts a CTS (clear to send) to C.
• When the packet has arrived, an ACK is sent.
• Now, if A then wants to broadcast, it would have heard the
CTS. So, instead, node A waits….
Collision Avoidance in 802.11
• DCF with RTS/CTS
– Suppose that node C wants to transmit to node B.
• First C broadcast a RTS (request to send) which includes
information on how long the broadcast will last.
• If B is not currently hearing another broadcast (i.e., B gets the
RTS), then B broadcasts a CTS (clear to send) to C along with
C’s estimate of the time the broadcast will last.
• When the packet has arrived, an ACK is sent to
• Now, if A then wants to broadcast, it would have heard the
CTS. So it waits for the amount of time specified in the CTS.
• Suppose you hear a RTS but no CTS, should you wait the
length of time in the RTS?
Collision Avoidance in 802.11
•
DCF with RTS/CTS
1. If a node wants to transmit, it checks that the channel is idle.
And continues to check it for DIFS seconds. If it remains idle
for this whole period it transmits.
2. Otherwise, it waits until it is idle and then wait a random
amount of time
Back off = Random(0,CW) * SlotTime
Random(0,CW) is a random number between 0 and CW.
3. After waiting, goto 1.
DIFS
channel busy
channel checked
backoff
Slot time
transmit if idle
channel still idle
DCF: CW calculation
•
•
CW may be increased when the channel fails to be clear when
checked.
CW may be decreased when the channel is idle when checked.
CW
CWmax
CWmin
could be zero
Channel found to be busy
Channel found to be idle
DCF: When do you sense the channel?
When you want to send a frame and
– No CTS and RTS indicates that there might be
an ongoing transmission.
– There is no ongoing backoff.
The network allocation vector (NAV) is an internal structure that
records when the channel might be free.
If the NAV indicates that the channel is busy, then we say that the
virtual channel is busy.
A transmission is only attempted when both the physical sense
and the NAV agree that the channel might be idle.
Flowchart of CSMA/CA
start
NAV=0
?
yes
sense channel
Channel
no
Idle
?
yes
transmit frame
?
collision
?
no
No - success
random
backoff
Fragmenting in DCF
• The BER for wireless channels may be large. So frames
are fragmented to increase throughput…
• But if a many fragments are used, then the overhead of
gaining access to the channel is large.
• To alleviate this problem, two different time intervals are
specified.
– For a node broadcasts, it first checks if the channel is
idle for DIFS.
– Thus, after an ACK, the channel is guaranteed to be idle
for at least DIFS. However, if another fragment needs
to be sent or resent, or if an frame is to be resent
(because the ACK did not arrive), it will be broadcast
after waiting SIFS (short interfame spacing). With SIFS
< DIFS.
Timing
SIFS = 16s, PIFS = 25s, DIFS = 34s, EIFS = 43s, Slottime = 9s
Sending a single data packet
DIFS
RTS
SIFS
CTS
SIFS
DATA
SIFS
ACK
DIFS
channel sense
begin to decide that
sense the channel
channel to be idle
Sending a fragmented data packet
DIFS
RTS
SIFS
CTS
SIFS
Frag 1
SIFS
ACK
SIFS
Frag 2
SIFS
ACK
SIFS
How long does it take to send an RTA, CTA, Data or ACK? Later
Sending back to back packets
DIFS
RTS
SIFS
CTS
SIFS
Data
SIFS
ACK
DIFS
RTS
SIFS
CTS
Wait an random backoff, i.e., random(0,CW)*slottime)
But don’t increment/decrement CW.
Problems with RTS/CTS
Frame Layout for 802.11b
PLCP
physical layer
convergence protocol
MPDU
MAC protocol data unit
Physical layer convergence protocol
always transmitted at 1Mbps
Preamble
Enable synchronization
Sync
128 bits
SFD
16 bits
Signal
8 bits
contains the
bit rate
of the MPDU
1Mbps, 2Mbps,
5.5Mbps, 11Mbps
Service
8 bits
Length
16 bits
CRC
16 bits
time in microseconds to
transmit the MPDU
total time to transmit PLCP = ?
Frame Layout for 802.11b
PLCP
physical layer
convergence protocol
MPDU
MAC protocol data unit
MPDU
data frame
Frame Layout for 802.11b
RTS
frame control
2 bytes
00011011X…X
duration
2 bytes
receiver address transmitter address error detection
6 bytes
6 bytes
4 bytes
CTS
frame control
2 bytes
00011100X…X
duration
2 bytes
receiver address
6 bytes
error detection
4 bytes
ACK
frame control
2 bytes
00011101X…X
duration
2 bytes
receiver address
6 bytes
error detection
4 bytes
What is the overhead for a data
packet and for a fragment?
PCF
• Definition AP access point – the central controller of the
nodes. Often these are connected to the wired network.
• The access point polls each node to ask if it wants to
send something. Hence, no collisions.
• When a node moves closer from one AP domain to
another, it waits for a beacon. The beacon invites nodes
to sign up for polling service.