Leonardo Fibucchi
|
From: | Leonardo Fibucchi |
Subject: | [lwip-users] TcpIp output hangs for a while after opening a TCP socket |
Date: | Wed, 1 Mar 2023 15:12:23 +0000 |
Hi, I am experiencing a particular behaviour with opening/closing TCP sockets. In my application I must regularly transmit from my device RTP packets every millisecond. I am also listening on a RTP stream and I receive and handle packets every millisecond. This works fine until I try to open a TCP socket (telnet or http connection). In this case it often happens that my transmitted packets are delayed and the received packet are not available on the stack when I need them. It seems that all tcpip thread is stuck in doing some operations related to TCP and UDP traffic cannot be received or transmitted. I attach 2 wireshark tracks, one that shows the problem and one that don’t. The problem is visible because my device (192.168.10.108) in one case cannot send a UDP packet after exactly 1 ms from the previous one, just after a TCP socket opening, and in the other case it succeds. My computer is 192.168.10.1, and I am opening a telnet connection on the device. Lwip statistics shows no error on TCP or UDP, and actually there are no errors because packets are not lost. I am running my code on an NXP MIMXRT1051, lwip version is STABLE-2_1_3_RELEASE and I attach also my lwipopts.h file. Tcpip thread has the highest priority on my SW while both telnet server or http server have a very low priority. UDP thread that sends and receive data has the immediately lower priority than tcpip thread. I tried many things like using custom pool instead of lwip malloc, or using hw acceleration or even using last lwip beta but the problem persists. I don’t know if this can be called a real issue because my real time requirements are strict and lwip may not guarantee to satisfy them but could you help me in trying to solve this issue? Are there any lwip options that I can set to give priority to UDP or try to make TCP more reactive on opening or closing of sockets? Thank you very much for your help. Greetings, Leonardo |
Track with problem.pcapng
Description: Track with problem.pcapng
Track good.pcapng
Description: Track good.pcapng
lwipopts.h
Description: lwipopts.h
[Prev in Thread] | Current Thread | [Next in Thread] |