LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-17-2003, 12:27 PM   #1
mikeshn
Member
 
Registered: Feb 2002
Distribution: Fedora Core 2
Posts: 586

Rep: Reputation: 30
TCP vs. UDP


What do you think is better ?

TCP or UDP ?
 
Old 05-17-2003, 12:52 PM   #2
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 587

Rep: Reputation: 32
Depends on purpose.
 
Old 05-17-2003, 01:31 PM   #3
Midnight Rain
LQ Newbie
 
Registered: May 2003
Distribution: Red Hat 9.0, Windows XP, Windows 98, Windows 2000 pro
Posts: 4

Rep: Reputation: 0
purpose doesn't really matter all to much tcp is much better than udp as far as a protocol goes but UDP does have it's purposes where nothing else would do. As far as basic functionality TCP is better because it has error checking built in where as UDP is simple best effort delivery. On transferring a file with UDP you may get it all you may not. You are going to get it all with TCP whatever is on the host computer is what you get everytime.
 
Old 05-17-2003, 02:41 PM   #4
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
what Rain said, TCP is what you want for reliable connections, examples include HTTP, FTP, TELNET, SSH. When a computer sends data, the reciever sends back an ACK (acknowledge) and if the there is no ACK recieved after a period of time, the sender re-sends the data. In UDP its just send it and hope it gets there. UDP is used in DHCP, DNS (i think), RIP and other protocols that dont require a reliable connection.
 
Old 05-17-2003, 03:03 PM   #5
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
And UDP is the default delivery mechanism for most streaming media
- less overhead involved and less likely to experience "stutter" when playing back as there's no hanging about waiting for acknowledgements
 
Old 05-17-2003, 04:14 PM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,535

Rep: Reputation: 148Reputation: 148
There's no "better" or "worser". TCP is connection oriented, used when you'd like to send data and be sure it was received (mail, ftp, www and many other uses). UDP is connection-less, when you don't want/don't need to know if the data was received (and you don't need/want retransmissions). It may be used for video, VoIP etc.

When you send VoIP, a loss of one piece is not a problem - people will be able to understand each other. The same with video. That's why UDP is used there.

Oh...Forgot one thing. UDP is faster. You don't need to connect. So when I want just to send short data, I prefer UDP.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP/UDP Confusion blackhole123 Linux - Networking 1 11-15-2005 03:46 AM
tcp/udp and c++ Kroenecker Programming 1 05-10-2005 11:56 AM
UDP over TCP The_Nerd Programming 7 07-21-2004 09:45 PM
Only receiving UDP packets, no TCP erevlehdeux Linux - Networking 1 04-23-2004 07:36 PM
Switching nfs from udp to tcp 850NA Linux - Networking 0 09-01-2003 10:11 PM


All times are GMT -5. The time now is 10:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration