Skip to content

padam2502/P2P-file-sharing-system

Repository files navigation

Peer to Peer Based File Sharing System

Description

Built a group based file sharing system where users can share, download files from the group they belong to. Download should be parallel with multiple pieces from multiple peers.

Pre-requisites:

Socket Programming, SHA1 hash, Multi-threading

Architecture Overview:

The Following entities will be present in the network :

  1. Tracker: Maintain information of clients with their files(shared by client) to assist the clients for the communication between peers
  2. Clients: Retrieve peer information from tracker for the file and download file from multiple peers simultaneously and all the files which client downloads will be shareable to other users in the same group.

Executing program

  • Go to tracker directory

g++ tracker.cpp -o tracker -lpthread

  • Go to client directory

g++ client.cpp -o client -lssl -lcrypto -lpthread

  • To run the Server

./tracker <tracker_ip> <tracker_port>

eg : ./tracker 127.0.0.1 8000

  • To run the Client ./client <client_ip> <client_port> <tracker_ip> <tracker_port>

creating client1 on new terminal with socket : 127.0.0.1:8000

eg : ./client 127.0.0.1 3000 127.0.0.1 8000

Commands on the Client side

  1. Create User Account :

create_user <user_id> <passwd>

  1. Login :

login <user_id> <passwd>

  1. Create Group :

create_group <group_id>

  1. Join Group :

join_group <group_id>

  1. Leave Group :

leave_group <group_id>

  1. List Pending Request :

requests list_requests <group_id>

  1. Accept Group Joining Request :

accept_request <group_id> <user_id>

  1. List All Group In Network :

list_groups

  1. List All sharable Files In Group :

list_files <group_id>

  1. Upload File :

upload_file <file_path> <group_id>

NOTE: Enter absolute path of the file.

  1. Download File :

download_file <group_id> <file_name> <destination_path>

NOTE: Enter absolute path of the destination. 12. Logout :

logout

  1. Show_downloads :

show_downloads

Output format: [D] [grp_id] filename [C] [grp_id] filename D(Downloading), C(Complete)

  1. Stop sharing :

stop_share <group_id> <file_name>

About

Peer-to-Peer Group Based File Sharing System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages