

When the receiver accepts a frame, it will sends and ACK of that frame if the checksum is valid, and else it will sends a NAK. The receiver defined a window that is marked by the Last Frame Received (LFR) and Largest Acceptable Frame (LAF) variables. That is why the window is shifted only if it is possible.

Notice that the window is not shifted everytime an ACK arrives, this is because ACKs can arrive in out of order. Everytime an ACK is recieved, the sender will shifts its window until the smallest un-ACK-ed sequence number is at LAR + 1. At first, the sender sends all the packets in the window and waits for each of their corresponsing ACKs. The sender defined a window that is marked by the Last Acknowledgement Received (LAR) and Last Frame Sent (LFS) variables. Hence, to disambiguate between buffers at the reciever, the buffer size must be more than twice the window size. In each buffer, the packets are given a sequence number that starts from zero. Since the data being sent can be quite large, the data is first divided into buffers and the transmission is done in a per-buffer basis. Each packet has a unique sequence number that is used reorder the packets into the complete data once the transmission is complete. Then the receiver sends a Negative Acknowledgement (NAK) to notify the sender to begin retransmission immediately.ĭata sent using the sliding window protocol is divided into packets (frames) that has a fixed maximum length.

In sliding window protocol the receiver has to have some memory to compensate any loss in transmission or if the frames are received unordered.ġ. If receiver sends a collective or cumulative acknowledgement to sender then it understands that more than one frames are properly received, for eg:- if ack of frame 3 is received it understands that frame 1 and frame 2 are received properly. If window size=w then after sending w frames sender waits for the acknowledgement (ack) of the first frame.Īs soon as sender receives the acknowledgement of a frame it is replaced by the next frames to be transmitted by the sender. In Networking, Window simply means a buffer which has data frames that needs to be transmitted.īoth sender and receiver agrees on some window size. At data link layer data is in the form of frames. Sliding window protocol is applied on the Data Link Layer of OSI model. In computer networks sliding window protocol is a method to transmit data on a network. Here you will get sliding window protocol program in C.
