You are not logged in.

#1 2011-10-22 19:35:18

rubdos
Member
Registered: 2011-09-22
Posts: 61

P2P network detection.

Hi guys,

I'll be writing a program soon, that will be decentralised (without server). I know its possible. But how...
If my program can find at least one client, that client can tell the other one some other IP's.
You can do it like this:
-Connect to a certain port and check the service. => check 255^4 ip's to check (in ipv4!)...
-Broadcast a message (aka ping 255.255.255.0 tongue) and see who answers with the right bytes/strings.

How's it done? I know some torrents do it like this...

Ruben

Last edited by rubdos (2011-10-22 19:49:33)

Offline

#2 2011-10-23 11:41:42

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: P2P network detection.

There are several possibilities... And broadcasting is not one of them smile.

- You can maintain a list of IPs in a centralized place (I think StealthNet did this.) Not the best option.

- You can use a DHT (or BitTorrent's DHT) to store the IPs of users. Like kademlia for eMule. Each client needs a list of IPs to "bootstrap" the DHT. If the list becomes empty or all IPs invalid, the user (or client) needs to download a fresh list from somewhere.

- You can adopt a "friend to friend" topology, and then it's up to each user to enter the information of each friend. For people with a dynamic IP address, they can use dyndns, or again a DHT to inform others of their new IP, or even use the network of friends to propagate their new IP. See RetroShare.

Last edited by stqn (2011-10-23 11:44:20)

Offline

#3 2011-10-23 15:18:59

rubdos
Member
Registered: 2011-09-22
Posts: 61

Re: P2P network detection.

stqn wrote:

There are several possibilities... And broadcasting is not one of them smile.

- You can maintain a list of IPs in a centralized place (I think StealthNet did this.) Not the best option.

Yup, not decentralised...

stqn wrote:

- You can use a DHT (or BitTorrent's DHT) to store the IPs of users. Like kademlia for eMule. Each client needs a list of IPs to "bootstrap" the DHT. If the list becomes empty or all IPs invalid, the user (or client) needs to download a fresh list from somewhere.

So basically, I make a txt file on a server around the world, which holds some ip's. The rest of the IP's can be downloaded by the client.

stqn wrote:

- You can adopt a "friend to friend" topology, and then it's up to each user to enter the information of each friend. For people with a dynamic IP address, they can use dyndns, or again a DHT to inform others of their new IP, or even use the network of friends to propagate their new IP. See RetroShare.

Mmm... I think I'll do it the second way.
Thanks!

Last edited by rubdos (2011-10-23 15:19:28)

Offline

#4 2011-10-23 20:52:14

Nisstyre56
Member
From: Canada
Registered: 2010-03-25
Posts: 85

Re: P2P network detection.

Umm, a DHT is a distributed hash table. It isn't just a bunch of text files. You need to actually have a lookup table that is distributed across several or more clients.

http://en.wikipedia.org/wiki/Distributed_hash_table


In Zen they say: If something is boring after two minutes, try it for four. If still boring, try it for eight, sixteen, thirty-two, and so on. Eventually one discovers that it's not boring at all but very interesting.
~ John Cage

Offline

#5 2011-10-23 20:58:14

rubdos
Member
Registered: 2011-09-22
Posts: 61

Re: P2P network detection.

That's what I'm planning to do! Thanks guys.
To be opensource (the resulting app WILL be opensource, if succeeds):
Clients will have at least one ip in a local file.
Every time the system starts, it will poll the ip's in that list for more IP's and append it to that list. The list will be sorted on how much chance there is to be able to connect to one...

Ruben

Offline

Board footer

Powered by FluxBB