eclipse-threadx / netxduo

Eclipse ThreadX - NetXDuo is an advanced, industrial-grade TCP/IP network stack designed specifically for deeply embedded real-time and IoT applications
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/netx-duo/index.md
MIT License
242 stars 137 forks source link

Use outside of an embedded system? #155

Closed maxkunes closed 1 year ago

maxkunes commented 1 year ago

Hi!

As part of an effort to mock the hardware elements of my system such that I can test off of actual hardware, I'll need to be able to use and test Netxduo in standard environments like compiling through MSVC and running on x86-64 under Windows.

I've noticed ports for this environment and others. However, how could a driver be written to perform the network capabilities? My best guess is modifying the RAM driver (nx_ram_network_driver.c) to do the actual system calls. However, my worry is this driver is too low-level to do that. However, I think it might be possible using some of the raw socket n Windows or Linux or using WinPCAP.

If I am correct in the above, I assume its a simple as modifying _nx_ram_network_driver_output to, for example, call pcap_sendpacket. For receive, I could connect it the ram receive function to a raw packet receive using pcaps pcap_open_live and using a pcap_handler?

Is there a recommended way to get Netxduo running outside an embedded system in a standard operating system like Windows running as a user-mode x86 application? And by running, I mean able to send and receive network traffic.

TiejunMS commented 1 year ago

@maxkunes , if you are interested in running NetX Duo on Linux, here is a tutorial: https://learn.microsoft.com/en-us/training/modules/build-a-udp-echo-client/3-building-and-running-the-project

And a simulator driver for Linux can be found here: https://github.com/Azure-Samples/azure-rtos-learn-samples/blob/main/courses/netxduo/Driver/nx_linux_network_driver.c

maxkunes commented 1 year ago

Awesome, that looks like what I would need. Porting that to windows seems possible with winpcap.

It would be nice to have some of these samples in the main repo. Didn't even realize that the other repo existed.

Thanks!

On Thu, Feb 16, 2023, 12:00 AM TiejunZhou @.***> wrote:

@maxkunes https://github.com/maxkunes , if you are interested in running NetX Duo on Linux, here is a tutorial: https://learn.microsoft.com/en-us/training/modules/build-a-udp-echo-client/3-building-and-running-the-project

And a simulator driver for Linux can be found here: https://github.com/Azure-Samples/azure-rtos-learn-samples/blob/main/courses/netxduo/Driver/nx_linux_network_driver.c

— Reply to this email directly, view it on GitHub https://github.com/azure-rtos/netxduo/issues/155#issuecomment-1432669741, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZP7FFJOIDXEN62H5IK7MTWXXNABANCNFSM6AAAAAAU5ZHPIA . You are receiving this because you were mentioned.Message ID: @.***>

hwmaier commented 1 year ago

Awesome, that looks like what I would need. Porting that to windows seems possible with winpcap.

I have done a Windows port using winpcap. But the code is not published and only used internally as NetXDuo is not really open source and I am uncertain of the license terms.

TiejunMS commented 1 year ago

Closing.