Valhalla Legends Forums Archive | General Programming | UDP or TCP

AuthorMessageTime
MoNksBaNe_Agahnim
What benifits do each bring? I know TCP is guareented to reach its destination and UDP isn't guarenteed, and i think TCP/IP is used the most now a days, but what does each bring that the other doesn't? Such as which times would you use TCP and not UDP and vise versa. Thanks for any information givin :)
November 15, 2003, 10:53 PM
Grok
UDP: low overhead, very fast, nobody cares about lost packets.
TCP: bigger, slower than UDP, when its gotta be there.
November 15, 2003, 10:55 PM
iago
UDP is good for stuff that you can just send off and not worry a lot whether or not it ever reaches its destination. Examples might be computer games, DNS Lookups, pings, and other stuff. It has very low overhead, and is much faster.

TCP is good if you need a sustained connection, and you require notification if the host is no longer available. Examples could be downloading files, chatrooms, and other stuff.
November 15, 2003, 10:56 PM
MoNksBaNe_Agahnim
awesome thanks for the info i appreciate it. What does low overhead mean?
November 15, 2003, 10:58 PM
j0k3r
I think UDP is used for streaming video, no?
November 15, 2003, 11:00 PM
iago
[quote author=MoNksBaNe_Agahnim link=board=5;threadid=3626;start=0#msg29333 date=1068937114]
awesome thanks for the info i appreciate it. What does low overhead mean?
[/quote]

When you send UDP, very little else is sent either way, so it's fast.

When you send TCP, a connection needs to be maintained, so a lot of data is sent both ways that have nothing to do with the connection stuff, so it's slower and takes more processing but it's more reliable.
November 15, 2003, 11:06 PM
Thing
http://www.protocols.com/pbook/tcpip1.htm may be of some help to you.
November 17, 2003, 2:16 PM
iago
Also, it's easier for UDP to spoof their return address and port and to get through firewalls ;)
November 17, 2003, 2:45 PM

Search