 Hello and welcome to the session on GoBack N and Selective Repeat Sliding Window Protocols. At the end of this session, student will be able to describe a GoBack N and Selective Repeat Sliding Window Protocol with example. The bidirectional protocols that belong to a class called Sliding Window Protocols are 1-Bit Sliding Window Protocol, GoBack N Sliding Window Protocol, Selective Repeat Sliding Window Protocol, Three bi-directional sliding window protocols with maximum sending window size & receiving window size are one-bit sliding window protocol has S&wan and receiving window size is one. Gobat N protocol has S& Similarly, Go bat is greater than one, and receiving window size is one. Selective repeat protocol has S& would be greater than one & receiving window size is greater than one. These protocols differ among themselves in terms of efficiency, complexity and buffer requirements. Until now the assumption was that the transmission time required for a frame to arrive at the receiver plus the transmission time for the acknowledgement to come back is negligible. Sometimes this assumption is clearly false. In these situations the long round trip time can affect the efficiency of the bandwidth utilization. For example, consider a 50 kbps satellite channel with a 500 millisecond round trip propagation delay. Let us imagine trying to use protocol 4 i.e. 1 bit sliding window protocol to send 1000 bit frames via the satellite. At t equal to 0 the sender starts sending the first frame. At t equal to 20 millisecond the frame has been completely sent. Under the best circumstances with a satellite channel with a 500 millisecond round trip propagation delay a frame takes 250 millisecond to reach at the receiver. At t equal to 20 millisecond the frame has been completely sent and requires 250 millisecond to reach at the receiver. So total time needed is 20 plus 250 i.e. t equal to 270 millisecond. Consider the frame has fully arrived at the receiver. Consider at t equal to 520 millisecond the acknowledgement arrived back at the sender. 520 minus 20 is 500. So for 500 millisecond sender is idle. Sender is blocked for 500 divided by 520 into 100 i.e. 96% of time. Bandwidth utilization is 20 divided by 520 into 100 i.e. 4%. So only 4% of the available bandwidth was used. Clearly the combination of a long transit time, high bandwidth and short frame length is disastrous in terms of efficiency. The problem described here can be viewed as a result of the rule requiring a sender to wait for an acknowledgement before sending another frame. If we relax that restriction, much better efficiency can be achieved. Basically the solution lies in allowing the sender to transmit up to W frames before blocking instead of just one. With a large enough choice of W, the sender will be able to continuously transmit frames since the acknowledgement will arrive for previous frames before the window becomes full, preventing the sender from blocking. The technique of keeping multiple frames in transit is an example of pipelining. Pipelining frames over an unreliable communication channel raises some serious issues. First, what happens if a frame in the middle of a long stream is damaged or lost? Large numbers of succeeding frames will arrive at the receiver before the sender even finds out that anything is wrong. When a damaged frame arrives at the receiver, it obviously should be discarded. What should the receiver do with all the correct frames following it? Remember that the receiving data link layer is required to send packets to the network layer in sequence. Two basic approaches are available for dealing with errors with pipelining. Those are go back n and selective repeat. Planning frames over an unreliable communication channel raises some serious issues. What happens if a frame in the middle of a long stream is damaged or lost? Large numbers of succeeding frames will arrive at the receiver before the sender finds something is wrong. In case of go back n protocol, the receiver simply discards all subsequent frames sending no acknowledgements for the discarded frames. This strategy corresponds to a receive window of size 1. In other words, the data link layer refuses to accept any frame except the next one it must give to the network layer. If the sender's window fills up before the timer runs out, the pipeline will begin to empty. Eventually, the sender will time out and retransmit all unacknowledged frames in order starting with the damaged or lost one. This approach can waste a lot of bandwidth if the error rate is high. In figure 1a, we see go back n protocol for the case in which the receiver's window size is 1. Frames 0 and 1 are correctly received and acknowledged. Frame 2 is damaged or lost. The sender is unaware of this problem and continues to send frames until the timer for frame 2 expires. Then it backs up to frame 2 and starts over with it. Sending frames 2, 3, 4, etc. all over again. With n bit sequence number, maximum sequence number is 2 raised to n minus 1 and maximum sending window size is 2 raised to n minus 1. For example, for 3 bit sequence number, max sq is equal to 2 raised to 3 equal to 8 minus 1. So it is 7 and window size is 7. The maximum number of frames that may be outstanding at any instant is not the same as the size of the sequence number space. For go back n, max sq frames may be outstanding at any instant. Even though there are max sq plus 1 distinct sequence numbers which are 0, 1 up to max sq. Before going further, pause the video for some time and find the answer. Once you have done this, you may resume the video. In the dash protocol, if no acknowledgement for all frame has arrived before timeout, sender resends all outstanding frames. Option A, stop and wait. Option B, go back n. Option C, selective repeat. Option D, none of these. The answer is B, go back n. The other general strategy for handling errors when frames are pipelined is called selective repeat. When it is used, a bad frame that is received is discarded, but any good frames received after it are accepted and buffered. When the sender times out, only the oldest unacknowledged frame is retransmitted. If that frame arrives correctly, the receiver can deliver to the network layer in sequence all the frames it has buffered. Selective repeat corresponds to a receiver's window size larger than 1. This approach can require large amount of data linked layer memory if the window size is large. Selective repeat is often combined with having the receiver send a negative acknowledgement i.e. NIC. When it detects an error, for example, when it receives a checksum error or frame out of sequence, NIC stimulates retransmission before the corresponding timer expires and thus improves performance. In figure 1B, frames 0 and 1 are again correctly received and acknowledged and frame 2 is lost. When frame 3 arrives at the receiver, the data linked layer there notices it has missed a frame. So it sends back a NIC for frame 2 but buffers frame 3. When frames 4 and 5 arrive, they too are buffered by the data linked layer instead of being passed to the network layer. Eventually, the NIC 2 gets back to the sender which immediately resends frame 2. When that arrives, the data linked layer now has 2, 3, 4 and 5 and can pass all of them to the network layer in the correct order. It can also acknowledge all frames up to and including 5 as shown in the figure. If the NIC gets lost, eventually the sender will time out for frame 2 and will resend it. In selective repeat, the maximum window size should be at most half the range of the sequence numbers. In general, the window size for protocol 6, that is selective repeat, will be max SCQ plus 1 divided by 2. Number of buffers needed is equal to window size. So with 3 bits, the sequence numbers range from 0 to 7, the max SCQ is 7, window size is equal to 7 plus 1 divided by 2 is equal to 4, number of buffers needed is also 4. In this video, we have seen go back N and selective repeat sliding window protocols. Thank you.