Skip to main content

discovery of peer in p2p network

2 replies [Last post]
Joined: 2010-04-03

I'm currently implementing a p2p network in java for a chat application. However, I don't know how to discover online peers. Each peer will join the network with 2 attributes which are a username provided by user and the ip address they have. First of all, ip addresses are mostly dynamic, and users should be able to join the network from anywhere in the world. So, my question is how can I discover online peers, since I don't know their ip addresses?

Actually I'm not very sure how p2p networks work and how they are created. I implemented a peer object, and some threads for multiple communication. However, I don't know how to create protocols for communication, as far as I know JXTA has already created a protocol to deal with some peer discovery and message transfer. I'll be glad if anyone explain me how can I take advantage of jxta and what are the useful classes for me?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2008-12-03


Do you use JXSE 2.6 ?

Did you read the Programmer's Guide 2.6 (Beta2) - PDF, ODT.

And this with examples for JXSE 2.5 :*checkout*/jxta-guide/trun...


Joined: 2010-04-03

Hi again,

I just want to create an application only for instant message transfer not any other object. I checked some of jxta downloads, but there are too many classes for me. I'm a newbie in networking, but I'm also told that I'm a quick learner. I'll appreciate If any one can explain me on which classes do I need to work, considering that I'm trying to implement a p2p instant messenger.

How can I deal with the issues below?

Things I need to achieve:
1-)creating an unstructured p2p network where peers broadcast to discover other peers and and use round-trip time to decide on which are 2 closest peers in order to only communicate with them.

2-)assigning unique id to each peer and making each peer aware of the peers near it

Thanks in advance..