Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ECE/CSC 570
ECE/CSC 570
Retransmission Strategies
n
Assumptions
Transmissions are eventually successful.
ECE/CSC 570
Approach
n
Sequence numbers
Delineated streams of bits stream of frames
Successive frames have different identities
Timing Diagrams
sender
Time
receiver
ECE/CSC 570
Stop-And-Wait (SAW)
Simplex in data transmission
Half-duplex considering acknowledgement
Go-Back-N (GBN)
Increase utilization
Sliding window
ECE/CSC 570
Assumptions
n
We refer to frames without transmission errors as errorfree frames and those with transmission errors as error
frames.
ECE/CSC 570
Stop-and-Wait (SAW)
Flow Control: How to prevent the sender from flooding the
receiver with data faster than the latter is able to process them?
n
Simplest scheme
Protocols in which the sender sends one frame and then waits
for an acknowledgement before proceeding are called SAW.
Assume that no automatic buffering and queuing at the
receiver, the sender must never transmit a new frame until the
old one has been fetched.
Stop-and-Wait (2)
n
T
Sender A
Receiver B
ECE/CSC 570
Stop-and-Wait (3)
n
Sender A
Ack
Packet 0 or 1 ?
Receiver B
Packet 0
Stop-and-Wait (4)
n
SN
Sender A
1 ?
0
Ack
Ack
2
Nak
Receiver B
Packet 0
Packet 0
Stop-and-Wait (5)
n
piggyback these requests for new packets into the headers of the
data frames from B to A.
SN
RN
Packet
CRC
ECE/CSC 570
Sender A
Receiver B
RN
Packets out
1
0
2
1
ECE/CSC 570
3.
Set the integer variable RN to 0 and then repeat steps 2 and 3 forever.
Whenever an error-free frame is received from A containing a sequence number
SN equal to RN , release the received packet to the higher layer and increment
RN.
At arbitrary times, but within bounded delay after receiving any error-free data
frame from A, transmit a frame to A containing RN in the request number field.
ECE/CSC 570
Assumption:
Note: From now on, frame and packet are used interchangeably.
ECE/CSC 570
More Assumptions
n
p = Probability of success !
ECE/CSC 570
ECE/CSC 570
ECE/CSC 570
Then
E ( X ) = pS + (1 p){T + E (Y )}
Since the transmission errors after the second transmission have the
same likelihood as after the first one, the random time Y has the same
statistics as the random variable X. Both X and Y are the random time
until the ack of a packet is correctly received, measured from the start of
the transmission of the packet.
E ( X) = pS + (1 p) (T + E ( X))
1 p
E ( X) = S + T
p
ECE/CSC 570
SW
n
=
S + T(1 p) / p
and T = S
a >> 1? a << 1?
ECE/CSC 570
Bidirectional protocols
To use the same circuit for data in both directions, instead of one for
data (forward) and one for ack (reverse). The receiver can tell whether
the frame is data or ack by looking at the type in the packet header.
Piggybacking
Temporarily delaying outgoing acks so that they can be hooked onto
the next outgoing data frame (free ride for acks!).
How long should the receiver wait for a packet to piggyback the
ack?
Too long will incur retransmission
Too short separate acknowledgement
ECE/CSC 570
ECE/CSC 570
Sending Window:
The sequence numbers within the senders window represent frames
that are allowed to send (have been sent or can be sent, but are as
yet not acknowledged).
When a new packet arrives from the network layer, the upper edge of
the window is advanced by one.
The sender must have a buffer which keeps the copy of all frames
within the window because these frames may need retransmission.
Frames already
transmitted
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6
Frame sequence
number
Last frame
transmitted
Window shrinks as
frames are sent
ECE/CSC 570
Window expands as
acknowledgements are
received
Receiving Window:
The receiver maintains a receiving window
corresponding to the sequence numbers of frames
that the receiver is permitted to accept.
Frames already
received
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6
Last frame
acknowledged
Window shrinks as frames
are received
ECE/CSC 570
Window expands as
acknowledgements are sent
ECE/CSC 570
Example
Transmitter
Receiver
0 1 2 3 4 5 6 7 0 1 2 3
F0
F1
F2
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
ACK 3
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
ECE/CSC 570
Example (contd)
Transmitter
Receiver
F3
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
F4
F5
F6
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
ACK 4
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
ECE/CSC 570
ECE/CSC 570
Go Back n ARQ
If no error occurs, this is the same as the previous
sliding window operation.
ECE/CSC 570
Go Back n ARQ
n
Window size W = n
Timer value T W
ECE/CSC 570
Operations:
A station may send multiple frames as allowed by
the window size.
receiver sends a NAK i if frame i is in error. After
that, the receiver discards all incoming frames until
the frame in error was correctly retransmitted.
If sender receives a NAK i, it will retransmit frame i
and all packets i+1, i+2, which have been sent,
but not been acknowledged.
ECE/CSC 570
Lost Frame
Frames 4,5,6 are
retransmitted
ACK 6
NACK 4
e6
ACK 3
Fra m
ECE/CSC 570
e5
e4
Frames 5 and 6
are discarded
Fra m
Fra m
e6
e5
e4
e3
e2
Fra m
Fra m
Fra m
Fra m
Fra m
e1
e0
Fra m
Fra m
Lost ACK
Frames 0 -- 4 are
retransmitted
Timeout
ACK 5
ACK 3
e5
ACK 3
Fra m
e4
e3
e2
ECE/CSC 570
Fra m
Fra m
Fra m
e1
e0
e4
e3
e2
Fra m
Fra m
Fra m
Fra m
Fra m
e1
e0
Fra m
Fra m
Why?
ECE/CSC 570
Efficiency of GBN
n
ECE/CSC 570
Assume no errors!
ACK
W
If S W =
S
S < W = 1
If
W
GBN = min 1,
S
ECE/CSC 570
T = S = W
sender
S
S, 1-p
S, 1-p
, p
receiver
ECE/CSC 570
, p
(1 p ) S
E( X ) = +
p
Since the useful transmission time per packet is , the
transmission time, we conclude that the efficiency GBN
of Go Back N is given by
(When S =T=W )
GBN
=
E( X )
GBN
ECE/CSC 570
=
+ (1 p)S / p
Example of Choosing W
n
n
n
n
n
The packets have 1000 bits and acknowledgements 100 bits. Assume
each bit transmission time is t.
W 1000
min 1,
1102
If W=1, then the efficiency is approximately 90%, and if W=2, then the
efficiency is equal to 100%.
ECE/CSC 570
Let R = 2.4Gbps
S=?
=?
W 424
min 1,
6
1.2 10
ECE/CSC 570
Let R = 2.4Gbps
10-6
W 424
min 1,
6
1.2 10
S = (424+424)/R + 2 250
= 424 / R.
ECE/CSC 570
Selective-Repeat ARQ
n
Disadvantages:
More complexity at sender and receiver
Each frame must be acknowledged individually (no
cumulative acknowledgements)
Receiver may receive frames out of sequence (buffer
required)
ECE/CSC 570
Lost Frame
Only frame 4 is
retransmitted
ACK 1
ACK 0
ACK 5
ACK 4
ACK 3
ACK 2
ACK 1
ACK 7
ECE/CSC 570
e0
Frames 5 and 6
are buffered
e7
e4
Fra m
Fra m
Fra m
e6
e5
e4
e3
e2
Fra m
Fra m
Fra m
Fra m
Fra m
e1
e0
Fra m
Fra m
ACK 6
NACK 4
W
SRP = min1,
S
ECE/CSC 570
Summary
n