Transcript for:
Overview of Go Back N ARQ Protocol

Hello everyone, welcome back to the next lecture in the computer network series and today we will see the go back NARQ. As usual, let's start the session with the outcomes. In today's session, we have only one outcome.

And what is that? Upon the completion of this session, the learner will be able to understand the working of go back NARQ. So, in today's session, we are exclusively focusing on the go back NARQ.

Before going into the details of go back and ARQ, let's revisit the sliding window protocol. We know sliding window protocol is different from the traditional stop and wait protocol. In stop and wait protocol, only one frame is sent at a time and the sender will not send the next frame without receiving the acknowledgement for the previously sent frame. Whereas in a sliding window protocol, group of frames, that is multiple frames can be sent at a time. The variations of sliding window protocols are go back n ARQ and selective repeat ARQ.

And the topic of the day is go back n ARQ. Let's see what is go back n ARQ in today's lecture in a detailed manner. In go back n ARQ, what is this n? This n is the sender window size.

Suppose if we say go back three, then three is the sender's window size. It means Three frames can be sent at a time before expecting an acknowledgement from the receiver. If it is go back five, then five frames can be sent by the sender to the receiver before expecting an acknowledgement. Shortly we are going to see an animation, at that time we will be able to understand what is this n and what is the significance of this n. Let's see the theoretical aspects of go back NARQ.

The go back NARQ, it uses the concept of protocol pipelining. That is, the sender can send multiple frames before receiving an acknowledgement for the first frame. Suppose if we have five frames and if the concept is go back three, then three frames can be sent.

Frame number one, frame number two, frame number three can be sent before expecting the acknowledgement for the frame one. There are finite number of frames and the frames are numbered in a sequential manner. We know this go back NARQ is going to send multiple frames.

We need to distinguish one frame from other frames. So, obviously we need some numbering approach. These numbers are called as sequence numbers and that is why the point which is mentioned here is the frames are numbered in a sequential manner.

The next point is, the number of frames that can be sent depends on the sender window size. We know this n is the sender window size and the number of frames that can be sent is this n. What if the acknowledgement is not received on time? If the acknowledgement of a frame is not received within an agreed upon time period, all frames in the current window are retransmitted. Suppose, if we have sent frame number five and we didn't get the acknowledgement for frame number five, if the current window is holding three frames and all these three frames are retransmitted.

Please understand, This is a very important point in go back NARQ. When we see an animation, this point will be very clear for you. Please make a note of this point, all frames in the current window are retransmitted if the acknowledgement of a frame is not received in time. Let's see some more details about this go back NARQ.

The size of this ending window determines the sequence number of the outbound frames. Suppose if there are ten frames, the sending window size is two, then the sequence number will not be like one, two, three, four, five, six, seven, eight, nine, ten. Since we have ten frames, we are not just like that numbering all the frames as one, two, three, four, five, six, like that. The sequence number of the frames is also decided by the sending window size, that is this n. We will see an example, then it will be clear.

We know n is the sender's window size. For example, if the sending window size is four, that is here this n is four. then the sequence number will be between 0 and 3, that is from 0 to 3, the frames are numbered. How this is done?

If the number is 4, it can be written as a part of 2. So, 4 can be written as 2 part 2, where this 2 means this is the sequence number bits, that is the binary bits. If the number of binary bits is 2, then 0 0, 0 1, 1 0, 1 1. Its decimal equivalent is 0, 1, 2 and 3 and that is what it is mentioned here. If the sending window size is 4, that is 2 power 2, this 2 is the number of bits in the sequence number. That is, in decimal they are 0, 1, 2 and 3. Suppose if we have ten frames, then this sequence number will be repeated for all the frames like this. 0, 1, 2, 3, 0, 1, 2, 3, 0, 1 and so on.

I hope now you understand what is this part two. This two is the number of bits in the sequence number. So, the number of bits in the sequence number is two, that is this two, is to generate the binary sequence 0, 0, 0, 1. 1 0 and 1 1. Its decimal equivalent is 0 0 means 0, 0 1 is 1, 1 0 is 2, and 1 1 is 3. And we can reuse this sequence number as per our requirement, that is the number of frames.

Let's see the working of go back in ARQ with an animation. Then it will be more clear for you. Suppose, if we have a sender and we have a receiver, let's assume that there are 11 frames to be sent.

And the frames are numbered as 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10. Please note, the sequence number, actually this is the sequence number of the frame. And this sequence number is decided by the Windows ICN. For better understanding, I have taken a running number, but actually if the number of bits in the sequence number is two, then this would be 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2 and it goes on. But for understanding purpose, I have taken a running serial number. Now, what is the sender window size?

Let's take the sender window size be four. It means, four frames can be sent by the sender before expecting an acknowledgement for the first frame, that is frame zero. Let's see it now.

The sender is now sending frame number zero. Now, what is there in the current window? In the current window, only frame zero will be there. Now, what happens? Sender will send the next frame because the sender can send a maximum of four frames before expecting an acknowledgement for frame zero.

Now, the sender will send frame one, frame two and frame three. So, four frames are sent by the sender because the sender window size is four. Now, what is expected?

The sender is expected to receive an acknowledgement for frame zero. Let's assume the receiver has sent an acknowledgement for frame zero. So, frame zero is acknowledged. So, what do we understand from this? So, frame zero is sent and it has been successfully received by the receiver because receiver has acknowledged frame zero.

Now, what will be done by the sender? Now, sender will send the next frame. What is the next frame in the buffer?

The next frame is frame number four. So, frame number four is sent and if you observe, the window now slides. Can you see, the window is now sliding. Because this is the frame which is sent and acknowledged.

We need not worry about this frame anymore. And what is this? These are the frames that was sent by the sender and is still waiting for an acknowledgement.

And what about this? These are the frames that are not yet sent. The receiver will now acknowledge for frame number one.

Let's assume the receiver has acknowledged frame number one. Now what sender does? It sends the next frame in the buffer.

What is the next frame in the buffer? It is frame number five. So, sender will send frame number five and the window now slides. Now, let's assume the sender is not acknowledging frame number two.

Why? Because either the frame is lost, that is frame number two is lost, or the acknowledgement is lost. What happens in the sender side? The sender will wait for a certain period of time.

If the acknowledgement is not received in time, what the sender does? It has to retransmit. So here the acknowledgement is not received in time, so sender times out.

And what is the next frame to be sent in the example? It is frame number six. But if you observe, frame number two is not acknowledged by the receiver. So sender understands that, either the frame two is missing or the acknowledgement is missing. So the sender is now going back to two.

You just see, it's going back to two. What is the starting frame in the current window? The current window is holding frame number 2, 3, 4 and 5. It is just going back to 2, which is the starting of the frame in the current window.

I hope now you understand, it is going back to 2. So from 2, what are there in the current window, all the frames are retransmitted. So frame 2, frame 3, frame 4 and frame 5 are retransmitted. If you observe, already frame four and five was sent by the sender, but the receiver discards these two frames. Why? Because it has not received frame number two.

So, it discards all the frames that are there in the receiver buffer. The frame that was not received by the receiver was frame two, because we assumed that frame two is lost. So, frame two's acknowledgement will not be sent by the receiver and there is no chance for the sender to receive frame two's acknowledgement. So, what the sender does, it is going back to the starting of the window that is frame 2, 3, 4, 5 is the current window and it is going to frame 2 and it start retransmitting frame 2, 3, 4 and 5. Already frame 4 and 5 are transmitted, but still the sender will retransmit all the frames that are there in the current window.

The frames that are there in the current window are 2, 3, 4 and 5. In this case, the receiver will ignore frame 4 and 5. And that's the working of a go back end ARQ protocol. I hope now you understood the working of go back end ARQ. In the next lecture, we will solve a problem in go back end ARQ. Thank you for watching.