Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 19

Sliding Window Protocols

1
Sliding Window Protocols

• A One-Bit Sliding Window Protocol


• A Protocol Using Go Back N
• A Protocol Using Selective Repeat

2
Sliding Window Protocol
Full Duplex data transmission

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.
In this model the data frames from A to B are intermixed with the
acknowledgement frames from A to B.

By looking at the kind field in the header of an incoming frame, the receiver
can tell whether the frame is data or acknowledgement.
3
Sliding Window Protocol
Piggybacking
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. 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.

4
Sliding Window Protocols (2)

A sliding window of size 1, with a 3-bit sequence number.


(a) Initially.
(b) After the first frame has been sent.
(c) After the first frame has been received.
(d) After the first acknowledgement has been received.
5
A One-Bit Sliding Window Protocol

6
Continued 
A One-Bit Sliding Window Protocol (ctd.)

7
A One-Bit Sliding Window Protocol (2)

Two scenarios for protocol 4. (a) Normal case. (b) Abnormal


case. The notation is (seq, ack, packet number). An asterisk
indicates where a network layer accepts a packet.
8
A Protocol Using Go Back N

Pipelining and error recovery. Effect on an error when


(a) Receiver’s window size is 1.
(b) Receiver’s window size is large. 9
Sliding
Window
Protocol
Using Go
Back N

10
Continued 
Sliding Window Protocol Using Go Back N

11
Continued 
Sliding Window Protocol Using Go Back N

12
Continued 
Sliding Window Protocol Using Go Back N

13
Sliding Window Protocol Using Go Back N (2)

Simulation of multiple timers in software.


14
A Sliding Window Protocol Using Selective Repeat

15
Continued 
A Sliding Window Protocol Using Selective Repeat (2)

16
Continued 
A Sliding Window Protocol Using Selective Repeat (3)

17
Continued 
A Sliding Window Protocol Using Selective Repeat (4)

18
A Sliding Window Protocol Using Selective Repeat (5)

(a) Initial situation with a window size seven.


(b) After seven frames sent and received, but not acknowledged.
(c) Initial situation with a window size of four.
(d) After four frames sent and received, but not acknowledged.
19

You might also like