802.11 – wireless phy and mac stallings 502-507. types of 802.11 802.11 infrared 802.11 fhss...

20
802.11 – Wireless PHY and MAC Stallings 502-507

Upload: mavis-chambers

Post on 16-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 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

802.11 – Wireless PHY and MAC

Stallings 502-507

Page 2: 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

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)

Page 3: 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

• 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?)

Page 4: 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

Collision Avoidance in 802.11• Two approaches

– DCF (Distributed Coordination Function)• No RTS/CTSCSMA/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).

Page 5: 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

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…..

BA C

Page 6: 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

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….

Page 7: 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

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?

Page 8: 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

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.

channel busyDIFS

channel checked channel still idle

Slot timebackoff

transmit if idle

Page 9: 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

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.

Channel found to be busy

CWmax

CW

Channel found to be idle

CWmin

could be zero

Page 10: 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

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.

Page 11: 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

Flowchart of CSMA/CA

start

NAV=0?

sense channel

yes

ChannelIdle

?

transmit frame

yes

collision?

No - success

random backoff

no

no?

Page 12: 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

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.

Page 13: 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

TimingSIFS = 16s, PIFS = 25s, DIFS = 34s, EIFS = 43s, Slottime = 9s

begin to sense

channel

DIFS

decide that the channel to be idle

RTS CTS SIFS DATA ACK

How long does it take to send an RTA, CTA, Data or ACK? Later

SIFS

channel sense

Sending a single data packetSIFS DIFS

DIFS RTS CTS SIFS Frag 1 ACKSIFS SIFS SIFS Frag 2 ACKSIFS SIFS

Sending a fragmented data packet

Page 14: 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

DIFS RTS CTS SIFS Data ACKSIFS SIFS

Sending back to back packets

DIFS

Wait an random backoff, i.e., random(0,CW)*slottime)But don’t increment/decrement CW.

RTS CTSSIFS

Page 15: 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

Problems with RTS/CTS

Page 16: 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

Frame Layout for 802.11b

Sync128 bits

SFD16 bits

PLCP MPDU

physical layer convergence protocol

MAC protocol data unit

Physical layer convergence protocolalways transmitted at 1Mbps

Signal8 bits

PreambleEnable synchronization

contains the bit rate

of the MPDU1Mbps, 2Mbps,

5.5Mbps, 11Mbps

Service8 bits

Length16 bits

CRC16 bits

time in microseconds to transmit the MPDU

total time to transmit PLCP = ?

Page 17: 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

Frame Layout for 802.11bPLCP MPDU

physical layer convergence protocol

MAC protocol data unit

MPDU

data frame

Page 18: 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

Frame Layout for 802.11b

RTSframe control

2 bytes00011011X…X

duration2 bytes

receiver address6 bytes

transmitter address6 bytes

error detection4 bytes

CTS

ACK

frame control2 bytes

00011100X…X

duration2 bytes

receiver address6 bytes

error detection4 bytes

frame control2 bytes

00011101X…X

duration2 bytes

receiver address6 bytes

error detection4 bytes

Page 19: 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

What is the overhead for a data packet and for a fragment?

Page 20: 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

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.