Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Running Multiple TCP/IP stacks: (9 Items)
   
Running Multiple TCP/IP stacks  
Hi all,

I am running multiple tcp/ip stack with command
io-net -i1 -del900 pci=0x1 -ptcpip prefix=/sock2
then i am setting SOCK environment varable in my server application as /sock2.I am doing the same thing in client 
application.I am able to receive the data in same node or machine on tcp/ip stack with prefix sock2.

But i am facing problem when i am running the client application on remote node and trying to receive the data.I tried 
to receive the data without setting the SOCK environ variable on default tcp/ip stack and also tried by running another 
tcp/ip stack with same  command and setting the SOCK environ variable in client application then also i am not able to 
receive.Is it possibe to do like this or there is any other way to do this.

I did not understand how this tcp/ip stack with prefix sock2 connects to remote node tcp/ip stack (either default or tcp
/ip stack with prefix sock2).Please let me know the solution i am new to tcp/ip.

Thanks, 
Rahul
Re: Running Multiple TCP/IP stacks  
On Tue, Dec 16, 2008 at 05:16:53AM -0500, RAHUL SABLE wrote:
> Hi all,
> 
> I am running multiple tcp/ip stack with command
> io-net -i1 -del900 pci=0x1 -ptcpip prefix=/sock2
> then i am setting SOCK environment varable in my server application as /sock2.I am doing the same thing in client 
application.I am able to receive the data in same node or machine on tcp/ip stack with prefix sock2.
> 
> But i am facing problem when i am running the client application on remote node and trying to receive the data.I tried
 to receive the data without setting the SOCK environ variable on default tcp/ip stack and also tried by running another
 tcp/ip stack with same  command and setting the SOCK environ variable in client application then also i am not able to 
receive.Is it possibe to do like this or there is any other way to do this.
> 
> I did not understand how this tcp/ip stack with prefix sock2 connects to remote node tcp/ip stack (either default or 
tcp/ip stack with prefix sock2).Please let me know the solution i am new to tcp/ip.

The SOCK environmental variable only controls which stack
gets the initial socket() call.  After that normal ip
routing is involved: you need an addr at each end, a route
to each dest, connect() bind() accept().

-seanb
RE: Running Multiple TCP/IP stacks  
I can also see from the "pci=1" option that you have more than one card
in your system.  Make sure that this is selecting the proper card that's
on the same network as the client.

	R. 

-----Original Message-----
From: Sean Boudreau [mailto:community-noreply@qnx.com] 
Sent: Tuesday, December 16, 2008 9:50 AM
To: general-networking
Subject: Re: Running Multiple TCP/IP stacks

On Tue, Dec 16, 2008 at 05:16:53AM -0500, RAHUL SABLE wrote:
> Hi all,
> 
> I am running multiple tcp/ip stack with command io-net -i1 -del900 
> pci=0x1 -ptcpip prefix=/sock2 then i am setting SOCK environment 
> varable in my server application as /sock2.I am doing the same thing
in client application.I am able to receive the data in same node or
machine on tcp/ip stack with prefix sock2.
> 
> But i am facing problem when i am running the client application on
remote node and trying to receive the data.I tried to receive the data
without setting the SOCK environ variable on default tcp/ip stack and
also tried by running another tcp/ip stack with same  command and
setting the SOCK environ variable in client application then also i am
not able to receive.Is it possibe to do like this or there is any other
way to do this.
> 
> I did not understand how this tcp/ip stack with prefix sock2 connects
to remote node tcp/ip stack (either default or tcp/ip stack with prefix
sock2).Please let me know the solution i am new to tcp/ip.

The SOCK environmental variable only controls which stack gets the
initial socket() call.  After that normal ip routing is involved: you
need an addr at each end, a route to each dest, connect() bind()
accept().

-seanb

_______________________________________________
General
http://community.qnx.com/sf/go/post18703
Re: RE: Running Multiple TCP/IP stacks  
Hi,

I am new to TCP/IP programming.

  My m/c contains only one card .so now i am running the io-net without pci option.

io-net -i1 -ptcpip prefix=/sock2 on m/c 1 (10.105.153.203)
io-net -i1 -ptcpip prefix=/sock2 on m/c 1 (10.105.153.204)

So i am attaching my test code please tell me where is the problem.
I am able to send and receive data on tcp/ip stack (sock2) by setting env SOCK in my code(application) on same node 
means in client i am setting (127.0.0.1) and receiving on(SOCK = /sock2).

I am not able to receive when i am running the client on (remote node 10.105.153.204 SOCK=/sock2 or on default one) and 
server on (10.105.153.203 SOCK=/sock2).

Please let me know the solution.

Attachment: Compressed file socket.zip 1.18 KB
Re: RE: Running Multiple TCP/IP stacks  
On Fri, Dec 19, 2008 at 08:59:31AM -0500, RAHUL SABLE wrote:
> Hi,
> 
> I am new to TCP/IP programming.
> 
>   My m/c contains only one card .so now i am running the io-net without pci option.
> 
> io-net -i1 -ptcpip prefix=/sock2 on m/c 1 (10.105.153.203)
> io-net -i1 -ptcpip prefix=/sock2 on m/c 1 (10.105.153.204)
> 
> So i am attaching my test code please tell me where is the problem.
> I am able to send and receive data on tcp/ip stack (sock2) by setting env SOCK in my code(application) on same node 
means in client i am setting (127.0.0.1) and receiving on(SOCK = /sock2).
> 
> I am not able to receive when i am running the client on (remote node 10.105.153.204 SOCK=/sock2 or on default one) 
and server on (10.105.153.203 SOCK=/sock2).
> 
> Please let me know the solution.
> 

Nothing obvious there.  Try checking for failure and
printing out some errors.  See the attached diff.  Can
you ping the other end?

# SOCK=/sock2 ping 10.105.153.203

-seanb
Attachment: Text diff 2.18 KB
Re: RE: Running Multiple TCP/IP stacks  
Hi Sean,

Before modifying the code i tried to ping as you told in your last reply.First  i executed the command like this to run 
second instance of tcp/ip stack.on defualt tcp/ip stack(/dev/socket) m/c1 is pinging to m/c2.

1>io-net -i1 -ptcpip prefix=/DCN

2>SOCK=/DCN ping 10.105.153.203 it started giving
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host

3>SOCK=/DCN ping 127.0.0.1
PING localhost.localdomain (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=1 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=255 time=1 ms

i checked the routing table.
4> netstat -nr
Internet:
Destination        Gateway            Flags     Refs     Use    Mtu  Interface
default            10.105.153.1       UG          0       46      -  en0
10.105.153/24      link#2             UC          8        0      -  en0
10.105.153.1       00:00:0c:07:ac:99  UHLc        1        0      -  en0
10.105.153.2       00:1d:e6:6b:60:00  UHLc        0        0      -  en0
10.105.153.31      00:1e:90:2b:0e:9b  UHLc        2    62156      -  en0
10.105.153.34      00:1e:90:2c:6c:82  UHLc        2    28798      -  en0
10.105.153.78      00:1d:92:ab:e0:ff  UHLc        0     4442      -  en0
10.105.153.105     00:1d:92:ab:da:7b  UHLc        0     4275      -  en0
10.105.153.110     00:1e:90:2c:6e:26  UHLc        0    57428      -  en0
10.105.153.203     00:1e:90:2c:74:b9  UHLc        0        6      -  en0
127.0.0.1          127.0.0.1          UH          0      400  33212  lo0

 5>it's there .203 to which i am trying to pin.
So is there any extra setup (or i need to add route ).Please let me know
which field tell us in this routing table that it's using SECOND tcp/ip STACK.

Thanks
Rahul



Re: RE: Running Multiple TCP/IP stacks  
On Wed, Dec 24, 2008 at 09:38:11AM -0500, RAHUL SABLE wrote:
> Hi Sean,
> 
> Before modifying the code i tried to ping as you told in your last reply.First  i executed the command like this to 
run second instance of tcp/ip stack.on defualt tcp/ip stack(/dev/socket) m/c1 is pinging to m/c2.
> 
> 1>io-net -i1 -ptcpip prefix=/DCN
> 
> 2>SOCK=/DCN ping 10.105.153.203 it started giving
> ping: sendto: No route to host
> ping: sendto: No route to host
> ping: sendto: No route to host
> 
> 3>SOCK=/DCN ping 127.0.0.1
> PING localhost.localdomain (127.0.0.1): 56 data bytes
> 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=1 ms
> 64 bytes from 127.0.0.1: icmp_seq=1 ttl=255 time=1 ms
> 
> i checked the routing table.
> 4> netstat -nr

> 
>  5>it's there .203 to which i am trying to pin.
> So is there any extra setup (or i need to add route ).Please let me know
> which field tell us in this routing table that it's using SECOND tcp/ip STACK.

You're looking at the other stack in the above 'netstat'.  To look
at the one in question:

# SOCK=/DCN ifconfig
# SOCK=/DCN netstat
# SOCK=/DCN route add ...

-seanb
Re: RE: Running Multiple TCP/IP stacks  
Hi ,

  I checked /dev/io-net1 it has only ip0 and ip_en.It does not have eno(ethernet interface as in /dev/io-net). My m/c 
has only one nic that is AMD PCNET-32 Ethernet Controller.when i am giving ifconfig it's showing only one interface en0.
 my question is do we need separate port(interface exmple en1) for running second instance of stack.if yes how to 
configure that en1. i tried by giving  ifconfig en1 ip_addr up but it's giving no such device or file.so when i tried to
 give or load 
io-net -i1 -d pcnet -ptcpip prefix=/sock2
it was giving resource busy.
some how i came to know that it requires separate interface for each tcp/ip stack.
because of that it was giving error while i was trying to configure 
SOCK=/sock2 ifconfig eno ip_addr up
ifconfig: SIOCGIFFLAGS en1: No such device or address
Please let me know solution.

Thanks, 
-Rahul
Re: RE: Running Multiple TCP/IP stacks  
On Fri, Dec 26, 2008 at 08:29:51AM -0500, RAHUL SABLE wrote:
> Hi ,
> 
>   I checked /dev/io-net1 it has only ip0 and ip_en.It does not have eno(ethernet interface as in /dev/io-net). My m/c 
has only one nic that is AMD PCNET-32 Ethernet Controller.when i am giving ifconfig it's showing only one interface en0.
 my question is do we need separate port(interface exmple en1) for running second instance of stack.if yes how to 
configure that en1. i tried by giving  ifconfig en1 ip_addr up but it's giving no such device or file.so when i tried to
 give or load 
> io-net -i1 -d pcnet -ptcpip prefix=/sock2
> it was giving resource busy.
> some how i came to know that it requires separate interface for each tcp/ip stack.
> because of that it was giving error while i was trying to configure 
> SOCK=/sock2 ifconfig eno ip_addr up
> ifconfig: SIOCGIFFLAGS en1: No such device or address
> Please let me know solution.

Yes, you can only load a particular nic in a single instance
of the stack.

-seanb