OurTorrent is a peer-to-peer (P2P) file-sharing system inspired by the BitTorrent protocol. This decentralized system allows users to download files more quickly by connecting with multiple uploaders, rather than relying on a single central server. OurTorrent aims to simulate a peer-to-peer file-sharing experience, including a custom client and a lightweight UDP tracker for efficient, low-overhead communication.
- UDP Tracker
- Asynchronous Socket Handling
- Bencoding Serialization Library
- Error Handling
- Security
-
Phase 1:
- Built a client compatible with the BitTorrent protocol that can download files using torrent files.
- Our client connects with general internet-based trackers to join peer groups and download any specified file.
-
Phase 2:
- Developed our own UDP tracker for a deeper understanding of the protocol.
- The tracker manages essential attributes for each peer, including peer IDs, seeders, and leechers, and shares this information with clients upon request.
- C++ for Tracker
- Python for Client
- Sqlite3 for database
- POSIX socket libraries
- OpenSSL for SHA1 hash
- Rich package for table formatting
- urrlib3 library for HTTP connections
Note: Since the project uses POSIX libraries which are unavailable on Windows, it is requested to use a Linux system.
-
Clone and navigate to the repository:
git clone https://github.com/Project-Group-Computer-Networks/OurTorrent.git cd OurTorrent
-
For running Tracker:
- Navigate to tracker_implementation
- Install the following dependencies:
sudo apt update sudo apt install sqlite3
- Compile the executable file:
g++ main.cpp db_manager.cpp peer_manager.cpp udp_server.cpp socket_util.cpp -l sqlite3 -o bittorrent_tracker
- The file is ready for use; to run:
./bittorrent_tracker
-
For running Client:
- Navigate to client_implementation
- Download all the pre-requisites present in /requirements.txt
pip install -r requirements.txt
- Change directory to src and run the help command
cd src python3 main.py --help
- To test the code, run the client with a torrent file present in examples folder As an example, we are using a torrent file from examples folder and creating a new folder as destination.
mkdir ../downloads python3 main.py ../examples/ubuntu.torrent -d ../downloads/
-
For running Tester:
- Navigate to tester_implementation
- Install OpenSSL libraries in Linux :
sudo apt-get install libssl-dev
- To run the directory code:
g++ -o client main.cpp announce_request.cpp connect_request.cpp peer_decoder.cpp -std=c++20 -lssl -lcrypto ./client
- Meet Sindhav
- Mohammed Haaziq
- Aditya Mundada
- Nayan Kakade
- Sarvesh Baheti
- Roopam Taneja