Lecture 9
Lecture 9
1. By retransmission
flow and error control protocols
2. Forward Error Correction (FEC)
require more redundancy bits
should locate the invalid bit or bits
n-bit code word contains m data bits + r
redundancy bits
n=m+r
Data and redundancy bits
Number of Number of Total
data bits redundancy bits bits
m r m+r
1 2 3
2 3 5
3 3 6
4 3 7
5 4 9
6 4 10
7 4 11
Hamming Code
10
Protocols (Contd.)
11
Noisy Channels
12
Stop-and-Wait Automatic Repeat
Request
Simplest flow and error control mechanism
The sending device keeps a copy of the last frame
transmitted until it receives an acknowledgement
identification of duplicate transmission (lost or delayed
ACK)
a damaged or lost frame is treated in the same way
timers introduced
positive ACK sent only for frames received safe &
sound
13
A Simplex Stop-and-Wait
ARQ
1. Normal operation
2. The frame is lost
3. The ACK is lost
4. The ACK is delayed
14
Stop-and-Wait ARQ
-Normal operation-
The sender will not send
the next piece of data until
it is sure that the current
one is correctly received
sequence number
necessary to check for
duplicated packets
No NACK – when packet
is corrupted – duplicate
ACKs instead
15
Stop-and-Wait ARQ
-Lost or damaged frame-
roundtrip delay
+
processing in the
receiver
16
Stop-and-Wait ARQ
-Lost ACK-
Importance of
numbering
17
Stop-and-Wait ARQ
-Delayed ACK-
Importance of
ACK numbering
18
Duplex Stop-and-Wait ARQ
Piggybacking
combine data with ACK (less overhead saves bandwidth)
19
Drawbacks of Stop-and-Wait
ARQ
After each frame sent the host must wait for an ACK
inefficient use of bandwidth
20
Pipelining
21
Sliding Window Protocols
Sequence numbers
sent frames are numbered sequentially
number of frames stored in the header
if the number of bits in the header is m than
sequence number goes from 0 to 2^m-1
sequence
number
Sliding window frame
to hold the unacknowledged
outstanding frames
the receiver window size
always 1
acknowledged
frames
22
Question
What is the consequence of the window size in the
receiver on the order of the received packets?
Answer:
23
Go-back-N
-Control variables-
S- holds the sequence number of the recently sent frame
SF – holds sequence number of the first frame in the window
SL – holds the sequence number of the last frame
R – sequence number of the frame expected to be received
24
The name of Go-back-N:
why?
Re-sending frame
when the frame is damaged the sender goes back and
sends a set of frames starting from the last one ACKn’d
the number of retransmitted frames is N
Example:
25
Go-back-N
-normal operation-
How many frames
can be transmitted
without
acknowledgment?
ACK1 – not
necessary if ACK2
is sent
Cumulative ACK
expected sequence
number
26
Go-back-N
-damaged or lost frame-
damaged frames
are discarded!
Why are correctly
received packets
not buffered?
What is the
disadvantage of
this?
27
Go-back-N
-sender window size-
sequence
number
28
Go-back-N
Inefficient
all out of order received packets are discarded
This is a problem in a noisy link
many frames must be retransmitted -> bandwidth
consuming
Solution
re-send only the damaged frames
29
Note
30
Selective Repeat ARQ
Processing at the receiver more complex
The window size is reduced to one half of 2 m
Both the transmitter and the receiver have the
same window size
Receiver expects frames within the range of the
sequence numbers
31
Selective Repeat ARQ
-lost frame-
Note:
retransmission
triggered with NACK
and not with
expired timer
32
Selective Repeat ARQ
-sender window size-
33
34