0% found this document useful (0 votes)
268 views15 pages

Sliding Window Protocol

Uploaded by

deekshithauppu41
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)
268 views15 pages

Sliding Window Protocol

Uploaded by

deekshithauppu41
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
You are on page 1/ 15

MALLA REDDY INSTITUTE OF TECHNOLOGY AND SCIENCE

An UGC Autonomous Institution


Approved by AICTE New Delhi and Affiliated to JNTU EAMCET
Code: MRIT
An ISO 9001: 2015 Certified Institution
JNTUH Code:
Accredited by NBA and NAAC ‘A’ Grade S1
Maisammaguda , Medchal (Dist), Hyderabad -500100,
Telangana.
Email : [email protected], www.mrits.ac.in

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Sliding window protocols

Presented by:
Uppu Deekshitha
22S11A0508
Key contexts:
• Introduction
• Key concepts
• Types
• Working of different protocols
Introduction:
• Sliding window protocols are used where Reliable In order delivery of packets is
required, & such as in the Data Link Layer (OSI model) in the Transmission Control
Protocol(TCP).

• This technique places varying limits on the number of data packets that are sent
before waiting for an acknowledgment signal back from the receiving computer.

• The number of data packets is called the window size. In this technique, each
frame has sent from the sequence number. The sequence numbers
are used to find the missing data in the receiver end.

• The purpose of the sliding window technique is to avoid duplicate


data, so it uses the sequence number.
Key concepts of Sliding window
protocol:
 Both the sender and receiver maintain a finite size buffer to hold outgoing and
incoming packets from the other side.

 Every packet sent by the sender, must be acknowledged by the receiver. The sender
maintains a timer for every packet sent, and any packet unacknowledged in a certain
time, is resent.

 The sender may send a whole window of packets before receiving an


acknowledgement for the first packet in the window. This results in higher transfer
rates, as the sender may send multiple packets without waiting for each packet's
acknowledgement.

 The Receiver advertises a window size that tells the sender how much data it can
receive, in order for the sender not to fill up the receivers buffers.

 Efficiency can also be improved by making use of the full-duplex line.


Types:
• Sliding window protocols are classified as:
1. A one-bit sliding window protocol

2. A protocol using Go-Back-N

3. A protocol using Selective Repeat


A one-bit sliding window protocol:
• In one – bit sliding window protocol, the size of the window is 1.

• So the sender transmits a frame, waits for its acknowledgment, then transmits the next
frame.

• Thus it uses the concept of stop and waits for the protocol. This protocol provides for full
duplex communications.

• Hence, the acknowledgment is attached along with the next data frame to be sent by
piggybacking.

Piggybacking is the technique of delaying outgoing acknowledgment


and attaching it to the next data packet.
Working Principle:

• The data frames to be transmitted additionally have an acknowledgment


field, ack field that is of a few bits length.

• The ack field contains the sequence number of the last frame received
without error.

• If this sequence number matches with the sequence number of the frame
to be sent, then it is inferred that there is no error and the frame is
transmitted.

• Otherwise, it is inferred that there is an error in the frame and the


previous frame is retransmitted.
Example:
• The following diagram depicts a scenario with sequence numbers 0, 1, 2, 3, 0, 1, 2 and so on.

• It depicts the sliding windows in the sending and the receiving stations during frame
transmission.

• A one-bit sliding window protocol : Example


A protocol using Go-Back-N
• In Go-Back-N ARQ protocol, if one frame is lost or damaged, then it retransmits all the frames
after which it does not receive the positive ACK.

• It is a case of sliding window protocol having to send window size of N and receiving window size
of 1.

Working Principle:

• Go – Back – N ARQ provides for sending multiple frames before receiving the acknowledgment for
the first frame. The frames are sequentially numbered and a finite number of frames.

• The maximum number of frames that can be sent depends upon the size of the sending window.

• If the acknowledgment of a frame is not received within an agreed upon time period, all frames
starting from that frame are retransmitted.
• 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 2 n−1. Thus in order to accommodate a sending window
size of 2n−1, a n-bit sequence number is chosen.

• The sequence numbers are numbered as modulo-n. For example, if the sending window size is 4, then the
sequence numbers will be 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, and so on. The number of bits in the sequence number
is 2 to generate the binary sequence 00, 01, 10, 11.

• The size of the receiving window is 1.


• In the figure, three frames have been
transmitted before an error discovered in
the third frame.

• In this case, ACK 2 has been returned


telling that the frames 0,1 have been
received successfully without any error.

• The receiver discovers the error in data 2


frame, so it returns the NAK 2 frame.

• The frame 3 is also discarded as it is


transmitted after the damaged frame.
Therefore, the sender retransmits the
frames 2,3.
A protocol using Selective Repeat

• Selective-Repeat ARQ technique is more efficient than Go-Back-n ARQ.

• In this technique, only those frames are retransmitted for which negative acknowledgement
(NAK) has been received.

• The receiver storage buffer keeps all the damaged frames.

• The sender provide searching mechanism that selects only the requested frame for
retransmission.

• Selective repeat protocol, also called Selective Repeat ARQ (Automatic Repeat request), is a
data link layer protocol that uses sliding window method for reliable delivery of data frames.
Here, only the erroneous or lost frames are retransmitted.

• It uses two windows of equal size: a sending window that stores the frames to be sent and a
receiving window that stores the frames receive by the receiver.
Working Principle:

• Selective Repeat protocol provides for sending multiple frames depending upon the availability
of frames in the sending window, even if it does not receive acknowledgement for any frame.

• The maximum number of frames that can be sent depends upon the size of the sending
window.

• The sender continues to send frames from sending window. Once, it has sent all the frames
from the window, it retransmits the frame whose sequence number is given by the Negative
acknowledgements.

• The receiver records the sequence number of the earliest incorrect or un-received frame. It
sends the sequence number of the missing frame along with every acknowledgement frame.

You might also like