ARQ Protocol

See also Flow Control. The purpose of ARQ requests is for:

There are 2 types:

Stop and Wait

Assuming that we are transmitting data in one direction, we acknowledge (ACK) from the other direction. Provides for both flow control and error recovery.

The algorithm is:

  1. The sender sends the data
  2. The sender waits for an ACK from the reciever.

Summary of Stop and Wait

Often times you either don't need to send a lot, or you don't want to overwhelm your devices:

Sliding Window Flow Control

The goal here is to all for multiple frames to be on the wire at the same time. If all goes well the sender is simultaneously receiving ACKs while it is sending data and will never have to stop sending to wait on ACKs.

Sliding windows on its is only for flow control. We will cover error recovery techniques later.

The advantage is obvious that we can make the Throughput higher doing this.

In Stop and Wait we block on the ACK. In Sliding Window, we are not blocking on the ACK and only using it to see if we need to resend our data or not.

Other Comments - Sliding Windows

ACK5 is saying that data5 was gotten, but you have no information on the other data's. Often we want ACK to mean something specifically. Receiver Ready (RR) is the an accumulative ACK instead.

For example, saying RR7 means that I'm waiting on 7, but that 0-6 are all good. Another example, if you get data 0,1,2,5,6,7,8, you can't RR8! At best you can RR3.

The nice thing about it being cumulative is that you never have to resend any RR's. If you send data7 (after 0-6 are good) and it doesn't go through then you get RR6 (but you already sent that, so you don't need to resend it).

Packet Flow Diagram - Sliding Windows

Here we want to be realistic with our buffer size. We call this buffer size the window size, or the number of frames that can be send and not yet ACK'ed before the sender must stop sending. It's defined for at least the sender, but often you'll want it to be the same for the receiver.

The sender must be able to buffer an entire window's worth of data.

Stop and Wait has a window size of 1.

Data gets deleted from the buffer once an RR arrives that covers it.

Sliding Window Process

Sender's window has some window size (buffer size). We limit the number of un-ACK'ed frames.

There's gonna be 3 variables:

  1. Lower Edge of Window
  2. Upper Edge of Window
  3. Current Frame
Example

Here: - Current is the current one to `RR` with.

Error Handling in Sliding Windows

We'll need to both detect and correct errors. The types of errors we may see is:

In our sliding window example, we'll look at two error recovery techniques via:

As a sneak peak, we have Forward Error Correct (FEC) where:

Note

Often the higher layer error correction is more sophisticated, since it'll be seen less often. For lower level (2) error correction fixing just one or two bits is fine.

Determining if there is an Error

How can the receiver detect if there was an error? It can:

Now how can the sender detect the error?

Sliding Windows - How to recover from an Error

  1. First, detect an error (previously discussed)
  2. Recover from the error
    1. Go-back-N ARQ
    2. Selective Repeat ARQ