Home / Companies / Cloudflare / Blog / Post Details
Content Deep Dive

QUIC restarts, slow problems: udpgrm to the rescue

Blog post from Cloudflare

Post Details
Company
Date Published
Author
Marek Majkowski
Word Count
2,806
Language
English
Hacker News Points
10
Summary

The Cloudflare team has developed a solution to handle graceful restarts of UDP servers without dropping any packets, a challenging problem due to the stateful nature of modern UDP protocols. The solution is called udpgrm, a lightweight daemon that uses Linux's `SO_REUSEPORT` API and eBPF programs to route incoming packets to the correct instance, preserving flow stickiness. The daemon provides a clean API using `setsockopt()` calls, careful socket-stealing logic, powerful and expressive configurable dissectors, and well-thought-out integration with systemd. udpgrm supports three dissector modes: DISSECTOR_FLOW, DISSECTOR_CBPF, and DISSECTOR_NOOP, which can be used to handle different protocols and scenarios. The solution is intended to be easy to use but solves a genuinely hard problem in the Linux Sockets API.