mod 3
mod 3
error control
Dr.S.Sivakumar /Associate
Professor/ VIT/ Chennai
Flow control
• Flow control is a set of procedures that tells the sender how
much data it can transmit before it must wait for an
acknowledgment from the receiver.
i) Data lost
ii) Acknowledgement lost
iii) Delayed Acknowledgement or data
– RTT (restart a time-out timer)
– Timeout
– Time To Live (TTL)
Stop and Wait ARQ
Sender Receiver
Frame 0
Timer start Ack 1
Timeout Frame 1
Timer start Ack 0
Timeout Frame 0
Ack 1
Stop and Wait ARQ (Frame lost)
Sender Receiver
Frame 0
Timer start
Ack 1
Timeout Frame 1
Timer start Frame 1 lost
Timeout
Frame 1
Resend Frame 1 Ack 0
Stop and Wait ARQ (ACK lost)
Sender Receiver
Frame 0
Timer start
Ack 1
Timeout Frame 1
Timer start Discard
Ack 0 Frame 1
Timeout
Frame 1
Ack 0 lost & so Ack 0
Resend Frame 1
Stop n Wait Protocol (Numbering Frames)
• We need to assign sequence nos. to data frames and
acknowledgement nos. to the ACK frames
• Sequence nos. are 0,1,0,1,0,1,…. The sequence numbers are
based on modulo-2 arithmetic.
• Acknowledgement nos. are 1,0,1,0,1,0,…
• That is, sequence nos. start with 0 and acknowledgement
nos. start with 1
• An ACK no. also defines the sequence no. of next frame to
receive
• ACK number always announces in modulo-2 arithmetic the
sequence number of the next frame expected
Scenario 1: Stop n Wait
Scenario 2: Stop n Wait
Scenario in Stop-and-Wait ARQ
• In Go-Back-N, the ACK no. is cumulative and defines the seq. no of the
next packet expected
• Send Window: It is an imaginary box covering the sequence nos of the
data packets that can be in transit or can be sent.
• In each window position, some of these sequence nos define the packets
that have been sent. Others define those that can be sent
• The max. size of the window is 2𝑚 - 1
• Let the size be fixed and set to the max. value
Note: Some protocols may have a variable window size
• Let us consider a sliding window of size 7 (m=3) for the Go-Back-N
protocol
Go back N ARQ (ACK lost)
Timer start 6 5 4 3 2 1 1
2
3
4
1
Timeout 2
Ack lost 3, 4
6 5 5
6 Discarded
6 5 4 3
Retransmit
Go_back_N ARQ (Frame Received out of order)
Transmitter Receiver
Timer start 6 5 4 3 2 1 1
2
3
4 Discarded
1
Timeout 2
Ack lost 3, 4
6 5 5
6 Discarded
6 5 4 3
Retransmit
Sliding Window of size 7 (m=3)
Send Window for Go-Back-N ARQ
The window itself is an abstraction; three variables define its size and location at any
time. We call these variables Sf (send window, the first outstanding frame),
Sn (send window, the next frame to be sent), and Ssize (send window, size).
The variable Sf defines the sequence number of the first (oldest) outstanding frame.
The variable Sn holds the sequence number that will be assigned to the next frame to
be sent.
Finally, the variable Ssize defines the size of the window, which is fixed in our protocol.
Sliding Window of size 15 (m=4)
Send Window before and after sliding
The sequence numbers to the left of the window belong to the frames already received and
acknowledged; the sequence numbers to the right of this window define the frames that cannot be
received. The receive window also slides, but only one slot at a time.
When a correct frame is received (and a frame is received only one at a time), the window slides.
Send Window Size
• We can now show why the size of the send window must be less
than 2m ?
• As an example, we choose m =2, which means the size of the
window can be 2m - 1, or 3.
• Fig 11.15 compares a window size of 3 against a window size of 4.
• If the size of the window is 3 (less than 22) and all three
acknowledgments are lost, the frame timer expires and all three
frames are resent. The receiver is now expecting frame 3, not
frame 0, so the duplicate frame is correctly discarded.
• If the size of the window is 4 (equal to 22) and all acknowledgments
are lost, the sender will send a duplicate of frame 0. However, this
time the window of the receiver expects to receive frame 0, so it
accepts frame 0, not as a duplicate, but as the first frame in the
next cycle. This is an error
Selective Repeat ARQ
Frame 0
0 1 2 3 4 5
Frame 1 0 1 2 3 4 5
0 1 2 3 4 5
ACK2 0 1 2 3 4 5
0 1 2 3 4 5 Frame 2 lost
Frame 3
0 1 2 3 4 5
0 1 2 3 4 5
NACK
Frame2
0 1 2 3 4 5
0 1 2 3 4 5
Selective-Repeat (SR) ARQ
• The Selective Repeat Protocol allows as many frames as the size of the receive window to arrive
out of order and be kept until there is a set of in-order frames to be delivered to the network
layer.
• Because the sizes of the send window and receive window are the same, all the frames in the
send frame can arrive out of order and be stored until they can be delivered.
• Also note that the receiver never delivers packets out of order to the network layer
The two well-known implementations of sliding window protocol
are:-
1. Go back N Protocol
2. Selective Repeat Protocol
Go back N Protocol
Go back N protocol is an implementation of a sliding window
protocol.
The features and working of this protocol are explained in the
following points-
Point-01:
In Go back N,
• Sender window size = N. Example in Go back 10, sender
window size will be 10.
• Receiver window size is always 1 for any value of N.
Point-02:
In Go back N,
• Receiver maintains an acknowledgement timer.
• Each time the receiver receives a new frame, it starts a new
acknowledgement timer.
• After the timer expires, receiver sends the cumulative
acknowledgement for all the frames that are unacknowledged
at that moment.
NOTE
A new acknowledgement timer does not start after the expiry
of old acknowledgement timer. It starts after a new frame is
received.
Point-03:
Go back N may use independent acknowledgements too.
• The above point does not mean that Go back N cannot use
independent acknowledgements.
• Go back N may use independent acknowledgements too if
required.
• The kind of acknowledgement used depends on the expiry of
acknowledgement timer.
Example-
Consider after the expiry of acknowledgement timer, there is
only one frame left to be acknowledged.
• Then, Go back N sends the independent acknowledgement
for that frame.
Point-04:
In Go back N,
• If receiver receives a frame that is corrupted, then it silently
discards that frame.
• The correct frame is retransmitted by the sender after the time
out timer expires.
• Silently discarding a frame means-“Simply rejecting the frame
and not taking any action” (like not sending a NACK to the
sender to send the correct frame)
Point-05:
In Go back N,
• If receiver receives a frame whose sequence number is not
what the receiver expects, then it silently discards that frame.
• All the following frames are also discarded.
• This is because receiver window size is 1 and therefore
receiver cannot accept out of order frames.
Point-06:
In Go back N,
• Receiver silently discards the frame if it founds the frame to
be either corrupted or out of order.
• It does not send any acknowledgement for such frame.
Thus, if for any particular frame, sender does not receive any
acknowledgement, then it understands that along with that
frame, all the following frames must also have been discarded
by the receiver.
• So, sender has to retransmit all the following frames too along
with that particular frame.
• Thus, it leads to the retransmission of entire window.
• That is why, the protocol has been named as “Go back N“.
Point-07:
Go back N leads to retransmission of lost frames after expiry of time out
timer.
In Go back N,
• Consider a frame being sent to the receiver is lost on the way.
• Then, it is retransmitted only after time out timer expires for that frame at sender’s
side.
Efficiency of Go back N Efficiency of any flow control protocol is given
Solution
1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 10
Step-by-step analysis
Finally, all the 9 packets got transmitted which took total 16 number of
transmissions.
Problem-03:
Problem-0 5:
A 1 Mbps satellite link connects two ground stations. The
altitude of the satellite is 36,504 km and speed of the signal is 3
x 108 m/sec. What should be the packet size for a channel
utilization of 25% for a satellite link using go-back-127 sliding
window protocol?
Solution
Given
• Bandwidth = 1 Mbps
• Distance = 2 x 36504 km = 73008 km
• Propagation speed = 3 x 108 m/sec
• Efficiency = 25% = 1/4
• Go back N is used where N = 127
01111110
Module 3