/*Google Adsense */
Showing posts with label Sliding Window Protocols. Show all posts
Showing posts with label Sliding Window Protocols. Show all posts

Selective Repeat Sliding Window Protocol

Another strategy is to re-send only ones that are actually lost or damaged. The receiver buffers all the frames after that lost one. When the sender finally noticed the problem (e.g. no ack for the lost frame is received within time-out limit), the sender retransmits the frame in question.

Main Window
The main window can be subdivided roughly into four areas:

  1. Sender - The representation assumes that the implementation of the Sliding-Window protocol takes place on Stack n. Layer n+1 represents the "data-supplier" for the protocol. It is represented through the text-input-field. One can hand over individual data-packages with "Step" button. So that the animation speed can be adjusted by clicking on it with the right mouse button one can choose the protocol to be simulated.

  1. Receiver - It is similar to the sender. The only difference is that the step button here controls the data transfer from the layer n+1 to the layer n. The received Packets is presented in the input text field. By clicking on it with the right mouse button one can choose the protocol to be simulated.

  1. Channel - Represent the network channel. By clicking on it with the right mouse button. One can simulate errors.

  1. History-Chart - One can adjust the number of messages to be displayed in this area.

Go-Back-n Sliding Window Protocol

In case of satellite communication, it takes 270 msec to transmit a frame and 520 msec is needed before the acknowledgement arrives. The solution here is the sender is allowed to send up to 'w' frames and the acknowledgment will arrive after the roundtrip time gets equal. The technique of allowing the sender to send the data and receiver acknowledging them parallel is called Pipelining.

If the channel capacity is b bits/sec and frame size 1 bits and the roundtrip propagation time R sec, the time required to transmit a single frame is 1/b sec. There is a delay of R/2 before the last bit arrives and another R/2 before acknowledgement arrives. The line utilization for the stop-and-wait is 1(1+bR). Pipelining has a serious drawback when one of the frames gets damaged in the middle. This could be overcome by the Go Back n protocol.

This approach is mainly used for dealing with errors when the frames are pipelined. The receiver simply discards all subsequent frames, sending no acknowledgments. Here the receiver window is of size 1. In other words, the data link layer refuses to accept any frame except the next one it must give to the network layer. If the sender's window fills up before the timer runs out, the pipeline will begin to empty. Eventually, the sender will time out and retransmit all unacknowledged frames in order, starting with damaged or lost one. This approach can waste a lot of bandwidth if the error rate is high.

One Bit Sliding Window Protcol

One bit sliding window protocol is also called Stop-And-Wait protocols. In this protocol, the sender sends out one frame, waits for acknowledgment before sending next frame, thus the name Stop-And-Wait.

Problem with Stop-And-Wait protocol is that it is very inefficient. At any one moment, only in frame is in transition. The sender will have to wait at least one round trip time before sending next. The waiting can be long for a slow network such as satellite link.

This protocol uses Stop-And-Wait, since the sender transmits a frame and waits for its acknowledgment before sending the next one. One of the two data link layers goes first. The starting machine fetches the first packet from its network layer, builds a frame from it and sends it. When this (or any ) frame arrives, the receiving data link layer checks to see if it is a duplicate. If the frame is the one expected, it is passed to the network layer and the receiver's window is slid up. The acknowledgement field contains the number of the last frame received without error. If this number agrees with the sequence number of the frame the sender is trying to send, the sender knows it is done with the frame stored in buffer and can fetch the next packet from its network layer. If the sequence number disagrees, it must continue trying to send the same frame. Whenever a frame is received, a frame is also sent back.

Introduction to Sliding Window Protocols

Sliding window is used by most connection oriented network protocols. In fact, TCP also uses sliding window. It assumes two -way communication (full duplex). It uses two types of frames:
  • Data
  • Ack (sequence number of last correctly received frame).

The basic data idea of sliding window protocol is that both sender and receiver keep a "window" of acknowledgment. The sender keeps the value of expected acknowledgment; while the receiver keeps the value of expected receiving frame. When it receives an acknowledgment from the receiver, the sender advances the window. When it receives the expected frame, the receiver advances the window.

The characteristics of sliding windows used at the sender and receiver usually involve

  • error correction (by retransmission)
  • flow control and
  • message ordering by sender (FIFO).

The latter property can easily be incorporated in a sliding window protocol, but sometimes, it is preferred to be implemented as a separate protocol for easier maintenance.