github.com/geph-official/geph2@v0.22.6-0.20210211030601-f527cb59b0df/libs/kcppp/README.md (about) 1 # KCP++: KCP but better (NOT FINISHED!) 2 3 ## Why? 4 5 KCP is pretty well known, but: 6 7 - It's really poorly documented 8 - `kcp-go`'s code quality is appalling 9 - It's a massive layering violation 10 11 KCP++ is a simplified, improved, and partially backwards-compatible reliable transport protocol on top of UDP or any other unreliable datagram transport. Some features include: 12 13 - Well-tuned bandwidth-probing congestion control based on BBR. 14 - Only handle reliable transport. ECC, encryption, etc belong on different layers. 15 - Better performance in really lossy environments through SACK. 16 - RST mechanism to terminate dead connections without timeout. 17 18 ## Packet header 19 20 - **4 bytes**: conversation ID. Not really important except as a sanity check. 21 - **1 byte**: command. One of 22 - PUSH (81) 23 - ACK (82) 24 - WASK (83) 25 - WINS (84) 26 - SACK (91) 27 - RST (0) 28 - **1 byte**: _Reserved, must be 0_ 29 - **2 bytes**: receive window advertisement (in packets) 30 - **4 bytes**: timestamp in ms 31 - **4 bytes**: segment number 32 - **4 bytes**: acknowledgement number