 Hello, and welcome to the session on sliding window protocols. At the end of this session, student will be able to describe various terminologies related to sliding window protocols. In the elementary protocols, data frames were transmitted in one direction only. In most practical situations, there is a need to transmit data in both directions. One way of achieving full duplex data transmission is to run two instances of one of the elementary protocols, each using a separate link for simplex data traffic in different directions. Each link contains a forward channel for data and a reverse channel for acknowledgments. In both cases, the capacity of the reverse channel is almost entirely wasted. The reverse channel normally has the same capacity as the forward channel. A better idea is to use the same link for data in both directions. In this model, the data frames from A to B are intermixed with the acknowledgement frames from A to B. By looking at the kind field in the header of an incoming frame, the receiver can identify whether the frame is data or an acknowledgement. Although interleaving data and control frames on the same link is a big improvement over having two separate physical links. Yet another improvement is possible. When a data frame arrives, instead of immediately sending a separate control frame, the receiver restrains itself and waits until the network layer passes at the next packet. The acknowledgement is attached to the outgoing data frame using the ACK field in the frame header. In effect, the acknowledgement gets a free ride on the next outgoing data frame. The technique of temporarily delaying outgoing acknowledgments so that they can be hooked onto the next outgoing data frame is known as piggybacking. The principal advantage of using piggybacking over having distinct acknowledgement frames is a better use of the available channel bandwidth. The ACK field in the frame header costs only a few bits, whereas a separate frame would need a header, the acknowledgement and a checksum. In addition, pure frames send generally means a lighter processing load at the receiver. The piggyback field costs only one bit in the frame header. It rarely costs more than a few bits. However, piggybacking introduces a complication not present with the separate acknowledgments. That is, how long should the data link layer wait for a packet on which to piggyback the acknowledgement? If the data link layer waits longer than the send or timeout period, the frame will be retransmitted, defeating the whole purpose of having acknowledgments. If the data link layer could foretell the future, it would know when the next network-like packet was going to come in and could decide either to wait for it or send a separate acknowledgement immediately, depending on how long the projected wait was going to be. The data link layer cannot foretell the future, so it must decide a scheme such as waiting a fixed number of milliseconds. If a new packet arrives quickly, the acknowledgement is piggybacked on it. Otherwise, if no new packet has arrived by the end of the time period, the data link layer just sends a separate acknowledgement frame. Before going further, pause the video for some time and find the answer. Once you have done this, you may resume the video. A technique in which acknowledgement is temporarily delayed and then hooked onto the next outgoing data frame is known as dash. Option A, back, option B, piggybacking, option C, waiting, option D, none of these. The answer is B, piggybacking. The bidirectional protocols that belong to a class called sliding window protocols are one-bit sliding window protocol, go-back-end protocol, selective repeat protocol. In all sliding window protocols, each outbound frame contains a sequence number ranging from 0 up to some maximum. The maximum is usually 2 raised to n minus 1, so the sequence number fits exactly in an n-bit field. The stop and wait sliding window protocol uses n equal to 1, restricting the sequence numbers to 0 and 1. But more sophisticated versions can use an arbitrary n. The essence of all sliding window protocols is that, at any instant of time, the sender maintains a set of sequence numbers corresponding to frames it is permitted to send. These frames are said to fall in sending window. Similarly, the receiver also maintains a receiving window. Corresponding to the set of frames it is permitted to accept. The sender's window and receiver's window need not have the same lower and upper limits or even have the same size. Although these protocols give the data link layer more freedom about the order in which it may send and receive frames, but not dropped the requirement that the protocol must deliver packets in the destination network layer to the destination network layer. In the same order, they were passed to the data link layer on the sending machine. The physical communication channel is wire-like. That is, it must deliver all frames in the order sent. The sequence numbers within the sender's window represent frames that have been sent but are not yet acknowledged or the frames which can be sent. Whenever a new packet arrives from the network layer, it is given the next highest sequence number and the upper edge of the window is advanced by one. When an acknowledgement comes in, the lower edge is advanced by one. In this way, the sending window continuously maintains a list of unacknowledged frames. Since frames currently within the sender's window may be lost or damaged in transit, the sender must keep all these frames and its memory for possible retransmission. Thus, if the maximum window size is n, the sender needs n buffers to hold the unacknowledged frames. If the window ever grows to its maximum size, the sending data link layer must forcibly shut off the network layer until another buffer becomes free. The receiving data link layer's window corresponds to the frames it may accept. Any frame falling within the window is put in the receiver's buffer. When a frame whose sequence number is equal to the lower edge of the window is received, it is passed to the network layer and the window is rotated by one. Any frame falling outside the window is discarded. In all of these cases, a subsequent acknowledgement is generated so that the sender may work out how to proceed. Note that a window size of 1 means that the data link layer only accepts frames in order. But for larger windows, this is not so. The network layer in contrast is always fed data in the proper order, regardless of data link layer's window size. Figure 1 shows an example with a maximum window size of 1. Figure 1a shows that initially no frames are outstanding, so the lower and upper edges of the sender's window are equal. But as time goes on, the situation progresses as shown in the next slide. Unlike the sender's window, the receiver's window always remains at its initial size, rotating as the next frame is accepted and delivered to the network layer. Figure 1b shows that the first frame has been sent, sending window points to sequence number 0 because it is waiting for an acknowledgement. The receiving window points to sequence number 0 because it is waiting for frame with sequence number 0. Figure 1c shows that after the first frame has been received, receiver window is rotated by 1 and is pointing to sequence number 1. But still sending window is pointing to sequence number 0 because it is waiting for acknowledgement to be received. Figure 1d gives the picture after the first acknowledgement has been received. Sending window is rotated and receiving window is pointing to sequence number 1. In this video, we have seen the basics of sliding window protocols. Thank you.