You are on page 1of 20

Topic:

Reliable Transmission via


Retransmission

Protocols
For Noiseless channel For Noisy Channels
Stop and wait ARQ
Simplest Go back N ARQ
Stop & Wait Selective Repeat ARQ
Noiseless Channel
Simplest Protocol
Stop and wait Protocol
Automatic Repeat reQuest (ARQ)

 Stop-and-wait ARQ
 Transmit a frame and wait for acknowledgement (ACK)
 If positive ACK from receiver, send next frame
 If ACK does not arrive after a certain period of time (Timeout),
retransmits the frame
 Simple, low efficiency
 Go-back-N ARQ
 Transmit frames continuously, no waiting
 The receiver only ACKs the highest-numbered frames received in
sequence
 ACK comes back after a round-trip delay
 If timeout, the sender retransmits the frames that are not ACKed and
N–1 succeeding frames that were transmitted during the round-trip
delay (N frames transmitted during a round-trip delay)
 Need buffer at sender, does not have to buffer the frames at the
receiver,
 Moderate efficiency and complexity. Less efficient when the round-
trip delay is large and data transmission rate is high
 Selective-repeat ARQ
 Transmit continuously, no waiting
Stop and Wait
ARQ
damaged
frame

damaged
ACK
Sliding Window – Keeping the Pipe Full

Goal: Sender should be busy sending packets


(as long as it has packets ready to send)
• Sender utilization as a metric of protocol performance
• “Keeping the pipe full”
Go – Back – N ARQ provides for sending multiple frames before receiving the
acknowledgment for the first frame.

The frames are sequentially numbered and a finite number of frames. The maximum number
of frames that can be sent depends upon the size of the sending window.

If the acknowledgment of a frame is not received within an agreed upon time period, all
frames starting from that frame are retransmitted.

The size of the sending window determines the sequence number of the outbound frames.

If the sequence number of the frames is an n-bit field, then the range of sequence numbers
that can be assigned is 0 to 2n−1. Consequently, the size of the sending window is 2n−1. Thus
in order to accommodate a sending window size of 2n−1, a n-bit sequence number is chosen.
The size of send window must be less than 2m and receiver window is 1
Go-back-N ARQ
Window N = 3 Sender Receiver
0 1 2 3 4 5 6 7 8 9 10 11 Pkt-0
0 1 2 3 4 5 6 7 8 9 10
Pkt-1 Next expected
seq.num.
0 1 2 3 4 5 6 7 8 9 10 11 Pkt-2 (loss)
Ack-0 0 1 2 3 4 5 6 7 8 9 10

Ack-0 discard Pkt-2


0 1 2 3 4 5 6 7 8 9 10 11 Pkt-3

1 2 3 4 5 6 7 8 9 10 11
Timeout for Pkt-1 discard Pkt-3
Ack-0
0 1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10 11 Pkt-1
)
Pkt-2 i ons
iss
1 2 3 4 5 6 7 8 9 10 11 m
Pkt-3 ns 1 2 3 4 5 6 7 8 9 10
rt a Ack-1
(re
Ack-2 2 3 4 5 6 7 8 9 10

(loss) Ack-3 3 4 5 6 7 8 9 10
2 3 4 5 6 7 8 9 10 11
Pkt-4

4 5 6 7 8 9 10 11 Pkt-5
4 5 6 7 8 9 10
Ack-4
4 5 6 7 8 9 10 11 Pkt-6
Selective ARQ
Go – Back – N ARQ provides for sending multiple frames before receiving the
acknowledgment for the first frame. The frames are sequentially numbered and
a finite number of frames. The maximum number of frames that can be sent
depends upon the size of the sending window. If the acknowledgment of a frame
is not received within an agreed upon time period, all frames starting from that
frame are retransmitted.

The size of the sending window determines the sequence number of the
outbound frames. If the sequence number of the frames is an n-bit field, then the
range of sequence numbers that can be assigned is 0 to 2n−1. Consequently,
the size of the sending window is 2n−1. Thus in order to accommodate a
sending window size of 2n−1, a n-bit sequence number is chosen.
Receiver must be able to accept packets out of order.

Since receiver must release packets to higher layer in order, the receiver must be able
to buffer some packets.

Retransmission requests :

Implicit – The receiver acknowledges every good packet, packets that are not ACKed
before a time-out are assumed lost or in error.Notice that this approach must be used to
be sure that every packet is eventually received.

Explicit – An explicit NAK (selective reject) can request retransmission of just one
packet. This approach can expedite the retransmission but is not strictly needed.

One or both approaches are used in practice.


Sliding Window ARQ
Sender Sender Receiver Receiver
window N = 4 window W = 4
0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 9
Pkt-
Pkt-0
Pkt-
Pkt-1
0 1 2 3 4 5 6 7 8 9 Pkt-
Pkt-2 0 1 2 3 4 5 6 7 8 9
Pkt-
Pkt-3 Ack-
Ack-0
Ack-
Ack-1
Ack-
Ack-2 0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10 Ack-
Ack-3
Pkt-
Pkt-4
Pkt-
Pkt-5
0 1 2 3 4 5 6 7 8 9 10 Pkt-
Pkt-6 0 1 2 3 4 5 6 7 8 9 10
Pkt-
Pkt-7 Ack-
Ack-4
Ack-
Ack-5
Ack-
Ack-6 0 1 2 3 4 5 6 7 8 9 10 11
0 1 2 3 4 5 6 7 8 9 10 Ack-
Ack-7
Pkt-
Pkt-8
Key: Key:
Already ACK’d Pkt-
Pkt-9 Received in-order & ACK’d
Sent, not yet ACK’d Expected, not yet received
Allowed to send Acceptable to receive
NOT allowed to send NOT acceptable
Selective Repeat Protocol (SRP) :

This protocol(SRP) buffers are used and the receiver, and the sender, each maintain a
window of size. SRP works better when the link is very unreliable. Because in this case,
retransmission tends to happen more frequently, selectively retransmitting frames is
more efficient than retransmitting all of them. SRP also requires full duplex link.
backward acknowledgements are also in progress.

Sender’s Windows ( Ws) = Receiver’s Windows ( Wr).

Window size should be less than or equal to half the sequence number in SR protocol.
This is to avoid packets being recognized incorrectly. If the windows size is greater than
half the sequence number space, then if an ACK is lost, the sender may send new
packets that the receiver believes are retransmissions.

Sender can transmit new packets as long as their number is with W of all unACKed
packets.

Sender retransmit un-ACKed packets after a timeout – Or upon a NAK if NAK is


employed.

Receiver ACKs all correct packets.

Receiver stores correct packets until they can be delivered in order to the higher layer.
In some protocols data frames flow in only one direction although control information
such as ACK and NAK frames can travel in the other direction. In real life, data frames
are normally flowing in both directions, from node A to node B and from node B to node
A. This means that the control information also needs to flow in both directions.

A technique called piggybacking is used to improve the efficiency of the bidirectional


protocols.

When a frame is carrying data from A to B, it can also carry control information about
arrived (or lost) frames from B; when a frame is carrying data from B to A, it can also
carry control information about the arrived (or lost) frames from A.

Each node now has two windows: one send window and one receive window. Both
also need to use a timer.

Both are involved in three types of events: request, arrival, and time-out. However,
the arrival event here is complicated; when a frame arrives, the site needs to handle
control information as well as the frame itself. Both of these concerns must be taken
care of in one event, the arrival event. The request event uses only the send window at
each site; the arrival event needs to use both windows.

You might also like