1 cs 6910 – pervasive computing spring 2007 section 6 (ch.6): multiple radio access prof. leszek...

64
1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan University Slides based on publisher’s slides for 1 st and 2 nd edition of: Introduction to Wireless and Mobile Systems by Agrawal & Zeng © 2003, 2006, Dharma P. Agrawal and Qing-An Zeng. All rights reserved. Some original slides were modified by L. Lilien, who strived to make such modifications clearly visible. Some slides were added by L. Lilien, and are © 2006-2007 by Leszek T. Lilien. Requests to use L. Lilien’s slides for non-profit purposes will be gladly granted upon a written request.

Post on 20-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

1

CS 6910 – Pervasive ComputingSpring 2007

Section 6 (Ch.6):

Multiple Radio Access

Prof. Leszek LilienDepartment of Computer Science

Western Michigan University

Slides based on publisher’s slides for 1st and 2nd edition of: Introduction to Wireless and Mobile Systems by Agrawal & Zeng

© 2003, 2006, Dharma P. Agrawal and Qing-An Zeng. All rights reserved.

Some original slides were modified by L. Lilien, who strived to make such modifications clearly visible. Some slides were added by L. Lilien, and are © 2006-2007 by Leszek T. Lilien.

Requests to use L. Lilien’s slides for non-profit purposes will be gladly granted upon a written request.

Page 2: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 2

Chapter 6 Multiple Radio Access

Page 3: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 3

Outline

Introduction Contention Protocols ALOHA Slotted ALOHA CSMA (Carrier Sense Multiple Access) CSMA/CD (CSMA with Collision Detection) CSMA/CA (CSMA with Collision Avoidance)

Page 4: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 4

6.1. Introduction

© 2007 by Leszek T. Lilien

Recall Large # of traffic

channels on each BS Bec. traffic channels used by

1 MS exclusively for call duration

Small # of controlchannels on each BS

Bec. control channelsshared by many MSsfor short periods

Too expensive/inefficient to assign control channnel for call duration

MSs compete for these few shared control channels For call setup, etc.

BS

Forward

(downlin

k) contro

l channel

MS

Reverse (

uplink) c

ontrol c

hannel

Forward

(downlin

k) traff

ic channel

Reverse (

uplink) tr

affic

channel

Page 5: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 5

Introduction – cont. 1 Multiple access control channels

Each MS attached to a transmitter/receiver Communicates with its BS via a control channel

(CC) CC shared by other MSs

=> “multiple access” CC Transmission from any MS is received by all MSs

within its radio range

Shared MultipleAccess Medium

MS 4

MS 3

MS 2

MS 1…

MS n…

Page 6: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 6

Multiple access issue If more than one MS transmits at a time on a CC

to BS, a collision occurs on this CC How to determine which MS can transmit to BS?

Multiple (radio) access protocols (a.k.a. MAC sublayer protocols)

Solve multiple access issues Specify how shared control channels are to be

accessed by M

Introduction – cont. 2

(Modified by LTL)

Shared MultipleAccess Medium

MS 4

MS 3

MS 2

MS 1

MS n

Page 7: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 7

Medium (Channel) Sharing Techniques

Medium- sharing

Techniques

Static Channelization

Dynamic Medium

Access Control

Scheduled

Random Access

Static channelization (static medium access control) – channel assigned in a pre-specified way and not changed

Dynamic channelization (dynamic medium access control) - channel allocated as needed and not changes with time

(Modified by LTL)

Page 8: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 8

Recall ISO Open Systems Interconnection Reference Model for networks Communication subnetwork = 3 lowest layers of

OSI Network layer (NET) Data link layer (DLL) Physical layer (PHY)

6.2. Multiple (Radio) Access Protocols = MAC Sublayer Protocols

© 2007 by Leszek T. Lilien

Page 9: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 9

Comm subnet in wired LANs, MANs, PRNs, PANsLAN = local area network / MAN = metropolitan area network PAN = personal area network / PRN = paceket radio network

Classic (wire!): point-to-point full-duplex channels

Comm subnet in wireless systems Broadcast half-duplex channels

Broadcast over airwaves - not point-to-point Radio transmission goes from xmitter to rcvr - not full-duplex

Can emulate point-to-point xmission in wireless systems

In order to use solutions (e.g., protocols) from wired netwroks over wireless

Note: broadcast possible in some wired net topologies

E.g. bus, ring, ...

6.2. Multiple (Radio) Access Protocols = MAC Sublayer Protocols – cont. 1

© 2007 by Leszek T. Lilien

Page 10: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 10

Q: How to emulate point-to-point xmission in wireless systems?

A: Modify OSI for point-to-point xmission in wireless systems Specifically, split DLL into 2 sublayers:

Logical link control (LLC)sublayer (upper sublayer)

Medium access control(MAC) sublayer (lower sublayer)

MAC sublayer protocols = multiple access protocols = multiple radio access protocols (see above)

(Modified by LTL)

© 2007 by Leszek T. Lilien

6.2. Multiple (Radio) Access Protocols = MAC Sublayer Protocols – cont. 1

DLL

NET

Page 11: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 11

Types of multiple access protocols (cf. next slide): Contention-based protocols - resolve a collision

after it occurs Execute a collision resolution protocol after each

collision

Collision-free protocols (a.k.a. conflict free p.) - ensure that a collision never occurs

E.g., a bit-map protocol and binary countdown protocol

Types of Multiple Access Protocols

(Modified by LTL)

Page 12: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 12

Classification of Multiple Access Protocols

Random access protocols – upon collision, retrans-mit after a ran-dom delay

Collision resolution protocols - upon collision, retransmit according to a more sophisti-cated method

Multiple-access protocols

Contention-based Collision-free

Random access Collision resolution

FDMA

TDMA

CDMA

Token Bus

DQDB

etc.

ALOHA

CSMA

BTMA,

ISMA

etc.

TREE

WINDOWetc.

DQDB: Distributed Queue Dual Bus BTMA: Busy Tone Multiple AccessISMA: Idle Signal Multiple Access

ALOHA and CSMA protocols will be discussed in this section.

Page 13: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 13

6.3. Contention-Based Protocols

Major categories of contention-based protocols1) ALOHA (a.k.a. Pure ALOHA)2) Slotted ALOHA3) CSMA (Carrier Sense Multiple Access)

... discussed in turn below ...

© 2007 by Leszek T. Lilien

Page 14: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 14

6.3.1. ALOHA (a.k.a. Pure ALOHA) Developed in the 1970s for a packet radio network by

University of Hawaii To interconnect islands’ campuses / Single-hop network

Principles: Sender S may xmit a packet at any time (hoping no

collision will occur) S finds out whether transmission was successful or

experienced a collision by listening for an ACK broadcast from the destination station

Successful if an ACK arrrives within a time-out period T If no ACK within T, S assumes that there was a collision

=> packet was lost after colliding with pckt of another station

If there was a collision, S retransmits after some random time

Analogy: 2 people entering a doorway simultaneously Collision can occur

(Modified by LTL)

Page 15: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 15

6.3.1. ALOHA – cont.

Collision in Pure ALOHA (can last up to 2T)

1 2 3 3 2Time

Collision

Retransmission Retransmission

MS 1 packetWait for a random time

MS 2 packetMS 3 packet

t - T t t + T T

Recall ALOHA principles: Sender S may xmit a packet at any time S waits for an ACK broadcast from the destination station If there was a collision, S retransmits after some random time

Example: Packet 2 from MS2 & Packet 3 from MS3 collide MS3 retransmits Packet 3 pretty soon (random wait) MS2 retransmits Packet 2 much later (random wait)

Note: Collision can block channel for period up to 2T

(Modified by LTL)

Page 16: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 16

** OPTIONAL ** Throughput of ALOHA

n

!n

(2G)nP

e 2G

• T – packet length (duration)• Probability P(n) that n packets arrive in time 2T

-- If 2 packets of length T arrive in time > 2T, they didn’t collide

where G is normalized offerred traffic load for the channel

GeP 20

• Probability P(0) that a packet is successfully received (without collision) - calculated by letting n=0 in P(n)

GeGPGS 20

• Throughput S

184.02

1max

eS

• Maximum throughput for ALOHA (occurs for G = ½ - cf. p. 129)

Analogy: two people sufficiently distant from each other do not collide in a doorway

(Modified by LTL)

Page 17: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 17

Improvements over Pure ALOHA: Time is slotted

Slot length = packet length (duration) = T Packet transmission can start only at the

beginning of a slot This reduces collision duration

Pure ALOHA: If Packet 1 is almost finished when it collides with just-starting Packet 2, collision can lasts for nearly T+T = 2T (details: Slide +2)

Slotted ALOHA: 2 Packets can collide only when both are just starting => collision can last at most T (details: Slide +4)

(Modified by LTL)

6.3.2. Slotted ALOHA

Page 18: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 18

6.3.2. Slotted ALOHA – cont.

Collision in Slotted ALOHA (can last max. T)

1 2&3 2Time

Collision

Retransmission Retransmission

3

Slots

MS 1 packet

MSs 2 & 3 packets Wait for a random time

Recall Slotted ALOHA improvements: Time is slotted / Packet can only start at the beginning of a slot This reduces collision duration

Collision can block channel for max. T Example: Packet 2 from MS2 & Packet 3 from MS3 collide

MS2 retransmits Packet 2 pretty soon (random wait) MS3 retransmits Packet 3 much later (random wait)

Note: Shows again that collision can block channel for period T

(Modified by LTL)

Page 19: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 19

** OPTIONAL ** Throughput of Slotted ALOHA

GeP 0

• Probability of no collision

GeGPGS 0

• Throughput S

368.01

max e

S

• Maximum throughput for slotted ALOHA (occurs for G = 1 - cf. p. 130)

Page 20: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 20

Comparison of Throughputsfor ALOHA and Slotted ALOHA

Slotted Aloha

Aloha

0.368

0.184

Traffic load G

Thr

ough

put S

th

(Modified by LTL)

G86420

0.5

0.4

0.3

0.2

0.1

0

Max. throughput for ALOHA (A) Sth = 0.184 at G = ½

Max. throughput for Slotted ALOHA (SA) Sth = 0.368 at G = 1

Notice that Sth for SA is exactly 2 x bigger than Sth for A

Hypothesis: bec. max. duration of a collision for SA (=2T) is 2 x smaller than for A (=T)

Page 21: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 21

6.3.2-B. CSMA (Carrier Sense Multiple Access) Group of Protocols

Max. throughputs for Pure & Slotted ALOHA are 0.184 & 0.368

CSMA protocols give better throughput than both Aloha protocols By avoiding collisions

Basic improvement in all CSMA protocols over ALOHA protocols: Listen to the channel (“sense” for the presence of the “carrier”) before transmitting a packet Don’t transmit if channel busy

Avoids some collisions - but not all See Fig - next slide

Page 22: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 22

Perspective on MAC & Access Methods

Medium Access Control (MAC) Different nodes must gain access to

the shared medium in a controlledfashion (otherwise there will becollisions)

Access methods FDMA - assigning channels in frequency domain TDMA - assigning time slots in time domain CDMA - assigning code sequences in code

domain CSMA - assigning transmission opportunities in

time domain on a statistical basis

© 2006, Michael Hall, Helsinki Univ. of Technology

DLL

NET

Page 23: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 23

Basic Collision Mechanism in CSMA Protocols

Some collisions avoided Packet 4 was not sent so it did not collide with Packet 2 Packet 5 was not sent so it did not collide with Packet 3

Collisions can still occur if sensing occurs nearly simulta-neously Packet 6 collided with Packet 7

7

Time1 2 3

Collision

6

MS 4 senses,avoids collision

Delay for MS 4

MS 5 senses,avoids collision

MS 5 Delay

MS 1 senses, sends packet

MS 2 senses, sends packet

MS 3 senses,sends packet

MS 6 senses, sends packet

MS 7 senses, sends packet

(Modified by LTL)

Page 24: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 24

1) Basic CSMA, often just CSMA (Carrier Sense Multiple Access)

2) CSMA/CD (CSMA with Collision Detection)

3) CSMA/CA (CSMA with Collision Avoidance)

Types of CSMA Protocols

© 2007 by Leszek T. Lilien

Page 25: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 25

(Basic) CSMA improvement over ALOHAs:Sender S starts transmission only if no transmission is ongoing

6.3.3 (Basic) CSMA Protocol

© 2007 by Leszek T. Lilien

Page 26: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 26

Types of CSMA Protocols

CSMA

Nonpersistent CSMA

Persistent CSMA

Unslotted nonpersistent CSMA

Unslotted persistent CSMA

Slotted nonpersistent CSMA

Slotted persistent CSMA

1-persistent CSMA

p-persistent CSMA

Page 27: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 27

Nonpersistent/x-persistent CSMA Protocols

Nonpersistent CSMA Protocol: Step 1: If the medium is idle, transmit immediately Step 2: If the medium is busy, wait a random amount of

time and then go to Step 1 Note:

Random backoff reduces probability of collisions Wasted idle time if the backoff time is too long

1-persistent CSMA Protocol: Step 1: If the medium is idle, transmit immediately Step 2: If the medium is busy, continue to listen until

medium becomes idle, and then transmit immediately

Note: There will always be a collision if two or more nodes

wait for idle medium Usually senders stop transmission attempts after a few

unsuccessful tries

Page 28: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 28

Nonpersistent/x-persistent CSMA Protocols – cont.

p-persistent CSMA Protocol: Slotted time required.

Step 1: If the medium is idle, transmit with probability p, or delay till next time slot with probability (1-p)

Step 2: If transmission was delayed by one time slot, go to Step 1

Step 3: If the medium is busy, continue to listen until medium becomes idle, then go to Step 1

Note: P-persistent CSMA is a good tradeoff between

nonpersistent and 1-persistent CSMA

Page 29: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 29

How to Select Probability p ?

Assume: N - # nodes that can be active at a time

(i.e., ready to send a packet) => Np - the expected number of nodes that will

attempt to transmit once the medium becomes idle Np ≥ 1 => a collision is expected to occur

=> to avoid collisions,network must make sure that Np < 1

(Modified by LTL)

Page 30: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 30

Throughput for Different ALOHA and CSMA Protocols with =0.01

0 1 2 3 4 5 6 7 8 9

Traffic Load G

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0

Thr

ough

put S

th

AlohaSlotted Aloha

1-persistent CSMA

0.5-persistent CSMA

0.1-persistent CSMA

0.01-persistent CSMA

Nonpersistent CSMA

= / T (p. 132)

- propagation delayT – packet transmission time

Recall:p-persistent: transmit with probability p if medium idle

Observe:p = 0.01 is best in this Fig. (others suffer more collisions reducing thruput => “don’t hurry too much”)(Modified by

LTL)

Page 31: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 31

6.3.4. CSMA/CD(CSMA with Collision Detection)

In Basic CSMA: If 2 terminals begin sending packets at the same time, each will transmit its complete packet Even if collision is taking place

Problem: Wasting medium for an entire packet duration

Solution principle (main CSMA/CD idea): Backoff immediately after a collision

Modified by LTL

Page 32: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 32

6.3.4. CSMA/CD (CSMA with Collision Detection) – cont.

Solution: CSMA/CD (CD = collision detection)Step 1: If the medium is idle, then transmit Step 2: If the medium is busy, continue to listen until the channel is idle, then transmit Step 3: When a collision is detected during transmission,

cease xmitting immediatelyStep 4: Wait a random amount of time & go to Step 1

Improvement over Basic CSMA:Able to terminate xmission as soon as collision detected Prevents wasting whole time slot (slot = packet

duration)

Modified by LTL

Page 33: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 33

Use of Jamming Signal in CSMA/CD

Collision Mechanisms in CSMA/CD1) Without a jamming signal2) With a jamming signal

Jamming signal facilitates collision detection by other terminals

Note: Different timing assumptions in the textbook (pp. 135-

136)

© 2007 by Leszek T. Lilien

Page 34: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 34

1) Collision Mechanism in CSMA/CD Without Jamming Signal

A B

τ – propa-gation delaycd – time to detect collis. ≈ 0

T0

A begins transmission at T0 when channel is idle [will reach B at T0+]

A B

B begins transmission just before A’s trans-mission reaches B

Time

T0+ τ -

A B

T0 + τ + τcd

A B

B detects collision cd after A’s transmission reaches B & stops its xmission immediately

(Modified by LTL)

A detects collision cd after B’s xmission reaches A[at (T0+ +cd) ++ ( - ( +cd)) + cd ≈ T0+2 +cd for ≈0

≈ T0+2τ +cd

=> Transmission period: = 2+ cd

gap ~

distance ~

distance ~ cd

length ~ + cd distance ~ cd

distance ~ - ( + cd )

Page 35: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 35

A B

T0

A begins transmission at T0 when channel is idle (will reach B at T0+)

A B

B begins transmission just bef. A’s trans-mission reaches B

Time

T0+ τ -

A B

T0 + τ + τcd

A B

T0+2τ+ 2τcd

B detects collision cd after A’s transmission reaches B & starts sen-ding jamming signal (not shown yet) to warn other terminals about collision

(Modified by LTL)

B finishes sending jam. sig. (red) that lasted crA detects jam. sig. cd after it reaches A [at (T0++cd+cr) + (-cr+cd) = T0+2+2cd]

T0+τ+τcd+τcr

A B

=> Transmission period: = 2+ 2cd

2) Collision Mechanism in CSMA/CD With Jamming Signal

τ – prop. delaycd – time to detect collis. ≈ 0cr – duration of jamming signal – long enough to ensure that all terminals detect collision (p.136/1)

gap ~

distance ~

distance ~ cd

length ~ cr

length ~ + cd

distance ~ - cr + cd

length ~ cd

distance ~ - cr

Page 36: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 36

T – packet xmission time G = gT – normalized offered load - propagation delay= / T - normalized time unit’ = / T, where is propagation path loss slope

Page 37: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 37

TimeMS A’s frame

MSs B & C sense the medium

MS B resenses the medium and transmits its

frame

MS B’s frame

Backoff -delay for B Backoff -

delay for C

MS C resenses the medium but defers to MS B

6.3.5. CSMA/CA(CSMA with Collision Avoidance)

A basic collision avoidance (CA) scheme CSMA/CA rule: Backoff before collision (to avoid collisions)

(Modified by LTL)

Page 38: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 38

When medium idle for a period ≥ DIFS => can xmit immediately DIFS = Distributed InterFrame Space

In 802.11b networks, DIFS = 50 μs

© 2006, Michael Hall, Helsinki Univ. of Technology

6.3.5. CSMA/CA (CSMA with Collision Avoidance) – cont. 1

DIFS

->

(Modified by LTL)

Page 39: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 39

Types of CSMA/CA

Types of CSMA/CA1) Basic CSMA/CA2) CSMA/CA with ACK3) CSMA/CA with RTS and CTS

... discussed in turn ...

© 2007 by Leszek T. Lilien

Page 40: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 40

1) Basic CSMA/CA Terminal T senses the medium before xmission1) If medium is busy, T defers access until the end of current xmission - (b1) in

Fig.2) If medium is idle or once it becomes idle:

T defers access for time period DIFS - (a) and (b2) in Fig. T picks a random backoff period - (c) in Fig. As long as medium idle during this backoff period, T keeps counting down Whenever medium busy during this backoff period, T freezes its counter After medium becomes idle again:

T defers access for the DIFS period T resumes countdown

T can start transmission when backoff counter = 0

(Modified by LTL)

≤ DIFS

Medium BusyMedium Busy

DIFS Contention window (cf. next slide)

Deferred access (b)- deferred till idle (b1)

+ deferred for DIFS after

became idle (b2)

Rand. backoff period (c)(after deferments)

Slot (cf. next slide)

Time

Could not start xmission (a)

since medium becamebusy in ≤ DIFS

b1 b2

Page 41: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 41

1) Basic CSMA/CA – cont. 1

All except red text repeated (in larger font) Terminal T senses the medium before xmission1) If medium is busy, T defers access until the end of

current xmission2) If medium is idle or once it becomes idle:

T defers access for time period DIFS T picks a random backoff period

Backoff counter - initialized with the value of backoff period As long as medium idle during this backoff period,

T keeps counting down = decreases its backoff counter

I.e., count down as long as medium idle, stop countdown when medium busy again

Whenever medium busy during this backoff period, T freezes its counter

After medium becomes idle again: T defers access for the DIFS period T resumes countdown

T can start transmission when backoff counter = 0(Modified by LTL)

Page 42: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 42

1) Basic CSMA/CA – cont. 2

Fragment of the CSMA/CA protocol: As long as medium idle during this backoff period, T

keeps counting down = decreases its backoff counter I.e., count down as long as medium idle, stop

countdown when medium busy again

(Modified by LTL)

≤ DIFS

Medium BusyMedium Busy

DIFS Contention window

Deferred access (b)- deferred till idle (b1)

+ deferred for DIFS after

became idle (b2)

Rand. backoff period (c)(after deferments)

Slot

Time

Could not start xmission (a)

since medium becamebusy in ≤ DIFS

b1 b2

Idle – starts countdown

Busy – stops countdown

Use of slots: Backoff counter is decreased by 1 each time medium is idle for 1 time slot interval

Page 43: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 43

Contention Window (CW) Recall: Backoff counter is decreased by 1 each time medium is detected to be idle for

an interval of one time slot

=> backoff period = backoff number (bn) = # of idle slots within CW to wait before being allowed to xmit a frame

Random bn value is chosen based on CW size CW_size: 31 - 1023 slots (=> bn can be from 31 to 1032) bn value: uniform distribution over 0 … CW_size

If transmission of a frame unsuccessful & frame to be re-transmitted => CW_size is doubled before retran. (up to 1023)

© 2007 by Leszek T. Lilien© 2006, Michael Hall, Helsinki Univ. of Technology (sl.19) (Modified by LTL)

1) Basic CSMA/CA – cont. 3

Page 44: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 44

Selection of Random Backoff Value

Recall: If transmission of a frame unsuccessful & frame allowed to be retransmitted =>=> before each retransm. CW_size is doubled (up to 1023)

=> Pr{ bn value is larger } is higher Since it is unlikely that several stations will choose

the same value of bn, collisions are avoided

© 2007 by Leszek T. Lilien© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 20)

1) Basic CSMA/CA – cont. 4

(Modified by LTL)

Page 45: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 45

2) CSMA/CA with ACK Positive Acknowledgement (ACK) frame from receiver

upon reception of each data frame ACK sent after receipt + after time interval SIFS

SIFS = Short Interframe Space Receiver transmits ACK without sensing the medium

(cf. next) If ACK lost, retransmission of ACK

DIFS

Medium Busy

ACK

Data

OtherMS

SourceMS

DestinationMS

DIFS

SIFS

Contention window

Defer access Backoff after defer

Time

SIFS < DIFSE.g., in 802.11b networks:

SIFS = 10 μs / DIFS = 50 μs

(Modified by LTL)

Page 46: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 46

When a frame is received without bit errors,receiving station B sends ACK back to vmitting station A

© 2007 by Leszek T. Lilien© 2006, Michael Hall, Helsinki Univ. of Technology

CSMA/CA with ACK – cont. 1

->

->

Page 47: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 47

CSMA/CA with ACK – cont. 2

Receiver transmits ACK without sensing the medium It works well because medium (radio channel) is

“reserved” for ACK

Medium “reserved” during the transmission sequence:Transmitted frame + SIFS + ACK

Next frame (from any station) can be transmitted at earliest after ACK and after next DIFS period

© 2006, Michael Hall, Helsinki Univ. of Technology

->

->

(Modified by LTL)

Page 48: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 48

Recal: SIFS < DIFS -- E.g., in 802.11b: SIFS = 10 μs / DIFS = 50 μs

When 2 stations try to access the medium at the same time, the one that has to wait for the shorter SIFS period “wins over” the one that has to wait for the longer DIFS period

“Wins over” = waits for shorter time Just bec. SIFS < DIFS

In other words, ACK frame waiting for SIFS has higher priority over Data frame waiting for DIFS

© 2007 by Leszek T. LilienFigure based on © 2006, Michael Hall, Helsinki Univ. of Technology

CSMA/CA with ACK – cont. 3

Now you see why medium “reserved” in quotes - not real reservation, just given an advantage to guarantee it always wins a race

(Modified by LTL)

C -> D

Data

Data

SIFSDIFS

Page 49: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 49

When Station S wants to send a frame & channel busy=> S must wait a backoff time before it may to xmit frame

Reason? Next two slides…

© 2007 by Leszek T. Lilien© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 16)

CSMA/CA with ACK – cont. 4

Page 50: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 50

No backoff => collision is certain Suppose that stations B and C waiting to access channel When channel becomes idle,

B & C start sending their packets at the same time=> collision!

© 2007 by Leszek T. Lilien© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 17)

CSMA/CA with ACK – cont. 5

Page 51: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 51

Random backoff => Pr { collision } is reduced Contending stations generate random backoff numbers bn Backoff counters count down, starting from bn

When backoff counter reaches zero,station allowed to send its frame

All other counters stop counting until the channel becomes idle again

Example below (fig): B & C back off after deferring for DIFS

C has small bn – xmits sooner B has large bn – waits longer

© 2007 by Leszek T. Lilien© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 18)

CSMA/CA with ACK – cont. 6

(Modified by LTL)

Page 52: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 52

Example for CSMA/CA with ACK

Four stations: A, B, C, D

© 2007 by Leszek T. Lilien© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 21)

Observe: C attempts to access medium before B does

Coincidentally, C’s backoff number is smaller

(Modified by LTL)

Page 53: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 53© 2006, Michael Hall, Helsinki Univ. of Technology (sl.22)

Example for CSMA/CA with ACK – cont. 1

Observe backoff counter for B: Frozen when medium becomes busy

When C starts xmission (when C’s backoff counter becomes 0)

B resumes countdown when medium becomes idle After C completes its xmission

(Modified by LTL)

Page 54: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 54© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 23)

Example for CSMA/CA with ACK – cont. 2

Observe backoff counter for D: Frozen when medium becomes busy

When B starts xmission (when B’s backoff counter becomes 0)

D resumes countdown when medium becomes idle After B completes its xmission

(Modified by LTL)

Page 55: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 55

3) CSMA/CA with RTS and CTS Transmitter sends an RTS (Request To Send) after

medium has been idle for time interval > DIFS Receiver responds with CTS (Clear To Send) after

medium has been idle for SIFS Data can be xmitted (after SIFS) ACK sent after SIFS

DIFS

Medium Busy

CTS

RTS

Other MS

Source MS

Destination MS

SIFS

Contention window

Defer access Backoff

SIFSData

SIFS

ACK

Time

DIFS

(Modified by LTL)

Page 56: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 56

Ladder Diagram for CSMA/CA with RTS/CTS Compare this diagram to the previous one

RTS

CTS

Data

ACK

Source MS Destination MS

Propagation delay

SIFS

SIFS

Propagation delay

Propagation delay

Propagation delay

SIFS

DIFS

DIFS

Other MS

3) CSMA/CA with RTS and CTS – cont. 1a

Page 57: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 57

3) CSMA/CA with RTS and CTS – cont. 1b

RTS/CTS performs channel reservation for data xmission Collision can occur at worst during sending RTS control message

Bec. SIFS (preceding CTS, Data, ACK) < DIFS (preceding other MS’s RTS)

DIFS

Medium Busy

CTS

RTS

Other MS

Source MS

Destination MS

SIFS

Contention window

Defer access Backoff

SIFSData

SIFS

ACK

Time

DIFS

(Modified by LTL)

Page 58: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 58

3) CSMA/CA with RTS/CTS – cont. 1c

RTS = Request To Send / CTS = Clear To Send

RTS/CTS scheme - used as a countermeasure against the “hidden node” problem

Hidden node problem WS 1 & WS 2 can hear

AP but not each other => If WS 1 sends a packet,

WS 2 does not notice this(and vice versa)=> collision!

© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 25)

Page 59: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 59

RTS/CTS scheme makes reservation of the medium to avoid collisions

RTS reserves medium for time needed for xmission of: CTS + Data + ACK + 3 * SIFS

= SIFS + CTS + SIFS + Data + SIFS + ACK CTS reserves medium for time needed for xmission of:

Data + ACK + 2 * SIFS (original: “3 * SIFS [?]) = SIFS + Data + SIFS + ACK

© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 26)

3) CSMA/CA with RTS/CTS – cont. 1b

Page 60: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 60© 2006, Michael Hall, Helsinki Univ. of Technology

3) CSMA/CA with RTS/CTS – cont. 2

Danger of collision only during RTS + SIFS (see Fig. below), because: WS 2 does not hear the RTS

frame from WS 1 to AP => WS 2 misses reservation for

CTS + Data + ACK + 3 * SIFS WS 2 can hear the CTS frame

from AP to WS 1 => WS 2 knows about reservation

for Data + ACK + 2 * SIFS

Page 61: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 61

Advantages of RTS & CTS Advantage #1 of RTS/CTS:

Reduces collision probability if the data frame is very long compared to the RTS frame Does not prevent collisions during very short RTS

frames Not a big problem - they are not very likely

Prevents more likely collisions during long data frame

© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 28)

Page 62: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 62

Advantage of RTS & CTS – cont. Advantage #2 of RTS/CTS

Avoids having long intervals with high collision danger (same Fig)

Good! Long interval w/ high collision danger should be avoided

Should be for the following reasons: Larger probability of collision Greater waste of capacity if a collision occurs and the

frame has to be retransmitted Frames shorter than a certain threshold value can be

transmitted without using RTS/CTS Because small waste of medium if collision occurs for short

frames=> low risk

Threshold parameter (dot11RTSThreshold) set in a xmitting station© 2006, Michael Hall, Helsinki Univ. of Technology (sl. 29)

Page 63: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 63

1) (Basic) CSMA1a) Nonpersistent CSMA

– Slotted – Unslotted

1b) Persistent CSMASubcategories # 1 of Persistent CSMA:– Slotted– UnslottedSubcategories # 2 (orthogonal) of Persistent CSMA:

–1-persistent CSMA– p-persistent CSMA

2) CSMA/CD (CSMA with Collision Detection)

3) CSMA/CA (CSMA with Collision Avoidance)3a) Basic CSMA/CA3b) CSMA/CA with ACK3c) CSMA/CA with RTS/CTS

Summary: Full Taxonomy ofCSMA (Carrier Sense Multiple Access)

Protocols

© 2007 by Leszek T. Lilien

Page 64: 1 CS 6910 – Pervasive Computing Spring 2007 Section 6 (Ch.6): Multiple Radio Access Prof. Leszek Lilien Department of Computer Science Western Michigan

Copyright © 2003, Dharma P. Agrawal and Qing-An Zeng. All rights reserved 64

The End of Section 6