Valhalla Legends Archive

Programming => General Programming => Topic started by: MoNksBaNe_Agahnim on November 15, 2003, 04:53 PM

Title: UDP or TCP
Post by: MoNksBaNe_Agahnim on November 15, 2003, 04:53 PM
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 :)
Title: Re:UDP or TCP
Post by: Grok on November 15, 2003, 04:55 PM
UDP:  low overhead, very fast, nobody cares about lost packets.
TCP:  bigger, slower than UDP, when its gotta be there.
Title: Re:UDP or TCP
Post by: iago on November 15, 2003, 04:56 PM
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.
Title: Re:UDP or TCP
Post by: MoNksBaNe_Agahnim on November 15, 2003, 04:58 PM
awesome thanks for the info i appreciate it. What does low overhead mean?
Title: Re:UDP or TCP
Post by: j0k3r on November 15, 2003, 05:00 PM
I think UDP is used for streaming video, no?
Title: Re:UDP or TCP
Post by: iago on November 15, 2003, 05:06 PM
Quote from: MoNksBaNe_Agahnim on November 15, 2003, 04:58 PM
awesome thanks for the info i appreciate it. What does low overhead mean?

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.
Title: Re:UDP or TCP
Post by: Thing on November 17, 2003, 08:16 AM
http://www.protocols.com/pbook/tcpip1.htm may be of some help to you.
Title: Re:UDP or TCP
Post by: iago on November 17, 2003, 08:45 AM
Also, it's easier for UDP to spoof their return address and port and to get through firewalls ;)