0

We are seeing UDP packets being reordered and duplicated when being sent over lo. We can see this because we're sending MPEG transport streams, which have their own sequence number in their headers, though it can also be seen by sending the traffic as RTP and seeing packets come in reordered that way. This may be potentially related to this question, though we are not doing large writes, as we're using code that sends data over networks, so our packets fit in 1500 byte frames.

We've tried configuring RFS with the default suggested configurations (our lo has only one rx-queue), but this doesn't seem to make a difference. This seems to occur regardless of application, whether its our own UDP/RTP code or an application like srt-live-transmit (we didn't test FFMPEG but it probably behaves similarly).

This is on Redhat 8.3 (kernel 4.18.0-240.15.1.el8_3).

4
  • don't forget the 1500 includes the IP headers as well as anything further up the stack ...
    – Mr R
    Apr 9, 2021 at 23:46
  • I am not sure what your question is. When you use UDP, the application is responsible for ordering packets. My admittedly not very network-savvy reaction is to use TCP if you want ordered traffic. I agree it's a bit surprising to see this happening on the loopback interface, but who knows what happens in the kernel. Apr 10, 2021 at 1:42
  • @MrR Right, we account for this, our total IP packet size is < 1500. Apr 12, 2021 at 21:57
  • @berndbausch The question is why are we seeing reordered packets on the loopback. The application is writing them to the socket in the appropriate sequence, as when they're sent over real network interfaces, they're received in the correct order. For some reason over loopback they are reordered by the time they get to the receiving socket. I'm not looking for an alternative (like TCP). I suppose my question is, what does happen in the kernel? Is this expected behavior or is this unusual? Should we not be expecting loopback traffic to be delivered in order or is there a way to ensure this? Apr 12, 2021 at 21:58

1 Answer 1

1

Try enabling RPS:

cat /sys/devices/virtual/workqueue/cpumask > /sys/class/net/lo/queues/rx-0/rps_cpus

Packet reordering is expected but RPS is a fix that should continue to work in the future: https://lore.kernel.org/netdev/[email protected]/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .