A TCP-based simulation of Go-Back-N (GBN) and Selective Repeat (SR) reliable data transfer protocols implemented in Python using sockets. The project includes both sender and receiver logic with features like packet sequencing, checksum validation, acknowledgments, and window-based flow control.
Project Structure:
- client.py – Sender: implements packet creation and transmission
- server.py – Receiver: validates and acknowledges packets
- README – Project documentation
Features:
-
Packet structure includes:
- Sequence number
- Checksum
- Payload
-
Checksum validation for data integrity
-
Two protocols supported:
- Go-Back-N: Resends all packets from a lost one
- Selective Repeat: Only resends corrupted or lost packets
-
Receiver (server):
- Accepts connections
- Negotiates protocol (GBN or SR)
- Validates packets and sends ACKs/NAKs
-
Sender (client):
- Sends either a single packet or a burst (batch)
- Dynamically adjusts congestion window based on feedback
- Handles timeouts and retransmissions
How to Run:
-
Start the server: python server.py
-
Run the client in another terminal: python client.py
-
Follow the on-screen prompts to:
- Choose the protocol (GBN or SR)
- Choose the mode (single packet or burst)
- Monitor acknowledgments, retransmissions, and congestion window behavior
Requirements:
- Python 3.x
- No external libraries needed (uses built-in socket and struct)
Author:
Cláudio Alves Gonçalves de Oliveira Email: hi@claudioav.com
License:
MIT License – free to use, modify, and distribute.