// the find
skywind3000/kcp
:zap: KCP - A Fast and Reliable ARQ Protocol
KCP is a pure ARQ protocol implementation in two C files (ikcp.h + ikcp.c) that trades 10-20% more bandwidth for 30-40% lower latency compared to TCP. It sits below UDP and above your application — you own the socket I/O; KCP handles the reliability and congestion logic. Used in production by Genshin Impact, NetEase, and Alibaba Cloud.
The implementation is genuinely minimal: two files, no system calls, no allocator dependencies, no threading assumptions — you hand it a clock and a send callback and it does the rest. Selective retransmission and fast retransmit (resend on 2 skipped ACKs rather than timeout) are the real wins over TCP in lossy environments. The pluggable congestion control added in V2 is useful — you can swap algorithms without breaking the wire format. The ecosystem of ports (Go, Rust, C#, Java, etc.) means you're not stuck on C if you need this in a managed runtime.
The primary README is in Chinese with an English translation that lags behind — if you don't read Chinese you're working from incomplete documentation. There's no built-in session management, encryption, or MTU path discovery; you get the ARQ core and nothing else, which is intentional but means significant integration work before you ship anything. The non-work-conserving congestion mode (nc=1) will happily saturate a shared link — useful for gaming, antisocial on anything else. Test coverage in the repo is thin: test.cpp is a single file and there's no CI matrix beyond a dead Travis badge.