s2n-quic icon indicating copy to clipboard operation
s2n-quic copied to clipboard

support ebpf with https://github.com/aya-rs/aya?

Open hiqsociety opened this issue 3 years ago • 4 comments

basically i mean making s2n as an ebpf

hiqsociety avatar Apr 17 '22 13:04 hiqsociety

You're wanting to compile the entire library as a eBPF program? What are you hoping to gain by doing that? Even if it were possible (it's definitely not in its current state) the outcome would definitely be slower than it is now.

camshaft avatar Apr 17 '22 14:04 camshaft

because...

https://speakerdeck.com/pantuza/equic-gateway-maximizing-quic-throughput-using-a-gateway-service-based-on-ebpf-plus-xdp?slide=16

https://github.com/pantuza/equic

hiqsociety avatar Apr 24 '22 08:04 hiqsociety

basically i mean making s2n as an ebpf

I don't think this proposes making s2n an eBPF program. According to the slides linked, possibly this could offload one of s2n-quic's gateway services like connection quotas (but possibly also encryption offload and HTTP request rate-limiting) to the kernel via eBPF.

It doesn't seem like a terrible idea, but I'm not sure to what degree the kernel module must communicate with s2n-quic. It seems it would be different for each type of offloading.

jon-chuang avatar Mar 02 '23 10:03 jon-chuang

BPF itself doesn't magically make things faster. The potential advantage comes from where it is executed. That being said, outside of XDP, there aren't a whole lot of things that could be moved into BPF. Encryption would be much slower since you don't have any intrinsics. And without a fast communication channel between the bpf program and userspace we'd likely make things worse.

camshaft avatar Mar 02 '23 14:03 camshaft