This is a group based file sharing system where users can share, download files from the group they belong to. Download happens parallely with multiple pieces from multiple peers. It also supports multithreaded client/server and tracker.
- Maintains information of clients with their files(shared by client) to assist the clients for the communication between peers.
- tracker_info.txt - Contains ip, port details of all the trackers
- Downloads files from multiple peers and makes itself available as a leacher as soon as it downloads any file.
- G++ compiler
sudo apt-get install g++
cd tracker
g++ tracker.cpp -lcrypto -Wall -pthread -o tracker
./tracker tracker_info.txt tracker_no
eg : ./tracker tracker_info.txt 1
cd client
g++ client.cpp -lcrypto -Wall -pthread -o client
./client ./client <IP>:<PORT> tracker_info.txt
eg : ./client 127.0.0.1:7600 tracker_info.txt
- At Least one tracker will always be online.
- Client needs to create an account (userid and password) in order to be part of the network.
- Client can create any number of groups(groupid 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 (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 name 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 data to take from which peer (You need to design your own Piece Selection Algorithm)
- As soon as a piece of file gets downloaded it should be available for sharing
- After logout, the client should temporarily stop sharing the currently shared files till the next login
- All trackers need to be in sync with each other
- Create User Account:
create_user <user_id> <passwd>
- Login:
login <user_id> <passwd>
- Create Group:
create_group <group_id>
- Join Group:
join_group <group_id>
- Leave Group:
leave_group <group_id>
- List pending join:
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>
- Download File:
download_file <group_id> <file_name> <destination_path>
- Logout:
logout
- Show_downloads:
show_downloads
- Output format:
- [D] [grp_id] filename
- [C] [grp_id] filename
- D(Downloading), C(Complete)
- Output format:
- Stop sharing:
stop_share <group_id> <file_name>