project 3 except crab
Go to file
xenia d921fcf556 Add comments 2020-03-14 18:47:25 -04:00
hptp Add comments 2020-03-14 18:47:25 -04:00
hptp-recv Add comments 2020-03-14 18:47:25 -04:00
hptp-send Add comments 2020-03-14 18:47:25 -04:00
scripts Add grade script with just the 4 performance tests 2020-03-14 15:03:59 -04:00
.gitignore With a rust-toolchain file I think manual rustup is no longer necessary 2020-03-11 00:01:38 -04:00
Cargo.lock Add silly hex encoder 2020-03-13 17:26:08 -04:00
Cargo.toml hello world 2020-02-21 16:51:19 -05:00
Makefile Update makefile 2020-03-14 18:08:58 -04:00
README.md readme v1 2020-03-14 18:18:02 -04:00
rust-toolchain Create test environment 2020-03-10 23:21:47 -04:00

README.md

      __ __  __
   __/ // /_/ /___ _____  ____ _   __  ___      ____  __
  /_  _  __/ / __ `/ __ \/ __ `/  / / / / | /| / / / / /
 /_  _  __/ / /_/ / / / / /_/ /  / /_/ /| |/ |/ / /_/ /
  /_//_/ /_/\__,_/_/ /_/\__, /   \__,_/ |__/|__/\__,_/
                       /____/

High level approach

For this assignment we developed a new protocol that would be particularly efficient at transferring a file over an unreliable connection. The protocol devides the input file into fixed-length "segments", numbers them sequentially, and attempts to transfer them to the receiver. It repeatedly retransmits segments that it is not confident that the receiever has obtained. The receiever periodically sends batched-acknowledgements that list receieved segments. The segments are compressed using state-of-the-art compression algorithms to ensure expedient delivery. The rate of sending and acknowledgement is continuously tuned to optimize for network conditions.

Challenges

We faced many challenges implementing this protocol, such as the following:

  • Learning how to use cutting-edge event-loop libraries in Rust
  • Selecting a re-transmission algorithms that would be resistant to drops and duplicates
  • Choosing constants that would tune the transmission rate to adjust automatically to network latency and bandwidth
  • Ensuring that both connections would close once the file had been successfully transferred.

Testing

Various internal algorithms and datastructures were tested using simple unit tests. For instance, we have unit tests to check that our packet encoding/decoding schemes work correctly.

However, testing general consistency of the protocol was done by running the scripts provided to us, which automatically adjust network conditions and send large files.