Flow Control & ARQs

download Flow Control & ARQs

of 34

Transcript of Flow Control & ARQs

  • 8/9/2019 Flow Control & ARQs

    1/34

    FLOW

    CONTROL TECHNIQUES&

    ARQS

    Presented by:Amit Saha

    Shantanav ChakrabortyAyan Ghosh

  • 8/9/2019 Flow Control & ARQs

    2/34

    Flow control refers to a set of proceduresFlow control refers to a set of proceduresused to restrict the amount of data thatused to restrict the amount of data thatthe sender can send before waiting forthe sender can send before waiting for

    acknowledgment.acknowledgment.

  • 8/9/2019 Flow Control & ARQs

    3/34

    Flow control ensures that a transmitting station, such as a server with higher processing

    capability, does not overwhelm a receiving station, such as a desktop system, with lesserprocessing capability. This is where there is an orderly flow of transmitted data between the

    source and the destination.

  • 8/9/2019 Flow Control & ARQs

    4/34

    Error control in the data link layer isError control in the data link layer isbased on automatic repeat request,based on automatic repeat request,which is the retransmission of data.which is the retransmission of data.

  • 8/9/2019 Flow Control & ARQs

    5/34

    PROTOCOLSPROTOCOLS

    NowNow let let usus seesee howhow thethe datadata linklink layerlayer cancan combinecombineframing,framing, flowflow control,control, andand errorerror controlcontrol toto achieveachieve thethedeliverydelivery ofof datadata fromfrom oneone nodenode toto anotheranother.. TheThe

    protocolsprotocols areare normallynormally implementedimplemented inin softwaresoftware bybyusingusing oneone ofof thethe commoncommon programmingprogramming languageslanguages..

  • 8/9/2019 Flow Control & ARQs

    6/34

  • 8/9/2019 Flow Control & ARQs

    7/34

    Stop-and-Wait protocol

    Figure : Stop-and Wait protocol

  • 8/9/2019 Flow Control & ARQs

    8/34

    This is the simplest form of flow control where a sendertransmits a data frame. After receiving the frame, thereceiver indicates its willingness to accept another frame bysending back an ACK frame acknowledging the frame just

    received. The sender must wait until it receives the ACKframe before sending the next data frame.This is sometimesreferred to as ping-pong behavior, request/reply is simple tounderstand and easy to implement, but not very efficient

  • 8/9/2019 Flow Control & ARQs

    9/34

    DRAWBACKS:

    Major drawback of Stop-and-Wait Flow Control is that only one frame can be in

    transmission at a time, this leads to inefficiency if propagation delay is much longer

    than the transmission delay.

  • 8/9/2019 Flow Control & ARQs

    10/34

    USES :

    Some protocols pretty much require stop-and-wait behavior. For example,Internet's Remote Procedure Call (RPC) Protocol is used to implement subroutine callsfrom a program on one machine to library routines on another machine. Since most

    programs are single threaded, the sender has little choice but to wait for a reply before

    continuing the program and possibly sending another request.

  • 8/9/2019 Flow Control & ARQs

    11/34

    1. Sender keeps a copy of the last frame Transmitted Until it receives

    an acknowledgment for that frame.

    1. Both data frames and ACK frames are numbered alternately 0 & 1

    1. Damaged, out of order or lost frames will be discarded and will

    not be acknowledged

    1. Control variables: S holds the number of recently sent frame

    Rholds the number of next frame expected

    1. Sender starts a timer when it sends a frame

    1. Receiver sends only positive ACK

    StopStop--andand--Wait ARQWait ARQ

  • 8/9/2019 Flow Control & ARQs

    12/34

    In Stop-and-Wait ARQ, we use sequence

    numbers to number the frames.The sequence numbers are based on modulo-

    2 arithmetic.

  • 8/9/2019 Flow Control & ARQs

    13/34

    Normal operation

  • 8/9/2019 Flow Control & ARQs

    14/34

    Stop-and-Wait ARQ, lost frame

  • 8/9/2019 Flow Control & ARQs

    15/34

  • 8/9/2019 Flow Control & ARQs

    16/34

    Stop-and-Wait ARQ, delayed ACK

  • 8/9/2019 Flow Control & ARQs

    17/34

    Numbered acknowledgments are needed ifNumbered acknowledgments are needed ifan acknowledgment is delayed and the nextan acknowledgment is delayed and the next

    frame is lost.frame is lost.

  • 8/9/2019 Flow Control & ARQs

    18/34

    Piggybacking

  • 8/9/2019 Flow Control & ARQs

    19/34

    Link Utilization in Stop-and-Wait

    Transmission time: The time it takes for a station to transmit a frame (normalized to avalue of 1).Propagation delay: The time it takes for a bit to travel from sender to receiver(expressedas a).

    a < 1 :The frame is sufficiently long such that the first bits of the frame arrive atthe destination before the source has completed transmission of the frame.

    a > 1: Sender completes transmission of the entire frame before the leading bits ofthe frame arrive at the receiver.

    The link utilization U = 1/(1+2a),a = Propagation time / transmission time

    It is evident from the above equation that the link utilization is strongly dependent on theratio of the propagation time to the transmission time. When the propagation time issmall, as in case of LAN environment, the link utilization is good. But, in case of longpropagation delays, as in case of satellite communication, the utilization can be verypoor.

  • 8/9/2019 Flow Control & ARQs

    20/34

    To improve the link utilization, we can use thefollowing (sliding-window)

    protocol instead of using stop-and-wait protocol.

    Sliding Window

    With the use of multiple frames for a single message, the stop-and-wait protocol does notperform well. Only one frame at a time can be in transit. In stop-and-wait flow control, if

    a > 1, serious inefficiencies result. Efficiency can be greatly improved by allowingmultiple frames to be in transit at the same time. Efficiency can also be improved bymaking use of the full-duplex line. To keep track of the frames, sender station sendssequentially numbered frames. Since the sequence number to be used occupies a fieldinthe frame, it should be of limited size. If the header of the frame allows k bits, thesequence numbers range from 0 to 2k 1. Sender maintains a list of sequence numbers

    that it is allowed to send (sender window).T

    he size of the senders window is at most 2k 1. The sender is provided with a buffer equal to the window size. Receiver alsomaintains a window of size 2k 1. The receiver acknowledges a frame by sending anACK frame that includes the sequence number of the next frame expected. This alsoexplicitly announces that it is prepared to receive the next N frames, beginning with thenumber specified. This scheme can be used to acknowledge multiple frames. It couldreceive frames 2, 3, 4 but withhold ACK until frame 4 has arrived. By returning an ACKwith sequence number 5, it acknowledges frames 2, 3, 4 in one go. The receiver needs abuffer of size 1.

  • 8/9/2019 Flow Control & ARQs

    21/34

    Sender sliding window

  • 8/9/2019 Flow Control & ARQs

    22/34

    Receiver sliding window

  • 8/9/2019 Flow Control & ARQs

    23/34

    Control variables

  • 8/9/2019 Flow Control & ARQs

    24/34

    Hence, Sliding Window Flow Control

    o Allows transmission of multiple frameso Assigns each frame a k-bit sequence numbero Range of sequence number is [0...2k-1], i.e., frames

    are counted modulo 2k.

    The link utilization in case ofSliding Window ProtocolU = 1, forN > 2a + 1

    N /(1+2a), forN < 2a + 1Where N = the window size,

    and a = Propagation time / transmission time

  • 8/9/2019 Flow Control & ARQs

    25/34

    Go-Back-N ARQ, normal operation

  • 8/9/2019 Flow Control & ARQs

    26/34

    Go-Back-N ARQ, lost frame

  • 8/9/2019 Flow Control & ARQs

    27/34

    Go-Back-N ARQ: sender window size

  • 8/9/2019 Flow Control & ARQs

    28/34

    In Go-Back-N ARQ, the size of the send

    window must be less than 2m;

    the size of the receiver window

    is always 1.

  • 8/9/2019 Flow Control & ARQs

    29/34

    SelectiveSelective--Repeat ARQRepeat ARQ

    Sender and Receiver Windows

    Operation

    Sender Window Size

    Transmission

    Pipelining

  • 8/9/2019 Flow Control & ARQs

    30/34

  • 8/9/2019 Flow Control & ARQs

    31/34

    Receive window for Selective Repeat ARQ

  • 8/9/2019 Flow Control & ARQs

    32/34

    Design of Selective Repeat ARQ

  • 8/9/2019 Flow Control & ARQs

    33/34

    Selective Repeat ARQ, window size

  • 8/9/2019 Flow Control & ARQs

    34/34

    Thank you