[Home] [Groups] - Message: [Prev in Group] [Next in Group]
27300: Re: [MUD-Dev] UDP vs TCP for MUD/MMORPG project.
[Full Header] [Plain Text]
From: Byron Ellacott <bje@apnic.net>
Newsgroups: nu.kanga.list.mud-dev
Date: 12 May 2003 09:48:04 +1000
References: [1]
Organization: Kanga.Nu
On Fri, 2003-05-09 at 05:30, Jason Slaughter wrote:
> I was planning to do it using UDP... My justification for using
> UDP is that it requires less resources than TCP. I can have one
> open port recieving message packets, and don't need to maintain a
> continuous connection, even when the user is doing nothing. Also,
> a UDP system fits better in the architecture of my game: It is
> better in my game to send discrete encoded messages representing
> an "event", than it is to send a continuious stream of text.
Unfortunately, there are several problems with UDP that TCP solves.
The first is reliability - if you send a UDP packet, there's no
guarantee it will arrive, and no implicit acknowledgement of arrival
if it does. If you send two, there's no guarantee about the order
in which they will arrive. With TCP, however, acknowledgements and
sequencing of data are taken care of for you. While it's true UDP
takes fewer resources than TCP, you may find that you will use extra
resources to maintain a connection over a connectionless protocol
anyway.
> However, I have heard from some people that UDP cannot be used
> reliably for such a thing... that it is common for people's
> firewall to not let UDP packets pass, that service providers block
> UDP packets to stop file-sharing, etc. etc., and that the only
> reliable solution is to use TCP.
When a TCP connection is established, NAT and firewalls can see the
connection request from the source and automatically update their
tables to route responses correctly. For UDP however, since there
is no state and no connection, incoming UDP packets are effectively
unknown data, and typically get thrown away.
> Is this true??? Is UDP really that big of a problem? It seems like
> scare-mongering to me, or that people are just so used to TCP that
> they don't know any different... but my technical knowledge of the
> subject isn't great (I am doing this as a learning project), so I
> could be totally wrong. I would greatly appreciate people's
> advice!
Why would someone try to scare you off using UDP? It's very
appropriate for connectionless protocols, but very inappropriate for
connection oriented protocols, which a MUD client (almost certainly)
is.
--
Byron Ellacott <bje@apnic.net>
APNIC
_______________________________________________
MUD-Dev mailing list
MUD-Dev@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev