Asaad27 / bittorrent-client

a peer to peer bittorrent client implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Informations

Link to project report : report

example scenario: test file : pieces -> 1_to 100
peer1 : 1_to_200 port : 2001
peer2 : 800_to_1000 port : 2003
peer3 : 100_to_900 port : 2004
peer4 : 400_to_669 port : 2005
peer5 : 200_700 port : 2002
img_1.png

console output:

img_3.png

end of the download console output stats

img_5.png

log file

img_4.png

How to Use

compile jar using : mvn compile assembly:single

command to execute:

java -jar equi*.jar torrentFileName.torrent [-s or -f]
-s : used for secure downloading mode eq: limited number of requests to send and receive.
-f : used for fast downloading mode
detailed output is written to log.txt file in the jar directory.

scripts are in scriptsForTesting

example of use:

1-run opentracker
2-inside scriptsForTesting folder, run a script, for example ./scriptMultiClient.sh
, the script will create a file, generate it's torrent file from it and launch 5 aria2c instances, each with a specific range of pieces (can be used without opentracker to demonstrate strategies). The script will create folders named peer_from_to with from = first piece (1-index based) and to = lastpiece (max is 1000), with each folder is used by one Aria2c
see the script file for more details and modifications.
IMPORTANT: change announce URL to opentracker url in -a http://..../announce inside the script sh file.
the script creates both torrent file, and metainfo file, hence the script can be used for multiple machines without the need of copying any file, and also for testing in one machine.
3-run java -jar equi*.jar test /scriptsForTesting/test.torrent [-f ou -s]

see scripts for generating files and torrents Readme for more details about how i created the scripts and infos about their CLI arguments

file generator Linux and Windows

scripts for generating files and torrents

opentracker for Windows

docker build -t ot .
docker run -p 6969:6969 ot
access opentracker in http://localhost:6969/stats

About

a peer to peer bittorrent client implementation


Languages

Language:Java 91.3%Language:Go 6.3%Language:Shell 1.2%Language:Makefile 0.7%Language:Dockerfile 0.5%