Skip to main content

Private JXTA Network

6 replies [Last post]
thanhlb
Offline
Joined: 2004-04-07
Points: 0

Dear all,

My question is one of questions that other members in forum/mail list posted nearly the same problem. But it's not clearly both answer and documentation.

* The first, my application can done in SUN publish servers (http://rdv.jxtahosts.net/cgi-bin/relays.cgi?2 and http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?2).

* And now I would like to run a private Jxta network. My current environment are:
- LAN1 - Relay Server - LAN2 (three networks independence)
- LAN1 behind firewall and NAT
- Relay Server can search from LAN1 and LAN2

* I referred to http://www.petrovic.org/blog/2006/11/15/a-turnkey-private-jxta-net-demo/
and with this example I have confused:
- Look at seeds.txt file content [tcp://192.168.0.6:9701] private ip address --> So how can LAN1 and LAN2 can search?? I also replaced with my publish ip address.
- Inside source code of this example defined peerid, groupid.. I also generated ID when application is running.
==> all workaround is not success.

I think this is a basic knowledge about private Jxta network. So I don't know why so hard to get specify documentation about it. Basiclly Sun have these servers (http://rdv.jxtahosts.net/cgi-bin/relays.cgi?2 and http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?2) and I would like to know how can they do that? how can they make it done?

Thanks in advanced.

-thanhlb

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
thanhlb
Offline
Joined: 2004-04-07
Points: 0

Dear all,

I can connected to RDV server. I do nothing, wait for few minutes and I got this message:

Waiting now..
CLIENTCONNECT:
urn:jxta:uuid-9E3BA06A68A3499781DCB5EAA34F06599FC3A50A2A87449FAFCE990394B7FF3403
0 Clients Connected, ThreadCount : 28
CLIENTRECONNECT:
urn:jxta:uuid-9E3BA06A68A3499781DCB5EAA34F06599FC3A50A2A87449FAFCE990394B7FF3403
1 Clients Connected, ThreadCount : 33
CLIENTRECONNECT:
urn:jxta:uuid-9E3BA06A68A3499781DCB5EAA34F06599FC3A50A2A87449FAFCE990394B7FF3403
1 Clients Connected, ThreadCount : 33
CLIENTRECONNECT:
urn:jxta:uuid-9E3BA06A68A3499781DCB5EAA34F06599FC3A50A2A87449FAFCE990394B7FF3403
1 Clients Connected, ThreadCount : 34
CLIENTRECONNECT:
urn:jxta:uuid-9E3BA06A68A3499781DCB5EAA34F06599FC3A50A2A87449FAFCE990394B7FF3403
1 Clients Connected, ThreadCount : 35
2007/09/07 12:37:47 net.jxta.impl.endpoint.EndpointServiceImpl$CanonicalMessenger connectImpl
Fatal: Internal messenger error: connect requested while connected.
2007/09/07 12:37:47 net.jxta.impl.endpoint.EndpointServiceImpl$CanonicalMessenger connectImpl
Fatal: Internal messenger error: connect requested while connected.
2007/09/07 12:46:20 net.jxta.impl.endpoint.EndpointServiceImpl$CanonicalMessenger connectImpl
Fatal: Internal messenger error: connect requested while connected.
2007/09/07 12:46:20 net.jxta.impl.endpoint.EndpointServiceImpl$CanonicalMessenger connectImpl
Fatal: Internal messenger error: connect requested while connected.
CLIENTFAILED:
urn:jxta:uuid-9E3BA06A68A3499781DCB5EAA34F06599FC3A50A2A87449FAFCE990394B7FF3403
0 Clients Connected, ThreadCount : 36

How can stable my connection from peer to Relay server? I published publish Relay with DiscoveryService.DEFAULT_LIFETIME. And could you explain me above error?

Best regards,

-thanhlb

thanhlb
Offline
Joined: 2004-04-07
Points: 0

Dear all,

Anybody in here??
When I telnet to my relay peer I got this:

* Telnet to private relay peer:
JXTAHELLO tcp://219.111.45.54:62865 tcp://10.10.1.3:9701 urn:jxta:uuid-59616261646162614E5047205032503371B62F04D2E44DF18C45ADFF9D5CAED903 0 1.1

*Telnet to Sun publish relay peer:
JXTAHELLO tcp://219.111.45.54:63199 tcp://192.18.37.36:9701 urn:jxta:uuid-59616261646162614A787461503250337B59AE24F1DC4C66AA9881046A14D83003 0 1.1

Why do I only get tcp://10.10.1.3:9701? This is my private ip address. But when I telnet to SUN publish relay server ip address display is publish IP(tcp://192.18.37.36)? Anybody can explain me what I am wrong in my configuration?

Best day

ThanhLe

slowhog
Offline
Joined: 2004-10-06
Points: 0

> Dear all,
>
> Anybody in here??
> When I telnet to my relay peer I got this:
>
> * Telnet to private relay peer:
> JXTAHELLO tcp://219.111.45.54:62865
> tcp://10.10.1.3:9701
> urn:jxta:uuid-59616261646162614E5047205032503371B62F04
> D2E44DF18C45ADFF9D5CAED903 0 1.1
>
> *Telnet to Sun publish relay peer:
> JXTAHELLO tcp://219.111.45.54:63199
> tcp://192.18.37.36:9701
> urn:jxta:uuid-59616261646162614A787461503250337B59AE24
> F1DC4C66AA9881046A14D83003 0 1.1
>
> Why do I only get tcp://10.10.1.3:9701? This is my
> private ip address. But when I telnet to SUN publish
> relay server ip address display is publish
> IP(tcp://192.18.37.36)? Anybody can explain me what I
> am wrong in my configuration?
>

Depends on your configuration, if you are running a RDV after NAT but would like it to be accessible to the internet as a public site, you will do the port forwarding on the NAT and configure your RDV accordingly.

You need to provide the public address and "use public address only" for the transport. Following is the sample from one of the public rdv.


tcp
auto
9701
192.18.37.36:9701

224.0.1.85
1234
16384

thanhlb
Offline
Joined: 2004-04-07
Points: 0

Dear Slowhog,

Thank you for your reply. For reason about security, I can not config port forwarding on NAT. Any else solutions?
By the way could you explain me about Sun publish RDV? I don't set any thing when I ran jxta application through by Sub publish server.

Thank for any explain.

thanhlb.

slowhog
Offline
Joined: 2004-10-06
Points: 0

> Dear Slowhog,
>
> Thank you for your reply. For reason about security,
> I can not config port forwarding on NAT. Any else
> solutions?

If you can explain your configuration(in the sake of network partition and IP segments) and what you intend to do, we can discuss the solutions.

Based on the information you provided in the first message, you should configure peers behind LAN1 to use the relay server, and by disable incoming for transport, you can force other peers to use relay to contact them.

> By the way could you explain me about Sun publish
> RDV? I don't set any thing when I ran jxta
> application through by Sub publish server.
>

Not sure I get your question. What do you want to know?

thanhlb
Offline
Joined: 2004-04-07
Points: 0

Dear all

>>If you can explain your configuration(in the sake of network partition and IP segments)
>> and what you intend to do, we can discuss the solutions.

My plan is developing application cross network(firewall/nat) with purpose are IM, Voice, file sharing, conference etc.. Our company have many independence networks and we would like to exchange information to together in private channel.

As you know we have three networks:
- Relay server: this is a group network have publish ip
- LAN1: network behind firewall and nat also have publish ip
- LAN2: like home network with dynamic ip
Peers located in LAN1 and LAN2 will be connect through by Relay Server.

>> Based on the information you provided in the first message, you should configure
>> peers behind LAN1 to use the relay server, and by disable incoming for transport,
>> you can force other peers to use relay to contact them.
These my code:

** For Relay:
// Generate private NetPeerGroupID
PeerGroupID pgID = MD5ID.createInftrastructurePeerGroupID(INFRABASE, INFRASEED);
String strPgID = pgID.toString();

try {
System.setProperty("JXTA_HOME", jxtaHome.getCanonicalPath());
log.info("JXTA_HOME="+jxtaHome.getCanonicalPath());

config = new NetworkConfigurator();
config.setHome(jxtaHome);
config.setName(pName);
// config.setPeerID(IDFactory.newPeerID(PeerGroupID.defaultNetPeerGroupID));
config.setPeerID(IDFactory.newPeerID(pgID));
config.setPrincipal(principal);
config.setPassword(password);
config.setDescription(description);
config.setUseMulticast(false);

try {
// String rdvSeedingURI ="tcp://10.10.1.4:9701";
// String relaySeedingURI ="tcp://10.10.1.4:9701";
// String rdvSeedingURI ="http://";
// String relaySeedingURI ="http://";
String rdvSeedingURI ="";
String relaySeedingURI ="";
config.addRdvSeedingURI(new URI(rdvSeedingURI));
config.addRelaySeedingURI(new URI(relaySeedingURI));
config.setMode(NetworkConfigurator.RDV_SERVER + NetworkConfigurator.RELAY_SERVER);

config.setUseOnlyRelaySeeds(true);
config.setUseOnlyRendezvousSeeds(true);

config.setTcpEnabled(true);
config.setTcpIncoming(true);
config.setTcpOutgoing(true);
// Set infrastructure
config.setInfrastructureID(pgID);
config.setInfrastructureName(infraName);
config.setInfrastructureDescription(infraDesc);

config.save();

} catch (URISyntaxException use) {
log.error("URISyntaxException ", use);
System.exit(1);
}
** For Edge Peer:
File home = new File(JXTA_HOME);
NetworkConfigurator config = new NetworkConfigurator();
config.setHome(home);
if (!config.exists()) { config.setPeerID(IDFactory.newPeerID(PeerGroupID.defaultNetPeerGroupID));
config.setName(username);
config.setDescription("Created by Aloha");
config.setMode(NetworkConfigurator.EDGE_NODE);
config.setPrincipal(username);
config.setPassword(password);
config.setUseMulticast(false);
try {

// config.addRdvSeedingURI(new URI("http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?2"));
// config.addRelaySeedingURI(new URI("http://rdv.jxtahosts.net/cgi-bin/relays.cgi?2"));
config.addRdvSeedingURI(new URI("http://myrelay/cgi-bin/relays/relays.cgi"));
config.addRelaySeedingURI(new URI("http://myrelay/cgi-bin/relays/relays.cgi"));
config.setUseOnlyRelaySeeds(true);
config.setUseOnlyRendezvousSeeds(true);
config.setTcpIncoming(false);
} catch (java.net.URISyntaxException use) {
use.printStackTrace();
}
try {
config.save();
} catch (IOException io) {
io.printStackTrace();
}
}

Now, my relay server can force event is RendezvousEvent.CLIENTRECONNECT but my edge peers can not exchange message together. Thank for any discussion.

-thanhlb