Skip to main content

Connect to Rdvz through the http transport method

6 replies [Last post]
jxtaenigma
Offline
Joined: 2007-07-11

Hello,

I have succeeded in creating a private group with JXTA, with one RDVZ peer and some edge peers. I am using the configuration of the example (http://www.petrovic.org/blog/2006/11/15/a-turnkey-private-jxta-net-demo/ ).

I have some questions though!

1. Why do the edge peers have the
configurator.setTcpIncoming(false);
Don't these peers ever have to accept connections on a listening tcp port?

2. I have created a RDV peer outside my LAN (NAT). On that peer I additionally set:
configurator.setTcpIncoming(true);
configurator.setTcpOutgoing(true);

configurator.setHttpEnabled(true); // new addition
configuratorsetHttpIncoming(true); // new addition

According to the jxse-javadoc this peer should now be also listening for http connections (on the default port 9901). But it does not seem to do so.

I mean I configured my edge peers to try to connect to:
http://my.rdv.ip:9901

But no connection happens with the external RDVZ. (I shut-down the local RDVZ peer before testing).

Note that in the edge peer code I have also put an additional command: configuratorsetHttpOutgoing(true);
so that it would attempt to connect through the http protocol.

What am I doing wrong?

P.S. I am however able to connect to the external RDVZ through the tcp method(!). I just want to know how can someone use the http method and how that works.

Message was edited by: jxtaenigma

Message was edited by: jxtaenigma

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jxtanewbie
Offline
Joined: 2007-06-14

Hi jxtaenigma

At first I hope to thank you for your answer, you have understand well what I hope to do, [b]is to create my own IDs[/b]. I use like you told me the IDTutorial.java from the example of [b]JXSE_ProgGuide_v2.5_draft.pdf (June 7th, 2007) pp-35[/b], I obtain the following result (by use [b]netbeans[/b] and [b]jxta2.5rc[/b]):

///////////////////////////////////////////////////////////////////
init:
deps-jar:
Created dir: C:\Test\IDTutorial2.5\build\classes
Compiling 1 source file to C:\Test\IDTutorial2.5\build\classes
compile:
run-single:

An infrastucture PeerGroupID: urn:jxta:uuid-*********
PeerID with the above infra ID encoding: urn:jxta:uuid-*********
PipeID with the default defaultNetPeerGroupID encoding: urn:jxta:uuid-********

BUILD SUCCESSFUL (total time: 0 seconds)

///////////////////////////////////////////////////////////////////////////

[b]First question-[/b] Must I in the program using by the example (http://www.petrovic.org/blog/2006/11/15/a-turnkey-private-jxta-net-demo/ ) put for Rendzvous.java in line 53 (found in privatenet-src.zip)

// our chosen peer ID
private String peerID = 'urn:jxta:uuid-**********

I found above, which is PeerID with the above infra ID encoding: urn:jxta:uuid-*********

Is it true?

[b]Second question-[/b] Concerning the line
// parameters that define our private JXTA NetPeerGroup
String NetPeerGroupID='urn:jxta:uuid-**********';

How I can found the NetPeerGroupID by use JXSE_ProgGuide_v2.5_draft.pdf, because when I do the example I found PeerGroupID and not NetPeerGroupID can you show me please because I am newbie in jxta.

Moreover, can you please show me please how to found the 'urn:jxta:uuid- ****** of
String gid and String specID

By use the the IDTutorial.java from the example of JXSE_ProgGuide_v2.5_draft.pdf (June 7th, 2007) pp-35.

[b]My last question -[/b] When I read your answer in the forum you speak about (I also use the "activeports" windows application). How and Where I can found this active port in windows please?

Sorry for all these simple questions (for you) I asked to you but I hope learn how it works jxta.

Thank you very much for your help.

jimbosi
Offline
Joined: 2007-06-14

Hi Enigma,

First off, I'm not an expert with jxta, but I've been fiddling with the same area as you for a while so I thought I might be able to help. It seems to be thanks to an irritating lack of information out there about configuring your different nodes and how it works.

Anyway, my first suggestion is, shortly after starting the peer group on your rdv server, print the group config params to the console and take a look at your configuration. This should show you which http/tcp incoming/outgoing connections are enabled and also what ports they're listening to and transmitting on. It should also tell you somewhere in there how your rendezvous and relay servers are configured. That way you can verify that what you think is running, is actually running.

One thing that you need to do also is make sure your rendezvous server is running as a relay server and that your edge peers are relay clients. I seem to recall reading something about the relay server being required for outside connections and it also seems to automatically find a route out of your local network.

Finally, if you need to confirm that certain ports are open and contactable on your server/clients I'd recommend using a great little tool called "netcat". Very handy for network problems.

hope that helped!
jim

jxtaenigma
Offline
Joined: 2007-07-11

I am using netstat -an (from windows) to see the listening ports and the established connections. (I also use the "activeports" windows application).

How can I print the group config parameters? I am not sure I understand this.
I get my info on how a peer is set-up, from the PlatformConfig in its jxta home folder.

For example on my edge peers (which are configured with setHttpOutgoing(true)) I can see that in their PlatformConfig at the paramater :
(jxta:TransportAdvertisement xmlns:jxta="http://jxta.org" type="jxta:HTTPTransportAdvertisement") (somewhere it says ServerOff)
There it says that the peer is not acting as http server. Which is what I want.
And when I run this peer, I see it trying to connect to the port I specified for the http connection to the rendezvous.
(e.g. it tries to connect to 192.168.1.201:9901). After a while I think that it also tries to connect to a bunch of outside peers (at port 80) that I have not provided in the seeds.txt file. Could they be hardcoded in the jxta SE implementation?

Now on my rendezvous peer, which are configured as HTTP servers, I can also see this in the corresponding PlatformConfig at the paramater :
(jxta:TransportAdvertisement xmlns:jxta="http://jxta.org" type="jxta:HTTPTransportAdvertisement") (somewhere it says ClientOff).
But when I run the rendezvous peer, the port I have specified for HTTP connections is not shown as a LISTENING port from netstat or activeports. And the edge peers never discover my rendezvous peer, even though in their seeds.txt file, I have explicitily put the rendezvous address and http port.

The edge peers are rendezvous and relay clients, and also TCP and HTTP clients. The rendezvous peer is a rendezvous server, relay server, tcp and http server.

Message was edited by: jxtaenigma

jimbosi
Offline
Joined: 2007-06-14

Ok, netstat isn't the same as netCAT. netcat allows you to check if ports are open on remote machines. It's a free tool and you can get it here:
http://netcat.sourceforge.net/

Next, if you want to see your configuration looking at the PlatformConfig file is one way to do it. If you want to access it from the program:
System.out.println(peergroup.getConfigAdvertisement().toString());

Next, I think there are (although I'm not 100% sure) standard rendezvous peers hardcoded into jxta. However, my guess is they're stored in the Network Configurator.
If you don't want this to happen, try using:
NetworkConfigurator.setUseOnlyRelaySeeds(true);
NetworkConfigurator.setUseOnlyRendezvousSeeds(true);

Finally... I'm not sure why the port isn't listening. Your http part of your platform config should look something like this:


http


192.168.2.28


auto


9901


192.168.2.28:9901


(Using the Network Configurator)
gets set through the method:
setHttpPort(9901)
gets set through the method:
setHttpPublicAddress("192.168.2.28:9901", false);

right, hope that answers your questions!

Message was edited by: jimbosi

Message was edited by: jimbosi

jxtanewbie
Offline
Joined: 2007-06-14

Hi jxtaenigma,

You said that you have succeeded in creating a private group with JXTAby using the example (http://www.petrovic.org/blog/2006/11/15/a-turnkey-private-jxta-net-demo/ ).
I try also to use this example but I have a question because I don't know how to do. can you please help to me.

my question is :

In the example it is write

private String NetPeerGroupID="urn:jxta:uuid-";

and also

public void createApplicationPeerGroup() {

// key parameters for the new "appPeerGroup"
String name = "";
String desc = "";
String gid = "urn:jxta:uuid-";
String specID = "urn:jxta:uuid-";

my question is how to fix the values of

NetPeerGroupID="urn:jxta:uuid-";
String gid = "urn:jxta:uuid-";
String specID = "urn:jxta:uuid-";

Thank you very much for your help.

jxtaenigma
Offline
Joined: 2007-07-11

jxtanewbie:
I am not sure I understand what you mean by "fix the values".

There is some sample code in the current [url=https://jxta-guide.dev.java.net/source/browse/*checkout*/jxta-guide/trunk/src/guide_v2.5/JXSE_ProgGuide_v2.5_draft.pdf]JXSE_ProgGuide_v2.5_draft.pdf[/url] which is named IDTutorial.java . It shows how you can create your own IDs for Groups, Pipes and Peers.

I mostly used that code to create my IDs. And then I used the toString() method to print them out and save them in a config.txt that my peers use to initialize themselves. Usually this is unecessary because the peer IDs are stored in the local jxta home folder.

But I wanted the IDs to be persistent even if I deleted that PlatformConfig file, so I created this Config.txt file. So far this works well.