Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Sliding Window Protocols

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Sliding Window Protocols:

• In the previous protocols, data frames were transmitted in one direction only. In most
practical situations, there is a need for transmitting data in both directions. • One way of
achieving full-duplex data transmission is to have two separate communication channels and
use each one for simplex data traffic (in different directions). • If this is done, we have two
separate physical circuits, each with a ''forward'' channel (for data) and a ''reverse'' channel
(for acknowledgements).
• In both cases the bandwidth of the reverse channel is almost entirely wasted. • In effect, the
user is paying for two circuits but using only the capacity of one. • A better idea is to use the
same circuit for data in both directions.
• Although interleaving data and control frames on the same circuit is an improvement over
having two separate physical circuits, yet another improvement is possible. • When a data
frame arrives, instead of immediately sending a separate control frame, the receiver restrains
itself and waits until the network layer passes it the next packet (this is possible only when
both parties mutually transfer data).

• The acknowledgement is attached to the outgoing data frame (using the ack field in the
frame header). • In effect, the acknowledgement gets a free ride on the next outgoing data
frame. • The technique of temporarily delaying outgoing acknowledgements so that they can
be hooked onto the next outgoing data frame is known as piggybacking.
• The principal advantage of using piggybacking over having distinct acknowledgement
frames is a better use of the available channel bandwidth. • Other advantage is ack field in
the frame header costs only a few bits, whereas a separate frame would need a header, the
acknowledgement, and a checksum.

• However, piggybacking introduces a complication not present with separate


acknowledgements. How long should the data link layer wait for a packet onto which to
piggyback the acknowledgement?  If the data link layer waits longer than the sender's
timeout period, what happens??? The frame will be retransmitted.
• A solution to the above problem is: waiting a fixed number of milliseconds. • If a new
packet arrives quickly, the acknowledgement is piggybacked onto it otherwise, if no new
packet has arrived by the end of this time period, the data link layer just sends a separate
acknowledgement frame.
• Three protocols have been proposed to overcome the above mentioned problems. • These
three protocols are bidirectional protocols that belong to a class called sliding window
protocols. • In all sliding window protocols, each outbound frame contains a sequence
number, ranging from 0 up to some maximum. The maximum is usually 2 N-1.
• The essence of all sliding window protocols is that at any instant of time, the sender
maintains a set of sequence numbers corresponding to frames it is permitted to send. • These
frames are said to fall within the sending (sender) window. • Similarly, the receiver also
maintains a receiving (receiver) window corresponding to the set of frames it is permitted to
accept.
• In sliding window method of flow control, the sender can transmit several frames before
needing an acknowledgement. • The receiver acknowledges only some of the frames, using a
single ACK to conform the receipt of multiple data frames. • The sliding window refers to
imaginary boxes at both the sender and receiver. School of Computing Science and
Engineering Course Code : BCSE2370 Course Name: Data Communication and networking
Name of the Faculty: Ms. Heena Khera Program Name: BTech
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Sliding Window
• To keep track of which frame has been transmitted and received , frames are numbered
modulo- n , which means they are numbered from 0 to n-1. • For example if n=8, the frames
are numbered 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1….. • The size of the window is n-1.
• When the receiver sends an ACK, it includes the number of the next frame it expects to
receive. For example if the ending frame is 4, the receiver send an ACK containing the
number 5. • When the sender sees an ACK with the number 5, it knows that all frames up
through number 4 have been received.
• The three protocols are : 1. A One-Bit Sliding Window Protocol. 2. A Protocol Using Go
Back N. 3. A Protocol Using Selective Repeat.
One-Bit Sliding Window Protocol: • Before tackling the general case, let us first examine a
sliding window protocol with a maximum window size of 1. • Such a protocol uses stop-and-
wait since the sender transmits a frame and waits for its acknowledgement before sending
the next one. • Below protocol depicts the same(One-Bit Sliding Window Protocol).

You might also like