What is sliding window protocol for example?

Hello Friends, In this blog post(Sliding Window Protocol) we are going to discuss Sliding Window Protocol. In stop-and-wait flow control, only one frame at a time can be in transit.

But when the bit length of the link is greater than the frame length (a>1), it results in serious inefficiencies.|Sliding Window Protocol|

In this blog post(Sliding Window Protocol) we are going to cover sliding window protocol with an example,…

… What are the types of sliding window protocols, What is the mechanism of sliding window flow control, and What is a sliding window?

What is the sliding window protocol with an example?|Sliding Window Protocol

The sliding window protocol is a data link protocol and is used to assure the reliable and sequential delivery of data packets.

This protocol is also used in the Transmission control protocol.

Inside this protocol sender can send multiple frames at the same time before receiving the acknowledgement for them.

What are the types of sliding window protocols?

There are two types of sliding window protocol: Go-Back-N-ARQ and Selective Repeat ARQ.

What is the mechanism of sliding window flow control?

The sliding window protocol is a data link protocol and is used to control the flow of data or flow control.

This protocol solves the problem of missing data packets during the transmission in the upper layers and makes sure the transmission may occur in order.

By permitting multiple frames to be in transit at the same time as a sliding window protocol, efficiency can be greatly improved.

Now, we see it working. For this, it is assumed that two stations, A and B, are connected by a full-duplex link.

For W frames, station B allocates buffer space. Therefore, B can take W frames and A is permitted to transmit W frames without waiting for any acknowledgement.

To keep track of which frames have been acknowledged, a sequence number is labelled for each.

By sending an acknowledgement, B acknowledges a frame which includes the sequence number of the next frame accepted.

This acknowledgement also implicitly announces that B is made ready to receive the next W frames, Starting with the number specified.

This method can also be used for acknowledging multiple frames.

A maintains a list of sequence numbers which is permitted to be sent and B maintains a list of sequence…

… numbers which are made to receive every list that can be thought of as a window of frames.

The operation is known as sliding window flow control with the use of a sliding window protocol.

Since the sequence number to be used occupies a field in the frame, it is obviously of bounded size.

As an example, for a 3-bit field, the sequence number can range from 0 to 7.

Accordingly, frames are numbered modulo8, which is after sequence number 7, The next number is 0.

Generally, the range of sequence numbers is 0 through 2^k-1 for a K-bit field and frames are numbered modulo 2^k.

Sliding window protocol: Sliding Window Depiction

The sliding window protocol or process is shown in fig1. In this fig a 3-bit sequence number is used, so that frames…

… are numbered sequentially from 0 through 7 and then the same numbers are reused for subsequent frames.

The shaded rectangle shows the frames which may be sent. In this figure, the sender may transmit five frames, starting with frame 0.

Using a sliding window protocol each time a frame is transmitted, the shaded window shrinks.

Each time an acknowledgement is obtained, the shaded window increases.

Frames between the vertical bar and the shaded -window have been transmitted but not acknowledged.

The sender must buffer these frames in case they require to be retransmitted.

Actual window size requires not to be the maximum possible size for a given sequence number length.

As an example, using a 3-bit sequence number, a window size of 4 could be configured for the station using the sliding window flow control protocol.

Fig 2 shows another example of a sliding window protocol. A 3-bit sequence number field and a maximum window size of seven frames are assumed in this example.

In starting, A and B have windows showing that A may transmit seven frames, beginning with frame 0(F0).

After sending three frames (F0, F1, F2) without acknowledgement, A has shrunk its window to four frames and a copy of three transmitted frames is maintained by it.

The window shows that A may transmit four frames, starting with frame number 3.

Then B sends an RR(receive ready)3, which means “All frames up through frame number 2 have been received by me and I am ready to receive frame number 3”.

With this acknowledgement, A is back up to permission to send seven frames, still starting with frame 3.

A may also discard frames which have now been acknowledged using a sliding window protocol.

Proceeds for transmitting frames 3,4,5 and 6. B returns RR4 that acknowledges F3 and permits transmission of F4 through the next instance of F2.

By the time this RR reaches A, It has already transmitted F4, F5 and F6, and thus A may only open its window to allow sending four frames starting with F7.

example of sliding window protocol new
Example of sliding window protocol

Sliding window flow control is potentially much more efficient in comparison to stop and wait for flow control.

The reason behind this is that, with sliding window flow control, the transmission link behaves like a pipeline which may…

… be filled with frames in transit. On the other hand, only one frame may be in the pipe at a time.

You can also go through a few more amazing blog links below related to computer networks:

What is meant by piggybacking what are its advantages and disadvantages…
What is meant by flow control…
What is sliding window protocol for example…
Stop and wait for the protocol Used In the Data Link Layer…
Difference Between Error Control and Flow Control…
What Is Data Link Protocol…
ARQ Technique: Error Control Techniques In the Data link layer…
Error Control Using Data Link Layer In Computer Network…
Flow Control Using Data Link Layer In Computer Network…
HDLC Protocol In Hindi…

Quick Q&A:

What is a sliding window protocol?

Sliding window protocol is known as a feature of packet-based data transmission protocols.

In the place where the focus is on reliable in-order delivery, sliding window protocol is used.

For example- It is used in the data link layer(OSI layer 2) and also in the transmission control protocol(TCP).

What is sliding window protocol for example?

This protocol belongs to the data link layer and it supports a sliding window method.

Under this protocol schema, if any data frame is manipulated or lost, then all subsequent frames have to be sent again.

For example- in GO–Back–N, the N is the sender’s window size; if it is GO-Back-5,…

… before receiving the knowledge of frame 1 the sender will send frames 1 to 5.

Why is the sliding window technique used?

A few important reasons for using sliding window protocols are given below:

It helps in reducing the complexity of the algorithms.

The reuse of loops gets reduced, which optimises the program and efficiency of the process.

We can reuse the previous step’s result to compute the next step’s result.

What are the types of sliding protocols?

two types of sliding window protocols are given below:

Go-Back-N ARQ,
Selective Repeat ARQ.

Why is it called a sliding window?

The reason behind this name is imaginary boxes holding the data frames.

We have also known this protocol as windowing.


Using this blog post(Sliding Window Protocol) we have gone through What is sliding window protocol with an example, What are the types of sliding window protocol, What is the mechanism of sliding window flow control, and What is the sliding window. The sliding window protocol is a data link layer protocol and is used for the flow control of data. This protocol ensures that the transmission of data remains in proper order.

In the case of any queries, you can write to us at a5theorys@gmail.com we will get back to you ASAP.|Sliding Window Protocol|

Hope! you would have enjoyed this post about sliding window protocol.

Please feel free to give your important feedback in the comment section below|Sliding Window Protocol|

Have a great time! Sayonara!


I am a blogger by passion, a software engineer by profession, a singer by consideration and rest of things that I do is for my destination.