This project implements a reliable TCP receiver from scratch, designed to handle byte-stream communication and manage out-of-order segments. The project is broken into three core components: ByteStream, Reassembler, and the final TCP receiver that integrates both.
- ByteStream: A container for managing the writing and reading of bytes with defined capacity, ensuring bytes are stored and accessed in the correct sequence.
- Reassembler: Responsible for assembling the received byte segments into a contiguous byte stream, even if the segments arrive out of order.
- TCP Receiver: Combines the ByteStream and Reassembler, handles TCP sequence numbers, and sends acknowledgment (ACK) and window size to manage data flow.
- ByteStream: Implements a simple data structure for writing and reading bytes. It handles memory limitations and ensures efficient byte handling.
- Reassembler: Assembles TCP segments, keeping track of missing bytes and discarding segments that exceed capacity.
- TCP Receiver: Manages the communication with the sender, including handling the sequence number wraparound and generating acknowledgments.
- Download and extract the zip file.
cdinto the project directory and create a new directory called build.- Now
cdinto the build directory and runcmake ..to configure the project. - Once the project is configured, run make in the same directory to build the project.
- Once the project is built without any errors, you can run
ctestto run all the tests for the TCP receiver.