36
Lecture 4 Lecture 4 Wireless Medium Access Control Wireless Medium Access Control Prof. Shamik Sengupta Office 4210 N [email protected] http://jjcweb.jjay.cuny.edu/ssengupta/ Fall 2010

Lecture 4 Wireless Medium Access Control

  • Upload
    yamka

  • View
    35

  • Download
    3

Embed Size (px)

DESCRIPTION

Prof. Shamik Sengupta Office 4210 N [email protected] http://jjcweb.jjay.cuny.edu/ssengupta/ Fall 2010. Lecture 4 Wireless Medium Access Control. Medium Access Control (MAC). Base Station. Forward link. Reverse link. Mobile Station. Mobile Station. Mobile Station. - PowerPoint PPT Presentation

Citation preview

Page 1: Lecture 4  Wireless Medium Access Control

Lecture 4 Lecture 4 Wireless Medium Access ControlWireless Medium Access Control

Prof. Shamik Sengupta

Office 4210 N

[email protected]

http://jjcweb.jjay.cuny.edu/ssengupta/

Fall 2010

Page 2: Lecture 4  Wireless Medium Access Control

Mobile Station

Base Station

Mobile StationMobile Station

Mobile Station

Forward link

Reverse link

Medium Access Control (MAC)

Page 3: Lecture 4  Wireless Medium Access Control

Earlier MAC Protocols: A quick overview

Channel Partitioning: TDMA, FDMA

– divide channel into “pieces” (time slots, frequency)

– allocate piece to node for exclusive use

C B A C B A C B A C B A

C

AB

Time

f0 Freq

uenc

y

A A

B B

C C Freq

uenc

y

Time

f2

f1

f0

Channel Partitioning: adv., disadv.

– Share channel efficiently at high load

– inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node!

Page 4: Lecture 4  Wireless Medium Access Control

Earlier MAC Protocols: A quick overview

Packet Radio (PR) Access Technique:

– Users attempt to access a single channel in an uncoordinated or random manner

Random Access: Aloha, Slotted Aloha

– allow collisions

– “recover” from collisions

Random access MAC protocols

– efficient at low load: single node can fully utilize channel

– high load: collision overhead

Page 5: Lecture 4  Wireless Medium Access Control

Pure (unslotted) ALOHA

Devised by Norman Abramson and his colleagues– University of Hawaii

Simple, no synchronization when frame first arrives

– transmit immediately

collision probability increases:– frame sent at t0 collides with other frames sent in [t0-1,t0+1]

Page 6: Lecture 4  Wireless Medium Access Control

Pure Aloha efficiency

What is the efficiency?

Page 7: Lecture 4  Wireless Medium Access Control

Slotted ALOHA

Assumptions: all frames same size time divided into equal

size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized if 2 or more nodes

transmit in slot, all nodes detect collision

Operation: when node obtains fresh

frame, transmits in next slot

– if no collision: node can send new frame in next slot

– if collision: node retransmits frame in each subsequent slot with prob. p until success

Page 8: Lecture 4  Wireless Medium Access Control

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized: only slots in nodes need to be in sync

simple

Cons collisions, wasting slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

Page 9: Lecture 4  Wireless Medium Access Control

5: DataLink Layer 5-9

Slotted Aloha efficiency

Efficiency : 37%

At best: channel

used for useful

transmissions 37%

of time!!

Page 10: Lecture 4  Wireless Medium Access Control

Why Aloha protocols were disadvantageous?

Aloha protocols do not listen to the channel before transmission– Do not exploit info about other users

Listening to the channel if any user is transmitting is key to the efficient wireless access – This was the basic of CSMA protocols

– Carrier Sense Multiple Access Protocol

Page 11: Lecture 4  Wireless Medium Access Control

Carrier Sense Multiple Access (CSMA) Protocol

Two imp parameters in CSMA– Detection delay

– Propagation delay

Detection delay– A function of the receiver hardware

– Time reqd for a terminal to sense whether or not the channel is idle

Propagation delay– Relative measure of how fast a packet travels from one station to

another station (BS or AP)

– Systems must be built taking this parameter significantly in account

– High propagation delay impact efficiency

– E.g., two extreme transmitting users may get into collision again and again due to high propagation delay

Page 12: Lecture 4  Wireless Medium Access Control

Variations of CSMA

1-persistent CSMA– Listens to the channel, if idle transmit

p-persistent CSMA– Listens to the channel, if idle, transmit with prob p in the first slot

or (1-p) in the next slot

CSMA/CD– Further improvement over earlier CSMA

– Not only listens to channel before transmissions but also during transmissions

– If collision is detected, transmissions are aborted immediately

– Saves valuable resources from wastage

– Combines “listen before talk” and “listen while talk”

– Happens in Ethernet (because of full-duplex radios)

Page 13: Lecture 4  Wireless Medium Access Control

CSMA in wireless

The concept of CSMA/CD is interesting– How about applying it in wireless medium access control?

Problems in wireless networks– signal strength decreases proportional to the square of the distance

– the sender would apply CS and CD, but the collisions happen at the receiver

– a sender cannot “hear” the collision at the same time of transmission, because transmission power suppresses receiving power

– i.e., CD does not work

– furthermore, CS might not work if, e.g., a terminal is “hidden”

Wireless MAC use variants of CSMA– CSMA/CA (collision avoidance protocol)

– Does not make collision zero, just tries to reduce it

– Very popular in IEEE 802.11 (WLAN)

Page 14: Lecture 4  Wireless Medium Access Control

IEEE802.11

infrastructure network

ad-hoc network

APAP

AP

wired network

AP: Access Point

Page 15: Lecture 4  Wireless Medium Access Control

802.11 infrastructure mode

Station (STA)– terminal with access mechanisms

to the wireless medium and radio contact to the access point

Basic Service Set (BSS)– group of stations using the same

radio frequency

Access Point– station integrated into the wireless

LAN and the distribution system

Portal– bridge to other (wired) networks

Distribution System– interconnection network to form

one logical network (ESS: Extended Service Set) based on several BSS

Distribution System

Portal

802.x LAN

Access

Point

802.11 LAN

BSS2

802.11 LAN

BSS1

Access

Point

STA1

STA2 STA3

ESS

Page 16: Lecture 4  Wireless Medium Access Control

802.11: ad-hoc mode

Direct communication within a limited range– Station (STA):

terminal with access mechanisms to the wireless medium

– Basic Service Set (BSS):group of stations in range and using the same radio frequency

802.11 LAN

BSS2

802.11 LAN

BSS1

STA1

STA4

STA5

STA2

STA3

Page 17: Lecture 4  Wireless Medium Access Control

IEEE standard 802.11

mobile terminal

access point

server

fixed terminal

application

TCP

802.11 PHY

802.11 MAC

IP

802.3 MAC

802.3 PHY

application

TCP

802.3 PHY

802.3 MAC

IP

802.11 MAC

802.11 PHY

LLC

infrastructure network

LLC LLC

Page 18: Lecture 4  Wireless Medium Access Control

How does the medium access work in WLAN?

Access methods– DCF CSMA/CA (mandatory)

– collision avoidance via exponential backoff

– Minimum distance (IFS) between consecutive packets

– ACK packet for acknowledgements (not for broadcasts)

– DCF with RTS/CTS (optional)– Distributed Foundation Wireless MAC

– avoids hidden terminal problem

– PCF (optional)– access point polls terminals according to a list

Contention

Based

Contention

Free

Distributed Coordination Function (DCF) Point Coordination Function (PCF)

Page 19: Lecture 4  Wireless Medium Access Control

802.11 – MAC

Priorities– defined through different inter frame spaces

– SIFS (Short Inter Frame Spacing)– highest priority, for ACK, CTS, polling response

– PIFS (PCF IFS)– medium priority, for time-bounded service using PCF

– DIFS (DCF, Distributed Coordination Function IFS)– lowest priority, for asynchronous data service, competing stations

t

medium busySIFS

PIFS

DIFSDIFS

next framecontention

direct access if medium is free DIFS

Page 20: Lecture 4  Wireless Medium Access Control

t

medium busy

DIFSDIFS

next frame

contention window

(randomized back-offmechanism)

WLAN CSMA/CA access method

Station ready to send – starts sensing the medium (Carrier Sense)

If the medium is free for the duration of an Inter-Frame Space (IFS), the station can start sending (IFS depends on service type)

If the medium is busy, the station has to wait for a free IFS, then the station must additionally wait a random back-off time

– collision avoidance, multiple of slot-time

If another station occupies the medium during the back-off time of the station, the back-off timer freezes

slot timedirect access if

medium is free DIFS

Page 21: Lecture 4  Wireless Medium Access Control

WLAN access scheme details

Sending unicast packets– station has to wait for DIFS before sending data

– receivers acknowledge at once (after waiting for SIFS) if the packet was received correctly (CRC)

– automatic retransmission of data packets in case of transmission errors

t

SIFS

DIFS

data

ACK

waiting time

other

stations

receiver

senderdata

DIFS

contention

Page 22: Lecture 4  Wireless Medium Access Control

Contention for channel

When the other stations find the channel idle, they would like to transmit their own packets– Contention for channel

If all the waiting stations attempt at once, this will surely result in collision

– Some CA scheme is necessary

– Backoff intervals can be used to reduce collision probability

Page 23: Lecture 4  Wireless Medium Access Control

Backoff Interval

When transmitting a packet, choose a backoff interval in the range [0,cw]– cw is contention window

Count down the backoff interval when medium is idle– Count-down is suspended if medium becomes busy

When backoff interval reaches 0, transmit packet

data

wait

B1 = 5

B2 = 15

B1 = 25

B2 = 20

data

wait

B1 and B2 are backoff intervals

at nodes 1 and 2Assume cw = 31

B2 = 10

Page 24: Lecture 4  Wireless Medium Access Control

Backoff Interval

The time spent counting down backoff intervals is a part of MAC overhead– Choosing a large cw leads to large backoff intervals and can

result in larger overhead

– Choosing a small cw leads to a larger number of collisions (when two nodes count down to 0 simultaneously)

Since the number of nodes attempting to transmit simultaneously may change with time, some mechanism to manage contention is needed– IEEE 802.11 DCF: contention window cw is chosen dynamically

depending on collision occurrence

– Follows Binary exponential backoff algorithm

Page 25: Lecture 4  Wireless Medium Access Control

Binary Exponential Backoff (BEB) in DCF

Even before the first collision, nodes follow BEB Initial backoff interval (before 1st collision)

– [0,7]

If still packets collide, double the collision interval– [0,15], [0,31] and so on…

Express this binary exponential backoff interval as a function of collision number

Page 26: Lecture 4  Wireless Medium Access Control

Numerical example #1

Two nodes, A and C both waiting for a busy channel to be idle so that they can proceed with their first transmission. After the channel becomes idle, what is the probability of A and C colliding in their first transmissions?

Page 27: Lecture 4  Wireless Medium Access Control

Numerical example #2

Two nodes, X and Y intend to transmit frames of 10 and 5 timeslots. Initially after waiting for DIFS, X and Y both generate random backoff number, rX and rY as 2. In the next stage, X generates rX =1 and Y generates rY =3. What will be the time (slots) taken to complete both transmissions and receive acks?– Assume, SIFS=1 timeslot, DIFS=2 timeslots

Page 28: Lecture 4  Wireless Medium Access Control

Avoiding collisions (more)

idea: allow sender to “reserve” channel rather than random access of data frames: avoid collisions of long data frames

sender first transmits small request-to-send (RTS) packets to BS using CSMA

– RTSs may still collide with each other (but they’re short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes

– sender transmits data frame

– other stations defer transmissions

avoid data frame collisions completely

using small reservation packets!

Page 29: Lecture 4  Wireless Medium Access Control

Collision Avoidance: RTS-CTS exchange

AP

A B

time

RTS(A)

RTS(B)

RTS(A)

CTS(A) CTS(A)

DATA (A)

ACK(A) ACK(A)

reservation collision

defer

Page 30: Lecture 4  Wireless Medium Access Control

802.11 access scheme details – RTS/CTS

Sending unicast packets– station can send RTS with reservation parameter after waiting for DIFS

(reservation determines amount of time the data packet needs the medium)

– ack via CTS after SIFS by receiver (if ready to receive)

– sender can now send data at once, acknowledgement via ACK– other stations store reservations distributed via RTS and CTS

t

SIFS

DIFS

data

ACK

defer access

other

stations

receiver

senderdata

DIFS

contention

RTS

CTSSIFS SIFS

NAV (RTS)NAV (CTS)

Page 31: Lecture 4  Wireless Medium Access Control

31

802.11 Steps – RTS/CTS

All backlogged nodes choose a random number, R

Each node counts down R– Continue carrier sensing while counting down

– Once carrier busy, freeze countdown

Whoever reaches ZERO transmits RTS– Neighbors freeze countdown, decode RTS

– RTS contains (CTS + DATA + ACK) duration = T_comm

– Neighbors set NAV = T_comm– Remains silent for NAV time

Page 32: Lecture 4  Wireless Medium Access Control

32

802.11 Steps – RTS/CTS

Receiver replies with CTS– Also contains (DATA + ACK) duration.

– Neighbors update NAV again

Tx sends DATA, Rx acknowledges with ACK– After ACK, everyone initiates remaining countdown

– Tx chooses new R = rand (0, CW)

If RTS or DATA collides (i.e., no CTS/ACK returns)– Indicates collision

– RTS chooses new random no. following BEB

Page 33: Lecture 4  Wireless Medium Access Control

Numerical example #3

Two nodes, X and Y intend to transmit frames of 10 and 5 timeslots. Initially after waiting for DIFS, X and Y both generate random backoff number, rX and rY as 2. In the next stage, X generates rX =1 and Y generates rY =3. What will be the time (slots) taken to complete both transmissions and receive acks?– Assume, SIFS=1 timeslot, DIFS=2 timeslots

– RTS threshold = 8.

Page 34: Lecture 4  Wireless Medium Access Control

Another special access – with Fragmentation

t

SIFS

DIFS

data

ACK1

other

stations

receiver

sender frag1

DIFS

contention

RTS

CTSSIFS SIFS

NAV (RTS)NAV (CTS)

NAV (frag1)NAV (ACK1)

SIFSACK2

frag2

SIFS

Page 35: Lecture 4  Wireless Medium Access Control

Point Coordination Function

PIFS

stations‘

NAV

wireless

stations

point

coordinator

D1

U1

SIFS

NAV

SIFSD2

U2

SIFS

SIFS

SuperFramet0

medium busy

t1

Page 36: Lecture 4  Wireless Medium Access Control

Point Coordination Function

tstations‘

NAV

wireless

stations

point

coordinator

D3

NAV

PIFSD4

U4

SIFS

SIFSCFend

contention

period

contention free period

t2 t3 t4