[OpenDHT-Users] What the coorect way to use OASIS to find gateway?

Michael J. Freedman mfreed at CS.Princeton.EDU
Sun Jan 4 08:48:07 UTC 2009


#CUI ZHUO# wrote:
> Dear all,
> 
> I just found that the OASIS service seems to be up again, It’s a good 
> news, because we r able to locate the nearest gateway for OpenDHT.
> 
> But I’m wondering how to use this OASIS, I think we can access it via 
> DNS or HTTP, since I’m the beginner of JAVA, I don’t know how to include 
> this dns lookup into my java code, and regarding the HTTP, I’m trying to 
> retrieve the IP from its XML response via:

There should be the equivalent of gethostbyname() in Java.

> http://http.nyuld.net:8096/anycast.xml?pol=opendht&max=3 
> <http://http.nyuld.net:8096/anycast.xml?pol=opendht&max=3>, is my syntax 
> correct?
> 
> However, every time the IP retrieved from the XML response is different 
> from the IP I get from the OASIS homepage by entering: 
> /opendht.nyuld.net/. the XML parsing tool I’m using is JDOM.

That would especially happen if OASIS doesn't have locality information 
about your particular IP prefix, and is instead just returning a random 
IP address.

You can tell via dig, for instance:

  dig opendht.nyuld.net

; <<>> DiG 9.4.2-P2 <<>> opendht.nyuld.net
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63784
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;opendht.nyuld.net.		IN	A

;; ANSWER SECTION:
opendht.nyuld.net.	100	IN	CNAME	opendht.ab4203b5.rnd.oasis.nyuld.net.
opendht.ab4203b5.rnd.oasis.nyuld.net. 14 IN A	128.2.223.63
opendht.ab4203b5.rnd.oasis.nyuld.net. 14 IN A	198.128.56.12


If you see the "rnd" in the CNAME...

Hope this helps,
--mike
(OASIS's author)




More information about the OpenDHT-Users mailing list