Subject: Re: Slow UDP traffic
To: Perry E. Metzger <>
From: Johnny Billquist <>
List: netbsd-users
Date: 06/06/2004 22:02:50
On Sun, 6 Jun 2004, Perry E. Metzger wrote:

> David Laight <> writes:
> > On Fri, Jun 04, 2004 at 08:43:14PM -0400, Perry E. Metzger wrote:
> >> Schamil Wackenhut <> writes:
> >> > I did some benchmarking in my private network today, and i saw that
> >> > the udp transferrate between my server(NetBSD 1.6.2/GENERIC/ipf
> >> > disabled) and my firewall(OpenBSD 3.5/GENERIC/pf disabled) (both
> >> > have 100mbit ethernet link) is down to only ~25MBit/s. TCP transferrate
> >> > is ok (90MBit/s). What can be a reason for such slow udp traffic?
> >>
> >> I'd read TCP/IP Illustrated, volume 1, to learn the answer, but
> >> in general UDP tends to be pretty slow unless you implement all the
> >> nice things TCP does, at which point you have TCP.
> >
> > On a 10M HDX local LAN segment, UDP should be faster then TCP because
> > there are no acks being sent.
> Not necessarily. TCP will actually often be faster unless the UDP
> based protocol does TCP style congestion management. There are some
> neat papers in some past SIGCOMMs about this sort of thing.

Any modern machine shouldn't hvae any problems sending or receiving a
10Mb/s stream of data.
If you're on a local LAN segment you shouldn't have any congestion, so I
totally fail to see why UDP shouldn't perform better than TCP, for the
simple resaon that you have a higher overhead with TCP.

But it's difficult to just compare TCP and UDP. It would be easier to
understand if the original poster would tell *how* he measured the
bandwidth with TCP and UDP. Did he write his own test program, or did he
use something already existing. If so, what program, and what does that
program do.

If he's doing something silly like transferring files, using ftp and tftp,
then I wouldn't be surprised by these numbers at all.

So: what is he really doing?

> > Provided no packets are being lost UDP should be faster than TCP.
> > I suspect this is one reason why NFS used TCP.
> You mean UDP. Initially NFS used UDP, but it turns out that most of
> the time you're better off with a TCP based implementation anyway, and
> almost all modern NFSes do TCP.

Most NFS implementations can do TCP, but I suspect that most still use UDP
anyway, because that's what you get unless you explicitly ask for TCP.
Also, SUN took it's time to implement NFS over TCP in Solaris (I assume
it's there now).


Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email:           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol