Ping test in serial link

Calculate upload/download speed by ping

1
$ ping -f -c 10000 -s 1472 10.100.100.100

At the end of the result i get: round-trip min/avg/max/stddev = 0.174/0.219/2.078/0.020 ms
so in average it takes 0.219 ms to send 1500 bytes and receive 1500 bytes, that’s 24 kb. 24 kb / 0.219 ms = 110 Mb/s
If you want to use that to a server on the internet, you need to lower the packet size to something like 1464 (for MTU 1492), drop the -f option and lower the count so it won’t take too long to finish.

1500 TX Bytes + 1500 RX Bytes= 3000 Bytes = 3000 * 8 = 24000 bits
24000 / 0.219 = 109.589 Mb/s

It ‘s not represent full throughput. just test single link in your ethernet adapter. not parallel.

MTU problem check

Level 3 network, between 2 nodes pass through gateway
Tcpdump show some packets loss, nmap show 10.xx.xx.clent port is “open”.
There are some packages return, some will not. Does it MTU problem ? ping could check it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ traceroute 10.xx.xx.client
traceroute to 10.xx.xx.client (10.xx.xx.client), 30 hops max, 60 byte packets
1 10.10.xx.gateway (10.10.xx.gateway) 2.239 ms 1.901 ms 2.080 ms
2 10.xx.xx.client (10.xx.xx.client) 0.606 ms 0.584 ms 0.592 ms
$ traceroute 10.xx.xx.client
traceroute to 10.xx.xx.client (10.xx.xx.client), 30 hops max, 60 byte packets
1 10.10.xx.gateway (10.10.xx.gateway) 1.881 ms 2.085 ms 2.245 ms
2 10.xx.xx.client (10.xx.xx.client) 0.563 ms * *

$ ping -f -c 20000 -M do -s 8972 10.xx.xx.client
PING 10.xx.xx.client (10.xx.xx.client) 8972(9000) bytes of data.
...................................................................^C
--- 10.xx.xx.client ping statistics ---
67 packets transmitted, 0 received, 100% packet loss, time 1076ms

You can got the issue from tcpdump, all larger than 1500 packets are loss.

1
2
3
4
5
6
7
8
client # tcpdump -v host 10.53.19.52 and greater 1500
tcpdump: listening on bond0, link-type EN10MB (Ethernet), capture size 65535 bytes
11:23:58.134708 IP (tos 0x0, ttl 63, id 27071, offset 0, flags [DF], proto TCP (6), length 8532)
10.53.19.52.988 > test-57-21.exp2: Flags [P.], cksum 0x496d (incorrect -> 0x5fe6), seq 2359537411:2359545891, ack 3804990367, win 53, options [nop,nop,TS val 1203816317 ecr 81802289], length 8480
11:23:58.136045 IP (tos 0x0, ttl 63, id 27077, offset 0, flags [DF], proto TCP (6), length 7292)
10.53.19.52.988 > test-57-21.exp2: Flags [.], cksum 0x4495 (incorrect -> 0xe386), seq 8480:15720, ack 1, win 53, options [nop,nop,TS val 1203816318 ecr 81802294], length 7240
11:23:58.148023 IP (tos 0x0, ttl 63, id 27083, offset 0, flags [DF], proto TCP (6), length 8588)
10.53.19.52.988 > test-57-21.exp2: Flags [P.], cksum 0x49a5 (incorrect -> 0x4006), seq 17016:25552, ack 1, win 53, options [nop,nop,TS val 1203816330 ecr 81802295], length 8536

If client MTU is 1500, tcpdump(client) will not receive any large packages. they are loss in switch.