ESP32-WROOM and KSZ8863RLL device questions on IP and sending packets
Posted: Sun Mar 24, 2024 10:45 pm
I have a board I have designed that uses the KSZ8863RLL switch from microchip. I am using the Two Ports mode from this example:
https://github.com/espressif/esp-eth-dr ... ports_mode
This chip is a three port switch with SPI interface. One port goes to the ESP32 and the other two connect to ethernet jacks to provide a dual ethernet solution. The driver uses 'tail tagging' to preserve which port traffic passes through.
I have it working to the point where I see broadcast packets sent out and have set the MAC address of the two ports.
The example uses the open("/dev/net/tap") function to return a file handle. Then uses ioctl() function to bind the ETH_0 and ETH_1 port interface. FInally, the packet is written using the write(fd,...) funciton.
This seems to be a pretty primitive way to send a packet. I was expecting that I would be able to use the bound netif handle and the traditional socket() function and all the sendto(sock, ... ) functions that I have used before.
Also the interfaces are not requesting a DHCP IP request like they did when I used the 'simple switch' configuration or single ethernet like using the W5500 chip.
While I am pleased I have the chip working hardware wise, I don't see how to go forward with typical ESP32 ethernet development.
I should add that it is important in this design to have two isolated ports. One port should not be able to reach the other port but instead must flow through the ESP32 where packets will be authorized and possibly modified.
https://github.com/espressif/esp-eth-dr ... ports_mode
This chip is a three port switch with SPI interface. One port goes to the ESP32 and the other two connect to ethernet jacks to provide a dual ethernet solution. The driver uses 'tail tagging' to preserve which port traffic passes through.
I have it working to the point where I see broadcast packets sent out and have set the MAC address of the two ports.
The example uses the open("/dev/net/tap") function to return a file handle. Then uses ioctl() function to bind the ETH_0 and ETH_1 port interface. FInally, the packet is written using the write(fd,...) funciton.
This seems to be a pretty primitive way to send a packet. I was expecting that I would be able to use the bound netif handle and the traditional socket() function and all the sendto(sock, ... ) functions that I have used before.
Also the interfaces are not requesting a DHCP IP request like they did when I used the 'simple switch' configuration or single ethernet like using the W5500 chip.
While I am pleased I have the chip working hardware wise, I don't see how to go forward with typical ESP32 ethernet development.
I should add that it is important in this design to have two isolated ports. One port should not be able to reach the other port but instead must flow through the ESP32 where packets will be authorized and possibly modified.