This project involves the implementation of both a TCP Receiver and Server. The primary goal is to analyze the performance of synchronous and asynchronous TCP servers while ensuring reliable communication between the sender and receiver.
This section focuses on the TCP Receiver implementation, which consists of building the ByteStream
class, creating a reassembler to assemble segments received from the sender, and implementing the actual TCP receiver by integrating the ByteStream
and Reassembler
.
Follow these steps to set up and test the TCP Receiver implementation:
- Clone the following repository
- Navigate to the project directory and create a new directory named 'build.'
- Enter the 'build' directory and run
cmake ..
to configure the project. - Once configured, run
make
in the same directory to build the project. - Verify that the project builds without errors by running
ctest
.
The ByteStream
class serves as a container for storing a collection of bytes, facilitating reliable communication. Key implementation details include push and pop operations, finite capacity, end of file (EOF) handling, initialization, and suitability for single-threaded use.
To validate the implementation of the ByteStream
class, run the following commands in the build directory:
make
ctest -R '^byte_stream'
The Reassembler
component is responsible for reconstructing byte streams from substrings received from the sender. It efficiently manages three categories of knowledge: next bytes in the stream, buffered bytes within the stream's capacity, and bytes beyond the stream's capacity.
To validate the implementation of the Reassembler
class, run the following commands in the build directory:
make
ctest -R '^reassembler'
This section outlines the tasks related to implementing different TCP server programs, including concurrent servers with multiple processes and threads, as well as non-blocking servers using select(), poll(), and epoll(). The servers perform factorial computations based on incoming requests.
Perform experiments with different numbers of concurrent client connections and collect data using tools like tcpdump or Wireshark. Write Python scripts to compute average throughput and latency for each TCP flow, and observe server process CPU and memory utilization.
The successful implementation of both the TCP Receiver and Server components deepens your understanding of TCP communication and its challenges. The combined efforts ensure reliable transmission and reception of data in various scenarios. Experimentation and analysis of server performance metrics provide valuable insights for further considerations in server design.