Setup your own P2PP-OpenWengo network

Setup your own P2PP network

Introduction

Welcome to our implementation of P2PP on Windows XP and Linux. To connect to our overlay, please below.

Connect to our overlay

We are running a bootstrap server at 128.59.19.185 and port 7080. Please follow the instructions to below to connect to our overlay as a client. These instructions are for Windows XP.

1. Download the zip file and unzip it into a directory such as c:\p2pp
2. Open configc.txt using wordpad and change USERID in configc.txt to a suitable name such as salman19 or john.
3. In folder c:\p2pp, run prompt.bat.
4. In command prompt type
    p2p.exe configc.txt logfile [Enter]
    Output:

Starting Client
>>===========joining===========
JOIN SUCCESSFUL === Peer-Id: 0xd6f54942a8e3c71235e4718ceb27c2cfe455c876
Hash size: 20 Hash alg: SHA1
PublishObject: user salman19 hash is: 0xcd9d1f6e29395966b5fdac282f6d5dc1ce0f2d
PublishObject: 302 response 128.59.19.154 7080

4a. At any stage get the prompt by pressing [Enter]. 
5. Try looking up for users john1234, tracy or melinda by typing
    >>ulookup melinda [Enter]
6. Insert a key / value pair:
    >>insert my_key my_value [Enter]
7. Look it up:
    >>rlookup my_key

Executable features

1. Obtain the routing and resource table of a peer
>>getro 128.59.19.185 32807 [Enter]
>>getrt 128.59.19.185 32807 [Enter]

2. Insert / Lookup a key / value pair
>>insert my_key my_value [Enter]
>>rlookup my_key [Enter]

3. Lookup a USER
>>ulookup melinda [Enter]

4. Routing and resource table of a peer
>>showrt [Enter]
>>showro [Enter]

Source code

P2PP source code [GPL license]
Wengo-P2PP code [instructions]

Executables and configuration files

Download for Windows XP
Download for Linux
Setting up Bootstrap Server
Setting up Peers
Setting up Clients

The instructions below are for building a peer-to-peer overlay in a public or a private network.

Windows executable
1. Download the file* from
here .

Linux executable
1. Download the file* from
here.

*: The same executable is used by the bootstrap server, peer and clients.


Setting up the Bootstrap Server


1. Download the configuration file for the bootstrap server from here.
2. Open it any any text editor.
3. There are several fields in this file. See below for an explaination.


TCP_PORT: This is the listening port for incoming requests over TCP. The current implementation does NOT support TCP.

UDP_PORT: This is the listening port for incoming requests over UDP.

P2P: This is the DHT to be used in the P2P network. Kademlia and Bamboo are supported by the current implementation.

HASH_ALG: This is the hash algorithm to be used in the DHT. SHA1, SHA256, MD4, MD5 are supported in the current implementation.

HASH_SIZE: Size of the IDs generated by the Hash Algorithm (in bytes). This depends on the value in the HASH_ALG field. Use the following pairs,
HASH_ALG-HASH_SIZE
SHA1 - 20
SHA256 - 32
MD4 - 16
MD5 - 16

REC: (Value: '0' for iterative, '1' for recursive). Specifies whether iterative or recursive routing is to be used. Current implementation supports both recursive and iterative routing.

PARALLEL: (Value: '1' for parallel, '0' for sequential). Specifies wether parallel requests are to be sent.

CMD: (Value: '1' for command-line usage, '0' for no-command line option). Specifies wether command line usage is desired.

BASE: Indicates the base to be used by the DHT. Should be a power of 2.

MODE: Set this to BOOTSTRAP (default).

4. After editing the file, open a terminal and browse to the directory containing the executable and configuration file.
5. On Linux type "$./p2main bootconfig.txt logfile" and for windows ">p2pmain.exe bootconfig.txt logfile"
6. Bootstrap server is running



Setting up Peers


1. Download the configuration file for the peer from here.
2. Open it with any text editor.
3. There are several fields in this file. See below for an explaination.


TCP_PORT: This is the listening port for incoming requests over TCP. The current implementation does NOT support TCP.

UDP_PORT: This is the listening port for incoming requests over UDP.

P2P: SHOULD be the same as that of the bootstrap server.

HASH_ALG: SHOULD be the same as that of the bootstrap server.

HASH_SIZE: SHOULD be the same as that of the bootstrap server.

REC: Set to '0' for iterative routing and '1' for recursive routing.

PARALLEL: Same as that of bootstrap. Not used by current implementation.

CMD: Specifies wether command line usage is desired. See this for using the command line interface

MODE: Set this to PEER (default).

BOOTIP: IP address of the bootstrap server.

BOOTPORT: UDP port of the bootstrap server.

USERID: Name of the peer. This should be unique for each peer.

4. After editing the file, open a terminal and browse to the directory containing the executable and configuration file.
5. On Linux type "$./p2main configp.txt logfile" and for windows ">p2pmain.exe configp.txt logfile"
6. Peer is running.



Setting up Clients


Clients are not part of the P2P overlay. They will be attached to a peer which will act as a super-peer for the attached
clients. Clients will not store resource objects and will not take part in lookups. However they can insert resource objects,
lookup for peers and resource objects in the same way as peers through their super-peer.

1. Download the configuration file for the client from
here.
2. Open it with any text editor.
3. Fields are the same as Peer. Except

MODE: Set this to CLIENT (default).

BOOTIP: Set this to that of bootstrap server.

BOOTPORT:Set this to the UDP port of the bootstrap server.

4. After editing the file, open a terminal and browse to the directory containing the executable and configuration file.
5. On Linux type "$./p2main configc.txt logfile" and for windows ">p2pmain.exe configc.txt logfile"
6. Client is running