Skip to content

A simple peer-to-peer (P2P) file-sharing application. This software will allow multiple users to share files without relying on a centralized server, similar to protocols used in BitTorrent or Gnutella.

Notifications You must be signed in to change notification settings

lynleei/P2P_file_sharing

Repository files navigation

CS351 P2P File Sharing Software

How to compile and run

You don't need to install any external libraries. This project uses only Python standard libraries.

###How to use

Open terminal windows and run "python peer.py" you should able to see help message

  • Commands:
    • peers - show known peers
    • showfiles - show local shared files
    • get <files> - download a file
    • search <files> - search for a file
    • exit - quit

Examples of Usage(once you are running the program)

show current Peer's neighbors

peers

show current Peer's available files

showfiles

Send request of a files and if other peer has it, it trigger download(ttl=8)

get file7.txt

Search for a file and see which peers has it(ttl=8)

search file7.txt

Exit the program

quit

###NOTE This program initializes every peer with files and name, and connect it:

Peer 1 ↔ Peer 2

Peer 1 ↔ Peer 3

Peer 2 ↔ Peer 4

Peer 2 ↔ Peer 5

UNDER shared directory, each Peer has corresponding folder to share

Peer 1 has:

file1.txt, file2.txt

Peer 2 has:

file3.txt, file4.txt

Peer 3 has:

file5.txt, file6.txt

Peer 4 has:

file6.txt, file7.txt

Peer 5 has:

file7.txt, file8.txt

Once "get file.txt" called you should able to see file being downloaded in "downloads" folder if other peers has the file.

About

A simple peer-to-peer (P2P) file-sharing application. This software will allow multiple users to share files without relying on a centralized server, similar to protocols used in BitTorrent or Gnutella.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages