RealTime Servers and Reliable UDP
The RealTime Servers documentation said
Communication between a Realtime server and connected game clients uses two channels: a TCP connection for reliable delivery and a UDP channel for fast delivery. When creating messages, game clients choose which protocol to use depending on the nature of the message. Message delivery is set to UDP by default. If a UDP channel is not set up or not available, all messages are sent using TCP as a fallback.
It didn't mention if the UDP is a Reliable UDP implementation or not. If not, is there a plan to introduce a RUDP protocol in the future?
No, RTS doesn't use Reliable UDP. It uses
dgram provided by NodeJS (https://nodejs.org/api/dgram.html).
Could you help me understand your use case for this? Do you have any data to show that TCP or UDP are insufficient for what you are trying to do? With these info, I can work with the product team and send in a feature request.
Well, any genre that is latency-sensitive. For example, the real-time strategy genre.
I'm from a Unity background that almost every popular network solutions offer RUDP as the preferred network protocol. I'd like to borrow the concept of Ruffles (a reliable UDP library of Unity):
- Reliable : All messages are guaranteed to be delivered, the order is not guaranteed, duplicates are dropped. Uses a fixed sliding window.
- ReliableSequenced : All messages are guaranteed to be delivered with the order also being guaranteed, duplicates are dropped. Uses a fixed sliding window.
- Unreliable : Delivery is not guaranteed, nor is the order. Duplicates are dropped.
- UnreliableSequenced : Delivery is not guaranteed but the order is. Older packets and duplicate packets are dropped.
The most useful one is the first "reliable" type.
The problem is RUDP is just a layer on top of UDP. So there's no gold standard or dominated cross-platform solution there.
Thanks for the details @REDACTEDUSER
Currently we are using DTLS to provide encryption in-flight over UDP. Do you know if RUDP has something similar? Could you recommend some popular RUDP libraries that are tried-and-true? Could you also share examples of your aforementioned network solutions which use RUDP?
Low-level RUDP Libraries
|LiteNetLib||C#||AES or XOR|
Ruffles - https://github.com/MidLevel/Ruffles
LiteNetLib - https://github.com/RevenantX/LiteNetLib
Lidgren.Network (maintain mode) - https://github.com/lidgren/lidgren-network-gen3
Hazel-Networking (fork) - https://github.com/willardf/Hazel-Networking
ENet-CSharp - https://github.com/nxrighthere/ENet-CSharp
- https://github.com/vis2k/kcp2k/ (C# port)
- https://github.com/leenjewel/node-kcp (node wrapper)
High-Level Network Solution that supports RUDP
|UNET/Mirror Networking||Y||via Ignorance (an ENet wrapper)|
|DarkRift 2||non-official||via EnetListener|
|Photon||Y||adopt from an early version of ENet|
Well, asymmetric cryptography is not the focus of these RUDP libraries, very few implemented DTLS.
- ENET is the well-used one but lacks documentation.
- KCP seems promising in the Chinese community.
- Hazel-Networking (fork) is maintained by the author of Among Us (and the game uses it).
Thanks for the detailed list! Those are definitely convincing.
If we pull in this feature, we would probably add one of the C# libraries in the C# RTS client; however, on the server side, we'd have to use NodeJS. It's shame that there is no widely used or actively maintained RUDP NodeJS library as far as I see. I found these 2: https://github.com/shovon/node-rudp, https://github.com/Raulmsm/RUDP. The former is slightly more promising and could be looked into.
Last question that could help greatly in prioritization, is there any research that shows concrete numbers on how much improvements RUDP brings over UDP and TCP, e.g. in areas like throughput / packet loss rate? (No big deal if you don't know, we'll do this research ourselves, but it seems like you are an expert in this so doesn't hurt to ask :) )
- [The author @REDACTEDUSER
- Benchmark for ENet and KCP https://paytonturnage.com/writing/latency-of-reliable-streams/
- Another benchmark for ENet and KCP https://github.com/libinzhangyuan/reliable_udp_bench_mark/blob/master/bench_mark.md
- Reliable User Datagram Protocol as a Solution to Latencies in Network Games - compare TCP, UDP, and RUDP
For cross-platform, since RUDP is just a custom layer on top of UDP, different implementations are not compatible with each other. To get a cross-platform solution you may have to port one implementation to node, vice versa.
- ENET is written in C, so it can be used anywhere with a wrapper layer.
- node wrapper: https://gitlab.com/dacevedo/enet-js
- KCP is also written in C and has both C# port and node wrapper.
- Another idea is to use edge.js to integrate .NET DLL with node, then both server and client can stick with the same managed .NET solution.
Not really an expert, hope this information help.
Actually there is a RUDP lib for Nodejs. Please check out geckos.io: https://github.com/geckosio/geckos.io
From the Geckosio page: Version 2 has huge performance improvements. I switched from wrtc to node-datachannel, which is much lighter and faster compared to wrtc.
I think GameLift Realtime Server is looking for a cross-platform solution.
Using our own computing servers instead of Amazon servers?Accepted Answerasked 3 years ago
Do aws free-tier t3.micro servers have a max?asked 4 months ago
RealTime Servers and Reliable UDPasked 8 months ago
GameLift SDK Updates for Unreal 4.26 and Realtime Serversasked a year ago
AWS Realtime scripts possible security issuesasked a year ago
GitHub repository for Realtime Servers?Accepted Answerasked a year ago
GameLift Realtime SDK protobuf definitionsasked 7 months ago
What exactly is the difference between Custom vs Realtime servers in gamelift?asked 4 months ago
Realtime Server Fleet Etag errorsAccepted Answerasked 2 years ago
Support for Unity 2019 in GameLift Realtime Client SDKasked 2 years ago