Skip to content

KoderuNoKo/CN_NetApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


BitTorrent Simulation - CN_NetApp

Overview

This project is a BitTorrent protocol simulation, demonstrating how peer-to-peer (P2P) file sharing works. It models key aspects of the BitTorrent protocol, such as peer communication, seeding, leeching, and tracker coordination to efficiently distribute files across multiple peers.

Key Features

  • P2P File Sharing: Simulates peer-to-peer distributed file sharing.
  • Seeder & Leecher Roles: Implements file distribution and downloading processes.
  • Tracker Server: Coordinates peers and manages metadata for shared files.
  • Chunk-Based File Transfer: Files are split into pieces for parallel downloading.
  • Simulated Network Latency: Adds realistic network delays to improve accuracy.

Project Structure

📂 CN_NetApp
│── peer.py                 # Peer node implementation (Seeder & Leecher)
│── tracker.py              # Tracker server managing peers
│── torrent_file.py         # Handles metadata about shared files
│── utils.py                # Helper functions for network communication
│── config.py               # Configuration settings (IP, Port, Chunk size)
│── README.md               # Project documentation

How It Works

  1. Tracker Server Initialization:
    • The tracker server registers active peers and provides file metadata.
  2. Peer Connection Establishment:
    • Peers connect to the tracker and request file chunks.
  3. File Piece Exchange:
    • Peers download and upload pieces in a distributed manner.
  4. Seeding & Completion:
    • Once a peer completes the file, it becomes a seeder and shares pieces with others.

Installation & Usage

Prerequisites

  • Python 3.x
  • Basic understanding of networking and P2P communication

Setup

  1. Clone the repository:
    git clone https://github.com/KoderuNoKo/CN_NetApp
    cd CN_NetApp
  2. Start the Tracker Server:
    python tracker.py
  3. Run Peer Nodes (Seeder/Leecher):
    python peer.py --role seeder --file sample.txt
    python peer.py --role leecher --file sample.txt

Customization

  • Modify config.py to change IP addresses, ports, and chunk sizes.
  • Enhance peer.py to support multiple file sharing.
  • Implement encryption for secure peer communication.

Future Enhancements

  • Support DHT (Distributed Hash Table) for decentralized tracking.
  • Implement peer reputation system to prioritize fast uploaders.
  • Add choking/unchoking mechanisms for bandwidth optimization.

References

  • BitTorrent Protocol Specification
  • Peer-to-Peer Networking Concepts

About

BitTorrent simulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages