Thursday, September 18, 2014

Error Detection And Correction Methods-Cont

Flow Control- Explanation

o    Any receiving device has a limited speed at which it can process incoming data and a
limited amount of memory in which to store incoming data
o    The receiving device must be able to inform the sending device before those limits are
reached and to request that the TX device send fewer frames or stop temporarily

   Flow Control-Buffer

o    Incoming data must be processed and checked before it can be used
o    The rate of such processing is often slower than the rate of TX
o    So, each receiving device has a block of memory called BUFFER, reserved for
storing incoming data until it is processed
o    If the buffer begins to fill up, the receiver must be able to tell the sender to halt the TX
until it is once again able to receive

Methods for Flow Control

o    Two methods have been developed to control the flow of data across communication
links :
¾   Stop and Wait
¾   Sliding Window
   Stop and Wait
In this method, the sender waits for an ACK after every frame it sends
o    Only when an ACK has been received, is the next frame sent
o    This  process  of  alternately  sending  and  waiting  repeats  until  the  sender transmits  an
EOT frame
Example: Officer giving dictation to the Typist, He says a word, typist says OK,
he says the next word, typist says OK and so on
     Advantages of Stop and Wait
ŠSIMPLICITY
-Each frame is checked and acknowledged before the next frame is sent
     Disadvantages of Stop and Wait
ŠINEFFICIENT ( Slow)
o    Each frame must travel all the way to the receiver and an ACK must travel all
the way back before the next frame can be sent
o    If the distance b/w devices is long, the time spent waiting for ACKs between
each frame can be significantly long

   Sliding Window
o    In this method, sender can transmit several frames before needing an ACK
o    Frames  can  be  sent  one  right  after  another  meaning  link  can  carry  several
frames at once and its capacity can be used efficiently
o    The receiver uses a single ACK to confirm the receipt of multiple data frames
o    Sliding Window refers to imaginary boxes at both the sender and the receiver
o    This window can hold frames at either end and provides the upper limit on the
number of frames that can be sent before requiring an ACK
o    Frames  may  be  ACK  at  any  point  w/o  waiting for  the  window  to  fill  up  and
may be TX as long as the window is not yet Full
o    To  keep  track  of  which  frames  have  been  transmitted  and  which  received,
sliding  window  introduces  an  identification  scheme  based  on  the  size  of  the
window
o    The frames are numbered modulo-n means from 0 to n-1
o    If n=8, frames are numbered 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,¼.
o    When the receiver sends the ACK, it includes the number of the next frame it
expects to receive

ŠFor example, to ACK the receipt of a string of frames ending in frame 4,
the receiver sends an ACK with number 5
ŠThe  window  can  hold  n-1  frames  at  either  end,  therefore  a  max  of  n-1
frames may be sent before an ACK is required

ŠAt the beginning of a TX, sender's window contains n-1 frames
ŠAs  frames  are  sent  out,  the  left  boundary  of  window  moves  inward,
shrinking the size of the window
ŠWhen an ACK is received, the window expands to allow in a number of
new frames equal to the number of frames acknowledged by that ACK

ŠAt  the  beginning  of  TX,  the  receiver  window  contains  n-1  spaces  for
frames
ŠAs new frames come in, the size of the receiver window shrinks
ŠThe   receiver   window   therefore   does   not   show   the   frames   that   are
received but the frames that may still be received before an ACK is sent



No comments:

Post a Comment