BNetEx UDP reliability

BlitzMax Forums/BlitzMax Programming/BNetEx UDP reliability

plash(Posted 2008) [#1]
Does BNetEx have guaranteed UDP? Vertex?

Why exactly is UDP (in general) not guaranteed?


Gabriel(Posted 2008) [#2]
In General, packet delivery in UDP is not guaranteed because it's designed to be used in situations where speed is critical. The overhead of ordering and guaranteeing packets would slow it down and this is not acceptable for applications which need that speed. Essentially, a dropped packet is more acceptable in these situations than a delayed packet.

Also, bear in mind that UDP supports packet broadcasting/multicasting where you send one packet to many recipients, and this really would slow down if all of those recipients had to acknowledge receipt of the packet.

Can't help you with BNetEx, I'm afraid.


plash(Posted 2008) [#3]
Do big developer games use UDP or TCP? Why, for either of them?

TCP is always guaranteed, right? Is it faster than guaranteed UDP (essentially the same as TCP?)?


Gabriel(Posted 2008) [#4]
I believe a common approach with big developer games is to use both, depending on the precise purpose. Critical information such as objects being bought and sold would be sent via TCP, because it must arrive, but it is not time-critical, whereas player positions would be sent via UDP, because speed is more important than accuracy for player positions.

TCP is always guaranteed, yes, and always ordered. I'm not sure about the relative speeds of guaranteed UDP vs TCP, but my gut says that an ordered UDP implementation *should* be faster. Raknet, for example, does this.


plash(Posted 2008) [#5]
Thanks for the insight.

Has anyone compared GNet vs BNetEx vs Raknet?
Is one easier to work with than the other (not really looking for ordered UDP anymore)?


TaskMaster(Posted 2008) [#6]
It is often said, if you try to make UDP reliable, you will just end up creating TCP.


Dreamora(Posted 2008) [#7]
GNet: is not for performance. Its scheme is for fullscale object replication. At best, an MMO could be done with it but even there you would waste lots of bandwidth.

BNetEx: Fast, but no reliable option

RakNet: not free, not sure if a wrapper to the most current version exists. It offers a lot of stuff which makes it very powerfull. But also needs significantly more time to get into, understand it and integrate it.

ENet: Present through Pub.ENet (its the base for GNet). Fast, simple, offers reliable.


For all: none of the removes the need that you have an understanding of how networking and related topics work. Otherwise you won't get performant networking independent of the option you use.


Retimer(Posted 2008) [#8]
It is often said, if you try to make UDP reliable, you will just end up creating TCP.


Except with having 'support' for reliable udp, you can optimize your engine by having unimportant or constant packets unreliable, and important ones reliable, instead of being stuck with TCP - which is even known to suck for NAT Punchthrough.

There are a lot of pro's in having such a flexible system. I used a customized Enet (very easy to play with the source but initially lacks many features) then moved to RakNet (which is amazing - check it out!) for my projects, was extremely satisfied with RakNet in the end and I don't think I would ever turn to another network library.


plash(Posted 2008) [#9]
I've designed a simple chat server/client already in BNetEx, which is probably what I will end up using (for the next project), simply because it's simple and I understand it. (I prefer open source, free and cross-platform :D)


xlsior(Posted 2008) [#10]
Why exactly is UDP (in general) not guaranteed?


It's by design -- for things like streaming video, a few artifacts during playback caused by a missing packet is a lot less annoying than the playback freezing while it waits for the few missing pixels to be received. Especially over a low-bandwidth connection, the link may not be able to keep up with the incoming stream of information in real time.