BitTorrent

BitTorrent is a terminal-based application that implements the P2P file sharing protocol, enabling users to share files efficiently. It features a tracker creation capability and peer connectivity, enhancing the overall file sharing experience.

View on GitHubJava

Stack

JavaThe application is built using Java.bittorrentnetworkingp2p-network

View as

Architecture

The application is built as a monolithic architecture, which simplifies deployment and management. Its component-based pattern allows for modular development, making it easier to maintain and extend the functionality of the application.

Technical narrative

Built using Java, BitTorrent leverages the language's robustness and performance to implement a reliable file sharing solution. The choice of Java supports the application’s scalability and ease of integration with other systems.

Deep dive

The application effectively manages peer connections and data transfer through features like chunking and merging pieces. By implementing choking/unchoking strategies, it optimizes bandwidth usage, enhancing the overall performance of file sharing.

Architecture

The architecture of BitTorrent is a monolith with a component-based pattern, consisting of a single Java application that incorporates multiple peer components. This design choice allows for efficient communication between peers while maintaining a cohesive structure for the application.

Technical narrative

The BitTorrent application is developed entirely in Java, utilizing its capabilities to manage peer connections and implement features like chunking and logging. The integration of these features is facilitated by Java's concurrency model, which supports efficient handling of multiple peer interactions.

Deep dive

In the BitTorrent application, the implementation of features such as choking/unchoking neighbors and optimistic choking is crucial for optimizing peer-to-peer communication. The application logs messages sent among peers with timestamps, providing valuable insights into the data transfer process. With a total of 7 files, the codebase is manageable while still encapsulating complex functionalities.

Tour

  1. 01

    P2P File Sharing Application

    This project implements the BitTorrent protocol for peer-to-peer file sharing in a terminal-based environment. It enables users to connect with peers, manage file chunks, and log messages.

    • Solves P2P file sharing challenges
  2. 02

    Monolithic Layered Architecture

    The application is structured as a single Java monolith with multiple peer classes managing connections and data chunks. It operates entirely in a terminal environment.

    • !Uses layered architecture
  3. 03

    FileOwner.java

    The FileOwner.java file manages the ownership of file chunks among peers, showcasing the developer's focus on chunk management and peer interactions.

    • Highlights chunk management logic

    FileOwner.java

    public class FileOwner {
        private List<Chunk> chunks;
        
        public FileOwner() {
            chunks = new ArrayList<>();
        }
        
        public void addChunk(Chunk chunk) {
            chunks.add(chunk);
        }
        
        public List<Chunk> getChunks() {
            return chunks;
        }
    }
  4. 04

    No CI Tests Configured

    The project currently does not have any configured continuous integration tests or frameworks. Testing practices may be minimal or absent.

    • !No CI workflows found
  5. 05

    No CI/CD Workflows Configured

    There are no CI/CD workflows configured for deployment in this project. Deployment strategies are not defined.

    • !No deployment workflows found
  6. 06

    Clone the Repository

    To explore the project, clone the repository using the command below.

    git clone https://github.com/shashankcm95/BitTorrent
Architecture diagram
graph TD;
    A[Terminal-based App] --> B[Tracker]
    A --> C[Peer Connections]
    A --> D[Chunking]
    A --> E[Logging]

Paste the source above into mermaid.live to view the rendered diagram.

Verified facts

  • The application is a terminal-based implementation of the P2P file sharing BitTorrent protocol.from README
    Evidence
    This is a terminal-based implementation of the P2P file sharing BitTorrent protocol.

    Source: README

  • The application has a feature for creating a tracker.from README
    Evidence
    The application has the features like creating a tracker.

    Source: README

  • The application can connect with peers.from README
    Evidence
    The application has the features like connecting with peers.

    Source: README

  • The application supports chunking.from README
    Evidence
    The application has the features like chunking.

    Source: README

  • The application implements choking/unchoking neighbors.from README
    Evidence
    The application has the features like choking/unchoking neighbors.

    Source: README

  • The application implements optimistic choking/unchoking.from README
    Evidence
    The application has the features like optimistic choking/unchoking.

    Source: README

  • The application merges pieces.from README
    Evidence
    The application has the features like merging pieces.

    Source: README

  • The application logs messages sent among peers with timestamps.from README
    Evidence
    Logs are also recorded for each peer along with timestamps.

    Source: README

← All projects