# TCP = 928Mb/s but UDP = 1.05Mb/s [SOLVED]

## timbo

mmm that's right UDP is rather slow.  Tried this through two differnt switches, on my older 100M switch I get TCP at 94.1Mb/s amd UDP is 1.05Mb/s.

Any thought's

Tim

----------

## szczerb

How can you check actual TCP throughput? (I assume not by copying file or stuff like that)

----------

## Mr_Maniac

iperf, right?

I also had similar results. Then I googled a bit and found out, that you need to provide your bandwidth to iperf, when using UDP.

```

Client specific:

  -b, --bandwidth #[KM]    for UDP, bandwidth to send at in bits/sec

                           (default 1 Mbit/sec, implies -u)

```

So you can use -u 1000M for Gigabit, for Example.

----------

## timbo

Yes using iperf...

tried -u 1000M and even -u -b 1000M or even 10000000000M still only getting 1.05Mb/s over udp and 940Mb/s tcp.

Tim

----------

## frenkel

If you search on google, it seems this is normal behaviour. Also read this: http://www.laynetworks.com/Comparative%20analysis_TCP%20Vs%20UDP.htm

----------

## Mr_Maniac

Okay... Seems like you have to put the parameters at the right place...

Wrong:

```

~ # iperf -b 1000M -u -p 12345 -c 192.168.0.1

WARNING: option -b implies udp testing

WARNING: option -b is not valid for server mode

------------------------------------------------------------

Client connecting to 192.168.0.1, UDP port 12345

Sending 1470 byte datagrams

UDP buffer size:   120 KByte (default)

------------------------------------------------------------

[  3] local 192.168.0.254 port 54863 connected with 192.168.0.1 port 12345

[ ID] Interval       Transfer     Bandwidth

[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec

[  3] Sent 893 datagrams

[  3] Server Report:

[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total Datagrams

[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec  0.016 ms    0/  893 (0%)

```

right:

```

~ # iperf -u -p 12345 -c 192.168.0.1 -b 1000M

------------------------------------------------------------

Client connecting to 192.168.0.1, UDP port 12345

Sending 1470 byte datagrams

UDP buffer size:   120 KByte (default)

------------------------------------------------------------

[  3] local 192.168.0.254 port 45199 connected with 192.168.0.1 port 12345

[ ID] Interval       Transfer     Bandwidth

[  3]  0.0-10.0 sec    704 MBytes    590 Mbits/sec

[  3] Sent 502022 datagrams

[  3] Server Report:

[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total Datagrams

[  3]  0.0-10.0 sec    704 MBytes    590 Mbits/sec  0.028 ms    0/502022 (0%)

```

----------

## timbo

Ahhhhhhhh much better not going nut's.

Thank's Mr_Maniac, I did search google but nothing helped now I get;

For UDP

```

[ ID] Interval       Transfer     Bandwidth

[  3]  0.0-10.0 sec  1.07 GBytes    916 Mbits/sec

```

and TCP

```

[ ID] Interval       Transfer     Bandwidth

[  3]  0.0-10.0 sec  1.08 GBytes    930 Mbits/sec

```

Regards

Tim

----------

