talira

Fast, reliable ARQ protocol that cuts latency compared with TCP

open sourceMITfree

KCP is a reliable transport protocol (ARQ) that trades some bandwidth for lower latency: its maker reports 30 to 40% lower average latency than TCP and up to three times lower maximum delay. It gets there with a gentler retransmission timeout, selective and fast retransmission, non-delayed ACKs and optional flow control. It's just the algorithm, two C files (ikcp.h and ikcp.c) with no I/O of its own, so you run it over UDP or any other transport, and it's used in games, P2P systems and tunnels such as kcptun.

Problems it solves

  • reliable low-latency protocol over UDP for a multiplayer game
  • reduce latency of a TCP connection on a lossy network
  • add reliability to a UDP P2P connection

Features

  • selective and fast retransmission
  • 1.5x RTO back-off in fast mode
  • non-delayed ACKs
  • normal and fast modes
  • two-file C implementation with no I/O
  • transport-agnostic, usually over UDP

Limitations

  • It's only the protocol algorithm: your code sends and receives the packets (over UDP, say) and passes them in, and it trades extra bandwidth for lower latency.1