Stop and wait

format_list_bulleted Contenido keyboard_arrow_down
ImprimirCitar

The Stop-and-wait method (Stop-and-wait) is a type of ARQ protocol for controlling errors in communication between two hosts based on sending frames or packets, so that once a packet is sent, the next packet is not sent until the corresponding ACK (acknowledgment of receipt) is received and in case of receiving a NACK (rejection of reception) the previous packet is resent.


Paradayespera.JPG


This protocol ensures that information is not lost and that frames or packets are received in the correct order. It is the simplest of the ARQ methods. In this, the sender, after sending a single frame, does not send the others until it receives an ACK signal (an acknowledgment that the frame was received) from the receiver. On the other hand, the receiver, when it receives a valid frame (without errors), sends the ACK signal.

If the ACK fails to reach the sender before a certain amount of time, called the timeout, then the sender resends the frame again. If the sender does receive the ACK, then it sends the next frame.

The above behavior is the simplest implementation of the Stop-and-Wait method. However, in real life practical implementation there are problems that need to be fixed.

Normally the sender adds a redundancy bit to the end of each frame. The receiver uses this redundancy bit to search for possible errors. If the receiver finds that the frame is valid (contains no errors), then it sends the ACK. If the receiver finds that the frame is corrupted, then the receiver discards it and does not send the ACK -- pretending that the frame was completely lost, not just corrupted.

A problem arises when an ACK sent by the receiver is corrupted or completely lost on the network. In this case, the sender of the frame does not receive the ACK, times out and forwards the frame again. Now the receiver has 2 copies of the same frame and does not know if the second frame is a duplicate frame or if it is the next frame in the sequence to be sent, which actually contains identical data to the first.

Another problem arises when the transmission medium has such a high latency that the sender times out even before the frame reaches the receiver. In this case, the sender forwards the frame. Eventually the receiver gets 2 copies of the same frame and sends an ACK for each of them. So the sender, which is expecting a single ACK, receives two ACK's which can cause problems if the sender assumes that the second ACK is for the next frame in the sequence.

To avoid these problems, the most common solution is to define a 1-bit sequence number in the frame header. This sequence number is alternated (from 0 to 1) in subsequent frames. Thus, when the receiver sends an ACK, it includes the sequence number of the next frame it expects to receive. In this way, the receiver can identify duplicate frames by checking if the frame's sequence number was toggled. If two subsequent frames have the same sequence number, it means that they are duplicates, and the second frame is discarded. Similarly, if two subsequent ACK's refer to the same sequence number, then it means that they are acknowledging the same frame.

As a comment, remember that all this can be applied to both frames and packets, since these protocols can be implemented both in the Data Link layer and in the Transport layer of the OSI model.

The Stop-and-Wait ARQ method is inefficient compared to other ARQ methods because the time between packets, in case the ACK's and data are successfully received, is twice the transmission time (assuming that the time it takes for hosts to process the information and respond is zero). Throughput on the channel is a fraction of what it really could be. To work around this problem, you can send more than one packet at a time with a larger sequence number and use a single ACK for that set of packets. This is what is done with the Simple Reject (Go-Back-N) and Selective Repeat (Selective Repeat) ARQ methods.

Contenido relacionado

Hybrid cryptography

Hybrid cryptography is a cryptographic method that uses both symmetric and asymmetric encryption. It uses public key encryption to share a key for symmetric...

Modding

The modding, a concept derived from the English word modify is the art or technique to modify aesthetically or functionally parts of a computer, be it the...

MediaWiki:Whitelistreadtitle

Login is required to...
Más resultados...
Tamaño del texto:
undoredo
format_boldformat_italicformat_underlinedstrikethrough_ssuperscriptsubscriptlink
save