Skip to content

Project-Group-Computer-Networks/OurTorrent

Repository files navigation

OurTorrent

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.

Key Features

  1. UDP Tracker
  2. Asynchronous Socket Handling
  3. Bencoding Serialization Library
  4. Error Handling
  5. Security

Project Phases

  1. 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.
  2. 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.

Tech Stack and Libraries

  1. C++ for Tracker
  2. Python for Client

Tools and Technologies Used

  • 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.

Installation

  1. Clone and navigate to the repository:

    git clone https://github.com/Project-Group-Computer-Networks/OurTorrent.git
    cd OurTorrent
  2. 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
  3. 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/
    
  4. 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

Video Demo Link:

Video Demo Link

Contributors:

  • Meet Sindhav
  • Mohammed Haaziq
  • Aditya Mundada
  • Nayan Kakade
  • Sarvesh Baheti
  • Roopam Taneja

Made with ❤️ by team "OurTorrent"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages