Networking Forums

Networking Forums > Computer Networking > Linux Networking > CPU usage - TCP vs UDP

Reply
Thread Tools Display Modes

CPU usage - TCP vs UDP

 
 
Guest
Posts: n/a

 
      03-03-2005, 07:12 PM
I am currently doing some work on the comparative performance of UDP and
TCP on a RedHat Linux platform.

In particular I have figures for both protocols that measure the CPU usage
for the transmission of data at a fixed bandwidth using varying packet
sizes. (So these are plotted on a graph where the y axis is "CPU usage" and
the x axis is "packet size".)

The results seem to show that TCP has a significantly higher CPU usage than
UDP for the
same bandwidth. This is what I expected.

However, I have seen at least one reputable study that seemed to demonstrate
that the CPU usage was similar for both protocols.

Does anyone have any further evidence to back up either view?

Many thanks

Steve


--
Pedalling Minstrel


 
Reply With Quote
 
 
 
 
Ed Prochak
Guest
Posts: n/a

 
      03-03-2005, 08:57 PM
What did you set up on the UDP side for cases where packets were lost.

If your application needs reliable delivery, then retransmission will
have to be done and that will bring the CPU usage right back up to TCP.

But if your application can live with occasional packet loss, then UDP
may be the one.

Basically you need to make sure you are comparing apples to apples.

HTH,

Ed

 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      03-03-2005, 10:37 PM
And in some cases the stack provider has worked to tune TCP more than
they have worked to tune UDP, which _can_ but may not mean that TCP
has lower overhead than UDP. Also, depends on if you use connected
versus unconnected UDP sockets - connected being able to (generally)
avoid a routing table lookup on each send where unconnected cannot.

Lots and lots of details.

rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
 
Reply With Quote
 
Stefano Pettini
Guest
Posts: n/a

 
      03-04-2005, 06:55 PM
(E-Mail Removed) wrote:

> In particular I have figures for both protocols that measure the CPU usage
> for the transmission of data at a fixed bandwidth using varying packet
> sizes. (So these are plotted on a graph where the y axis is "CPU usage" and
> the x axis is "packet size".)


Which software do you use to measure the CPU usage? I need to perform
similar tests.

Thanks.

Stefano
 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      03-04-2005, 07:05 PM

"Stefano Pettini" <(E-Mail Removed)> wrote in message
news:333Wd.61834$(E-Mail Removed)...

> (E-Mail Removed) wrote:


>> In particular I have figures for both protocols that measure the CPU
>> usage
>> for the transmission of data at a fixed bandwidth using varying packet
>> sizes. (So these are plotted on a graph where the y axis is "CPU usage"
>> and
>> the x axis is "packet size".)


TCP doesn't preserve message boundaries but UDP does. So when you
compare them, do you force a layer on top of TCP that preserves message
boundaries? If you do, then it's not a fair comparison for protocols where
there's no need for preserving message boundaires. If you don't, then it's
not a fair comparison for protocols that need boundaries preserved.

> Which software do you use to measure the CPU usage? I need to perform
> similar tests.


I don't think you really can. TCP and UDP are designed for different
types of application. It wouldn't be fair to compare CPU usage with TCP
trying to solve the type of problem UDP was designed for or vice versa, no
would it be fair to compare their CPU usage as they tackle totally different
problems.

You would have to construct a specific case, and then ask whether TCP or
UDP consumes the least CPU usage for that particular problem. If, for
example, you require duplicate detection, lost packet detection with
retransmission, transmit pacing with exponential backoff, congestion
detection and control, and in order reception, TCP will take less CPU time
per unit of data moved. On the other hand, if you don't need duplicate
detection, transmit pacing, can tolerate out of order reception and have no
need for retransmission, UDP will win hands down.

DS


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to know download usage Martin ©¿©¬ @nohere.net Broadband 3 07-16-2008 02:17 PM
Usage Basil Lee Broadband Hardware 2 08-09-2006 09:39 AM
SSh usage rahul8143@gmail.com Linux Networking 2 10-12-2005 06:37 PM
Broadband usage Alan Penn Broadband 13 02-07-2005 08:28 AM
Usage limitations John Edgar Broadband 5 04-13-2004 08:53 AM



1 2 3 4 5 6 7 8 9 10 11