A Web-Based Introduction to Computer Networks for Non-Majors

Reliable Data Transfer Protocols

A Laboratory


The Reliable Data Transfer applet and the accompanying notes (such as How do I use the applet? and An Explanation of Reliable Data Transfer Protocols ) can be used as the basis of a series of laboratory experiments as shown below. Some of the experiments have questions to supplement the explanation.

Experiment One: Stop-and-Wait Protocol with No Loss

A family of protocols are used for ensuring reliable data transfer in computer networks. The same family is used at multiple protocol layers including the application layer, the transport layer, and the data link layer. Our discussion is motivated by how this family of protocols are used at the transport layer in the Transmission Control Protocol (TCP) which is the transport layer protocol used in the Internet when reliable data transfer is needed. This family of protocols are investigated in this laboratory by a series of experiments starting with the simplest case and then continuing to increasingly more complex cases.

This first experiment explores the simplest of this family of protocols, called the stop-and-wait protocol, and the simplest scenario which is that there are no losses.

In the applet among the protocol choices select the Stop-and-Wait radio button. Among the scenario choices select the No Loss radio button. Click the Start button and watch the simulation. A single data packet with the number one on it will leave the sender and reach the receiver. An acknowledgement packet, also with the number one on it, goes from the receiver to the sender as soon as the data packet arrives at the receiver. Both of these packets are moving diagonally because time is progressing to the right. When the acknowledgement reaches the sender, the sender sends another data packet which has the number two on it.

This simulation illustrates that a key aspect of these protocols is the idea that the receiver sends an acknowledgement if it receives a data packet that is not corrupted and is the packet the receiver is expecting. In this case, the acknowledgement has the same number as the data packet so that the sender knows which data packet the receiver is acknowledging. In the stop-and-wait protocol the sender stops and waits until the acknowledgement for the current outstanding packet arrives before sending the next packet. Thus, there is always at most one outstanding data packet.

  1. Observe that the sender is idle (waiting for the arrival of the acknowledgement for large fraction of the time). The percentage of the time that the sender is active is much less than one hundred percent.
  2. Observe that in the top of the animation area a line shows the time since the data packet left the sender. Notice that the timer line does not reach its end before the acknowledgement reaches the sender.

Experiment Two: Stop-and-Wait Protocol and Lost Data Packet

Repeat experiment one except select the Lost Data radio button.

  1. What is different about the simulation this time? Why does the receiver not send an acknowledgement? How is the timer at the top of the animation area involved?

Experiment Three: Stop-and-Wait Protocol and Lost Acknowledgement

Repeat experiment two except select the Lost ACK radio button.

  1. What is different about the simulation this time? Why does the receiver send an acknowledgement this time unlike in experiment two? How is the timer at the top of the animation area involved?

Experiment Four: Pipelined Protocol

As noted above, the stop-and-wait protocol does not have good utilization in many situations. The sender spends much of its time waiting instead of transmitting packets. The solution is pipelining which means that the sender can transmit another packet even when the acknowledgement for the previous packet has not yet arrived. Thus, there may be multiple outstanding data packets. This experiment illustrates the simplest case for a pipelined protocol: when there are no losses. Select the Pipelined radio button and the No Loss radio button and then click the Start button.

  1. Observe that the time to complete sending three data packets (including the acknowledgements reaching the sender) is much less than the time it would have taken with the stop-and-wait protocol. Observe that there is a timer in the top of the animation area for each outstanding packet. Observe that the acknowledgement reaches the sender before the corresponding timer expires (that is, times out) for every data packet and that timer than is cancelled and disappears.

Experiment Five: Pipelined Protocol (Selective Repeat) and Lost Data Packet

There are two main approaches for how Pipelined reliable data transfer protocols handle losses. This applet illustrates the Selective Repeat approach. Repeat experiment four except select the Lost Data radio button. Which of the three data packets initially transmitted is lost is randomly chosen on each simulation. Consequently, you will want to repeat this experiment to see the differences in what happens depending on which data packet is lost.

  1. What is different about the simulation this time? What does the receiver do about sending acknowledgements? How are the timers at the top of the animation area involved?

Experiment Six: Pipelined Protocol (Selective Repeat) and Lost Acknowledgement

Repeat experiment four except select the Lost Data radio button. The first acknowledgement is always the one that is lost in the simulation.

  1. What is different about the simulation this time? What does the receiver do about sending acknowledgements? How are the timers at the top of the animation area involved?

Experiment Seven: Bandwidth, Packet Size, and

All of the above experiments assumed default values for the link bandwidth, the packet size, and the one way delay. The one way propagation delay is determined by the link length and the propagation speed of the media.

  1. Select one of the above experiments and repeat but with a different link bandwidth. How does the change in the bandwidth change the appearance of the packet? How does the change in the bandwidth change the simulation in general?
  2. Select one of the above experiments and repeat but with a different packet size. How does the change in the packet size change the appearance of the packet? How does the change in the packet size change the simulation in general?
  3. Select one of the above experiments and repeat but with a different one way delay. How does the change in the one way delay change the appearance of the packet? Do you notice any changes in the speed at which the packets move? Do you notice any changes in the speed at which the timers advance? Is there a connection between those two speeds? How does the change in the one way delay change the simulation in general?
  4. The applet does not support changing the duration of a timeout period relative to the duration of the one way propagation delay. If the applet were to allow the timeout period to be shorter relative to the one way delay, how would that affect the protocol behavior? If the applet were to allow the timeout period to be longer relative to the one way delay, how would that affect the protocol behavior?