This is a Java-based network simulator for Assignment 2 (COMP211). The project simulates packet transmission using an event-driven approach and includes implementations for sender and receiver protocols.
Assign2code.iml— provided by instructorAssignment2.java— provided by instructor (main entry)Event.java— provided by instructorEventList.java— provided by instructorMessage.java— provided by instructorNetworkHost.java— provided by instructorNetworkSimulator.java— provided by instructorPacket.java— provided by instructorReceiver.java— implemented as part of this assignment (student work)Sender.java— implemented as part of this assignment (student work)Testing.java— test code (part of the project)
- Java JDK 8 or higher
- Recommended IDE: IntelliJ IDEA (Windows)
- Open the project in IntelliJ IDEA.
- Compile and run
Assignment2.java.
-
gobackn— Implements the Go-Back-N protocol. The sender can transmit multiple packets within a window and uses cumulative acknowledgments. On timeout of a packet, the sender retransmits all unacknowledged packets starting from the base sequence number. Suitable for higher throughput. -
stopandwait— Implements the Stop-and-Wait protocol. The sender transmits one packet at a time and waits for its acknowledgment (or timeout) before sending the next. Simpler but lower throughput.
Switch branches with:
git checkout gobackngit checkout stopandwait
Receiver.javaandSender.javaare the parts implemented by the student; other source files were provided by the instructor.- This assignment received a score of 98/100.