Solved

How faster is UDP compared to TCP?

Posted on 2002-04-19
10
401 Views
Last Modified: 2013-11-29
How faster can UDP be, compared to TCP on the same line, in case of stable work of UDP?
I mean, how many unused information i get by using TCP here instead of UDP.
Actually, I'm a lamer in networking. I just have heard that UDP is more faster, so is it really definitely faster, or I can just tune TCP to have same speed und don't bother with UDP?
(We're assuming here that UDP will work reliable on my network.)
0
Comment
Question by:Perkoff
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 11

Assisted Solution

by:geoffryn
geoffryn earned 20 total points
ID: 6954133
It depends on windowing.  The more frequently the ack is sent, the more overhead TCP has assuming 100% packet delivery.
0
 
LVL 5

Expert Comment

by:dcgames
ID: 6954168
Lots. You can fine tune TCP to make it as fast as possible, changing packet size (large vs. small, depends on average message size, etc.), changing window size (how many packets can be sent before you have to wait for an ACK, etc.

However, UDP is a lot simpler because there is no window. You just send the message and get no confirmation about it having gotten there, so the only thing to worry about is throughput.

Dave
0
 
LVL 8

Accepted Solution

by:
scraig84 earned 30 total points
ID: 6954528
There are other factors as well (other than windowing), such as the stability of the line.  Since UDP has no error control, if there are frequent errors UDP can be dreadfully slow.  Eventually the requestor will determine that a response has not been sent and have to resubmit a request.  However, the decision to go with TCP or UDP has more to do with the fact that error control has to come from someplace.  If the application has no means of checking for errors and resubmitting requests (as I mentioned above), then really your only choice is to go with TCP.  However, if the app does have this ability, and occasionally larger delay is acceptable, then UDP might be the choice.  

Otherwise, like said above, windowing is pretty much everything assuming all other factors are equal such as packet size.  There is a bit of efficiency lost with TCP as well due to a larger header in the packet.
0
 
LVL 11

Expert Comment

by:geoffryn
ID: 6954550
Scraig84 is correct, that is why I qualified my statement with 100% packet delivery.
0
 
LVL 16

Expert Comment

by:SteveJ
ID: 6960158
Depends on the application  . . . kind of like asking "which is faster; a car or a truck?"

Steve
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 5

Expert Comment

by:dcgames
ID: 6960421
So... Do you have more info for us about the TYPE of application?
--

All things being equal UDP is faster than TCP/IP because it has less overhead.

UDP is appropriate for applications where a missing packet every now and then does not cause a problem. If you do detect missing packets and request a re-transmission, you have to add the "re-transmission" cost into the picture.

With TCP, the application gets the packets in order and there are no missing packets. But the overhead is greater to guarantee this. If you have a very clean connection, the overhead is wasted because packets rarely get lost.

If the connection is very dirty, TCP may be bettern than UDP because you detect missing packets right away and they are re-transmitted within a small transmission window.

Dave
0
 

Author Comment

by:Perkoff
ID: 6960462
Ok, I'm interrested in this because I have contact to a group of programmers. They're developing a protocol, an alternative to TCP & UDP. They want it to be almost so fast as UDP and pretty stable as TCP. So i want to know real facts / statistics about the difference in speeds of these 2 protocols, assuming that the line quality is so good, that _there will be no packet loss or other errors when using UDP_. So I want to know, do these programmers really need to bother developing such an alternative?
Now i think everything is clear. Sorry for being so unprecise. My English is not perfect too.
0
 
LVL 5

Expert Comment

by:dcgames
ID: 6960522
UDP and TCP serve different purposes. TCP does have a lot of overhead because it seeks to work even in bad link conditions.

If you were to assume a good quality of line, you could create a protocol that is something like a scaled-down TCP that is closer in performance to UDP in terms of overhead.

Whether or not you need something like this, is up to you :)

Dave
0
 
LVL 8

Expert Comment

by:scraig84
ID: 6960574
My question would be - why???

If you are in need of stability that UDP doesn't provide, why wouldn't you just use TCP?  The hassle of creating something new at this level of the IP stack would be pretty large.  This wouldn't just "hook in" with existing IP stacks - meaning users would need to load specialized IP stacks to work with this.  I have never heard of anyone going to this level of pain just because of the negligible speed differences of UDP and TCP.  Its not like TCP is such a pig that nobody wants to use it.  Is there a difference between TCP and UDP in identical situations? - yes.  Is the difference big enough to reinvent the wheel? - not unless you're certifiably insane - in which case I would suggest that you get help.
0
 

Expert Comment

by:CleanupPing
ID: 9155711
Perkoff:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Join & Write a Comment

Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now