TCP/IP

Thomas Castleman and I implemented IP (using UDP as the link layer) and then TCP (on top of IP) in Rust, as the semester-long project for Brown CS 1680 - Computer Networks, taught by Nicholas DeMarinis.

The IP layer implements RIP (RFC 2453) for routing, which dynamically updates routing tables as nodes join and leave the network. We added support for Echo, Echo Reply, and Time Exceeded messages, according to ICMP (RFC 792), in order to implement a traceroute program, which prints the sequence of IP addresses in the network along the shortest path from the node where traceroute is launched to the node of the user-provided target address.

Our TCP (RFC 793) implementation can transfer a 5 MB file in a few seconds, and guarantees zero packet loss, even over a channel that sporadically drops packets.

As part of my senior capstone requirements, I added TCP Tahoe for congestion control, which involves Slow Start, Congestion Avoidance, and Fast Retransmit / Fast Recovery from RFC 5681. When congestion control is applied, data transmission is much "smoother", leading to fewer packets retransmitted and less variance in the number of bytes in flight during file transmission.

In our tests, congestion control shrinks the average packet size. As a result, file transmission was faster without congestion control applied. However, congestion control could speed up transmission in high-traffic scenarios, such as when multiple nodes send files simultaneously.

Click here to view window scaling plots and Stevens curves for a 1 MB file transfer, as well as more discussion on the effect of TCP Tahoe.

Code for this project is not public on GitHub, but can be made available on request.