LAB: Sliding Window Protocols


Introduction

The previous lab exercise was about simulation of basic stop-and-wait protocols for reliable data transfer (link). In this lab, we will incrementally develop, simulate and explore two protocols for pipelined data transfer: the Go-Back-N protocol and the Selective Repeat protocol as described in Section 3.4 of the textbook “Computer Networks: A top-down approach” by Kurose and Ross (6th ed).

Video Tutorial

Requirements

  • Python3 (version >3.2)

  • SimPy (version >=3.0.10) for Python3.

  • This lab assumes familiarity with the previous lab on basic stop-and-wait protocols for reliable data transfer. It uses a slightly modified version of the template from the previous lab.

Template

You are provided with a simulation model for the Go-Back-N protocol which consists of the following Python files:

  • Download all of the following files into a single folder:

  • Check if the simulation works by running the command $ python3 Testbench.py

  • To understand the models, it is suggested to go through the code in the same order as the list above.

Problem Statement

Download the problem statement and instructions for the lab exercise here (pdf).


A Note on Channel Utilization

When a packet is being transmitted, the channel remains busy for some amount time equal to the “transmission_delay” for the packet. After it has been transmitted, the packet reaches the other end after “propagation delay” amount of time. In the simulation model, the propagation delay has been modeled in the behavior but the transmission delay is taken into account only for calculating the total channel utilization. We haven't really modelled the behavior where the channel remains “busy” for transmission_delay amount of time and no new packet can be transmitted while the channel is busy. This is a rough approximation and has been done to keep the model simple and easy to understand, closely resembling the simple FSM description in the number of states. The state machine would have been much more complex otherwise, requiring us to introduce several new states when the channel is busy, and to also define the actions when some events happen while the channel is busy.

Thus, the model closely matches reality when the channel utilization is less than 100% and at other times it helps us detect when there is over-utilization so that we can adjust the protocol parameters accordingly. So, for the optimization problem in the lab exercise, you should choose parameter values such that the channel utilization is below 100%. In q3(a), You may ignore the impact of transmission time into the calculation of the total time to transmit 1000 packets (T), as this may not be a large component when the utilization is small.