Advertisement

Tachyon reliable udp

Started by January 16, 2022 04:19 AM
7 comments, last by umen242 2 years, 2 months ago

Thought I'd post this here. It's a reliable udp library written in Rust that uses a nack based model. Docs are still in short supply I'll be adding those soon, but it's fairly straight forward to use.

https://github.com/gamemachine/tachyon-networking

Cheers

Please change the name, reliable udp doesn't exit by definition of udp.

Adding a transport layer like you did to improve reliability is likely very smart and fast and minimally invasive, but it's not udp.

Advertisement

Everybody in game networking knows that “reliable UDP” is just shorthand for “reliable transport on top of UDP.”

It would be interesting to see benchmarks comparing to popular wrapper libraries like Enet and Raknet.

enum Bool { True, False, FileNotFound };

hplus0603 said:
Everybody in game networking knows that “reliable UDP” is just shorthand for “reliable transport on top of UDP.”

Ok, didn't know that.

But even then, literally every IP transport protocol including TCP/IP is built on top of UDP, so it has no distinguishing meaning at all.

Alberth said:
literally every IP transport protocol including TCP/IP is built on top of UDP

Nope. They're independent.

TCP and UDP usually use IP but theoretically can run on any network model. TCP and UDP are both independent of each other, and quite dramatically so.

People have spent the time to implement many of TCP's features using UDP, implementing their own sliding windows, error checking and recovery, sequencing and reliability features, and all the rest. If they implement the full TCP protocol the overhead would be far greater than just using TCP to begin with, so people don't do that.

UDP and TCP also aren't the only transport protocols. There are several other transport-layer protocols, QUIC (RFC 9000) is a notable one, which is picked up by SteamWorks in games, although developed for modern web browsers. Initially layered with UDP before becoming a draft specification in the earliest days, once it made it to the standards track it only looks like UDP just enough for old networking equipment to let it flow through networks.

hplus0603 said:
It would be interesting to see benchmarks comparing to popular wrapper libraries like Enet and Raknet.

Strongly agreed with this. How does it compare? How does it beat them? I'd also add Steamworks to both of them, which does an amazing job too.

Also it's worth noting that of the 9 online games I've worked on in the past 6 years (whew!) only one has used sockets directly, and that was a port of a homebrew game that happened to win the game development lottery and get a publishing deal. There is little point in re-inventing the wheel for basic connectivity when it's been a solved problem through middleware and first-party libraries for two decades.

There are a ton of features most libraries support these days, or have community support. Encryption through both TLS/DTLS, out-of-band channel communication, connection migration, protection from assorted attacks like DOS attacks, ACK attacks, forgeries and session splitting with ARP attacks, fragmentation attacks, and much more. The high quality of the libraries makes the barrier to enter quite high.

Alberth said:
literally every IP transport protocol including TCP/IP is built on top of UDP

UDP and TCP are both built on top of IP, but TCP is not built on top of UDP.

enum Bool { True, False, FileNotFound };
Advertisement

This is supposed to be reliable, but there's no flow control. If you try to send faster than the receiver can accept, it queues until you're out of buffer space, then returns an error. See the reliable send code in:

https://github.com/gamemachine/tachyon-networking/blob/master/src/tachyon/channel.rs​

So what is the caller supposed to do? Timed wait and retry? Abort? Discard? That needs to be thought out.

This looks like it's intended to be called from C, not Rust or even C++.. It's written like C code, with error codes instead of Result types. Buffer allocation uses unsafe code. “By design it's not thread safe”.

@snacktime how did you learn about URDP ?
Im trying to learn also

This topic is closed to new replies.

Advertisement