ReliableNetcode.NET icon indicating copy to clipboard operation
ReliableNetcode.NET copied to clipboard

BitCorruption on ReliableChannel

Open NBG-Zorian opened this issue 1 year ago • 4 comments

Question: Does it handle bit corruption which happens naturally sending over the network with poor traffic on reliable channel? I cant seem to find the code which should do it.

NBG-Zorian avatar Jul 25 '24 09:07 NBG-Zorian

This is generally expected to be handled by the underlying communication layer, which should drop corrupt or invalid packets. For instance, Netcode.io mostly handles this by encrypting packet data - a malformed or tampered packet is likely to cause decryption to fail, and the packet will be dropped.

GlaireDaggers avatar Jul 25 '24 15:07 GlaireDaggers

Definitely yes. The packets are both encrypted and signed. Any modification to the packet whatsoever, whether malicious or due to corruption over the network will result in the signature check failing on the packet, and then the packet will be dropped. You can trust that only packets sent by you will be received on the other side, and that these packets will not be corrupted.

gafferongames avatar Jul 25 '24 15:07 gafferongames

But if I am using it with different transport, not Netcode.io? Currently noticed that low level UnityTransport doesnt handle this, so was wondering if using Reliability layer on top of it will solve this?

NBG-Zorian avatar Jul 26 '24 07:07 NBG-Zorian

This library by itself has no mechanism for detecting corrupt packets, as it expects that to be handled by the underlying transport layer. If your transport layer does not handle that, you might consider adding your own layer on top which does (there is a spectrum of ways to do this ofc - from a basic checksum to a full encrypt+sign approach as the Netcode protocol implements).

GlaireDaggers avatar Jul 26 '24 08:07 GlaireDaggers