Java implementations of two reliable transport protocols
This project implements a reliable data transfer protocol over an unreliable network simulator.
1, The sender and receiver use a Stop-and-Wait (with windowsize = 1) or Selective Repeat (SR) protocol with Cumulative Ack.
2, The sender and receiver use a Go-Back-N (GBN) protocol with Selective Acknowledgment (SACK).
The goal is to ensure that all messages generated from the sender's layer 5 are successfully delivered to the receiver's layer 5 in order, even under adverse network conditions. Performance is evaluated using trace-level outputs and analyzed across varying loss and corruption rates to assess the robustness of the protocol.
- Run
./compileto compile the project. - Run
java Projectto launch the simulator. - Enter the simulation parameters when prompted.
Example input for SR with Cumulative Ack:
-- * Network Simulator v1.0 * --
Enter number of messages to simulate (> 0): [10] 1000
Enter packet loss probability (0.0 for no loss): [0.0] 0.1
Enter packet corruption probability (0.0 for no corruption): [0.0] 0.1
Enter average time between messages from sender's layer 5 (> 0.0): [1000] 200
Enter window size (> 0): [8] 8
Enter retransmission timeout (>0.0) [15.0] 30
Enter trace level (>= 0): [0] 3
Enter random seed: [0] 1234
- Trace results will be saved to a
.txtfile.
-
Run
./automate_tests.sh.
This script compiles all Java files and runs 45 tests using 5 random seeds with combinations of 3 corruption rates and 3 loss rates.
All generated trace files are saved in the./tracesdirectory, and aresults_summary.csvis generated in the project root. -
Run
python3 analyze_results.py.
This script readsresults_summary.csv, computes confidence intervals (CI), and generates two performance analysis graphs.