Skip to main content

Peer ID when peer belongs to multiple groups

5 replies [Last post]
waldiman
Offline
Joined: 2007-06-26
Points: 0

Hi,

I am quite new to the JXTA project and currently researching whether JXTA suites the requirements of an ongoing medical research project I am involved in.

My question is how the peer ID is created when multiple groups are involved. I found in the JXTA V2.0 specification that the current J2SE reference implementation (UUID format) uses a group UUID in the first 16 bytes of the JXTA UUID Peer ID field. The following 16 bytes are the actual peer UUID. This allows to find out the group of a peer just by looking at the JXTA UUID Peer ID. But how does it work when the peer is participating in multiple groups?! My initial thought was that each peer creates a unique UUID peer ID for each group it is involved in. But then I found this discussion about multiple identities on one of the old mailing list archives:

http://209.85.129.104/search?q=cache:imbXL7u4KeAJ:osdir.com/ml/java.jxta...

Does the peer have to create its ID with the help of the parent group ID?! Is it still possible to evaluate the group membership from the JXTA UUID peer ID in the described scenario?

Thanks a lot in advance for answering!

Cheers,
Jens

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
thenetworker
Offline
Joined: 2003-06-13
Points: 0

Your question may be answered by asking yourself another question. What are those IDs used for? The ID duo of peer+group is used for routing, indexing, searching, etc.. For example, in traditional TCP/IP network, you use IP address and ports to transport messages, while in JXTA, you use IDs, which represent whatever underlying transport mechanism and/or routing strategies you want.

A peer ID is not like an ID you would use when you do your online banking. The former is a part of transport mechanism, and the latter is in the context of identification for security purposes. In JXTA, your unique security identity is represented by the X.509 certificate.

asghar
Offline
Joined: 2005-07-26
Points: 0

Hello Jens,

I hope following statements can help you. I’m not sure, if all of them are correct.

What is a PeerGroup?
No particular rules are imposed on the way peer groups are formed. (from JXTA Spec V 2.0)
Also: What does mean „ [b]peer belonging to multiple peer groups[/b]“?

When a peer starts, it instantiates the WorldPeerGroup, which is responsible for low-level networking issues of JXTA (EndPointService, etc). Than, if it misses a user-defined NetPeerGroup, it starts the default NetPeerGroup (core and standard services of jxta platform). From here the Peer can build a tree-like hierarchy of groups (while some of them can inherit from parent peer group. See [b]LightWeightPeerGroup[/b]) to meaningfully subdivide the JXTA network.

User-specific implemented services can be associated with default NetPeerGroup or some of its subgroups. Access to services can be designed so, resulting in the same effect, as having „[b]Peer belonging to multiple PeerGroups[/b]“.

For a JXTA peer, [b]belonging to multiple groups[/b] can practically mean [b]interaction[/b] with [b]multiple[/b] „[b]set-of-services[/b]“, having platform services in common.

Asghar

waldiman
Offline
Joined: 2007-06-26
Points: 0

Hi Asghar,

thanks a lot for helping me on this.

> For a JXTA peer, [b]belonging to multiple groups[/b] can practically mean [b]interaction[/b] with
> [b]multiple[/b] „[b]set-of-services[/b]“, having platform services in common.

This is actually what I meant with "peer belonging to multiple groups".

Now the question is: How are peerIDs and groupIDs connected to each other when using the UUID reference implementation from the JXTA V2.0 protocol specification. As far as I understood, the JXTA UUID peer ID consists of effectively 32bytes, namely a group UUID (bytes 0-15) and a peer UUID (bytes 16-31).

Now let's assume a [b]peerA[/b] having joined several subgroups ([b]groupA[/b], [b]groupB[/b]) of the default NetPeerGroup. Does the peer now have three JXTA UUID peer IDs "assigned" to it, with respect to the scope of each group? Namely ([groupUUID : peerUUID]):

JXTA UUID peer ID of peerA in NetPeerGroup: [b][NetPeerGroup_ID : peerA_ID][/b]
JXTA UUID peer ID of peerA in groupA: [b][groupA_ID : peerA_ID][/b]
JXTA UUID peer ID of peerA in groupB: [b][groupB_ID : peerA_ID][/b]

Again, thanks a lot for answering.

Cheers,
Jens

Message was edited by: waldiman

Message was edited by: waldiman

dangar27
Offline
Joined: 2008-01-18
Points: 0

Hi waldiman,

For the application I am developing, I need to know the answer to the very same question you asked in this post. Please, if you already know it, It will help me a lot if you (or anyone) could post it here.

Thanks a lot for your help.

PS: My English is quite poor, I will like to apologize if I do not sound as polite as I tried to be.

> Hi Asghar,
>
> thanks a lot for helping me on this.
>
> > For a JXTA peer, [b]belonging to multiple
> groups[/b] can practically mean [b]interaction[/b]
> with
> > [b]multiple[/b] „[b]set-of-services[/b]“, having
> platform services in common.
>
> This is actually what I meant with "peer belonging to
> multiple groups".
>
> Now the question is: How are peerIDs and groupIDs
> connected to each other when using the UUID reference
> implementation from the JXTA V2.0 protocol
> specification. As far as I understood, the JXTA UUID
> peer ID consists of effectively 32bytes, namely a
> group UUID (bytes 0-15) and a peer UUID (bytes
> 16-31).
>
> Now let's assume a [b]peerA[/b] having joined several
> subgroups ([b]groupA[/b], [b]groupB[/b]) of the
> default NetPeerGroup. Does the peer now have three
> JXTA UUID peer IDs "assigned" to it, with respect to
> the scope of each group? Namely ([groupUUID :
> peerUUID]):
>
> JXTA UUID peer ID of peerA in NetPeerGroup:
> [b][NetPeerGroup_ID : peerA_ID][/b]
> JXTA UUID peer ID of peerA in groupA: [b][groupA_ID :
> peerA_ID][/b]
> JXTA UUID peer ID of peerA in groupB: [b][groupB_ID :
> peerA_ID][/b]
>
> Again, thanks a lot for answering.
>
> Cheers,
> Jens

Message was edited by: dangar27

adamman71
Offline
Joined: 2007-01-31
Points: 0

Hi,

If you run the following code:

public static void main(String[] args) {

// Creating a peer group ID and a sub-peer group ID
PeerGroupID MyPeerGroupID_A = IDFactory.newPeerGroupID();
PeerGroupID MyPeerGroupID_B = IDFactory.newPeerGroupID(MyPeerGroupID_A);
PeerGroupID MyPeerGroupID_C = IDFactory.newPeerGroupID(MyPeerGroupID_B);

// Creating a peer ID
PeerID MyPeer_A = IDFactory.newPeerID(MyPeerGroupID_A);
PeerID MyPeer_B = IDFactory.newPeerID(MyPeerGroupID_B);
PeerID MyPeer_C = IDFactory.newPeerID(MyPeerGroupID_C);

byte[] MySeed = { 0, 1, 2, 3, 4, 5, 6 };
PeerID MyPeer_Seed = IDFactory.newPeerID(MyPeerGroupID_A, MySeed);

// Creating a Pipe ID
PipeID MyPipe_A = IDFactory.newPipeID(MyPeerGroupID_A);

// Displaying the IDs
System.out.println("Peer Group A : " + MyPeerGroupID_A.toString());
System.out.println("Peer of A : " + MyPeer_A.toString());
System.out.println("Pipe of A : " + MyPipe_A.toString());

System.out.println("Pipe of A with seed : " + MyPeer_Seed.toString());

System.out.println("Peer Group B of A : " + MyPeerGroupID_B.toString());
System.out.println("Peer of B : " + MyPeer_B.toString());

System.out.println("Peer Group C of B : " + MyPeerGroupID_C.toString());
System.out.println("Peer of C : " + MyPeer_C.toString());

}

You will get something like this:

Peer Group A : urn:jxta:uuid-[b]E2E76334369C484E8986AC6A6EE02F3E[/b] 02
Peer of A : urn:jxta:uuid-[b]E2E76334369C484E8986AC6A6EE02F3E[/b] 5BCCE1738E284BDBA60AD939D7EAB25F03
Pipe of A : urn:jxta:uuid-[b]E2E76334369C484E8986AC6A6EE02F3E[/b] FBB2B65AECF349288561BE8F5D3C7FFB04

Peer of A with seed : urn:jxta:uuid-[b]E2E76334369C484E8986AC6A6EE02F3E[/b] 000102030405460080008003

Peer Group B of A : urn:jxta:uuid-[u]B44AA561277449CC8843E1872D59AB47[/u] [b]E2E76334369C484E8986AC6A6EE02F3E[/b] 02
Peer of B : urn:jxta:uuid-[u]B44AA561277449CC8843E1872D59AB47[/u] C0997BE0299F4140AE50DE6A85297D3C03

Peer Group C of B : urn:jxta:uuid-48F764A983BE47C3938FD3B3B22EC2E3 [u]B44AA561277449CC8843E1872D59AB47[/u] 02
Peer of C : urn:jxta:uuid-48F764A983BE47C3938FD3B3B22EC2E3 2AE55ACDEC7B452CB6B58EE94642833C03

I have added bolds and underlinings to describe the hierarchical structures of IDs.

You must provide a peer group ID when you create a peer ID, but there is a possibility to provide your own seed for the peer part of the peer ID, if you see what I mean in the example above.

Hope it helps,

J.