4 ms·
TL;DR: A protocol running on top of TCP. It offers encryption, configurability, cheap stream multiplexing and improved latency on unreliable networks at the cos
by wongarsu 7y ago
TL;DR: A protocol running on top of TCP. It offers encryption, configurability, cheap stream multiplexing and improved latency on unreliable networks at the cost of additional bandwidth overhead compared to TCP and RakNet. Designed for communication between game server and client, where little bandwidth is needed but latency is key.
It seems to replace TCPs retransmission of lost packets with erasure encoding, so single lost packets can be reconstructed from the packets that made it. That should provide a nice improvement in mobile or wireless networks.
- adrianmonk 7y ago> A protocol running on top of TCP Probably just a typo, but according to the article it actually runs on top of UDP, as an alternative to TCP.
- DSingularity 7y agoIt wouldn’t make sense to build on top of TCP— a protocol which achieves reliability through packet retransmission.
- vbezhenar 7y agoDoes it adapt to network conditions? Usually my network does not lose any packets, sounds wasteful to spend so many bytes for a rare event.
- kazen44 7y agoyour network might not loose packets, but somewhere between yourself and any other node in the internet, packet loss is quite common.
- tenebrisalietum 7y agoWAN links drop packets all the time and that is not a rare event.
- vbezhenar 7y agoEthernet does not drop packets for me. I guess that people who're using WAN don't care much about network quality, otherwise they wouldn't use it in the first place.
- SahAssar 7y agoWAN is not the same as WLAN.
- vbezhenar 7y agoThen I don't understand why are you saying that WAN is dropping packets all the time. That's not the case for me. It happens, but it means that my Internet is almost unusable and it's rare event. I'm pinging various websites from time to time (because I play online games and dropped packets is very dangerous) and those pings are just fine. Unless it's common occurrence to pass ping packets but drop data packets, that's not happening for me.
- SahAssar 7y ago> dropped packets is very dangerous It's not, they are re-transmitted just fine by TCP or over the protocol built on UDP. Anyway, dropping packets over WAN is just a fact. If you don't think it happens then you are lucky enough to be able to ignore it. If you also think it never happens on your LAN then either you have better networking than the best datacenters or you are relying on hardware and software so you never see it.
- vbezhenar 7y agoI did not state that it never happens. I'm aware how TCP works. It's dangerous because game becomes unplayable. My point is, packets do not drop regularly for me. It's an exception rather than a rule. Spending a significant amount of traffic for error correcting codes which won't be used is a waste. Proper network stack should not enable this mode until actual packet drops are observed and should disable this mode if packets stop dropping. If a lot of packets are dropping, it might be worth to put even more error correcting codes, to be able to recover from two dropped packets, and so on.
- loeg 7y agoYou got the top level bullet wrong. KCP runs on top of an unreliable packet model (and only provides value in that model); implementer's choice as to the actual mechanism, but that usually means UDP if you want to get it across the existing internet infrastructure.