A fast and reliable ARQ protocol that reduces latency by 30-40% compared to TCP, at the cost of 10-20% more bandwidth.
KCP is a lightweight, reliable ARQ protocol built on top of UDP, designed to provide faster and more responsive data transmission than TCP. It reduces average latency by 30-40% and cuts maximum latency by three times, at the cost of a 10-20% bandwidth overhead. It solves the problem of TCP's high latency in unreliable network conditions, such as mobile networks or congested public internet.
Developers building real-time applications like online games, live video streaming, VoIP, or any UDP-based protocol that requires reliable, low-latency data delivery. It's particularly useful for those implementing custom network stacks or tunneling solutions.
Developers choose KCP because it offers fine-grained control over transmission behavior, is extremely lightweight (just two source files), and provides significantly lower latency than TCP in lossy network environments. Its modular design allows easy integration into existing projects without adopting a full protocol stack.
:zap: KCP - A Fast and Reliable ARQ Protocol
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements selective retransmission, fast ACKs, and a 1.5x RTO multiplier to reduce average latency by 30-40% and maximum latency by 3x compared to TCP, as benchmarked in real-world use.
Consists of only two source files (ikcp.h, ikcp.c) with no system dependencies, allowing easy integration into custom UDP-based protocols without adopting a full stack.
Offers tunable parameters like nodelay mode, window sizes, and MTU, enabling optimization for specific network conditions, such as mobile or lossy environments.
Used in major projects like Genshin Impact and Alibaba Cloud's GRTN, demonstrating reliability and performance in large-scale, real-time applications.
Requires developers to implement UDP sending/receiving, timing, and session management externally, adding complexity compared to all-in-one libraries.
Lacks encryption, authentication, or FEC (Forward Error Correction) by default, forcing users to add separate layers for secure or resilient transmission.
Admits to 10-20% higher bandwidth usage than TCP for latency gains, which may be prohibitive for cost-sensitive or bandwidth-constrained deployments.