trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

Add recvmmsg(2)/sendmmsg(2) support on UDP layer

Open masaori335 opened this issue 7 years ago • 11 comments

The recvmmsg() system call is an extension of recvmsg(2) that allows the caller to receive multiple messages from a socket using a single system call.

The sendmmsg() system call is an extension of sendmsg(2) that allows the caller to transmit multiple messages on a socket using a single system call.

These have performance benefits for UDP/QUIC. It'd be grate if ATS can use these on some platforms which support these system calls.

masaori335 avatar Oct 30 '17 01:10 masaori335

Note: The recvmmsg() and sendmmsg() is Linux-specific.

VERSIONS
       The recvmmsg() system call was added in Linux 2.6.32.  Support in glibc was added in version 2.12.
VERSIONS
       The sendmmsg() system call was added in Linux 3.0.  Support in glibc was added in version 2.14.

oknet avatar Oct 30 '17 13:10 oknet

Actually FreeBSD 11.0 supports them.

HISTORY
     The recv()	function appeared in 4.2BSD.  The recvmmsg() function appeared
     in	FreeBSD	11.0.

https://www.freebsd.org/cgi/man.cgi?query=recvmmsg&manpath=FreeBSD+11.0-RELEASE https://www.freebsd.org/cgi/man.cgi?query=sendmmsg&manpath=FreeBSD+11.0-RELEASE

maskit avatar Oct 30 '17 13:10 maskit

How about the Mac OS X and macOS ?

oknet avatar Oct 30 '17 14:10 oknet

macOS doesn't, as far as I know. However, I don't think that will be a reason to not use *mmsg(). In my opinion, we should use native *mmsg() and create compatible functions for platforms which don't have them.

maskit avatar Oct 30 '17 22:10 maskit

At QUIC Hackathon in Tokyo, we agreed to use recvmmsg(). But @oknet concerns about using sendmmsg() for packet lost.

masaori335 avatar Jan 19 '18 07:01 masaori335

Update: It seems like we can use recvmsg_x on macOS.

maskit avatar Oct 23 '18 02:10 maskit

@masaori335 is this still an issue?

bryancall avatar May 22 '19 21:05 bryancall

Right. This is a TODO of QUIC project.

masaori335 avatar May 23 '19 07:05 masaori335

So this only impacts QUIC not DNS?

ywkaras avatar May 03 '21 21:05 ywkaras

I haven't seen any discussion about how we do this yet. I'm not sure if it's good or bad for DNS, but I'd use recv/sendmmsg for the both if there's no objection.

maskit avatar May 05 '21 15:05 maskit

I'm working on this.

maskit avatar Jul 13 '22 04:07 maskit

sendmmsg was supported. recvmmsg is not yet.

maskit avatar Feb 16 '23 01:02 maskit

closed by https://github.com/apache/trafficserver/pull/9905

brbzull0 avatar Jul 10 '23 19:07 brbzull0