0% found this document useful (0 votes)
28 views34 pages

WINSEM2024-25 SWE3001 ETH AP2024254000552 2025-02-25 Reference-Material-I

Flow control regulates data transmission between sender and receiver at different speeds, while error control detects and corrects corrupted data frames. Various protocols such as Stop and Wait, Go Back N, and Selective Repeat ARQ are discussed, each addressing flow and error control in different ways. The document also includes calculations for efficiency and maximum data rates in specific scenarios.

Uploaded by

yeluri2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views34 pages

WINSEM2024-25 SWE3001 ETH AP2024254000552 2025-02-25 Reference-Material-I

Flow control regulates data transmission between sender and receiver at different speeds, while error control detects and corrects corrupted data frames. Various protocols such as Stop and Wait, Go Back N, and Selective Repeat ARQ are discussed, each addressing flow and error control in different ways. The document also includes calculations for efficiency and maximum data rates in specific scenarios.

Uploaded by

yeluri2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

COMPUTER NETWORKS –

PART 10
What is Flow Control?
• Flow control is a technique that allows two stations working at different speeds to
communicate with each other.
• It is a set of measures taken to regulate the amount of data that a sender sends
so that a fast sender does not overwhelm a slow receiver.
• Flow control in Data Link Layer simply restricts and coordinates number of frames
or amount of data sender can send just before it waits for an acknowledgement
from receiver.
• The receiver needs a buffer for storing data or frames until they are processed.
• Flow Control is classified into two categories:
• Feedback based Flow Control: In these protocols, the sender sends frames
after it has received acknowledgments from the user.
• Rate based Flow Control: These protocols have built in mechanisms to
restrict the rate of transmission of data without requiring acknowledgment
from the receiver.
What is Error Control?
• Error control in data link layer is the process of detecting and correcting
data frames that have been corrupted or lost during transmission.
• Data link layer follows a technique to detect transit errors and take
necessary actions, which is retransmission of frames whenever error is
detected or frame is lost. The process is called Automatic Repeat Request
(ARQ).
Phases in Error Control
• The error control mechanism in data link layer involves the following phases.
• Detection of Error − Transmission error, if any, is detected by the receiver
and notified to the sender.
• Acknowledgment − acknowledgment may be positive or negative.
• Positive ACK − On receiving a correct frame, the receiver sends a
positive acknowledge.
• Negative ACK − On receiving a damaged frame or receiving no frame,
the receiver sends a negative acknowledgment back to the sender.
• Retransmission − The sender maintains a clock and sets a timeout period. If
an acknowledgment of a data-frame previously transmitted does not arrive
before the timeout, or a negative acknowledgment is received, the sender
retransmits the frame.
Simplest Protocol – no flow control or error control
• Simplest Protocol is a protocol that neither has flow control nor has error control.
This can be used in noiseless channels.
• The simplest protocol is basically a unidirectional protocol in which data frames
only travel in one direction; from the sender to the receiver.
• In this, the receiver can immediately handle the frame it receives whose
processing time is small enough to be considered as negligible.
Stop and Wait Protocol – only flow control
• Stop and wait protocol can be used in noiseless channels.
• Sender side
• Rule 1: Sender sends one data packet at a time.
• Rule 2: Sender sends the next packet only when it receives the
acknowledgment of the previous packet.
• Receiver side
• Rule 1: Receive and then consume the data packet.
• Rule 2: When the data packet is consumed, receiver sends the
acknowledgment to the sender.
The following are the problems associated with a stop and wait protocol:
1. Problems occur due to lost data: Since the data is not received by the receiver, so it does not send any
acknowledgment. Since the sender does not receive any acknowledgment so it will not send the next
packet. In this case, two problems occur:
• Sender waits for an infinite amount of time for an acknowledgment.
• Receiver waits for an infinite amount of time for a data.

2. Problems occur due to lost acknowledgment: In this case, the acknowledgment is lost in a network, so
there is no chance for the sender to receive the acknowledgment. There is also no chance for the sender
to send the next packet. In this case, one problem occurs:
• Sender waits for an infinite amount of time for an acknowledgment

3. Problem due to the delayed data or acknowledgment: Suppose the sender sends the data and it has
also been received by the receiver. The receiver then sends the acknowledgment but the
acknowledgment is received after the timeout period on the sender's side. As the acknowledgment is
received late, so acknowledgment can be wrongly considered as the acknowledgment of some other
data packet.
Stop and Wait ARQ Protocol – flow control
and error control
• Stop and wait ARQ protocol can be used in noisy channels.
• It provides a solution to all the limitations of stop and wait protocol.
• A stop-and-wait ARQ sender sends one frame at a time.
• Stop-and-wait ARQ is a special case of the general sliding window protocol with
transmit and receive window sizes equal to one in both cases.
• The sliding window is a technique for sending multiple frames at a time. It
controls the data packets between the two devices where reliable and sequential
delivery of data frames is needed.
• Sliding Window Protocol sends multiple frames at a time. Number of frames to
be sent is based on the window size. Each frame is numbered.
• Stop and wait ARQ is a one bit sliding window protocol where-
• Sender window size = 1
• Receiver window size = 1
• Minimum number of sequence numbers required = Sender Window Size +
Receiver Window Size = 1 + 1 = 2
• Minimum number of sequence numbers required in Stop and Wait ARQ = 2.
• The two sequence numbers used are 0 and 1.
1. Problem of Lost Data Packet-
• Time out timer helps to solve the problem of lost data packet.
• After sending a data packet to the receiver, sender starts the time out timer.
• If the data packet gets acknowledged before the timer expires, sender stops the
time out timer.
• If the timer goes off before receiving the acknowledgement, sender retransmits
the same data packet. After retransmission, sender resets the timer.
2. Problem of Lost Acknowledgement
• Sequence number on data packets help to solve the problem of delayed
acknowledgement.
• Consider the acknowledgement sent by the receiver gets lost.
• Then, sender retransmits the same data packet after its timer goes off.
• The sequence number on the data packet helps the receiver to identify the
duplicate data packet. Receiver discards the duplicate packet and re-sends the
same acknowledgement.
3. Problem of Delayed Acknowledgement-
• Sequence number on acknowledgements help to solve the problem of delayed
acknowledgement.
4. Problem of Damaged Packet-
If receiver receives a corrupted data packet from the sender, it sends a negative
acknowledgement (NAK) to the sender.
NAK requests the sender to send the data packet again.
Go Back N ARQ Protocol – flow control and
error control
• The sending process continues to send a number of frames as specified by the
window size even without receiving an acknowledgement (ACK) packet from the
receiver.
• 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. The receiver window size is 1.
• This protocol makes the use of cumulative acknowledgements means here the
receiver maintains an acknowledgement timer; whenever the receiver receives a
new frame from the sender then it starts a new acknowledgement timer. When
the timer expires then the receiver sends the cumulative acknowledgement for
all the frames that are unacknowledged by the receiver at that moment.
• If the timeout timer runs out for the first frame in the window then the sender
will resend all the packets in the window.
• Whenever a valid acknowledgement arrives then the send window can slide one
or more slots.
• The sender keeps a copy of each frame until the arrival of acknowledgement.
• If the receiver receives an out-of-order frame, then that frame and all the
subsequent frames are discarded.
• The receiver window slides when a correct frame arrives; the sliding occurs one
slot at a time.
• It is important to note that the new acknowledgement timer only starts after the
receiving of a new frame, it does not start after the expiry of the old
acknowledgement timer.
Efficiency of GBN = N/(1+2a)
• where a = Tp/Tt

Throughput
• = Efficiency * Bandwidth
• = (N/(1+2a)) * B
Selective Repeat ARQ Protocol – flow control
and error control
• The Go-back-N ARQ protocol works well if it has fewer errors. But if there is a lot
of error in the frame, lots of bandwidth loss in sending the frames again.
• So, we use the Selective Repeat ARQ protocol. In this protocol, the size of the
sender window is always equal to the size of the receiver window.
• If n bits are available for sequence numbers, then sender window size = receiver
window size = 2n-1
• SR protocol can send a negative ACK for each corrupted or lost packet. However,
this behavior is less common.
• SR protocol accepts the out of order frames. SR protocol requires sorting at the
receiver’s side.
• SR protocol leads to retransmission of unacknowledged frames after expiry of
time out timer at the sender.
Efficiency = N/(1+2a)
• Where a = Propagation delay / Transmission delay
3. A 20 Kbps satellite link has a propagation delay of 400 ms. The transmitter
employs the “go back n ARQ” scheme with n set to 10. Assuming that each
frame is 100 bytes long, what is the maximum data rate possible?
5 Kbps
10 Kbps
15 Kbps
20 Kbps

Given-
Bandwidth = 20 Kbps
Propagation delay (Tp) = 400 ms
Frame size = 100 bytes
Go back N is used where N = 10
Calculating Transmission Delay-
Transmission delay (Tt)
= Frame size / Bandwidth
= 100 bytes / 20 Kbps
= (100 x 8 bits) / (20 x 103 bits per sec)
= 0.04 sec
= 40 msec

Calculating Value Of ‘a’-


a = T p / Tt
a = 400 msec / 40 msec
a = 10
Calculating Efficiency-
Efficiency (η)
= N / (1+2a)
= 10 / (1 + 2 x 10)
= 10 / 21
= 0.476
= 47.6 %

Calculating Maximum Data Rate Possible-


Maximum data rate possible or Throughput
= Efficiency x Bandwidth
= 0.476 x 20 Kbps
= 9.52 Kbps
≅ 10 Kbps

Thus, Correct Option is (B)


4. Consider a 128 x 103 bits/sec satellite communication link with one way propagation delay
of 150 msec. Selective Retransmission (repeat) protocol is used on this link to send data with
a frame size of 1 KB. The minimum number of sequence numbers to achieve 100% utilization
is ________ .

Given-
Bandwidth = 128 x 103 bits/sec
Propagation delay (Tp) = 150 msec
Frame size = 1 KB

Now,
To achieve 100% utilization, efficiency must be 100%.
Efficiency is 100% when sender window size is optimal i.e. 1+2a

Calculating Transmission Delay-


Transmission delay (Tt)
= Frame size / Bandwidth
= 1 KB / (128 x 103 bits per sec)
= (1 x 210 x 8 bits) / (128 x 103 bits per sec)
= 64 msec
Calculating Value of ‘a’-
a = T p / Tt
a = 150 msec / 64 msec
a = 2.34

Calculating Optimal Sender Window Size-


Optimal sender window size
= 1 + 2a
= 1 + 2 x 2.34
= ⌈5.68⌉
=6

Calculating Number Of Sequence Numbers Required-


In SR Protocol, sender window size and receiver window size are same.
So, sender window size = receiver window size = 6
For any sliding window protocol, minimum number of sequence numbers required
= Sender window size + Receiver window size
=6+6
Min bits required in seq number field-
⌈ log2 (12) ⌉
= ⌈ 3.585⌉
=4

Link for more problems on Go Back N:


1. https://www.gatevidyalay.com/go-back-n-practice-problems/

You might also like