9 years ago.

Receiving network packets and sending network packets to the host using the LPC1768

Hello,

I recently got my hands on a LPC1768 and am experimenting with networking at the moment. I have found two libraries that can probably support my experiment: "USB_Ethernet" https://developer.mbed.org/users/daniele/code/USB_Ethernet/ and the "USBDevice" library itself. I found that USB_Ethernet contains Pico http://www.picotcp.com/.

Now I do NOT have an ethernet cable attached to the board. Instead I would like that that the device present itself as an ethernet connection to the computer and should become the preferred network device. Then whenever it gets a packet, I would like to analyze the header and count how many packets are directed to a website such as Google. Next the packets should be send for real, because else you would block all the internet traffic (I guess). So the usb should send the packets back to the host, but tell it to use the secondary (active) internet connection this time.

Should I set up a DHCP server on my LPC1768 to do this? I found that Pico has a "pico_dhcp_server.h" implementation. Also, I have no approach yet on how to receive packets or send them back to the host. Does anyone have experience with this or know a library that can do so?

Thanks!

Be the first to answer this question.