Anda di halaman 1dari 6

Stop and Wait ARQ

Stop and Wait transmission is the simplest reliability technique and is adequate for a very
simple communications protocol. A stop and wait protocol transmits a Protocol Data Unit
(PDU) of information and then waits for a response. The receiver receives each PDU and
sends an Acknowledgement (ACK) PDU if a data PDU is received correctly, and a Negative
Acknowledgement (NACK) PDU if the data was not received. In practice, the receiver may
not be able to reliably identify whether a PDU has been received, and the transmitter will
usually also need to implement a timer to recover from the condition where the receiver does
not respond.
Under normal transmission the sender will receive an ACK for the data and then commence
transmission of the next data block. For a long delay link, the sender may have to wait an
appreciable time for this response. While it is waiting the sender is said to be in the "idle"
state and is unable to send further data.


Stop and Wait ARQ - Waiting for Acknowledgment (ACK) from the remote node.
The blue arrows show the sequence of data PDUs being sent across the link from the sender
(top to the receiver (bottom). A Stop and Wait protocol relies on two way transmission (full
duplex or half duplex) to allow the receiver at the remote node to return PDUs
acknowledging the successful transmission. The acknowledgements are shown in green in the
diagram, and flow back to the original sender. A small processing delay may be introduced
between reception of the last byte of a Data PDU and generation of the corresponding ACK.
When PDUs are lost, the receiver will not normally be able to identify the loss (most
receivers will not receive anything, not even an indication that something has been
corrupted). The transmitter must then rely upon a timer to detect the lack of a response.

Stop and Wait ARQ - Retransmission due to timer expiry

In the diagram, the second PDU of Data is corrupted during transmission. The receiver
discards the corrupted data (by noting that it is followed by an invalid data checksum). The
sender is unaware of this loss, but starts a timer after sending each PDU. Normally an ACK
PDU is received before this the timer expires. In this case no ACK is received, and the timer
counts down to zero and triggers retransmission of the same PDU by the sender. The sender
always starts a timer following transmission, but in the second transmission receives an ACK
PDU before the timer expires, finally indicating that the data has now been received by the
remote node.
The state diagram (also showing the operation of NACK) is shown below:

State Diagram for a simple stop and wait protocol
(Green for ACK, Blue for Data, Red for NACK)


Go-Back-N Error Recovery
Go-Back-N error recovery is a procedure which is implemented in some communications
protocols to provide reliability. Go-Back-N ARQ (is one of a number of error recovery
procedures to detect and retransmit I-frames which have been corrupted due to errors in the
physical link (c.f. saw, polling, selective repeat).
Features required for Go-Back-N ARQ
To support Go-Back-N ARQ, a protocol must number each PDU which is sent. (PDUs are
normally numbered using modulo arithmetic, which allows the same number to be re-used
after a suitably long period of time. The time period is selected to ensure the same PDU
number is never used again for a different PDU, until the first PDU has "left the network"
(e.g. it may have been acknowledged)).
The local node must also keep a buffer of all PDUs which have been sent, but have not yet
been acknowledged.
The receiver at the remote node keeps a record of the highest numbered PDU which has
been correctly received. This number corresponds to the last acknowledgement PDU which
it may have sent.
Recovery of lost PDUs using Go-Back-N.
The recovery of a corrupted PDU proceeds in three stages:
First, the corrupted PDU is discarded at the remote node's receiver.
Second, the remote node requests retransmission of the missing PDU using a control PDU
(sometimes called a NACK or REJECT). The receiver discards all PDUs which do not have the
number of the requested PDU.
The final stage consists of retransmission of the lost PDU(s).


Retransmission using Go-Back-N
A remote node may request retransmission of corrupted PDUs by initiating Go-Back-N error
recovery by sending a control PDU indicating the last successfully received PDU. This
allows the remote node to instruct the sending node where to begin retransmission of PDUs.
The remote node does not store any out-of-sequence PDUs and therefore must discard all
received PDUs until one is received with the expected sequence number.
Upon receipt of a Go-Back-N control PDU (by the local node), the transmitter winds-back
the sequence of PDUs pending transmission to the indicated PDU in its buffer of
unacknowledged PDUs. The transmitter then retransmits (Goes Back-to-N) the requested
PDU followed by all successive PDUs. This is sometimes known as "wind back" of the
transmitter.

Example of Go-Back-N. The sender in this example transmits four PDUs (1-4) and the first
one (1) of these is not successfully received. The receiver notes that it was expecting a PDU
numbered 1 and actually receives a PDU numbered 2. It therefore deduces that (1) was lost.
It requests retransmission of the missing PDU by sending a Go-Back-N request (in this case
N=1), and discards all received PDUs with a number greater than 1.The sender receives the
Go-Back-N request and retransmits the missing PDU (1), followed by all subsequently sent
PDUs (2-4) which the receiver the correctly receives and acknowledges.
If the retransmission is not successful, the protocol relies upon a protocol timer in the local
node to detect that no acknowledgment was received. The lost PDUs may then be recovered
by Polling.

Selective Repeat Error Recovery
Selective Repeat error recovery is a procedure which is implemented in some
communications protocols to provide reliability. It is the most complex of a set of procedures
which may provide error recovery, it is however the most efficient scheme. Selective repeat is
employed by the TCP transport protocol.
Features required for Selective Repeat ARQ
To support Go-Back-N ARQ, a protocol must number each PDU which is sent. (PDUs are
normally numbered using modulo arithmetic, which allows the same number to be re-used
after a suitably long period of time. The time period is selected to ensure the same PDU
number is never used again for a different PDU, until the first PDU has "left the network"
(e.g. it may have been acknowledged)).
The local node must also keep a buffer of all PDUs which have been sent, but have not yet
been acknowledged.
The receiver at the remote node keeps a record of the highest numbered PDU which has
been correctly received. This number corresponds to the last acknowledgement PDU which
it may have sent.
The above features are also required for Go-Back-N, however for selective repeat, the
receiver must also maintain a buffer of frames which have been received, but not
acknowledged.
Recovery of lost PDUs using Selective Repeat ARQ
The recovery of a corrupted PDU proceeds in four stages:
First, the corrupted PDU is discarded at the remote node's receiver.
Second, the remote node requests retransmission of the missing PDU using a control PDU
(sometimes called a Selective Reject). The receiver then stores all out-of-sequence PDUs in
the receive buffer until the requested PDU has been retransmitted.
The sender receives the retransmission request and then transmits the lost PDU(s).
The receiver forwards the retransmitted PDU, and all subsequent in-sequence PDUs which
are held in the receive buffer.

Retransmission using Selective Repeat
A remote node may request retransmission of corrupted PDUs by initiating Selective Repeat
error recovery by sending a control PDU indicating the missing PDU. This allows the remote
node to instruct the sending node where to retransmit the PDU which has not been received.
The remote stores any out-of-sequence PDUs (i.e. which do not have the expected sequence
number) until the retransmission is complete.
Upon receipt of a Selective Repeat control PDU (by the local node), the transmitter sends a
single PDU from its buffer of unacknowledged PDUs. The transmitter then continues normal
transmission of new PDUs until the PDUs are acknowledged or another selective repeat
request is received.

Operation of Selective Repeat. The sender transmits four PDUs (1-4). The first PDU (1) is
corrupted and not received. The receiver detects this when it receives PDU(2), which it stores
in the receive buffer and requests a selective repeat of PDU(1). The sender responds to the
request by sending PDU(1), and then continues sending PDUs (5-7). The receiver stores all
subsequent out-of-sequence PDUs (3-4), until it receives PDU(1) correctly. The received
PDU (1) and all stored PDUs (2-4) are then forwarded, followed by (5-7) as each of these is
received in turn.
If the retransmission is not successful, the protocol relies upon a protocol timer in the local
node to detect that no acknowledgment was received. The lost PDUs may then be recovered
by Polling.
Comparison of ARQ Methods
The table below provides a comparison of the various ARQ methods described. (W is the
window size, or number of PDUs which may be in transit at any one time).
ARQ Method Sender Buffer Receiver Buffer Control PDUs
Stop-and-Wait 1 PDU 1 PDU ACK
Polling W PDUs 1 PDU
ACK, Poll,
Response
Go-Back-N W PDUs 1 PDU ACK, Go-Back-N
Selective Repeat W PDUs W PDUs
ACK, Selective
Repeat

Anda mungkin juga menyukai