Problems with Stop and Wait protocols 1) Data may be lost (both sender and receiver may go into dead lock) To solve this problem of dead lock we can add a timer 2) Acknowledgment lost ( here we can get duplicate packet problem) To solve this duplicate packet problem we assign sequence numbers to the packets 1 3) Acknowledgment is delayed (we can get missing packet problem) by assigning numbers to acknowledgments we can solve this problem 2 Solution SLIDING WINDOW PROTOCOLS 1) What is piggybacking? ( temporarily delaying out going acknowledgments) The technique of temporarily delaying outgoing acknowledgements so that they can be hooked onto the next outgoing data frame is known as piggybacking 2) What is a sender window? (a sender maintains a set of sequence numbers corresponding to the frames it has to send) 3 3) What is a receiver window?( a receiver maintains a set of sequence numbers corresponding to the set of frames it is permitted to accept) 4) What the sequence number within sender’s window represent (Frames that have been sent) 5) What a sender does when a new packet arrives? 1. It will give next highest sequence Number 2.The upper edge of the window is by one 6) What a sender do when an acknowledgment comes? (the lower edge is advanced by one, In this way the window continuously maintains a list of unacknowledged frames.) 7) Diagram 4 8) Types of sliding window protocols? ( 1. A One-Bit Sliding Window Protocol 2. A Protocol Using Go-Back-N 3. A Protocol Using Selective Repeat 1. A One-Bit Sliding Window Protocol 1) Technique used here? (stop and wait ) A sliding window protocol with a window size of 1 uses stop-and-wait since the sender transmits a frame and waits for its acknowledgement before sending the next one 2) Assumption (Computer A tries to send its frame 0 to computer B Computer B tries to send its frame 0 to Computer A) 5 3) When the problem of duplicate frame arises? (when time out period is too short ) 4) Example (A may time out repeatedly, sending a series of identical frames) Diagram In (a) each frame arrival brings a new packet for the network layer; there are no duplicates In (b) half of the frames contain duplicates, even though there are no transmission errors. 6 Sliding Window ProtocolSliding window protocol is a flow control protocol. It allows the sender to send multiple frames before needing the acknowledgements. Sender slides its window on receiving the acknowledgements for the sent frames. This allows the sender to send more frames. It is called so because it involves sliding of sender’s window. Implementations of Sliding Window Protocol The two well-known implementations of sliding window protocol are 7 Go back N sliding window protocol 1) Sender window size is N 2) Receiver window size is 1 1) For what purpose this protocol is used?(for reliable and sequential delivery of data frames) 2) What is sender window size and meaning of Go-Back-N?( The senders window size is N Go-Back-N means at a time sender can send N frames without waiting for ack from receiver 3) Which technique is used by it? (Protocol pipe lining for sending multiple frames before receiving acknowledgment for the first frame) 4) Max number of frames that can be sent? (depends on size of the senders window size) 5) What happens if the acknowledgment is not received? ( all the frames starting from that frame will be resent) 8 Example 1) no of frames that can be sent by sender? (4 frames , 0,1,2,3) 2) Step 1;( sender sends all the 4 frames and waits for ack for 0th frame) Step 2 (sender receives acknowledgement for the 0th frame) 9 Step 3(sender send’s the next frame i.e frame 4 and window slides containing 4 frames 1,2,3,4) Step 4( receiver sends the acknowledgment for frame 1 and sender sends the next frame i.e frame 5 now , sender window will be slided to hold the frames 2,3,4,5) 10 Step 5( assume that frame 2 is lost or ack of frame 2 is lost , then the sender will goback(4) from the current window and retransmit all the frames 2,3,4,5 11 3. A Protocol Using Selective Repeat Sender’s window size = N Receivers window size = N 1) What type of protocol is it ?(data link protocol using sliding window technique for reliable frame delivery ) 2) What is implemented here? (Only erroneous or lost frames are retransmitted in this case, while good frames are received and buffered) Step 1 (initial position) Step 2(sender sends 4 frames) 12 Step 3(receiver sends acknowledgement for frame 0) Step 4(sender sends next frame i.e frame 4) Step 5( receiver sends acknowledgment for frame 1) Step 6(sender sends frame 5 , and frame 2 or ack of frame 2 is lost) 13 Step7 (sender re transmit the frame 2 only , since it did not get the ack with in time) 14