-
OpenSSL library
sudo apt-get install openssl
- Linux
- Extract the files.
- you can now see two folders Client and Server
- Open a terminal and run following commands
cd client
g++ -o login login.cpp -lssl -lcrypto
./login 127.0.0.1:5050 tracker_info.txt
cd ..
- Now open a new terminal and run following commands
cd tracker
g++ -o tracker run_tracker.cpp
./tracker tracker_info.txt 1
cd ..
- Run Tracker:
cd tracker
./tracker <TRACKER INFO FILE> <TRACKER NUMBER>
ex: ./tracker tracker_info.txt 1
<TRACKER INFO FILE>
contains the IP, Port details of all the trackers.
Ex:
127.0.0.1
5000
127.0.0.1
6000
- Close Tracker:
quit || Quit || QUIT
- Run Client:
cd client
./client <IP>:<PORT> <TRACKER INFO FILE>
ex: ./client 127.0.0.1:18000 tracker_info.txt
- Create user account:
create_user <user_id> <password>
- Login:
login <user_id> <password>
- Create Group:
create_group <group_id>
- Join Group:
join_group <group_id>
- Leave Group:
leave_group <group_id>
- List pending requests:
list_requests <group_id>
- Accept Group Joining Request:
accept_request <group_id> <user_id>
- List All Group In Network:
list_groups
- List All sharable Files In Group:
list_files <group_id>
- Upload File:
upload_file <file_path> <group_id>
- Stop sharing:
stop_share <group_id> <file_name>
- Logout:
logout
- At Least one tracker will always be online.
- Client needs to create an account (user_id and password) in order to be part of the network.
- Client can create any number of groups (group_id should be different) and hence will be owner of those groups.
- Client needs to be part of the group from which it wants to download the file
- Client will send join request to join a group
- Owner Client Will Accept/Reject the request.
- After joining group, client can see list of all the shareable files in the group.
- Client can share file in any group (as an owner or member; note: file will not get uploaded to tracker but only the : of the client for that file)
- Client can send the download command to tracker with the group_id and filename, and tracker will send the details of the group members which are currently sharing that particular file.
- After fetching the peer info from the tracker, client will communicate with peers about the portions of the file they contain and hence accordingly decide which part of file to take from which peer (You need to design your own Piece Selection Algorithm)
- As soon as a chunk of file gets downloaded it should be available for sharing (the client becomes a ‘leecher’)
- After logout, the client should temporarily stop sharing their own currently shared files/file chunks till the next login.
- All trackers need to be in sync with each other, so that any seeding/sharing information is available to all.
- Only one tracker is implemented and that tracker should always be online.
- The peer can login from different IP addresses, but the details of his downloads/uploads will not be persistent across sessions.
- SHA1 integrity checking doesn't work correctly for binary files.
- File paths should be absolute.(whole path)
- segment size is 512kb
In this part of code Download file functionality has not coded.