The Actual Maximum throughput
From running tcpdump on Dublin, we know that the
maximum payload on TCP packet is 1448 Byte.
How do you know that?
Step 1. Run "tcpdump" on router Dublin.
Step 2. Run "nettest/pingserver" on Prague
Step 3. Run "nettest/pingclient" on Madrid, packet size 1500 Byte ( Max data payload for Ethernet frame )
Step 4. From dublin, we can see the IP fragment is 1448
See the result
[root@dublin /root]# tcpdump -S -i eth2 dst host 192.168.2.2
Kernel filter, protocol ALL, TURBO mode (575 frames), datagram packet socket
tcpdump: listening on eth2
21:45:18.721415 < 192.168.1.2.1641 > 192.168.2.2.1026: S
4098556398:4098556398(0) win 32120 <mss 1460,sackOK,timestamp 51137723
0,nop,wscale 0> (DF)
21:45:18.721640 < 192.168.1.2.1641 > 192.168.2.2.1026: .
4098556399:4098556399(0) ack 4090392485 win 32120 <nop,nop,timestamp 51137723
36471011> (DF)
21:45:18.728551 < 192.168.1.2.1641 > 192.168.2.2.1026: P
4098556399:4098556403(4) ack 4090392485 win 32120 <nop,nop,timestamp 51137724
36471011> (DF)
21:45:18.728706 < 192.168.1.2.1641 > 192.168.2.2.1026: P 4098556403:4098557851(1448)
ack 4090392485 win 32120 <nop,nop,timestamp 51137724 36471011> (DF)
21:45:18.736906 < 192.168.1.2.1641 > 192.168.2.2.1026: P 4098557851:4098557903(52)
ack 4090392485 win 32120 <nop,nop,timestamp 51137725 36471013> (DF)
21:45:18.737311 < 192.168.1.2.1641 > 192.168.2.2.1026: .
4098557903:4098557903(0) ack 4090393933 win 31856 <nop,nop,timestamp 51137725
36471013> (DF)
21:45:18.741197 < 192.168.1.2.1641 > 192.168.2.2.1026: F
4098557903:4098557903(0) ack 4090393985 win 31856 <nop,nop,timestamp 51137725
36471013> (DF)
21:45:18.741426 < 192.168.1.2.1641 > 192.168.2.2.1026: .
4098557904:4098557904(0) ack 4090393986 win 31856 <nop,nop,timestamp 51137725
36471013> (DF)
[lin@prague nettest]$ pingserver 1026
server: at port 1026 on node prague, internet address 0.0.0.0
server: connected to client at internet address 192.168.1.2, port 1636
server: disconnected from client at internet address 192.168.1.2, port 1636
[lin@madrid nettest]$ pingclient 1026 192.168.2.2 1 1500
pingclient: 1 iterations, 1500 bytes each
pingclient: on host madrid
pingclient: at internet address 192.168.1.2, port 1641
pingclient: sending to server at internet address 192.168.2.2, port 1026
pingclient: finished 1 iterations of 1500 bytes each
Elapsed: 0.01, user: 0.00, sys: 0.00
===============================================================================
The ping test script is:
for i in `seq 1 10`
do
echo " "
echo "pingclient 1026 192.168.2.2 100000 1448"
sleep 3; pingclient 1026 192.168.2.2 100000 1448
done
Round Trip Time when packet size is optimal ( 1448 Bytes ) PingTest | |||||||||||||
1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th | 10th | AVG | Var | RTT | |
ElapseTime ( Sec ) | 63.74 | 63.77 | 64.36 | 64.12 | 63.67 | 63.61 | 63.54 | 63.81 | 63.50 | 63.49 | 63.761 | 0.2032 | 637.61us |
ping test Detail Data is
HERE
The blast test script is:
for i in `seq 1 10`
do
echo " "
echo "blastclient 1026 192.168.2.2 1000000 1448"
sleep 3; blastclient 1026 192.168.2.2 1000000 1448
done
Blast test when request size is optimal ( 1448 Bytes ) PingTest | |||||||||||||
1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th | 10th | AVG | Var | Throughput(Byte/Sec) | |
ElapseTime ( Sec ) | 123.21 | 123.19 | 123.26 | 123.35 | 123.22 | 123.64 | 123.32 | 123.33 | 123.47 | 123.17 | 123.316 | 0.106 | 12374712 |
How do we get 12374712 Byte/Sec
Although, we just send useful data 1448 Byte on each request, we actually send TCP and IP header and Ethernet Wrapper. We actually send 1526 Bytes for each frame. ( 1500 for layer 2 data, 26 for ethernet packet wrapper, for header detail, see here )
So actual throughput = 1526*1000000/123.316 = 12374712 Bytes/Sec
It is (12500000 - 12374712)/12500000 = 1.0023% less than the Ideal Theoretical throughput 100Mb/sec
Note:
We know 1 Mb/sec in Ethernet specification is 1000000 bit/sec, 1 KB = 1024 Byte, 1 Byte = 8 bits
Fast Ethernet 100Mb/Sec = 10^8 bits/Sec = 12500000 Bytes/sec
Blast Test detail Data is
HERE
Now test the optimal throughput by UDP
The udpserver code is here.
The udpclient code is here.
Updated Makefile is here
How do you know that UDP optimal payload is 1472, see experiment here
Script on client Side( Madrid ):
[lin@madrid nettest]$ . udp 2>&1 | tee clientInfoOptimal
Where udp is a script file whose content is:
for i in `seq 1 15`;
do
sleep 3
echo " "
echo "/home/lin/nettest/udpclient 1024 192.168.2.2 100000 1490"
/home/lin/nettest/udpclient 1024 192.168.2.2 100000 1490
echo " "
done
Script on server side ( Prague ):
[lin@prague nettest]$ . udp 2>&1 | tee serverInfoOptimal
Where udp is a script file whose content is: /home/lin/nettest/udpserver 1024
Run tcpdump on prague: tcpdump dst host 192.168.2.2 and udp
The result is:
UDP test when request size optimal( 1472 Byte ) Sending 1000000 udp packets |
||||||||||||||||||
1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th | 10th | 11th | 12th | 13th | 14th | 15th | AVG | Var | Throughput( Byte/sec) | |
ElapseTime ( Sec ) | 123.27 | 123.48 | 123.35 | 123.45 | 123.45 | 123.34 | 123.17 | 123.19 | 123.37 | 123.61 | 123.20 | 123.35 | 123.08 | 123.11 | 123.32 | 123.316 | 0.1168 | 12374712 |
Packet Loss | 42 | 0 | 0 | 0 | 0 | 108 | 0 | 0 | 0 | 0 | 49 | 0 | 51 | 0 | 61 |
It's pretty interesting that the Average Elapse Time is the same as that in TCP optimal case.
So actual throughput = 1526*1000000/123.316 = 12374712 Bytes/Sec
It is (12500000 - 12374712)/12500000 = 1.0023% less than the Ideal Theoretical throughput 100Mb/sec
The detailed experiment data on Elapse Time is here
The detailed experiment data on Packet lost is here