Skip to content

gmendonca/simple-p2p-file-sharing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Peer to Peer File Sharing System

To run the project you need ant and java in a linux environment. If you don't want to create Jar files, you can use the script run-non-jar.sh.

First you need to run the script (has to be done with source):

$ source run.sh

You can use the command help to get help all the possibilities. The possible commands are:

$ compile
$ run_server
$ run_client
$ benchmarking

A quickly overview of the files are shown above:

Commands

compile

There aren't possible option here, but this will only work with a working version of Apache Ant.

run_server

By default, it runs the server at the port 3434, to change it you have to use:

$ run_server portNumber

run_client

For the client there are two possibilities, the first one uses the default address for the Central Indexing Server and the second one you have to define the address and port for the server:

  1. Uses the Central Indexing Server at localhost:3434

    $ run_client directory port
  2. Uses the Central Indexing Server address defined by the user:

    $ run_client directory port serverAddress serverPort

bench_lookup

For the Benchmarking of sending Lookup requests to the server, you can use like this:

  1. Uses the Central Indexing Server at localhost:3434

    $ bench_lookup numNodes folderName fileName numRequests
  2. Uses the Central Indexing Server address defined by the user:

    $ bench_lookup numNodes folderName fileName numRequests serverAddress serverPort
  • numNodes: number of nodes
  • folderName: the benchmarking is a peer so needs a folder name to register to the Server
  • fileName: the file you want to search in the Server
  • numRequests: number of requests per node

bench_single_registry

For the Benchmarking of registering peers to the server, you can use like below. In this one, it will run the program 'numPeers' times.

  1. Uses the Central Indexing Server at localhost:3434

    $ bench_single_registry numPeers folderName
  2. Uses the Central Indexing Server address defined by the user:

    $ bench_single_registry numPeers folderName serverAddress serverPort
  • numPeers: number of Peers registering
  • folderName: the benchmarking is a peer so needs a folder name to register to the Server

bench_registry_nodes

For the Benchmarking of registering peers to the server, you can use like below. In this one, it will run the program 'numPeers' times and will register 'numRegistryPerNode' times using a pool of threads for the concurrency.

  1. Uses the Central Indexing Server at localhost:3434

    $ bench_registry_nodes numPeers folderName numRegistryPerNode
  2. Uses the Central Indexing Server address defined by the user:

    $ bench_registry_nodes numPeers folderName numRegistryPerNode serverAddress serverPort
  • numPeers: number of Peers registering"
  • folderName: the benchmarking is a peer so needs a folder name to register to the Server"
  • numRegistryPerNode - how many times will register each peer"

bench_registry

For the Benchmarking of registering peers to the server, you can use like below. In this one, it will run the program just once and will register 'numPeers' peers using a pool of threads for the concurrency.

  1. Uses the Central Indexing Server at localhost:3434

    $ bench_registry folderName numPeers
  2. Uses the Central Indexing Server address defined by the user:

    $ bench_registry folderName numPeers serverAddress serverPort
  • numPeers: number of Peers registering
  • folderName: the benchmarking is a peer so needs a folder name to register to the Server

bench_download

For the Benchmarking of downloading files from other peer, you can use like this:

  1. Uses the Central Indexing Server at localhost:3434

    $ bench_download numNodes folderName fileName numRequests
  2. Uses the Central Indexing Server address defined by the user:

    $ bench_download numNodes folderName fileName numRequests serverAddress serverPort
  • numNodes: number of nodes
  • folderName: the benchmarking is a peer so needs a folder name to register to the Server
  • fileName: the file you want to search in the Server
  • numRequests: number of requests per node

create_directory

This command will create a directory and random text files(1~20K) in order to test the system. It uses base64, so check if your Linux distro has it. Make any changes if needed. You can use this like this:

$ create_directory folderName numFiles
  • folderName: Folder name that will be created to put the text files on
  • numFiles: number of files that will be created in the created folder

help

You can type $ help to view all the commands possible, and $ help 'command' to know more about the command.

About

Simple Peer to Peer File Sharing System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published