IP/TCP
As part of Brown University's Computer Networks course (CS1680), I collaborated with Keven Li to implement a complete TCP/IP network stack from scratch. Starting with a UDP "Layer 2" foundation, we built Internet Protocol (IP) routing capabilities and then Transmission Control Protocol (TCP) on top, resulting in a router program that can route packets over a self-healing network and a host program that can send and receive data reliably.
IP (Internet Protocol)
We implemented IP to support packet forwarding via longest-prefix matching, updating relevant IPv4 header fields correctly (e.g. TTL, checksum), and automatic route discovery and healing using RIP with split horizon and poison reverse. This allows networks using our IP stack to remain usable even when an intermediate node goes down (as long as there are redundant connections). Key features included longest-prefix matching for optimal routing paths, IPv4 header management with TTL and checksum validation, and self-healing network capabilities that adapt to topology changes.
TCP (Transmission Control Protocol)
We implemented TCP by directly referencing RFC 9293. We built support for TCP handshake, teardown, retransmissions over lossy connections, handling out-of-order segments, and zero-window probing. This included the complete TCP connection lifecycle with three-way handshake, reliable data transfer with automatic retransmission mechanisms, proper sequencing and reassembly of out-of-order segments, and flow control mechanisms including zero-window probing to handle receiver buffer constraints.
Reflection
Throughout implementing both IP and TCP, we used Wireshark as a primary debugging tool to ensure checksums were correct, headers were well-formatted, retransmissions were behaving correctly, and ACK numbers were updating as expected, especially in the case of dropped packets. This hands-on experience with network protocol debugging deepened my understanding of how network protocols work at the packet level.