Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to forward traffic between Ethernet and serial port?: (5 Items)
   
How to forward traffic between Ethernet and serial port?  
All, I have an embedded device which has an Ethernet interface and serial port.

I want this device to work like a "router", that is, 
1.The device get IP packet from the Ethernet, it the dest IP is not the device itself. It just foward the packet to the 
serial port.
2. The device get data from the serial port (supposed to be IP packet)  and send this data (IP packet) to Ethernet.
3. The device has its own IP and can response ping and ARP from the Ethernet interface.

Now I have QNX running, Ethernet and Serial port are all OK. So how can I realize the forwarding function? BPF or PF.

I just read the doc for "packet filtering" and has no idea so far.
I will not handle the Ethernet header. So BPF is not necessary?

Thanks in advance for any clues. 
Re: How to forward traffic between Ethernet and serial port?  
I believe that what you want to do is set the serial port up as a PPP link.  It will then have it's own IP address and 
standard IP forwarding rules would apply.  

 
Re: How to forward traffic between Ethernet and serial port?  
In case forwarding is not enabled on your system, check out sysctl to enable
ip_forwarding flag which would allow QNX IP stack to route traffic between
eth and ppp interfaces. (for that matter between any two interfaces)

Regards
VG

On Wed, Feb 16, 2011 at 8:22 PM, Robert craig <community-noreply@qnx.com>wrote:

> I believe that what you want to do is set the serial port up as a PPP link.
>  It will then have it's own IP address and standard IP forwarding rules
> would apply.
>
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post83210
>
>
Re: How to forward traffic between Ethernet and serial port?  
Thanks for your suggestion. I successfully test the forwarding function in x86/QNX6.4. The traffic can travel from "en0"
 to serial port (ppp) and vice versa.

But it seems PPP is not suitable for my case. Attached please find the topology of my system. PPP need the other peer 
also support ppp. But the other peer does not support ppp in my system.

I am wodering for two questions:
1. Is the following possible? I write a network driver for my serial port to provide a virtual interface, say "tiger0", 
just like the function of "en0" or "ppp0". Then I forward traffic between "en0" and "tiger0".
If this solution is OK, is it hard to write such a "pseudo" driver. The only thing it needed is to register an interface
 in QNX. So it can recv/send traffic to "en0".
Can I refer to the Ethernet driver in offical BSP for my board?

2. io-pkt and QNX6.4.
The document claims that QNX6.4.0 move to io-pkt.
I start "io-pkt" in boot script. The TCP/IP runs smoothly. However, I saw "/dev/io-net" not expected "/dev/io-pkt".
 I also have offical QNX6.4.0 BSP for ATMEL AT91SAM926x. In the Ethernet driver, all the prefix is still "io-net-...". 
So I am confused.  
 

Thanks
Tiger
Attachment: Image Drawing1.png 5.1 KB
Re: How to forward traffic between Ethernet and serial port?  
Pure guess here, but maybe devn-fd can help?

http://community.qnx.com/sf/discussion/do/listPosts/projects.networking/discussion.drivers.topc12934

In terms of /dev/io-net,  io-net drivers are binary compatible with io-pkt.  When you run them, they register as they 
normally would (with /dev/io-net entries).  This is the driver doing the registration (not the stack).

http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Drivers_wiki_page