A Python-based file transfer application that accelerates the transmission of large files by utilizing parallel TCP connections, breaking files into smaller chunks and transmitting them concurrently. It enhances speed, reliability, and efficiency in file transfers, perfect for large data transfers across a congested networks.
- Parallel Transmission: Utilizes multiple TCP connections to transfer file chunks concurrently.
- Progress Monitoring: Displays transfer speed, percentage completed, and estimated time remaining.
- Error Handling: Gracefully handles interruptions during transfer.
- Python 3.x
- Required Libraries:
socketthreadingostime
git clone https://github.com/prathampt/parallelFileTransfer.git
cd parallelFileTransferThe application is designed around the concept of parallelism in file transmission. Here's how it works:
The file to be transferred is divided into smaller chunks, each of which can be sent over separate TCP connections. The client sends these chunks concurrently to the server using multiple threads.
Instead of transmitting the file sequentially, the application opens multiple TCP connections. Each connection handles a specific chunk of the file, reducing overall transfer time by utilizing network bandwidth more effectively.
The application calculates and displays:
- Percentage Complete: Shows how much of the file has been transferred.
- Transfer Speed: Calculates the speed in MB/s.
- Estimated Time Remaining: Dynamically estimates how long the transfer will take to complete based on the current speed.
If a connection is interrupted, the application catches the error and ensures no data is lost or corrupted, resuming the transfer where it left off.
Run the server script to start receiving file chunks. The server listens on a specified port and waits for connections from clients.
python main.py -r receiver -s ./data/Run the client script, specifying the file to transfer and the server's IP address. The client breaks the file into chunks and sends them over multiple TCP connections.
python main.py -r sender <file_path> <receiver_ip>You can adjust the number of parallel connections and the chunk size by modifying the corresponding variables in the code.
- Encryption: Implement end-to-end encryption for secure file transfers.
- Compression: Add file compression to reduce the amount of data sent over the network.
- Better error handling: Improve recovery from network interruptions.
Contributions are welcome! Please open an issue or submit a pull request to contribute.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your GitHub account.
- Clone Locally: Clone the forked repository to your local machine using a Git client.
git clone https://github.com/prathampt/parallelFileTransfer
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.' - Push to GitHub: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
Once your PR is reviewed and approved, it will be merged into the main branch.
This project is licensed under the GNU GENERAL PUBLIC LICENSE Version 3 - see the LICENSE file for details.
Don't forget to fork the repository and give a star if you liked it...