News for hackers. Stuff that matters.
Re:QUIC Is Not Quick Enough over Fast Internet by Veserv on Monday September 09, 2024 @04:29AM (#41486528)
The system call to send multiple UDP packets in a single call has existed since Linux 3.0 over a decade ago[1]: sendmmsg().

[1] https://man7.org/linux/man-pages/man2/sendmmsg.2.html

Re:QUIC Is Not Quick Enough over Fast Internet by arghwhat on Monday September 09, 2024 @04:33AM (#41486549)
Ah nice, in that case OP's point about syscall overhead is entirely moot. :)

That should really be in the `SEE ALSO` of `man 3 sendmsg`...

Re:QUIC Is Not Quick Enough over Fast Internet by evntdrvn on Monday September 09, 2024 @09:08AM (#41488163)
patches welcome :p
Re:QUIC Is Not Quick Enough over Fast Internet by wtarreau on Wednesday September 11, 2024 @02:47AM (#41508664)
There's still the problem of sending to multiple destinations: OK sendmmsg() can send multiple datagrams, but for a given socket. When you have small windows (thank you cubic), you'll just send a few datagrams this way and don't save much.
Re:QUIC Is Not Quick Enough over Fast Internet by arghwhat on Wednesday September 11, 2024 @07:37AM (#41510367)
> There's still the problem of sending to multiple destinations: OK sendmmsg() can send multiple datagrams, but for a given socket.

Hmm? sendmsg takes the destination address in the `struct msghdr` structure, and sendmmsg takes an array of those structures.

At the same time, the discussion of efficiency is about UDP vs. TCP. TCP writes are per socket, to the connected peer, and so UDP has the upper hand here. The concerns were about how TCP allows giving a large buffer to the kernel in a single write that then gets sliced into smaller packets automatically, vs. having to slice it in userspace and call send more, which sendmmsg solves.

(You can of course do single-syscall or even zero-syscall "send to many" with io_uring for any socket type, but that's a different discussion.)

Re:QUIC Is Not Quick Enough over Fast Internet by wtarreau on Thursday September 12, 2024 @02:40AM (#41518167)
> > There's still the problem of sending to multiple destinations: OK sendmmsg() can send multiple datagrams, but for a given socket.

> Hmm? sendmsg takes the destination address in the `struct msghdr` structure, and sendmmsg takes an array of those structures.

But that's still pointless on a connected socket. And if you're not using connected sockets, you're performing destination lookups for each and every datagram you're trying to send. It also means you're running with small buffers by default (the 212kB default buffers per socket are shared with all your destinations, no longer per destination). Thus normally you want to use connected socket when dealing with UDP in environments having performance requirements.

Re:QUIC Is Not Quick Enough over Fast Internet by justincormack on Monday September 09, 2024 @10:08AM (#41488729)
At one point if I remember it didnt actually work, it still just sent one message at a time and returned the length of the first piece of the iovec. Hopefully it got fixed.
Re:QUIC Is Not Quick Enough over Fast Internet by johnp_ on Monday September 09, 2024 @04:54PM (#41493692)
Looks like Mozilla is currently working on implementing `sendmmsg` and `recvmmsg` use in neqo (Mozilla's QUIC implementation) [1].

[1] https://github.com/mozilla/neqo/issues/1693