Flow Control
Consider a situation in which the sender transmits frames faster than the receiver can accept them. If the sender keeps pushing the frames at high rate, at some stage the receiver will be totally swamped and will start losing some frames. This problem may be solved by introducing flow control. The majority of flow control protocols contain a feedback mechanism to inform the sender when it should transmit the next frame.
Mechanisms for Flow Control:
- Stop and Wait Protocol: It is the simplest file control protocol in which the sender end transmits a frame and then waits for an acknowledgement, either +ve or -ve, from the receiver end before proceeding. If a +ve acknowledgement is received, the sender transmits the subsequently packet; else it retransmits the same frame. On the other hand, this protocol has one major flaw in it. If a packet(frame) or an acknowledgement is totally shattered in transit due to a noise burst, a deadlock will occur since the sender cannot proceed until it receives an acknowledgement. This trouble may be solved using timers on the sender end. When the frame is transmitted, the timer is set. If there is no answer from the receiver end within a certain time interval, the timer goes off and the frame possibly will be retransmitted.
- Sliding Window Protocols: In spite of the use of timers, the stop and wait protocol still faceing few problems. Initially, if the receiver had the capacity to accept more than one frame and its resources are being underutilized. Secondly, if the receiver was tiring and did not wish to receive any more packets, it possibly will delay the acknowledgement. On the other hand, the timer on the sender end could go off and cause an needless retransmission. These drawbacks can be overcome by the sliding window protocols.
In sliding window protocols the sender end data link layer maintains a 'sending window' which consists of a set of sequence numbers equivalent to the frames it is permitted to send. Likewise, the receiver maintains a 'receiving window' equivalent to the set of frames it is allowable to accept. The window size is dependent on the retransmission policy and it may vary in values for the receiver's and the sender's window after that The sequence numbers within the sender's window signify the frames sent but as yet not recognized. At any time a new packet arrives from the network layer, the high edge of the window is advanced by one. When an acknowledgement reaches at the receiver the lower edge is advanced by one. The receiver side window corresponds to the frames that the receiver's data link layer might accept. When a frame with sequence number equal to the lower edge of the window is received and it is passed to the network layer, an acknowledgement is created and the window is rotated by one. On the other hand, a frame falling outside the window is received and the receiver's data link layer has two options. It could either discard this frame and all subsequent frames until the respective frame is received or it could accept these frames and buffer them until the appropriate frame is received and then pass the frames to the network layer in sequence.
In this easy example, there is four byte sliding window. As we move from left to right, the window "slides" as bytes in the stream are sent and recognized. Most sliding window protocols also use ARQ (Automatic Repeat reQuest ) mechanism. In ARQ, the sender waits for a +ve acknowledgement before going to the next frame. If there is no acknowledgement received within a assured time interval it retransmits the frame. ARQ is of two kind.
1. Go Back 'n': If a frame is missing or received in error, the receiver may simply throw away all subsequent frames, sending no acknowledgments for the unnecessary frames. In this case the receive window is of size one. Since no acknowledgements are being received the sender side window will fill up, the sender will finally time out and retransmit every the unacknowledged frames in order starting from the spoiled or lost frame. The utmost window size for this protocol can be obtained as follows. Suppose that the window size of the sender is n. So the window will firstly contain the frames with sequence numbers from 0 to (w-1). Believeing that the sender transmits all these frames and the receiver end data link layer receives all of them efficiently. Yet, the sender side data link layer does not receive any acknowledgements as all of them are gone. So the sender will retransmit all the frames after its timer goes off. On the other hand the receiver window has by now advanced to w. Therefore to avoid overlap , the sum of the two windows should be less than the sequence number space.
w-1 + 1 < Sequence Number Space i.e., w < Sequence Number Space
Maximum Window Size = Sequence Number Space - 1
2. Selective Repeat: Here this protocol rather than throw away all the subsequent frames following a spoiled or lost frame, the receiver end data link layer simply stores them in buffers. When the sender does not get an acknowledgement for the 1st frame it's timer goes off after a definite time interval and it retransmits only the missing frame. Assuming error - free transmission this time, the sender side data link layer will have a sequence of a numerous correct frames which it can hand over to the network layer. As a result there is less overhead in retransmission than in the case of Go Back n protocol.Where as In case of selective repeat protocol the window size could be calculated as follows. Suppose that the size of both the sender end and the receiver end window is w. So originally both of them contain the values zero to (w-1). Believing that sender side data link layer transmits all the w frames, the receiver side data link layer receives them properly and sends acknowledgements for all of them. Yet, all the acknowledgemnets are gone and the sender does not advance his window. The receiver window at this point contains the values w to (2w-1). To keep away from overlaping when the sender side data link layer retransmits, we should have the sum of these two windows less than sequence number space. Therefore, we get the condition as
Maximum Window Size = Sequence Number Space / 2
Email based Computer Science assignment help - homework help at Expertsmind
Are you searching Computer Science expert for help with Flow Control questions? Flow Control topic is not easier to learn without external help? We at www.expertsmind.com offer finest service of Computer Science assignment help and computer science homework help. Live tutors are available for 24x7 hours helping students in their Flow Control related problems. We provide step by step Flow Control question's answers with 100% plagiarism free content. We prepare quality content and notes for Flow Control topic under computer science theory and study material. These are avail for subscribed users and they can get advantages anytime.
Why Expertsmind for assignment help
- Higher degree holder and experienced experts network
- Punctuality and responsibility of work
- Quality solution with 100% plagiarism free answers
- Time on Delivery
- Privacy of information and details
- Excellence in solving computer science questions in excels and word format.
- Best tutoring assistance 24x7 hours