The only ssl libs that I'm aware of that support kTLS are OpenSSL, and a hack I did to golang (modeled on https://blog.filippo.io/playing-with-kernel-tls-in-linux-4-1...).
The only ssl libs that I'm aware of that support kTLS are OpenSSL, and a hack I did to golang (modeled on https://blog.filippo.io/playing-with-kernel-tls-in-linux-4-1...).
edit: Maybe the developers would be amenable to a patch, but it sounds like a substantial undertaking.
https://mailman.nginx.org/pipermail/nginx/2021-November/0611...
I'm happily using BoringSSL with nginx-quic but this might be enough for me to give quictls a brief look; I'm a sucker for seeing just how much perf I can squeeze out of a static file server without compromising too much on security, and this could be neat.
The only other TLS lib I know of with kTLS 1.3 support is wolfSSL.
For static content (videos, large images, etc) that live on disk, sendfile() will bring them into the kernel page cache, and then send them on to the network. This involves 2 memory accesses: DMA DISK->RAM, DMA RAM->NIC).
To serve that content with a userspace SSL library, you now have to copy the content to userspace, encrypt in userspace, and then copy the content back into the kernel. So you add copy KERN->USER, encrypt USER->USER, copy USER->KERN. So you now have essentially 3 more memory accesses.
By using ktls, you eliminate the KERN->USER and USER->KERN copies by encrypting KERN->KERN.
With SW ktls, we see something like a 2.5 to 3.x speedup for static content on the Netflix CDN.
For inline HW kTLS, you're back to the 2 memory access case, since inline HW kTLS NICs encrypt the TLS records as the traffic is sent on the wire. So it boils down to what's essentially the unencrypted case. That's another 2x speedup, roughly.
I suppose the other way to do it would be a user space network stack?
Ed: i know alpine is popular as (docker) container images - but that typically doesn't include the kernel. I suppose in theory a docker container might leverage kTLS via the host kernel (but not without library support..). How many run alpine on bare metal with 10gbe+ networking?