Freitag, 2. Januar 2009

message propagation in a network, p2p approach

I have several nodes in a network. They find each other by certain mechanisms (multicast, broadcast, ...) And then they deliver messages to each other. I have seen this so by a JXTA implementation and JGroups.

But i have problems to understand the JXTA protocol and i can't see through JGroups. I blame this on me, but its way to complicate for me to understand and to debug both. No bad feelings.

I do not like static factories (in the JXTA reference implementation you can only have one "world" within a jvm, you can not do something like:

jxtaNode1 = new JXTA();
jxtaNode2 = new JXTA();

Good Bye, easy JUnit tests!

And in JGroups i also run into trouble when i want to simulate two nodes in one junit test, fast shutdown/startups within a test will usually fail. Probably it has something to do with the nodeIds, which dont really change and therefore nothing is "from scratch" and recovery is being started, etc etc.

And multicast is always troublesome for me. But thats what the JXTA reference implementation and JGroups rely on, its their defaults, even if it works without multicast.

Nevermind, i am a nobody and i simply enjoy fast learning curves for myself. I am impatient, i prefer more the brain dead stuff, which looks simple, but still results from complex thoughts, when you dig deeper into it. Both JXTA and JGroups are complex, but not "brain dead". Wow, thats a lame bashing. :-)

I like the bittorrent approach, tho:


  • There is a resource out there. This resource is identified by a unique hash.

  • A bunch of peers are ready to seed this resource to other peers.

  • Those other peers have found a way to get the hash to a resource.

  • The other peers have found a way to find the seeding peers and can then start to leech/download the resource.

  • The other peers have found a way to find other peers, who have already leeched/downloaded parts of the resource.

  • The more peers have downloaded the resource completely (or peers have pieces only, but all pieces make the puzzle complete again), the more the seeder loses importance.


Anyhow, I find this very easy to understand.

But what bittorrent can not offer to me is a resource, which has no start and no end. It all relies on a resource, which does not change.

However, you can fake it, by creating continuously new resources and publishing those hashes.

Keine Kommentare: