[PATCH 0 of 6] QUIC packet routing improvements

Roman Arutyunyan arut at nginx.com
Fri Dec 9 09:38:46 UTC 2022


Tha patchset addresses the packet routing problem in current QUIC
implementation.  The problem is how to route a QUIC datagram to the right nginx
worker.  The simplest and currently available solution is to use SO_REUSEPORT
(SO_REUSEPORT_LB in FreeBSD) socket option, which allows to route a packet
based on client/server address pair.  The downside of the solution is not
handling nginx reloads/restarts properly.

Also, basic eBPF routing is currently implemented which supports client
migration, but it also breaks on reloads and restarts.  Details are in [1],
which is my previous attempt to address the issue.

Two solutions are implemented.

Patch #5 improves the QUIC eBPF module to properly handle nginx reloads and
restarts.  Each QUIC listening allocates several worker sockets which handle
existing worker connections.  The main QUIC UDP sockets only handle new
connections and are inherited as usual.  A reuseport eBPF program routes
a packet to a worker socket based on its DCIDs or to a main sockets based on
the address hash.

Patch #6 adds experimental support for UDP client sockets.  This is a direct
analogy with TCP listen/accept model.


[1] https://mailman.nginx.org/archives/list/nginx-devel@nginx.org/thread/AAEKCDMXWNORDYQ5I2I36DADLF5MCWT4/

--
Roman Arutyunyan



More information about the nginx-devel mailing list