Python Go-Back-N Application

I was required to implement a Go-Back-N protocol application as one of my projects for my CSC 573 – Networking course.

For this project, we implemented the Go-back-N automatic repeat request (ARQ) scheme for my CSC 573 – Networking course. My partner and I first implemented the protocol in Python. We then carried out 3 experiments to  evaluate the performance of our implementation. During the development process, we gained a fundamental understanding of layer 4 services such as encapsulating application data in to transport layer segments, buffering and managing data received from and to the application, managing the window size at the sender, computing checksums, and using the python UDP socket interface. We were separated by 2 hops on our own machines on the university network. We used a timeout of 100 milliseconds to simulate the propagation delay.

Task 1: Effect of Window Size N

For this task, we sought to determine the effect the window size (N) had on the average delay of the transmissions. We set the parameters of the program to the settings below. We then varied the value of the window size N using values 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, and 1024. We completed 5 transmissions for each value of N.

The following parameters were used for this task:

table
The graph below plots the average transfer time against N. In this graph, values of window size are plotted on the x-axis on a logarithmic scale of base 2. For example, a value of 4 on the x-axis translates to a window size of 16 (24= 16).

table2

Figure 1: Transfer Time (seconds) vs. Window Size (N) (log scale) using Go-back-N

In the Go-back-N protocol, a small window size leads to wasted time in retransmitting packets due to timeouts. A large window size, on the other hand, leads to time-intensive error recovery problems. If a segment is lost, for example, all of the following segments are also treated as lost. Therefore, a window size somewhere in the middle is best. This can be seen in our graph.

Task 2: Effect of MSS

For this task, we sought to determine the effect the MSS had on the average delay of the transmissions. We varied the MSS from 100 bytes to 1000 bytes in increments of 100 bytes. We completed 5 transmissions for each value of MSS.

The following parameters were used for this task:

table3

table4

Figure 2: Transfer Time (seconds) vs. Maximum Segment Size (MSS) using Go-back-N

This graph is quite easy to interpret. In Go-back-N, as MSS is increased, the average delay decreases. This is an exponential decay, so the returns are diminishing. This, of course, is highly dependent on the bandwidth of the network. A larger MSS only makes sense if the bandwidth can support it efficiently. For example, a smaller segment size in a network with a large bandwidth would be an inefficient utilization of bandwidth resulting in a higher transfer time relative to a larger segment size.

Task 3: Effect of Loss Probability p

For this task, we sought to determine the effect of the loss of probability, p, on the average transfer time. We varied the probability values from 0.01 to 0.10 in increments of 0.01. We completed 5 transmissions for each value of p.

The following parameters were used for this task:

table5

table6

Figure 3: Transfer Time (seconds) vs Probability (p) using Go-back-N

Figure 3 shows the linear relationship between probability and transfer time. As probability increases, so does transfer time. This is what we expect with a protocol like Go-back-N. If the rate at which an error occurs increases, then the time needed to retransmit the lost packets must also increase.

The full Python code for the application can be seen here: https://github.com/adamgillfillan/go-back-n

Leave a Reply

Your email address will not be published.