An open API service indexing awesome lists of open source software.

https://github.com/akshayxml/peer-to-peer-group-based-file-sharing-system

A P2P file sharing system implemented using socket programming, multi-threading and SHA1 hashing. Users can share, download files from the group they belong to. Downloading is done in parallel with multiple pieces from multiple peers.
https://github.com/akshayxml/peer-to-peer-group-based-file-sharing-system

cpp filesharing multithreading openssl peer-to-peer sha1-hash socket-programming

Last synced: 3 months ago
JSON representation

A P2P file sharing system implemented using socket programming, multi-threading and SHA1 hashing. Users can share, download files from the group they belong to. Downloading is done in parallel with multiple pieces from multiple peers.

Awesome Lists containing this project

README

        

# Peer-to-Peer Group Based File Sharing System

## Prerequisites

**Software Requirement**

1. G++ compiler
- **To install G++ :** `sudo apt-get install g++`
2. OpenSSL library

- **To install OpenSSL library :** `sudo apt-get install openssl`

**Platform:** Linux

## Installation

```
1. cd client
2. make
3. cd ../tracker
5. make
6. cd ..
```

## Usage

### Tracker

1. Run Tracker:

```
cd tracker
./tracker​
ex: ./tracker tracker_info.txt 1
```

`` contains the IP, Port details of all the trackers.

```
Ex:
127.0.0.1
5000
127.0.0.1
6000
```

2. Close Tracker:

```
quit
```

### Client:

1. Run Client:

```
cd client
./client​ :
ex: ./client 127.0.0.1:18000 tracker_info.txt
```

2. Create user account:

```
create_user​
```

3. Login:

```
login​
```

4. Create Group:

```
create_group​
```

5. Join Group:

```
join_group​
```

6. Leave Group:

```
leave_group​
```

7. List pending requests:

```
list_requests ​
```

8. Accept Group Joining Request:

```
accept_request​
```

9. List All Group In Network:

```
list_groups
```

10. List All sharable Files In Group:

```
list_files​
```

11. Upload File:

```
​upload_file​
```

12. Download File:​

```
download_file​
```

13. Logout:​

```
logout
```

14. Show_downloads: ​

```
show_downloads
```

15. Stop sharing: ​

```
stop_share ​
```

## Working

1. User should create an account and register with tracker.
2. Login using the user credentials.
3. Tracker maintains information of clients with their files(shared by client) to assist the clients for the communication between peers.
4. User can create Group and hence will become admin of that group.
5. User can fetch list of all Groups in server.
6. User can join/leave group.
7. Group admin can accept group join requests.
8. Share file across group: Shares the filename and SHA1 hash of the complete file as well as piecewise SHA1 with the tracker.
9. Fetch list of all sharable files in a Group.
10. Download:
1. Retrieve peer information from tracker for the file.
2. Download file from multiple peers (different pieces of file from different peers - ​piece selection algorithm​) simultaneously and all the files which client downloads will be shareable to other users in the same group. File integrity is ensured using SHA1 comparison.
11. Piece selection algorithm used: Selects random piece and then downloads it from a random peer having that piece.
12. Show downloads.
13. Stop sharing file.
14. Logout - stops sharing all files.
15. Whenever client logins, all previously shared files before logout should automatically be on sharing mode.

## Assumptions

1. Only one tracker is implemented and that tracker should always be online.
2. The peer can login from different IP addresses, but the details of his downloads/uploads will not be persistent across sessions.
3. SHA1 integrity checking doesn't work correctly for binary files, even though in most likelihood the file would have downloaded correctly.
4. File paths should be absolute.