/Go-Back-N

Implementation of Go-Back-N protocol using C

Primary LanguageCApache License 2.0Apache-2.0

Go-Back-N

An implementation of Go-Back-N protocol.This is a teamwork with kennch. An article about interesting issues during our implementing process can be found here.

Feature

  • Cycler array is used to store packet window, making it compatible for transfering unlimited larget file.
  • Dynamically swtiching window size among 1,2, and 4 based on TIMEOUT event. When all ACKs received, switch to larger window size, but when there is ACK loss, slow down to size 1 window

Usage

create input file with name , it can be of any type: pdf, jpeg, etc.
make
launch receiver
./receiver <port> <output-file>
launch sender
./sender 127.0.0.1 <port> <input file>

C Standard

We use C99 for this lab.

External source

The logger used in this lab is credited to rxi/log.c

Play with it

Change packet loss rate and corrupt rate in file gbn.h, they are configured by LOSS_PROB and CORR_PROB.

Enable Logger Output

The logger for this lab is disabled by default, in order to optimize its performance. To enable logging output, go to gbn.c, and find gbn_init().

log_set_quiet(1);
log_set_level(LOG_DEBUG);

Changing log_set_quiet(1) to log_set_quiet(0) enables logging output. You can also change the logging level by modifying log_set_level(LOG_DEBUG). For more usages, you can have a reference on rxi/log.c