This project implements a custom TCP protocol over UDP using Python. The goal is to simulate TCP-like behavior (reliability, ordering, and connection management) on top of UDP, which is inherently connectionless and unreliable.
- Connection establishment and teardown using a custom handshake
- Reliable data transfer with packet acknowledgments
- Fully functional file transfer that can resume even if the connection is interrupted and reconnected
- Packet ordering and reassembly to ensure data integrity
- Python 3.7+
- Windows: requires PyQt5
pip install PyQt5
- Run the script (
script.py
) on both machines (or on the same machine usinglocalhost
). - When prompted, enter the IP address of the other user:
- Use
localhost
for testing on the same PC. - Use the actual IP address for communication across machines.
- Use
- Choose a user profile:
user0
on one device anduser1
on the other device (predefined settings that work together), oruser2
(custom mode, where you can manually set listening port, sending port, and packet size).
- After the handshake completes, you can:
- Send text messages → just type your message in the terminal and press Enter.
- Send a file → type
file
and press Enter, then select a file from your system to send. - Change download path → type
path
and press Enter, then enter a new folder path (by default, files are saved in the same directory as the script). - Exit the connection → type
exit
and press Enter to gracefully close the session.