FLOW CONTROL IN DATA LINK LAYER
Flow Control at the Data Link Layer ensures smooth data transfer and prevents overload. In
Feedback-based Flow Control, the sender waits for acknowledgment before sending more data. In
Rate-based Flow Control, the sender slows down if the receiver is unable to hand the speed. Stop-
and-Wait sends one Frame at a time and waits for Acknowledgment, but is slow with high delays,
Sliding Window allows multiple Frames to be sent before waiting for Acknowledgment, thus
improving throughput but is more complex and causes Out Order Frames.
Approaches of Flow
• Feedback- based approach
• Rate-based flow approach
Stop-and-Wait Protocol
The Stop-and-Wait protocol is a fundamental Data Link Layer Protocol that is used for reliable
communication between two devices. In this protocol, the sender transmits one Frame and waits
for an Acknowledgment (ACK) from the receiver before sending the next Frame. This ensures
error detection and reliable data delivery but comes with specific pros and cons.
Advantages of Stop-and-Wait Protocol
• Easy to implement and understand with minimal resources.
• Ensures reliable data transfer by individually acknowledging each Frame.
• Lost or corrupted Frames are retransmitted through timeouts or Negati Acknowledgments
(NAK).
• Prevents the sender from overwhelming the receiver by waiting for Acknowledgmet before
proceeding.
• Low computational complexity as only one Frame is in transit at a time.
Disadvantages of Stop-and-Wait Protocol
• Leads to underutilization of network bandwidth, especially in High-Latency networks
• Only one Frame is sent at a time, thus causing idle time while waiting for Acknowledgment.
• Data transfer is slow due to waiting periods between Frames, with Round-Trip Time (RTT)
which impacts Throughput.
• Inefficient for large-scale systems or high-speed networks over long distances.
• Frequent retransmissions due to errors causes delays and reduces performance.
• The following are some problems that are associated with Stop-and-Wait protocol.
1. Problem due to lost data
If the sender’s data is lost, the receiver waits indefinitely for it. Since the receiver does not send
an Acknowledgment, the sender waits infinitely for Acknowledgment and does not send the next
Packet. This results in two problems:
▫ The sender waits indefinitely for an Acknowledgment
▫ The receiver waits indefinitely for the data
2. Problems due to Lost Acknowledgment
If the sender sends data and the receiver acknowledges it, but the Acknowledgment is lost, then
the sender waits indefinitely for the Acknowledgment and cannot send the next Packet. The
problem is that the sender waits indefinitely for the Acknowledgment.
3. Problem due to 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 it can be wrongly considered as the
Acknowledgment of some other data Packet.
Sliding Window Protocol
The Sliding Window Protocol improves efficiency of data transmission by allowing multiple
Packets to be sent without waiting for an Acknowledgment for each. It is commonly used in
protocols like TCP to ensure reliable communication, particularly over long distances or with
delays.
Key Terms Related to Sliding Window Protocol
1. Transmission Delay (Tt) : This is the time it takes to send a Packet from one device from one to
another. It depends on how fast the link is its bandwidth) and how big the Packet where D is the
data size and B is the Bandwidth.
Tt = D/B
2. Propagation Delay (Tp): This is the time it takes for the first Bit of data to travel from the sender
to the receiver. It depends on the distance and the speed at which the signals travel.
Tp = d/s
Where d is the distance and s is the speed of the signal.
3. Efficiency: Efficiency shows how well a system is utilizing its time to send useful data. In the
Stop-and-Wait Protocol, it is the ratio of useful time (data transmission) to total time (including
delays). The formula is:
𝑇𝑡
Efficiency (n) = 𝑇𝑡 + 2×𝑇𝑝
where: Tt = Transmission Time (time taken to send the data).
Tp= Propagation Delay (time taken for data to travel from sender to receiver).
4. Effective Bandwidth (EB) or Throughput: This measures how much data is successfully
transferred per second over the link. The higher the efficiency, the more data is transmitted in the
same amount of time.
The Effective Bandwidth (EB) or Throughput is given by the formula:
EB =
In terms of bits per second (bps):
𝑇𝑜𝑡𝑎𝑙𝐷𝑎𝑡𝑎(𝑏𝑖𝑡𝑠)
Throughput = 𝑇𝑜𝑡𝑎𝑙 𝑇𝑖𝑚𝑒 𝑇𝑎𝑘𝑒𝑛(sec 𝑜𝑛𝑑𝑠)
where RTT = 2 x Propagation Delay (Tp)
Effective Bandwidth takes into account both the available bandwidth and the efficiency of the
transmission process.
5. Capacity of the Link: Capacity is the maximum data a link can handle. In a Full can handle. In
a full Duplex channel, it equals double the bandwidth times the Propagation delay. The Sliding
Window Protocol improves efficiency by sending multiple packets without waiting for
Acknowledgments, preventing network overload. In contrast, the Stop-and-Wait Protocol sends
one packet at a time, causing inefficiency due to waiting time. Propagation Time (T_{p}) : The
time taken for the Packet to travel from the sender to
How Efficiency is Affected
• Transmission Time (Tt): The time taken to send a Packet.
• Propagation Time (Tp): The Time taken for the packet to travel from the sender to the
[Link] the
Total Cycle = Time Transmission Time + 2 x Propagation Time
This is the time taken to send a Packet and wait for its Acknowledgment.
Types of Sliding Window Protocol
Sliding Window Protocol is a method that is used in networking to efficiently send multiple
Packets of data. It ensures reliable delivery by sending Packets in a specific order and waiting for
Acknowledgments. There are two main types of Sliding Window Protocol:
Go Back N ARQ: Go Back N ARQ is an Error Control protocol under the Sliding Window
Protocol, which allows multiple Frames to be sent before waiting for an acknowledgment. Stop-
and-Wait is a separate Flow Control protocol that does not use a window mechanism.
Go Back N ARQ is a Sliding Window Protocol that allows multiple Frames to be sent together.
Pipelining is used in Go Back N ARQ, which means a Frame can be sent before receiving
Acknowledgment for the previous one.
Sender and Receiver Windows in Go-Back-N ARQ Protocol
The Sender Window is a fixed-sized window that defines the number of Frames that are
transmitted from the sender to the receiver at once. The integer 'N' in the Go Back 'N' is the Frame
size.
For example, in Go Back 4 ARQ, the size of the Sender Window is 4.
The Receiver window in the Go Back N ARQ protocol is always 1. This means that at most the
receiver takes 1 Frame at a single time.
Working of Go-Back-N ARQ Protocol
Below are the steps to clearly explain how the Go-Back-N ARQ algorithm works:
1. Data Packets are divided into multiple Frames. Each Frame contains information about the
destination address, and the error control mechanism it follows, etc. These multiple Frames are
numbered so that they can be distinguished from each other.
2. The integer 'N' in Go-Back-N ARQ tells us the size of the window, i.e. the number of
unacknowledged frames that are sent at once from the sender to the receiver. Suppose the window
size 'N' is equal to 4, then, 4 Frames (Frame 0, Frame 1, Frame 2, and Frame 3) will be first sent
from the sender to the receiver.
3. The receiver sends the acknowledgment of Frame 0. Then the Sliding Window moves by 1 and
Frame 4 is sent.
4. The receiver sends the Acknowledgment for Frame 1. Then the Sliding Winder moves by 1 and
Frame 3 is sent.
5. The sender waits for the Acknowledgment for a fixed amount of time. If the sender does not get
the Acknowledgment for a Frame in that time, it considers that the Frame is corrupted. Then the
Sliding Window moves to the start of the corrupted Frame and all the Frames in the window are
retransmitted.
For example, if the sender does not receive the Acknowledgment for Frame 2, it retransmits all the
Frames in the windows i.e. Frames (2, 3, 4, 5).
Characteristics of Go-Back-N ARQ
1. The size of the Sender Window in Go-Back-N ARQ is equal to N.
2. The size of the Receiver Window in Go-Back-N ARQ is 1, meaning it can store only the
next expected frame.
3. When the Acknowledgment for one Frame is not received by the sender or the Frames
received by the receiver are out of order, then the whole window starting from the corrupted
Frame is retransmitted.
Go-Back-N ARQ follows the principle of pipelining, meaning the sender can transmit multiple
frames before receiving acknowledgments, but it must retransmit all frames from an error onward
if an acknowledgment is missing.
Advantages of Go-Back-N ARQ
1. It can send multiple Frames at once.
2. Pipelining is present in the Go-Back-N ARQ i.e. a Frame can be sent by the sender before
receiving the Acknowledgment of the previously sent Frame. This results in shorter waiting
time for the Frame.
3. It handles corrupted as well as out-of-order Frames which result in minimal Frame loss
Disadvantages of Go-Back-N ARQ
1. If Acknowledgment for a Frame is not received, the whole window of Frames is
retransmitted instead of just the corrupted Frame. This makes the Go-Back-N ARQ
protocol inefficient.
2. Retransmission of all the Frames on detecting a corrupted Frame increases channel
congestion and also increases the bandwidth requirement.
3. It is more time-consuming because while retransmitting the Frames on detecting a
corrupted Frame, the error-free Frames are also transmitted.
Selective Repeat ARQ
Selective Repeat ARQ, a Sliding Window Protocol, ensures reliable, in-order data delivery
particularly in noisy channels. It retransmits only damaged or lost Frames, while correctly received
Frames are buffered. ARQ uses ACK for Acknowledgment and Negative Acknowledgment
(NACK) for lost Frames. Each Frame has a timer; if no ACK is received, the sender retransmits
the Frame. In Selective Repeat ARQ, the sender and receiver have the same maximum window
size of 2 where m is the number of bits allocated for sequence numbers. The process involves
sending Frames, receiving ACKs, detecting lost Frames with NACKs, and retransmitting only
those Frames for efficient transmission.
Advantages of Sliding Window Protocol
1. The sender sends multiple Packets without waiting, which improves speed and network
usage.
2. Data is sent safely, as the receiver confirms each Packet. This prevents loss or errors.
3. It can work with various network types like wireless, Ethernet, or the internet.
4. The protocol adjusts the number of Packets sent based on network conditions, thus helping
to avoid overloading the network.
Disadvantages of Sliding Window Protocol
1. It requires more memory and processing power to keep track of which Packets were sent,
Acknowledged, or need resending.
2. There can be delays, as the sender waits for Acknowledgment before sending more Packets.
3. On high-speed networks, the sliding window protocol may not fully utilize the available
bandwidth due to waiting for acknowledgments, especially with small window sizes.
4. The sender’s limit on how many Packets can be sent depends on the receiver’s capacity
and network resources.
Question: Consider the use of 10 K-Bit size Frames on a 10 Mbps satellite channel with
270 ms delay. What is the link utilization for Stop-and-Wait ARQ technique assuming?
Solution: To calculate the link utilization for the Stop-and-Wait ARQ technique, we use the
formula:
Link Utilization =
Given Data:
Frame size (L) 10Kbits 10x 103 bits
Chanel capacity ® = 10 Mbps = 10 x 106 bits per second
Propagation delay (T_prop) = 270 ms = 0.270 seconds
Error probability (P) = 10-6
Steps to calculate:
1. Frame transmission Time (T_frame): The time to send one frame can be calculated using:
T_frame = Frame size / Channel capacity
T_frame = 10 x 103/ 10 x 106 = 0.001 seconds = 1 ms
2. Round-Trip Time (T_RTT): The round-trip time includes the propagation delay in both
directions: T_RTT = 2xT_prop
= 2 x 0.270 seconds
= 0.540 seconds
3. Link Utilization for stop-and-wait ARO: For Stop-and-Wait ARQ. The link utilization is
affected by the error probability P. Which determines the retransmission time. The
retransmission time is P x T_frame, and the utilization formula becomes:
Link Utilization = T_frame /T_frame + T_RTT + P x T_frame
Substituting the values:
Link Utilization = 0.001 / 0.001 + 0.540 + (103 x 0.001)
Link Utilization = 0.001 / 0.001+0.540+0.000001
Link Utilization = 0.001 / 0.541001
Link Utilization ~ 0.00185
The link utilization for the Stop-and-Walt ARO technique in this case is approximatel 0.00185
or 0.185%.
This shows that with a high propagation delay and a low error probability, the Stop-an/Wait ARQ
protocol has poor link utilization, making it inefficient for long-delay networks like satellite
communication
Question: A channel has a Bit rate of 20 kbps. The Stop-and-Wait protocol with Frame size
4500 Bits is used. The delay for error detection and sending ACK by the receiver is 0.25
seconds because of a fault. Find the maximum efficiency of the channel if the destination is
30000 km away and the speed of propagation of the signal is 2.8 x 108 m/s. Find the decrease
in efficiency due to the fault.
Solution: Let’s solve the problem step by step:
Given:
Bit rate = 20Kbps = 20,000 bps
Frame size = 4500 bits
Round-Trip propagation delay (RTT):
➤ Distance = 30,000 km = 30,000 × 103
➤ Propagation speed = 2.8 x 108 m/s
Fault-induced delay = 0.25 seconds
Step 1: Calculate the one-way propagation delay
Propagation delay (t_prop) is the time it takes for a signal to travel from the sender to receiver:
t_prop = Distance/ Propagation speed
= 30,000 x 103 / 2.8x108
= 0.1071 seconds
Step 2: Calculate the transmission time for a frame
Transmission time (t_trans) is the time it takes to send a frame over the channel:
Ttrans = Frame size / Bit rate
= 4500 bits / 20.000 bps
= 0.225 seconds
Step 3: Calculate the total round-trip time (RTT)
The round-trip time (RTT) is the time it takes for the frame to travel from sender to receive and
for the acknowledgment (ACK) to return:
RTT = 2x tprop + tack
Where:
tack is the time for error detection and sending the ACK (given as 0.25 seconds)
So, the RTT becomes:
RTT = 2 x 0.1071 seconds + 0.25 seconds
= 0.4642 seconds
Step 4: Calculate the efficiency of the stop-and-wait protocol
Efficiency (n) of the stop-and-wait protocol is given by the formula:
η = Ttrans / Ttrans + RTT
Substitute the values: η = 0.225 / 0.225 + 0.4642
= 0.0225 / 0.6892
Thus, the maximum efficiency of the channel considering only the round-trip time (RTT) without
the additional fault delay is approximately 32.6%.
Step 5: Calculate the efficiency with the fault
Now, to calculate the decrease in efficiency due to the fault, we use the following:
ηfault = t_trans / t_trans + RTT + Fault delay
Where: Fault delay = 0.25 seconds
ηfault = 0.225 / 0.225 +0.4642+0.25
= 0.239 / 0.9392 = 0.239
Thus, the channel efficiency when considering both RTT and the additional fault delay is
approximately 23.9%.
Step 6: Decrease in efficiency due to he fault
The decrease in efficiency due to the fault is:
Decrease in efficiency = η - ηfault
= 0.326-0.239
= 0.087 or 8.7%
Final Answer:
• The maximum efficiency of the channel is 32.6% without the fault.
• The efficiency with the fault is 23.9%.
• The decrease in efficiency due to he fault is 8.7%.
Question: Calculate the total number of transmissions that are required to send 10 data
Packets through GBN-3 where every 5th Packet is lost.
Solution:
Given:
Total number of Packets = 10
Every 5th Packet is lost (i.e., Packets 5, 10, etc., are lost).
Go-Back-N-3 means the sender can send up to 3 Packets before waiting for Acknowledgment.
Step-by-step Solution:
1. First Transmission:
The sender sends Packets 1, 2, and 3. All 3 Packets are successfully Acknowledged. Total
transmissions so far = 3
2. Second Transmission:
The sender sends Packets 4, 5, and 6.
Packet 5 is lost, so the receiver will not Acknowledge Packet 5. The sender will retransmit Packet
5 and all subsequent Packets. Total transmissions so far = 3+3=6
3. Third Transmission:
The sender retransmits Packets 5, 6, 7, 8, 9, and 10. Total transmissions so far = 6+ 6-12 Packet
10 is lost, so the sender will retransmit Packet 10.
4. Fourth Transmission:
The sender retransmits Packet 10. Total transmissions so far 12 + 1 = 13
Total Number of Transmissions: First transmission: 3 Packets (1, 2, 3), Second transmission: 3
Packets (4. 5. 6). Third transmission: 6. Packets (5. 6. 7. 8. 9. 10). Fourth transmission: 1 Packet
(10)
Total Transmissions 3+3+6+1 = 13 Transmissions.
Thus, the total number of transmissions required to send 10 data Packets through Go-Back-N-3,
where every 5th packet is lost, is 13 Transmissions.