Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have two applications that exchange UDP datagrams. For the most part, the receiving application is able to get data via the recvfrom() call without any delay. Occasionally, I see that although the sender (using write() into socket fd) sends the data, there is a considerable amount of delay (~100 msec) before the receiver sees the data (Polling via recvfrom()).
I would like to get few pointers/hints so I can debug this.
Questions:
1. I noticed that /proc/net/udp shows a snapshot of the sockets with the rx/tx queues. Is the data flow below accurate?
sender user space buffer -> Kernel UDP tx buffer -> Kernel UDP rx buffer -> receiver user space buffer.
I'd like to know if I can debug the latency issue just by relying on monitoring the rx/tx queues in /proc/net/udp. Is there any other way I can do this?
2. I have verified that the sender and receiver threads are not starved of CPU time. Given this, is there anything else that is likely to cause the data to not show up on the receiver socket?
Any hints/directions you can give will be helpful. Thanks for reading.
I'm observing exactly the same problem, in my case, I'm using sendto(), poll() and recv() on 8 sockets to exchange request/reply every 1 milliseconds. Randomly I'm observing a reply being delayed 100 milliseconds only on one socket, all other sockets are receiving reply normally meanwhile. I did also reproduce the problem using only one socket.
Additional tests shown that sending a request and receiving the reply pushes the old reply out of the socket, but the new reply is not received and again waits for the next reply to come in for a period of 100 milliseconds then the situation goes back to normal on that socket.
Last edited by slizotteK; 07-13-2018 at 05:27 PM.
Reason: Addtional Information
There is something that blocks the reception of the buffer in the socket that is pushed by the next reply, I do not believe this has nothing to do with the real-time nature of Linux.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.