Class 6
Class 6
24, 1A, Chandi Ghosh Rd, Ashok Nagar, Tollygunge, Kolkata, West Bengal 700040
Dept.: - Computer Science and Engineering
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. In data link layer,
flow control restricts the number of frames the sender can send before it waits for an
acknowledgment from the receiver. Approaches of Flow Control can be broadly classified
into two categories:
Feedback based Flow Control: In these protocols, the sender sends frames after it
has received acknowledgments from the user. This is used in the data link layer.
Rate based Flow Control: These protocols have built in mechanisms to restrict the
rate of transmission of data without requiring acknowledgment from the receiver. This
is used in the network layer and the transport layer.
Flow Control Techniques in Data Link Layer: Data link layer uses feedback based flow
control mechanisms. There are three main techniques:
1. Stop-and-Wait Protocol.
2. Go-Back-N ARQ.
3. Selective Protocol.
35 | P a g e
Calcutta Institute of Engineering and Management
24, 1A, Chandi Ghosh Rd, Ashok Nagar, Tollygunge, Kolkata, West Bengal 700040
Dept.: - Computer Science and Engineering
Characteristics of Stop-and-Waait
Used in Connection
Connection-oriented
communication.
It offers error and flow control.
It is used in Data Link and Transport Layers
Stop and Wait for ARQ mainly implements the Sliding Window Protocol concept
with Window Size 1
It uses a link between sender and recei
receiver as a half-duplex link
Throughput = 1 Data packet/frame per RTT
If the bandwidth*Delay product is very high, then they stop and wait for protocol if it
is not so useful. The sender has to keep waiting for acknowledgments before sending
the processed next xt packet.
It is an example of “Closed Loop OR connection-oriented
connection “ protocols
It is a special category of SWP where its window size is 1
Irrespective of the number of packets sender is having stop and wait for protocol
requires only 2 sequence numbers 0 and 1
Round Trip Time (RTT) = Amount of time taken by a packet to reach the receiver + Time
taken by the Acknowledgement to reach the sender
Time Out (TO) = 2* RTT
Time To Live (TTL) = 2* Time Out. (Maximum TTL is 255 seconds)
36 | P a g e
Calcutta Institute of Engineering and Management
24, 1A, Chandi Ghosh Rd, Ashok Nagar, Tollygunge, Kolkata, West Bengal 700040
Dept.: - Computer Science and Engineering
Go-Back-N ARQ: The Sliding Window Protocol is a method used in computer networks to
manage the flow of data between two devices, ensuring that data is sent and received in the
correct order. There are two types
of sliding window protocol Go-
Back-N (GBN), and Selective
Repeat (SR). In Go-Back-N, the
sender can send multiple data
packets without waiting for an
acknowledgement for each one.
However, it can only send a
certain number of packets (this is
called the “window size”). If one
packet is lost or not
acknowledged, the sender must
go back and resend that packet
and all the packets that followed
it, even if they were received correctly. For example, if packets 1, 2, 3, 4, and 5 are sent and
packet 3 gets lost, the sender will have to resend packets 3, 4, and 5, even if 4 and 5 were
received.
Sender Window Size (WR): It is N itself. If we say the protocol is GB10, then Ws = 10. N
should be always greater than 1 in order to implement pipelining. For N = 1, it reduces to the
Stop and Wait protocol.
𝑵 𝑻𝒑
𝐄𝐟𝐟𝐢𝐜𝐢𝐞𝐧𝐜𝐲 = , where 𝐚 =
(𝟏+𝟐𝒂) 𝑻𝒕
Receiver Window Size (WR): In the GB-N the receiver window size is one always. i.e. WR
is always 1 in GBN.
37 | P a g e
Calcutta Institute of Engineering and Management
24, 1A, Chandi Ghosh Rd, Ashok Nagar, Tollygunge, Kolkata, West Bengal 700040
Dept.: - Computer Science and Engineering
Selective Repeat ARQ: It is also known as Sliding Window Protocol and used for error
detection and control in the data link layer. In the selective repeat, the sender sends several
frames specified by a window size even without the need to wait for individual
acknowledgement
from the receiver as
in Go-Back
Back-N ARQ.
In selective repeat
protocol, the
retransmitted frame
is received out of
sequence. In
Selective Repeat
ARQ only the lost or
error frames are
retransmitted,
whereas correct
frames are received
and buffered. The receiver while keeping track of sequence numbers buffers the frames in
memory and sends NACK for only frames which aare re missing or damaged. The sender will
send/retransmit a packet for which NACK is received.
Explanation:
Step 1: Frame 0 sends from sender
nder to receiver and set timer.
Step 3: In the same way frame2 is also sent to the receiver by setting the timer without
waitingg for previous acknowledgement.
Step 5: whenever the sender receives the ACK1 from the receiver, within the frame 1 timer
then it is closed and sent
ent to the next frame, frame 4.
Step 6: If the sender doesn’t receive the ACK2 from the receiver within the time slot, it
declares timeout for frame 2 and resends the frame 2 again, because it thought the frame2
may be lost or damaged.
38 | P a g e
Calcutta Institute of Engineering and Management
24, 1A, Chandi Ghosh Rd, Ashok Nagar, Tollygunge, Kolkata, West Bengal 700040
Dept.: - Computer Science and Engineering
Sliding Window: This protocol improves the efficiency of stop and wait protocol by
allowing multiple frames to be transmitted before receiving an acknowledgment. The
working principle of this protocol can be described as follows:
Both the sender and the receiver has finite sized buffers called windows. The sender
and the receiver agrees upon the number of frames to be sent based upon the buffer
size.
The sender sends multiple frames in a sequence, without waiting for
acknowledgment. When its sending window is filled, it waits for acknowledgment.
On receiving acknowledgment, it advances the window and transmits the next frames,
according to the number of acknowledgments received.
Why Piggybacking??? Communications are mostly full – duplex in nature, i.e. data
transmission occurs in both
directions. A method to achieve full
– duplex communication is to
consider both the communication as
a pair of simplex communication.
Each link comprises a forward
channel for sending data and a
reverse channel for sending
acknowledgments. However, in the
above arrangement, traffic load
doubles for each data unit that is
transmitted. Half of all data
transmission comprise of
transmission of acknowledgments.
So, a solution that provides better
utilization of bandwidth is
piggybacking. Here, sending of acknowledgment is delayed until the next data frame is
available for transmission. The acknowledgment is then hooked onto the outgoing data frame.
The data frame consists of an ACK field. The size of the ACK field is only a few bits, while
an acknowledgment frame comprises of several bytes. Thus, a substantial gain is obtained in
reducing bandwidth requirement.
Working Principal: Suppose that there are two communication stations X and Y. The data
frames transmitted have an acknowledgment field, ACK field that is of a few bits length.
Additionally, there are frames for sending acknowledgments, ACK frames. The purpose is to
39 | P a g e
Calcutta Institute of Engineering and Management
24, 1A, Chandi Ghosh Rd, Ashok Nagar, Tollygunge, Kolkata, West Bengal 700040
Dept.: - Computer Science and Engineering
minimize the ACK frames. The three principles governing piggybacking when the station X
wants to communicate with station Y are:
If station X has both data and acknowledgment to send, it sends a data frame with the
ack field containing the sequence number of the frame to be acknowledged.
If station X has only an acknowledgment to send, it waits for a finite period of time to
see whether a data frame is available to be sent. If a data frame becomes available,
then it piggybacks the acknowledgment with it. Otherwise, it sends an ACK frame.
If station X has only a data frame to send, it adds the last acknowledgment with it.
The station Y discards all duplicate acknowledgments. Alternatively, station X may
send the data frame with the ack field containing a bit combination denoting no
acknowledgment.
40 | P a g e