Skip to content

An interactive simulator for the Selective Repeat ARQ protocol, visualizing packet transmission, ACK handling, sliding windows, and retransmissions in unreliable networks.

Notifications You must be signed in to change notification settings

tanmaypaliwal576/Selective-ARQ-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Selective Repeat ARQ Simulator


πŸš€ Live Demo

https://selectiverepeatarq.vercel.app/


🧠 What Is Selective Repeat ARQ?

Selective Repeat ARQ is a reliable data transfer protocol used in computer networks.
It enhances efficiency by retransmitting only the specific lost or corrupted packets, instead of resending the entire window (as in Go-Back-N).

This simulator visually demonstrates:

  • Sender & receiver sliding windows
  • Packet transmission
  • ACK-based acknowledgement
  • Packet loss & ACK loss
  • Timer expiration
  • Selective retransmissions
  • Out-of-order packet buffering

πŸ“˜ How the Protocol Works (Diagram Explanation)

1. Sender Window

[ 0 ][ 1 ][ 2 ][ 3 ]       <-- Sliding Window (example: size 4)
   ↑     ↑     ↑
   |     |     |
 Sent  ACKed  Timer Running

2. Receiver Window

[ 0 ][ 1 ][ 2 ][ 3 ]
   ↑
Expected Packet

3. Packet Flow

Sender  --->  Packet(i)  ---> Receiver
Receiver --->    ACK(i)   ---> Sender

4. Loss Scenario Example

Packet(2) Lost
Timer for Packet(2) Expires
Sender Retransmits Packet(2)
Receiver Buffers Out-of-Order Packets

This diagram helps learners visualize the internal logic of Selective Repeat ARQ.


🎯 Features

  • Real-time sliding window animations
  • Simulated packet & ACK loss
  • Timer-driven retransmissions
  • Out-of-order packet handling
  • Receiver-side packet buffering
  • Clean UI for education & demonstrations
  • Highly interactive visualization

πŸ“Œ Use Cases

1. Education & Learning

Ideal for students studying computer networks and reliability mechanisms.

2. Classroom Demonstrations

Teachers can visually explain ARQ techniques.

3. Debugging Networking Logic

Helps learners experiment with real-time packet behavior.

4. Portfolio Showcase

Excellent project to demonstrate understanding of:

  • Reliability protocols
  • Sliding window mechanisms
  • Network error handling

5. Research & Experimentation

Can be extended to compare:

  • Selective Repeat ARQ
  • Go-Back-N ARQ
  • Stop-and-Wait ARQ

πŸ› οΈ Tech Stack


πŸ“‚ Project Structure

β”œβ”€β”€ index.html        # Main UI layout
β”œβ”€β”€ style.css         # Styling and animations
β”œβ”€β”€ main.js           # Core logic and simulation handling
└── README.md         # Documentation

🀝 Contributing

Pull requests and suggestions are welcome.
Feel free to open an issue for discussions.


πŸ“š License

This project is open-source under the MIT License.

About

An interactive simulator for the Selective Repeat ARQ protocol, visualizing packet transmission, ACK handling, sliding windows, and retransmissions in unreliable networks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published