I am measuring the tcp and udp throughput by iperf3. I run iperf3 in virtual machines, one as server and the other as client. The VMs are connecting via 10 Gbps link. The results show that tcp get much higher throughput than udp. However, as we know TCP runs more algorithms and computation and it has three-way handshaking also, so why udp throughtput is less that tcp?is it something related to the buffer size of tcp and udp? below are result of tcp and udp measurements. It is apparent that iperf sends more data for tcp rather than udp in a specific time, but why?
TCP: 8.88 Gbps
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 922 MBytes 7.73 Gbits/sec 1 3.04 MBytes
[ 4] 1.00-2.00 sec 1.04 GBytes 8.92 Gbits/sec 0 3.04 MBytes
[ 4] 2.00-3.00 sec 1.07 GBytes 9.15 Gbits/sec 0 3.04 MBytes
[ 4] 3.00-4.00 sec 1.05 GBytes 8.99 Gbits/sec 0 3.04 MBytes
[ 4] 4.00-5.00 sec 1.04 GBytes 8.91 Gbits/sec 80 2.17 MBytes
[ 4] 5.00-6.00 sec 1.04 GBytes 8.91 Gbits/sec 0 2.35 MBytes
[ 4] 6.00-7.00 sec 1.04 GBytes 8.98 Gbits/sec 0 2.54 MBytes
[ 4] 7.00-8.00 sec 1.01 GBytes 8.69 Gbits/sec 176 1.88 MBytes
[ 4] 8.00-9.00 sec 1.04 GBytes 8.97 Gbits/sec 208 1.42 MBytes
[ 4] 9.00-10.00 sec 1.02 GBytes 8.80 Gbits/sec 0 1.48 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 10.3 GBytes 8.80 Gbits/sec 465 sender
[ 4]
UDP: 3.26 Gbps, packet length is default 8Kbytes
iperf3 -c "server address" -u -b 0
[ 4] local 145.100.132.197 port 58375 connected to 145.100.132.34 port 5201
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.00 sec 375 MBytes 3.15 Gbits/sec 48035
[ 4] 1.00-2.00 sec 394 MBytes 3.31 Gbits/sec 50457
[ 4] 2.00-3.00 sec 352 MBytes 2.94 Gbits/sec 45114
[ 4] 3.00-4.00 sec 391 MBytes 3.30 Gbits/sec 50092
[ 4] 4.00-5.00 sec 403 MBytes 3.38 Gbits/sec 51566
[ 4] 5.00-6.00 sec 403 MBytes 3.38 Gbits/sec 51599
[ 4] 6.00-7.00 sec 418 MBytes 3.51 Gbits/sec 53493
[ 4] 7.00-8.00 sec 372 MBytes 3.12 Gbits/sec 47651
[ 4] 8.00-9.00 sec 444 MBytes 3.73 Gbits/sec 56892
[ 4] 9.00-10.00 sec 399 MBytes 3.34 Gbits/sec 51033
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.00-10.00 sec 3.86 GBytes 3.32 Gbits/sec 0.020 ms 354384/505931 (70%)
according to the packet length the throughput in udp is calculated based on the packets which are sent, regardless of the recieved ones!