True enough. But Linux, properly configured, should also be able to do the same
result. This is strictly systems level programming. It does not require a real
time kernel.
--------------------------------------------
On Wed, 11/6/13, Jason Stahls <> wrote:
Subject: Re: [ts-7000] RE: ts-7800 how do I make 4 (at least 2) identical
network stacks?
To:
Date: Wednesday, November 6, 2013, 7:53 AM
I can see QNX being able to do that, it a
micro-kernel, almost
everything is userland.
On 11/4/2013 8:56 PM, Walter Marvin wrote:
> I don't know QNX, maybe they are doing some routing
under the covers
> --------------------------------------------
> On Mon, 11/4/13, Jonathan Leslie
<> wrote:
>
> Subject: Re: [ts-7000] RE: ts-7800 how do I make 4
(at least 2) identical network stacks?
> To:
> Date: Monday, November 4, 2013, 10:34 AM
>
> I don't know if this
> is relative or not, but to do what I wanted with 2
devices
> with the QNX OS, I boot setup was this:
> # start
> network driverdisplay_msg
> "---> Starting network"io-pkt-v4-hc
> -d e1000 did=0x1501 -ptcpip -vwaitfor /dev/socket
> 3ifconfig
> wm0 192.168.1.127/24#dhcp.client
> -u -i wm0 io-pkt-v4-hc
> -d e1000 did=0x10d3 -ptcpip prefix=/alt -vwaitfor
> /alt/dev/socket 6
> ...
> SOCK=/altifconfig wm0
> 192.168.1.27/24sleep 1SOCK=/
>
> So I had
> two SOCK element which were the 2 different IP
> STACKS.
>
> In a C
> program all I had to do was set which SOCK I was
using to
> determine what network I was on:
>
//////////////////////////////////////////////////////////////////////////////int
sockReceiveThread()
> { struct sockaddr_in
> sa; struct sockaddr_in
> sb; unsigned char
> buffer[128]; int recPort =
> -1; ssize_t
> recsize; socklen_t
> fromlen; CIMConfigReq_t
> requestOut; char
> addrBuff[INET_ADDRSTRLEN];
> setenv("SOCK",
> "/alt", 1); //same as boomcom, but
> lower than correlator and console setprio(getpid(),
> 21);
> requestOut.requestID =
> CIMRECPORTREQUEST; MsgSend(configCoid,
> &requestOut, sizeof(CIMConfigReq_t),
> &cimRecPort, sizeof(int));
> //printf("Crows
> receive port = %d\n", cimRecPort);
> cimRecSocket =
> socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); if
(cimRecSocket == -1)
> {
> sprintf(lmsg.buff, "INIT->ERROR: CROWSCOM
> could not open
socket\n"); MsgSend(loggerCoid,
> &lmsg, sizeof(logMessage_t), NULL, 0); }
> memset(&sa, 0x0,
> sizeof(sa)); sa.sin_family =
> AF_INET; sa.sin_addr.s_addr =
> htonl(INADDR_ANY); sa.sin_port =
> htons(cimRecPort);
> if (-1 ==
> bind(cimRecSocket, (struct sockaddr*) &sa,
sizeof(sa)))
> { sprintf(lmsg.buff,
> "INIT->ERROR: CROWSCOM could not bind to
> socket\n");
> MsgSend(loggerCoid, &lmsg, sizeof(logMessage_t),
> NULL, 0); close(cimRecSocket); return
> -1;
> }
> fromlen =
> sizeof(sb);
> while (1)
> { recsize =
> recvfrom(cimRecSocket, (void*) buffer,
sizeof(buffer),
> 0, (struct sockaddr*)
> &sb, &fromlen);
> // process
> buffer...
>
> }// end
> while }// end
> function
sockReceiveThread////////////////////////////////////////////////////////////////////
>
> I could make 2
> threads, and by changing the one line:
> setenv("SOCK",
> "/alt", 1);
>
> to
> setenv("SOCK",
> "/", 1);
>
> I was on the alternate
> network, I was still node 1.1.1.200, but talking on
a
> completely different network and the other
program(thread)
> new nothing of this process. I'm in touch with
> the folks at QNX to see if I can add a pc104 network
card
> and have
> SOCK=/
> SOCK=/alt
> SOCK=/alt2
> SOCK=/alt3
>
> but I really want to
> do this with the TS-8700 board. So can I do it or
not
> with a Ts-8700?
> Can I do it with a
> TS-7500 and 2 usb-ethernet dongles?
>
>
>
>
>
>
>
>
>
>
> From: Jonathan Leslie
> <>
> To:
> ""
> <>
> Sent: Monday,
> November 4, 2013 1:13 PM
> Subject: Re:
> [ts-7000] RE: ts-7800 how do I make 4 (at least 2)
identical
> network
> stacks?
>
>
>
>
>
>
>
>
>
>
>
>
> " The four
> interfaces can be given four different
addresses"
> I'm not sure what you mean by this and I
> don't expect the kernel to do route anything.
> I
> want 4 interfaces (networks) that I can address
individually
> so as I am talking to right legacy device .101 that
I
> want to.
>
>
> From:
> "" <>
> To:
>
> Sent: Monday, November
> 4, 2013 11:04 AM
> Subject: [ts-7000] RE:
> ts-7800 how do I make 4 (at least 2) identical
> network stacks?
>
>
>
>
>
>
>
>
>
>
>
>
> I think the salient issue is that the four
> legacy boxes need to be on separate networks. Each of
the
> ethernet interfaces can be a separate network. The
four
> interfaces can be given four different addresses. The
custom
> application (or any application at all; the magic
will be
> done in the kernel with the iptables rules) talks to
IP
> addresses which get trapped by rules which NAT/route
the
> destination addresses to a specific interface. Any
> application can then talk to a specific IP address,
but the
> kernel will route the traffic to a 10.1.1.xxx address
on the
> correct interface. This is conceptually similar to
using
> Linux to create a LAN-WAN router with port
forwarding,
> except in this case, the WAN side is internal to the
Linux
> host, and there are multiple LAN
> interfaces.Totally do-able, but will take some
> fiddling to get the right rules.
>
>
> ---In
> <> wrote:
>
> You
> can be a pro in some areas but not others. The guy
admits
> his experience is only at the socket level.
That's not
> enough for what he wants to do. Its not silly to be
> ignorant, it is silly to stay that way. BTW he's
been
> given a lot of bad advice on this forum.
>
> He will either have to hire help, or do a lot of
work.
>
> --------------------------------------------
>
> On Mon,
> 11/4/13, Petr Štetiar <> wrote:
>
>
>
> Subject: Re: [ts-7000] RE: ts-7800 how do I make 4
(at
> least 2) identical network stacks?
>
> To:
>
> Date: Monday, November 4, 2013, 2:14 AM
>
>
>
> Jonathan Leslie <>
>
> [2013-11-03 06:30:51]:
>
>
>
> > I'm confused, I have to send messages to
> two
>
> different devices, both have
>
> > address 1.1.1.101. The way I've done it in
the
> past was
>
> to set up two
>
> > different IP stacks, with different SOCK. I
want
> to
>
> repeat this on a
>
> > TS-7800 only this time I need 4 different IP
stacks
> as
>
> I have 4 different
>
> > devices 1.1.1.101.
>
>
>
> What's so confusing in "Buy TCP/IP book and
read
> it" ?
>
>
>
> I don't know what a SOCK is neither I know what
> you've done
>
> in the past.
>
>
>
> What I know is, that you're kind of a silly guy,
which
> is
>
> calling himself a
>
> Pro, but don't know even basic networking stuff.
And as
> a
>
> bonus point, you're
>
> going to use USB ethernet in production...
>
>
>
> Pro would buy OpenWrt capable 4-5 port router and
would
> do
>
> NAT with iptables.
>
>
>
> -- ynezz
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo Groups is subject to:
http://info.yahoo.com/legal/us/yahoo/utos/terms/
|