Вы находитесь на странице: 1из 40

6    



6   

m
î
À î

6    
   
 
      
   

 


Error Control mechanisms

 top and wait ARQ

 Go Back N ARQ

 elective repeat ARQ

›
top and Wait ARQ Features
 ender keeps copy of the last frame
transmitted until it receives
acknowledgment.
 For identification, both data and ACK
frames are numbered 1 and 0 alternately.
Data 0 frame is acknowledged by ACK 1
frame, Data 1 by ACK 0
 Damaged or lost frame receiver sends no
acknowledgment. imply discards it. It
also discards out of order frames.
©
Continued
 ender has control variable  that holds
the number of recently sent frame either 0
or 1.
 Receiver has control variable R that holds
the number of next frame expected either
0 or 1.
 The sender starts a timer when it sends a
frame, this is the time it waits for
acknowledgement frame.
 Receiver sends only positive
acknowledgements for frames received
safe and sound. else wise it stays silent. ×
top-and-Wait ARQ

¦

 
£  
In the transmission of a frame, we can have
four situations.

 Normal operation
 The frame is lost
 The acknowledgment is lost
 The acknowledgement is delayed
0
À  

Sender
waits
before
sending
next
frame

Timer
is set
again

u
  
     

meceiver
retains
value
of m

metransmission

Œ
top-and-Wait ARQ

 £ne frame received and handled at a time


 If frame is damaged, receiver discards it and
sends no acknowledgment
 ender uses timer to determine whether or not to
retransmit
 ender must keep a copy of transmitted frame until
acknowledgment is received
 If acknowledgment is damaged, sender will
know it because of numbering

m
mm    
   

mm
top-and-Wait ARQ: Example

m
î
À î

 

 
   
   !     

    


mm    
   

Suppose
Frame lost

If there were
No numbering
Sender would
Have thought
This as ACK of
Frame 1. m©
î
À î

À
  
  


   
 


 
  "  


Go-Back-N ARQ
 In stop and wait ARQ, at any point in time
for sender, there is only one frame, the
outstanding frame, that is sent and
waiting to be acknowledged.
 Not a good use of transmission medium.
 Multiple frames should be in transition
while waiting for acknowledgement.
 More than one outstanding frames. This
will improve the efficiency of system.


3
3  

 


         


    
  

  

£  
m0
equence Numbers
 Frames from sender are numbered
sequentially.
 equence number of each frame is
included in header.
 If header allows m bits for sequence
number then sequence number range
would be from 0 to 2m-1.
 If m=3 sequence numbers are
0,1,2,3,4,5,6,7,0,1,2,3,ƦƦƦ.
mu
ender liding Window
 At sender side, to hold outstanding frames
until they are acknowledged, we use
concept of window.
 £utstanding frames are enclosed in
window.
 ize of window is fixed in this protocol.
 ize of window is at most 2m-1.
 The frames on left are already sent and
acknowledged ones. These can be purged.






Frames sent, waiting for Waiting,


Already sent and acknowledgment Cannot sent until
acknowledged frames Window slides on
Them.


 


meceiver sliding window is always 1 in this protocol.

meceiver is looking for specific frames to arrive at specific order.

Frame arriving out of order are discarded and needs to be resent.

m

  

Sender has 3 control variables,


1. S holds sequence number of recently sent frame
2. SF holds sequence number first frame in the window
3. SL holds sequence number last frame in the window

Size of window = SL- SF+1

meceiver has only one variable m holds sequence number


of frame it expects to receive.


Acknowledgment
 Receiver sends positive acknowledgment if
a frame has arrived safe and in order.
 If a frame is damaged or out of order,
receiver stay silent and will discard all
subsequent frames, until it gets the one it
wants.
 This causes sender to go back and
resends all frames.
 Now receiver sends one cumulative ACK
for several frames.

Resending Frame

 When frame is damaged sender goes


back and sends a set if frames starting
from damaged one up to the last one
sent.
 uppose sender has already send frame 5
but time for frame 2 expires.
Frame 2 not acknowledged. ender
sends 2,3,4,5 again.
 Thatƞs why we call it Go-Back-N ARQ


3  À
 


3  À 


Damaged or lost Acknowledgement
1. If the next acknowledgement occurs before
expiration of any timer no need of
retransmission Acknowledgments are
cumulative.
ACK 3 means ACK1, ACK2, ACK3
(o if ACK1 & 2 are lost, ACK4 can cover them).

2. IF next ACK comes after the timeout, the frame


and all the frame after that are resent.
Note: Receiver never resends an ACK.

0
î
À î

#$ 
# $  À %  
 

   &

   &'
 %    ! 

 ((
 

u
 


        

£  

   


 

 


›
elective Repeat ARQ
 ender window size

 Receive window size

›m
î
À î

  !    % 


  
 
  ! 

 &
    &
  

›
elective-reject ARQ

 Most efficient error control


protocol
 If a frame is received in
error, the receiver asks
transmitter to resend
£NLY the frame that was
in error
 ubsequent frames
following the Nth frame
are not retransmitted

››
  

›©
elective Repeat ARQ

›×
 

 

›¦
elective Repeat ARQ: Example

›0
Bandwidth Delay Product
 Measure of efficiency of an ARQ system
 Bandwidth delay product is measure of
the number of bits we can send out of our
system while waiting for news from
receiver.
 Bandwidth delay product = bandwidth (in
bits per second) X round trip delay (in
seconds)

›u
6"  (
6"  (
   
  


 

 
  
 
!"


 #


$
 ! #

"


| 
    

ma m a a m   

| 

  
        
  
   
 

  


m   
  
  
 
m
!" #  
 
    
   
  
  
     

›Œ
6"  &
6"  &



$
 ! #

%&

'
(!) 
*+ !"


|  
         |   

  m!
  m!   
   
  |  
     

m!  $! 
           
  

         


Вам также может понравиться