Solved Different delay between ping ::1 and 127.0.0.1

The same happens to public IPv4 and IPv6 addresses but also to localhost:

Code:
ping -c 10 ::1
PING6(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim=64 time=0.037 ms
16 bytes from ::1, icmp_seq=1 hlim=64 time=0.023 ms
16 bytes from ::1, icmp_seq=2 hlim=64 time=0.028 ms
16 bytes from ::1, icmp_seq=3 hlim=64 time=0.035 ms
16 bytes from ::1, icmp_seq=4 hlim=64 time=0.032 ms
16 bytes from ::1, icmp_seq=5 hlim=64 time=0.033 ms
16 bytes from ::1, icmp_seq=6 hlim=64 time=0.032 ms
16 bytes from ::1, icmp_seq=7 hlim=64 time=0.032 ms
16 bytes from ::1, icmp_seq=8 hlim=64 time=0.032 ms
16 bytes from ::1, icmp_seq=9 hlim=64 time=0.033 ms
--- ::1 ping6 statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.023/0.032/0.037/0.004 ms

Code:
ping -c 10 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.049 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.274 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.208 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.283 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.305 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.264 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.286 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.420 ms
64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.289 ms
64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.028 ms

--- 127.0.0.1 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.028/0.241/0.420/0.113 ms

Any idea why the delay is different when I ping ::1 and when 127.0.0.1 ?

It happens to two different "AMD Ryzen 9 5950X" servers. Other servers with different hardware have similar results for ::1 and 127.0.0.1
 
I can't reproduce this on several hosts (all Intel based) with various update states of 12.3-RELEASE and 13.0-RELEASE.

e.g.:
Code:
% ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.022 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.025 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.024 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.036 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.024 ms
^C
--- 127.0.0.1 ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.022/0.026/0.036/0.005 ms
% ping6 ::1
PING6(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim=64 time=0.039 ms
16 bytes from ::1, icmp_seq=1 hlim=64 time=0.028 ms
16 bytes from ::1, icmp_seq=2 hlim=64 time=0.031 ms
16 bytes from ::1, icmp_seq=3 hlim=64 time=0.028 ms
16 bytes from ::1, icmp_seq=4 hlim=64 time=0.028 ms
^C
--- ::1 ping6 statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.028/0.031/0.039/0.004 ms

depending on system load all RTTs are (WAY) below .1 ms and roughly the same in average for v4 and v6 (as it is expected).

Any chance you have some PF filters in place for v6 that might interfere?
 
try to take the average of those 10 pings, the IPv4 average and the IPv6 average. To me it does look like ping (IPv4) times are more consistent than ping6 (IPv6). IPv6 packets are also bigger than IPv4 (duh), so more time is needed to compose a return ping packet.
 
ok, I think I found a system where I can also reproduce this to some extent:

Code:
[sko@hal9000] ~> ping -qc10 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes

--- 127.0.0.1 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.073/0.111/0.153/0.029 ms
[sko@hal9000] ~> ping6 -qc10 ::1
PING6(56=40+8+8 bytes) ::1 --> ::1

--- ::1 ping6 statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.038/0.095/0.192/0.044 ms

[sko@hal9000] ~> ping -qc20 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes

--- 127.0.0.1 ping statistics ---
20 packets transmitted, 20 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.031/0.100/0.205/0.044 ms
[sko@hal9000] ~> ping6 -qc20 ::1
PING6(56=40+8+8 bytes) ::1 --> ::1

--- ::1 ping6 statistics ---
20 packets transmitted, 20 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.033/0.067/0.120/0.024 ms

Sometimes v6 is faster (as shown above), sometimes a bit slower than v4, but both are usually between .06-.1 on that system. I suspect those small variations are casued by different loads of the system.
However, I can't get reasonably constant results and by far not with those huge differences (factor of 10!) like CyberCr33p
 
might be related to this
 
One of those things where forums are better than Discord - in Discord, (useful info like this) can be compared to fish - if you don't pay attention, it will scroll away pretty fast. In forums, you gotta have usable search terms, and it's easier to leave a trace of your research and learning, you can come back and review how you looked for info. Both forums and Discord are useful, but they do work differently.
 
One of those things where forums are better than Discord - in Discord, (useful info like this) can be compared to fish - if you don't pay attention, it will scroll away pretty fast. In forums, you gotta have usable search terms, and it's easier to leave a trace of your research and learning, you can come back and review how you looked for info. Both forums and Discord are useful, but they do work differently.
I search but didn't thought it was related to Ryzon :D
 
Not quite what I meant... ? in forums, someone can make a comment within a specific thread - and it will be saved differently than on Discord. That difference makes it easier to search forums than Discord. For example, if someone points out that an issue may be related to Ryzen - that kind nugget is easier to find (via search) on forums than Discord. Someone can just as easily post the same info on Discord - but there, that info will just scroll away if you don't catch it. Forums are a seafood restaurant, Discord is the sea. Both places have fish, but the eating process is pretty different.
 
This is also from a desktop with Ryzen processor

ping -c 3 ::1
PING6(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim=64 time=0.082 ms
16 bytes from ::1, icmp_seq=1 hlim=64 time=0.110 ms
16 bytes from ::1, icmp_seq=2 hlim=64 time=0.120 ms

--- ::1 ping6 statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.082/0.104/0.120/0.016 ms

ping -c 3 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.042 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.077 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.104 ms

--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.042/0.074/0.104/0.025 ms

ping -c 10 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.041 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.102 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.119 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.112 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.068 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.086 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.081 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.064 ms
64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.078 ms
64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.097 ms

--- 127.0.0.1 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.041/0.085/0.119/0.022 ms

ping -c 10 ::1
PING6(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim=64 time=0.048 ms
16 bytes from ::1, icmp_seq=1 hlim=64 time=0.087 ms
16 bytes from ::1, icmp_seq=2 hlim=64 time=0.089 ms
16 bytes from ::1, icmp_seq=3 hlim=64 time=0.088 ms
16 bytes from ::1, icmp_seq=4 hlim=64 time=0.089 ms
16 bytes from ::1, icmp_seq=5 hlim=64 time=0.114 ms
16 bytes from ::1, icmp_seq=6 hlim=64 time=0.113 ms
16 bytes from ::1, icmp_seq=7 hlim=64 time=0.090 ms
16 bytes from ::1, icmp_seq=8 hlim=64 time=0.113 ms
16 bytes from ::1, icmp_seq=9 hlim=64 time=0.077 ms

--- ::1 ping6 statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.048/0.091/0.114/0.019 ms

ping -qc10 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
--- 127.0.0.1 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.042/0.080/0.120/0.022 ms

$ ping6 -qc10 ::1
PING6(56=40+8+8 bytes) ::1 --> ::1
--- ::1 ping6 statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.048/0.099/0.153/0.026 ms

doas sysctl machdep.idle=mwait
machdep.idle: acpi -> mwait

ping -qc10 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
--- 127.0.0.1 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.027/0.036/0.047/0.006 ms

ping6 -qc10 ::1
PING6(56=40+8+8 bytes) ::1 --> ::1
--- ::1 ping6 statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.038/0.045/0.054/0.005 ms

doas sysctl machdep.idle=mwait
machdep.idle: mwait -> mwait

hash -r
ping -qc10 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
--- 127.0.0.1 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.026/0.031/0.039/0.004 ms


ping6 -qc10 ::1
PING6(56=40+8+8 bytes) ::1 --> ::1

--- ::1 ping6 statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.038/0.047/0.078/0.011 ms
 
Back
Top