2
I've noticed ping6
command was significantly slower than ping
on MacOS 10.12.
Using ping6
command:
❯ ping6 localhost
PING6(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim=64 time=0.088 ms
16 bytes from ::1, icmp_seq=1 hlim=64 time=0.092 ms
16 bytes from ::1, icmp_seq=2 hlim=64 time=0.137 ms
16 bytes from ::1, icmp_seq=3 hlim=64 time=0.117 ms
16 bytes from ::1, icmp_seq=4 hlim=64 time=0.116 ms
16 bytes from ::1, icmp_seq=5 hlim=64 time=0.112 ms
16 bytes from ::1, icmp_seq=6 hlim=64 time=0.149 ms
16 bytes from ::1, icmp_seq=7 hlim=64 time=0.116 ms
16 bytes from ::1, icmp_seq=8 hlim=64 time=0.119 ms
16 bytes from ::1, icmp_seq=9 hlim=64 time=0.125 ms
^C
--- localhost ping6 statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.088/0.117/0.149/0.017 ms
Using regular ping
command:
❯ ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.048 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.040 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.070 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.071 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.077 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.083 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.109 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.076 ms
64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.040 ms
64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.068 ms
^C
--- localhost ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.040/0.068/0.109/0.020 ms
I can't think of why using IPv6 would be slower than IPv4, so is there any reason why using ping6
would be slower than using ping
?
Updated
I've removed the example of pinging a remote hostname. It was not relevant since I can't be sure the machines that are reached are the same in both tests It could also lead to answers not concerning my primary question.
Guess: As you are only pinging localhost, the reason are probably differences in the network stack of the OS, with the IPv4 case better optimized. – dirkt – 2017-04-20T06:23:54.730