Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - qnet over ip without dns: (10 Items)
   
qnet over ip without dns  
Hello,

I would like to do qnet over ip using "bind=ip", but in a situation where a dns server isn't available.  In other words 
I would like to be able to reference the other nodes based on their ip address alone, and or have some way of aliasing 
those ip's to a name without needing a dns server available for the translation.

Is this possible?  And if so how?

Thanks,

Josh
RE: qnet over ip without dns  
Gosh, qnet "bind=ip" was really meant to be used
where there was a DNS server, because the reason
people want to encapsulate qnet packets in IP is
because they can't L2 switch - they are using 
routers and subnets and such in a largish network.

There is a file resolver which theoretically you
could use, but it was sort of a "science project"
and IIRC it does not re-populate (etc) and as such
is really not a serious alternative to DNS.

If you have a configuration where you MUST use
IP packets, but there is no DNS server available,
then I guess you are going to have to use the file
resolver, but be warned that you may have to modify
it to work correctly in your configuration.  The good
news is that all the source is available.

--
aboyd
Re: RE: qnet over ip without dns  
I was just about to create a PR for lwl4 qnet - "file resolver sucks" - 
but looking at the source:

http://svn.ott.qnx.com/view/core_networking/trunk/sys/lsm/qnet/nr/nr_file.c?revision=904&view=markup

the resolve function reloads the file!  Woo-hoo!  Someone has
tried to fix this poor thing.

Next thing I looked at was to make sure the ndb_parse_iface()
function would correctly parse an IP address in the file, and
according to this:

http://svn.ott.qnx.com/view/core_networking/trunk/sys/lsm/qnet/qos/parse_iface.c?revision=904&view=markup

look at:

#if defined(QNET_TRANSPORT_IP_IONET) || defined(QNET_TRANSPORT_IP_IOPKT)

it should.

Ironic moment: in QNX4, /etc/config/netmap was all we had  :)

Executive summary: I think bind=ip should work with the
file resolver.  Someone fixed the file resolver in the past - 
what we don't know is if they were using ethernet MAC
or IP addresses, and the details of their configuration.

--
aboyd
Re: RE: qnet over ip without dns  
Nice,  I will try it out on my end with ip addresses and let you know.
Re: RE: qnet over ip without dns  
I haven't had any luck yet... but i realized i had a messed up qnet_hosts file... at any rate I wanted to let you know 
that if you use "resolve=file" without a /etc/qnet_hosts file being present I ended up with an io-net core dump.... I'm 
assuming that the code loading that file is common for both io-pkt and io-net.  An error message would probably be nicer
 then the core dump.

hopefully I can get something working soon.
Re: RE: qnet over ip without dns  
> I haven't had any luck yet... but i realized i had a messed up qnet_hosts file
> ... at any rate I wanted to let you know that if you use "resolve=file" 
> without a /etc/qnet_hosts file being present I ended up with an io-net core 
> dump.... I'm assuming that the code loading that file is common for both io-
> pkt and io-net.  An error message would probably be nicer then the core dump.
> 
> hopefully I can get something working soon.

The "resolve=file" maybe a little bit stretch.

You should still be able to use "bind=ip,resolve=dns" in your case. "resolve=dns" means QNET will use a (basically) 
gethostbyname() to resolve the ip address from a given name. As long as you have a /etc/hosts to satisfy this resolving,
 no one says you must have a name server.

1) make sure the /etc/hosts is set up correct on both machines.

2) start io-net -p tcpip (without QNET), settle the IP network first. (IP address, your own host name/domain all must be
 properly set)

3) make sure IP resolve will go through /etc/hosts first. By specifying:
     # setconf CS_RESOLVE "lookup file bind"

4) make sure you can ping each other with the name in /etc/hosts

5) load qnet.
    # mount -Tio-net -o "bind=ip,resolve=dns" npm-qnet.so

Hopefully this could get you going.

-xtang
Re: RE: qnet over ip without dns  
Thanks xtang

I'll try that first thing this morning and let you know.

Josh
Re: RE: qnet over ip without dns  
YAY!

So I got it working with your suggestions.

my etc/hosts contained the following:
192.168.100.1 host1.net host1
192.168.100.2 host2.net host2


I set _CS_HOSTNAME, _CS_DOMAIN, and _CS_RESOLVE using the setconf utility.  I then launched io-net with the following:
   io-net -ptcpip stacksize=8192 -dasix -pqnet bind=ip,resolve=dns

Note: when I launched with the default tcpip stack size io-net core dumped indicating that I blew past my stack... never
 seen that before, so I increased the size a bit and it seems to work fine now.

Then I set my static ip addresses with:
  ifconfig en0 inet 192.168.100.1
and
  ifconfig en0 inet 192.168.100.2

At that point i'm able to:
  ls /net/host1
and
  ls /net/host2

and get back valid results.

In addition "cat /proc/qnetstats" doesn't show any of the errors that I was seeing before.


Thanks for all the help!

Josh
Re: RE: qnet over ip without dns  
alright this is what I have so far...

contents of /etc/qnet_hosts 

host1.mydomain 192.168.100.1
host2.mydomain 192.168.100.2


I am launching io-net with the following:
  io-net -ptcpip -dasix -pqnet bind=ip,resolve=file

I set my ip address with the following
  ifconfig en0 inet 192.168.100.1
or
  ifconfig en0 inet 192.168.100.2


My network is simply a cross over cable at this point.
I am able to ping successfully.

cat'ing out /proc/qnet_stats really doesn't show any activity at all even after attempting to access various directories
.

Note: I am currently building qnet, so if I need to make changes to get this to work that isn't a huge deal.

any thoughts?

Josh
Re: RE: qnet over ip without dns  
An addition bit of info.

Once I use ifconfig to set my ip address the following lines show up in qnetstats.


01000553: ip_ionet_rx_ctrl(): _IO_NET_MSG_ADDR_ADD: no existing interface for ND
_LOCAL_NODE
01000553: ip_ionet_rx_ctrl(): _IO_NET_MSG_ADDR_ADD: getconf _CS_DOMAIN failed (N
o such file or directory)


Josh