Published April 1, 2026 | Version v1

Peer File Sharing Protocol For Efficient Data Transfer

Description

#Introduction#

This experiment is designed to demonstrate that a device (R) before receiving can check the availability of the same file with other devices (P) on the same network.
Intra net always has better transfer rate as compared to Internet. Intranet sharing or Local network sharing can save the bandwidth. 
The same bandwidth can be used for other unique communications. 
Peer (P) has ability to check if the Receiver(R) is entitled for the file by testing it possession of respective Sender (S).
If S really has the file then only P will share the file with R.
This attempt is to overcome the limitations and requirements of Cache Proxy, CDN and torrents.
 
 

#Steps to use"

Sender(S), Receiver (R) and Peer(P) uses ports 8080,8081,8082.
Any more instances of the peer will use further ports.
Create directories 8080,8081,8082 for the above entities.
Keep the files in 8080 and 8082.
To specify files for the receiver edit Sender.py and enter the hash values of the files. search --FileBase--- in the Receiver.py
IF running on separate machines, modify the address. search --Address Configuration-- in Receiver.py 
Execution sequence will be Sender.py, Peer.py and Receiver.py
 

#Desclaimar 

We are proposing that the Receiver broadcasts the enquiry over the network. But we have implemented the enquiry with known local instance of the peer.
 

#Description

R will ask the list of files available at S for sharing
For each file yet to be shared by the S, R does the following
R further asks their metadata
R checks availability of the file with Peer P
P , if the file is available checks the file is in possession of S by sending random challenges
S resolves the challenges and forwards to Peer
Peer , if challenges are resolved correctly , shares the file
Receiver notifies to the Sender about successful delivery

#Message Types and Details

Sr

Message Type

From

To

Explanation

Example

1

AVAILABILITY_CHECK

Receiver

Sender

Receiver checks file available at Sender

{"AVAILABILITY_CHECK": {"USER": "A"}}

2

FILE_AVAILABILITY

Sender

Receiver

Sender shares list of file signatures

["File Hash 1", "File Hash 2", "File Hash N"]

3

FILE_INFO_REQUEST

Receiver

Sender

Receiver seeks information of the file by using file signature

{"FILE_INFO_REQUEST":

                {"USER": "A", "FILE_HASH": "File Hash X"}}

4

FILE_INFO

Sender

Receiver

Sender shares requested file signature

{"FILE_INFO":

                {"FILE_HASH": "File Hash X",

                "FILE_NAME": "Image_B.png",

                "FILE_SIZE": 523482}}

5

AVAILABILITY_STATUS

Receiver

Peer

Receiver checks availability of the file at Peer

{"AVAILABILITY_STATUS":

                 {"FILE_HASH": "File Hash X",

                "STATUS": "AVAILABLE",

                "CHALLENGES": ["41-98", "14-29", "12-49"]}}

6

FILE_AVAILABLE

Peer

Receiver

Peer confirms availability.

Adds challenges to confirm possession of the file at the sender.

{"FILE_AVAILABLE": {"FILE_HASH": "File Hash X"}}

7

FWD_CHALLENGES

Receiver

Sender

Receiver forwards challenges to the Sender

{"FWD_CHALLENGES":

                {"FILE_HASH": "File Hash X",

                "CHALLENGES": ["41-98", "14-29", "12-49"]}

}

8

RESPONSE

Sender

Receiver

Sender calculates and shares the responses to Receiver

{"RESPONSE":

                 {"FILE_HASH": "File Hash X",

                "RESOLVED_CHALLENGES": {

                                "41-98": "Response 1",

                                "14-29": "Response 2",

                                "12-49": "Response 3"}}}

9

FWD_RESPONSE

Receiver

Peer

Receiver forwards responses to Peer

{"FWD_RESPONSE":

                {"FILE_HASH": "File Hash X",

                "RESOLVED_CHALLENGES": {

                                "41-98": "Response 1",

                                "14-29": "Response 2",

                                "12-49": "Response 3"}}}

10

PEER_DECISION

Peer

Receiver

Peer checks validity of responses. Notifies the Receiver.

{"PEER_DECISION":

                 {"FILE_HASH": "File Hash X",

                "DECISION": "POSITIVE"}}

11

LOCAL_SHARE

Receiver

Peer

Receiver request file transfer after positive decision.

{"LOCAL_SHARE": {"FILE_HASH": "File Hash X"}}

12

SUCCESSFUL_DELIVERY

Receiver

Sender

Receiver notifies Sender about successful file receiving from the Peer.

{"SUCCESSFUL_DELIVERY": {"FILE_HASH": "File Hash X"}}

13

SEND_FILE

Receiver

Sender

Receiver request Sender to transfer after Peers are not able to share.

{"SEND_FILE": {"FILE_HASH": "File Hash N"}}

Files

8080.zip

Files (2.5 MB)

Name Size Download all
md5:a9242578fce2fe181ef39fe161d2348e
832.6 kB Preview Download
md5:82d76978135ee9e582b23573c4aad6f8
832.6 kB Preview Download
md5:4c1a6afc47229821934a8cbbdcb2321e
832.6 kB Preview Download
md5:864ce50ee4a2f4b5574dcad85485d77b
37 Bytes Preview Download
md5:76083cddc239852fc57259761f63cb40
172 Bytes Preview Download
md5:78d26fb4d12b43584e34fe437da7eca0
3.7 kB Download
md5:d5890126ffedc5e26237921df006845f
204 Bytes Preview Download
md5:7e4abda9994db85fcce7485388b6f09f
101 Bytes Preview Download
md5:586a06b938409733d475fa7e4107aab0
145 Bytes Preview Download
md5:123730245e640e09ed188b00d6da14f9
117 Bytes Preview Download
md5:9cd5c89bf5a970a3a80af6c0ac5914d0
144 Bytes Preview Download
md5:ee01c9069127bf6bc4de8a8c73c1c211
355 Bytes Preview Download
md5:443d3a4e813e597e9f733a6600c5bb2c
98 Bytes Preview Download
md5:11b53b18661d8e1dd3d5660ca70fd793
3.9 kB Download
md5:565d1ce2f856426e9e5de24715f910bd
124 Bytes Preview Download
md5:03d893332ae62a873b8955e2948e0bdd
1.9 kB Preview Download
md5:8cbc897a96bf60fe0423837c50a2de16
7.8 kB Download
md5:398deb3c415b6d4bbdc35b86c22a9a17
351 Bytes Preview Download
md5:53bcf795108a3f76e6a5097a46dccfcb
70 Bytes Download
md5:cabd69df17f0b91c01807474228fc7a7
96 Bytes Preview Download
md5:36a6f43b7b35c5375732993c7ef6fa19
5.7 kB Download
md5:fdd753a30610cebe7b25b4ae6060ba5c
106 Bytes Preview Download

Additional details

Software

Programming language
Python
Development Status
Concept