Medium Access Control Protocols CMPE 252: Introduction to Computer Networks

Download Report

Transcript Medium Access Control Protocols CMPE 252: Introduction to Computer Networks

CMPE 252: Introduction to Computer Networks LECTURE 6:

Medium Access Control Protocols

April 20 UCSC CMPE252 1

 

FAMA: Floor Acquisition Multiple Access

Stations use carrier sensing to send any packet.

The CTS lasts much longer than an RTS to force the interfering sources to detect carrier (from the receiver) and back off.

RTS S R RTS H S to R R to S CTS CTS

RTS CTS time RTS

H to R noise is heard

2  RTS from S arrives at R with no collisions.

RTS from H must start within one prop. delay from CTS from R to S.

H must hear noise from CTS and backs off!

April 20 UCSC CMPE252 2

Correctness of MAC Protocols

   A protocol must be safe and live.

Liveness is trivial in most MAC protocols.

Safety means different things for different protocols:   Trivial in ALOHA and CSMA “Floor acquisition” in collision avoidance: No data paket collides at the intended receiver.

April 20 UCSC CMPE252 3

Correct Floor Acquisition

 The dialogue between S and R is affected by their neighbors (L and X) and their neighbors’ neighbors (Y and K).

Y X R S L K

any neighbor of R any neighbor of S  We need to show that, if S sends a data packet to R, no other packet can collide with it at R:  S must receive entire CTS without interference.

 R must receive entire data packet without interference.

April 20 UCSC CMPE252 4

Correct Floor Acquisition

 We need to show:  After receiving the RTS from S, L backs off beyond the time when S receives the entire CTS from R.

 After receiving the CTS from R, X backs off beyond the time when R receives the data packet from S.

Y X R S

t

0 : S starts sending RTS

RTS L K

April 20 UCSC CMPE252 5

Y

Correct Floor Acquisition

X R S L K RTS

t

0

L

: L starts receiving RTS

Correct RTS:

back off for a time > 2      

RTS in error or interference due to K:

back off for a time > 2     

Minimum back off by L:

t

1 

t

0  2       April 20 UCSC CMPE252 6

Y

Correct Floor Acquisition

X R RTS S RTS L

If R receives RTS in error or suffers interference from X, it cannot send CTS, and S cannot send any data.

t

0

L

: L starts receiving RTS

Minimum back off by L:

t

1 

t

0  2       Must assume that RTS arrives correctly at R.

K

April 20 UCSC CMPE252 7

Y

Correct Floor Acquisition

X R RTS

t

2 : R receives correct RTS

t

2 

t

0    

S RTS L

t

0

L

: L starts receiving RTS

Minimum back off by L:

t

1 

t

0  2      

K

April 20 UCSC CMPE252 8

Y

April 20

Correct Floor Acquisition

X R RTS RTS received:

t

2 

t

0    

CTS CTS S

If S does not receive a correct CTS, it sends no data packet.

Assume S receives a correct CTS!

UCSC CMPE252

L K Minimum back off by L:

t

1 

t

0  2       9

Correct Floor Acquisition

Y X CTS R S L K CTS Minimum back off by L:

t

1 

t

0  2      

t

3 : S receives correct CTS S receives the CTS at most after a maximum propagation delay.

t

3 

t

2      

t

0       2 

t

3 

t

1 : L must back off long enough for S to receive CTS!

April 20 UCSC CMPE252 10

Y

Correct Floor Acquisition

X CTS R CTS S L

t

3 S must start sending its data packet after it receives R’s CTS: 

t

2      

t

0       2 

data data

t

5

R must receive the complete data packet from S by time:

t

3     

t

2       2 

K

April 20 UCSC CMPE252 11

Correct Floor Acquisition

Y X CTS R CTS S

X must start receiving CTS from R by time:

t

2

X

t

2

Correct CTS:

back off for a time > 2      

CTS in error or interference due to Y:

back off for a time > 2 

t

Minimum back off by X:

6 

t

2  2            April 20 UCSC CMPE252

L K

12

Correct Floor Acquisition

Y X R S CTS CTS data

t

Minimum back off by X:

6 

t

2  2      

t

5

R must receive the complete data packet from S by time:

t

3     

t

2       2 

data L K

t

5 

t

6 : X must back off long enough for R to receive data!

April 20 UCSC CMPE252 13

RIMA-SP

waiting period

Node X sends an RTR and after  seconds receives a DATA packet

X Z RTR DATA X RTR

Nodes X and Z send RTRs within  seconds and therefore a collision occurs

Z

channel

RTR

collision

BACKOFF Noise detected at Z

Due to interference from node Z, node X sends an NTR to stop the handshake April 20

X Z RTR

interference

NTR

UCSC CMPE252

BACKOFF

14

Correct Floor Acquisition

 We need to show:  After receiving the RTR from A, X does not send data to A, until it has allowed A to stop the transaction.

Y H X A L K

t

0 : S starts sending RTR

RTR

April 20 X sends no data if RTR is in error or has interference from H; assume correct RTR is received.

X starts sending data to A after waiting collision    UCSC CMPE252 15

Correct Floor Acquisition

Y H X A L K data

t

1 

t

0    

t

3 : A starts sending NTR if L interferes after RTR

NTR

t

3 

t

0  

t

2 : X starts receiving NTR if L interferes after RTR

t

2 

t

0    

t

2 

t

1 : X backs off long enough to get NTR from A.

April 20 UCSC CMPE252 16

Collision Resolution and Backoff Strategies

   Used to stabilize the system by preventing traffic loads that exceed its capacity.

Collision resolution:

Let the stations with packets that collide resolve when each should retransmit and block new traffic from entering the system, until all such stations are successful.

Backoff strategies:

retransmissions when traffic load (that creates collisions) increases.

Increase the time between April 20 UCSC CMPE252 17

Example of Backoff Strategies

  Backoff strategy in Ethernet:   After experiencing the nth collision of a frame, pick a value K randomly from the set {0, 1, 2,…, 2^m -1} with m= min{10, n}.

Wait K.512 bit times before attempting a retransmission.

Goal is to reduce offered load to the channel; however, it provides no assurance that a retransmission will be sent ahead of another new transmission from other node.

April 20 UCSC CMPE252 18

Collision Resolution

  One of the first algorithms was proposed in:  J.L. Capetanakis, The Multiple Access Broadcast Channel: Protocol and Capacity Considerations, Ph.D. Thesis, MIT, EECS Dept., 1977; and IEEE Trans. Info. Theory, Vol. 25, pp. 505-515, 1979.

These algorithms require feedback to all the nodes regarding the state of the system (successful transmission, collision, idle period) and whether or not stations are allowed to transmit new packets after a prior collision interval is resolved.

April 20 UCSC CMPE252 19

ALOHA with Collision Resolution

sum NEW

2, 5, 20

  

c RET RET 2, 5 c RET ACK 2 s RET 5 ACK s RET ACK 20 s

time no new packets allowed no more backlog, new packets allowed What is the feedback needed to indicate when new packets are allowed?

What are the signals that indicate idle, collision, and success?

What percentage of time is the channel sending correct packets?

April 20 UCSC CMPE252 20

CARMA

   Assume a fully-connected network and no channel errors.

Each node maintains a stack, a HighID, a LowID and knows the finite range of IDs in the system.

Assume CSMA/CA as the baseline.

April 20 UCSC CMPE252 21

CARMA

How to detect a collision:

 Listening nodes detect a collision if they detect carrier without a control packet being understood.

 Sending nodes detect a collision if no CTSs are received for their RTSs.

What to do after detecting a collision:

  Listening nodes detecting a collision go to REMOTE state to back off, until they hear idle for a long-enough period indicating that new packets are allowed into the channel (one maximum round-trip delay plus the lenth of an RTS). Sending nodes detecting a collision enter a collision resolution phase, during which all collided RTSs are resolved and associated data packets are transmitted.

April 20 UCSC CMPE252 22

CARMA

   Collision resolution evolves as a sequence of collision resolution intervals (CRI).

The first CRI involves all the stations that sent an RTS.

Each time a collision is detected:  All stations in the system divide the ID space (LowID, HighID) in two halves (allowable ID interval and the backoff ID interval).

  Only those stations in the allowable ID interval are allowed to try next. The stations execute a PUSH of the backoff ID interval into a stack, and update the values of (LowID, HighID).

April 20 UCSC CMPE252 23

CARMA

 Idle intervals: Stations detect that no station exists in an ID interval when an idle period is heard for one propagation delay (signaling no RTSs), which causes a can transmit .

POP of the stack to obtain a new ID range (LowID, HighID) of stations that April 20 UCSC CMPE252 24

CARMA

    The time of a successful transmission is the RTS, CTS, data and the propagation delays.

The duration of a collision interval is equal to the length of the collision (one RTS length plus up to a propagation delay) plus one propagation delay.

A CRI includes multiple idles, collision, and success turns.

Combinatorial computations shows that, for m >1 stations trying to send packets (see Mobicom 96 paper):  The average number of idle turns is no larger than m/2   The average number of collision turns is no larger than 3m/2 - 1 The number of success turns equals m.

April 20 UCSC CMPE252 25

CARMA

Average length of a successful turn: Average length of a failed turn: Length of an idle turn: Probability of successful turn:

T s T f T i P s

 2      

e

     2 

B

I m U

 

T s e

   1         

e

  3

m

2  2   1  

T

 1 

f

e

 

m

2  

e

   

m

 1 

e

      ( 1 

mT s

    1 ) 

e

  

e

     

B

  3 

S

U

/(

B

 

I

) April 20 UCSC CMPE252 26

CARMA

    Collision resolution provides a stable channel.

It serves as the dynamic back-off time needed to keep offerered load low enough to keep system stable.

Unfortunately, it requires the same state at each node.

Problems:

 How can we devise a collision resolution solution in the presence of hidden terminals?

 Is it worth it compared to scheduling?

April 20 UCSC CMPE252 27