A Python-based distributed file downloading system that accelerates downloads by distributing work across multiple peer servers.
The system consists of three components:
| Component | Purpose | Default Port |
|---|---|---|
Tracker (tracker.py) |
Central registry that coordinates peers | 5000 |
Peer Server (server.py) |
Downloads file segments on behalf of clients | 6000 |
Peer Client (client.py) |
Initiates downloads, distributes work to peers | - |
- Peer Servers register with the Tracker
- Client requests a file URL and asks the Tracker for available peers
- Client divides the file into segments (one per peer)
- Each Peer Server downloads its assigned segment in parallel
- Client reassembles all segments into the final file
┌────────┐ ┌─────────┐ ┌─────────────┐
│ Client │ ──1──▶ │ Tracker │ ◀──reg──│ Peer Server │
└────────┘ └─────────┘ └─────────────┘
│ ▲
│ │
└────────────2. Request Segments─────────┘
3. Download & Return
dtpx/
├── tracker.py # Tracker entry point
├── server.py # Peer server entry point
├── client.py # Client entry point
├── trackermodule/ # Tracker logic
├── peerserver/ # Server logic
├── peerclient/ # Client logic
├── utils/ # Shared utilities (downloader, file handling)
└── configfiles/ # Configuration (ports, threads, directories)
python tracker.pyRun on one or more machines:
python server.pypython client.py <file_url>Configuration files are located in configfiles/:
tracker-config.ini- Tracker port settingspeer-server-config.ini- Server port, tracker address, threadspeer-client-config.ini- Tracker address, download directory, threads, proxy settings
- If no peer servers are available, the client falls back to multithreaded download locally
- If the target URL doesn't support range requests, same fallback applies
- Python 3.8+
- urllib3