Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   Development Open Discussion (https://www.gnutellaforums.com/development-open-discussion/)
-   -   How to setup the gnutella network using phex (https://www.gnutellaforums.com/development-open-discussion/94950-how-setup-gnutella-network-using-phex.html)

hustnn February 28th, 2010 09:59 PM

How to setup the gnutella network using phex
 
If I own 5 machines in the local network.Then I want to build the local gnutella network using the phex, what should I do? Can I build the local gnutella network in LAN?How?

How to make my node become the ultraPeer?

giorgiob June 4th, 2011 12:51 PM

I would like to do a similar experiment as a test.

I would like to build a network with 2 or 3 computers and have one servent running on each node.
As far as I understand, a servent has a number of IP addresses where it looks for other running servents at startup.

Question: Where (in the code) are these addresses configured in phex?
Is it possible to have them read from a configuration file?


I would also be interested to know how to switch a phex servent to ultra peer mode (in case this is possible).

GregorK June 5th, 2011 10:52 PM

Both is possible:

Ultrapeer: You can force Phex to be ultrapeer by setting the preference:
Connection.ForceToBeUltrapeer = true
or modify class PrivateNetworkConstants.DEFAULT_FORCE_TOBE_ULTRAPE ER

Otherwise check Servent.isAbleToBecomeUltrapeer() for the conditions that need to apply for a servent to become ultrapeer.


The file src/main/resources/phex/resources/phex.hosts contains a list of hosts Phex tries to connect to on startup.
If you like to create a real private network, there are a few code changes that need to be applied. There should be some outdated instructions in the forum and on the Phex wiki. If you like to experiment with it and like to help to incorporate this into the source with an easy "private" switch, it would be very cool.

Gregor

giorgiob June 6th, 2011 01:06 AM

Since I would like to write an application that exchanges files using phex, I would like to set up my local network to test it first, i.e. I want that
  1. phex connects to specific hosts in my network
  2. phex does not look for further peers on the internet, even if it is connected to the internet
I do not understand exactly why I need to change the source code, shouldn't it be sufficient to change the hosts file?

Anyway, I will look at instructions in the forum before I proceed.

Thanks for the feedback.

giorgiob June 17th, 2011 12:06 PM

I have managed to get Ubuntu on some old computer and start phex from there. I also started phex on my main computer and both servents are connected to each other.
So, I have a network of two computers. Now I have a folder phex in my home directory. It contains three folders: download, incomplete, shared

I have put a file (some mp3 whose file name contains the word "bach") in folder shared. From phex I have added the shared folder to Library -> Shared Files. But now, if I start a search on the other phex servent (search for "bach") I get no result.

Does anyone have an idea as to what I might be doing wrong?

Thank you in advance and many greetings
Giorgio

GregorK June 19th, 2011 02:17 AM

This is the kind of problem I was talking about when you create our own private network.
The problem is, if both servents have not connected to the public Gnutella network, they still assume they are firewalled. If both servents are firewalled they will determine that they can't download from each other... so they want display search results.

In the class Servent.isFirewalled() try to return false as a fixed value. I'm not sure if this is already all that is needed. Somewhere there should a forum thread or a wiki page I think that explains all steps..

giorgiob June 19th, 2011 03:02 AM

Thanks for the hint! It works now.

Maybe there should be a more sophisticated way to determine whether a servent can download from another servent. I.e., if two servents are on the same local network, this should be possible even if they are behind a firewall.

The next problem I have is that both servents also get connected to external servents, even though I have used my own hosts file.
Can it be that external servents have my servents in their caches and try to connect to my servents when they are online? This would mean that my servents to do not try to connect to external servents but external servents find them anyway.

GregorK June 19th, 2011 06:18 AM

Yes but how do you determine whether two servents are on the same local network.
You can't relay on the same IP range, they could be in two different networks. The only reliable way would be to use some multicast channel, which could also be used for a more efficient communication inside a local network.
Though there are many ideas to make this better and more efficient, we had no time and developers yet to implement this.

You need to change your network name to prevent external servents from connecting. You can do this through the Phex UI (Switch Network) or hard wire it in the PrivateNetworkConstants.


All times are GMT -7. The time now is 04:50 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.