Hi,
In my program, I established a full-duplex TCP communication with my PC via a router.
Socket.SCK = netTCP_GetSocket (tcp_cb_func); if (Socket.SCK >= 0) { netTCP_Listen (Socket.SCK , 5150); netTCP_SetOption (Socket.SCK , netTCP_OptionTimeout, 5) }
The connection was functioning correctly. However, when a new client was added to the network switch and sent a 1K multicast packet to all connected devices, an unexpected issue arose. Although my program did not open any UDP sockets, the UDP event handler was an empty block, my program stopped working after some hours. Should I do anything else that I wasn't aware of?
uint32_t udp_cb_func (int32_t socket, const NET_ADDR *addr, const uint8_t *buf, uint32_t len) { return 0; }
Hello,
Based on the observed reaction of the circuit, when it receives more data (even if the correct socket is not configured to receive them), the load on the network functions increases. This implies that within the Real-Time Operating System (RTOS) structure, more time is required for the network functions to operate well. By introducing longer sleep periods (osDelay) for other functions, the network function can work correctly.
If the Ethernet driver is implemented correctly, the EMAC itself will drop all multicast packets that do not belong to a multicast group that the device has joined. This would reduce the load on the processor so that it should not need time to process these packets.
On the other hand, the router should not forward multicast packets to an Ethernet port that is not involved in the multicast group. This is to prevent the device from being overloaded with multicast packets.
So I wonder what really happened in your case.