What could be the cause of these erratic and extremely high ping times between two MacBooks over wifi

Networkpingwifi

I have two laptops on my network: a Mid-2015 Macbook Pro Retina running 10.10.5 and an Early 2014 Macbook Air running 10.9.5.

When I ping one from the other over the same wifi network, I get very erratic ping times (here, from 12ms to more than half a second):

$ ping -c 10 192.168.1.242
PING 192.168.1.242 (192.168.1.242): 56 data bytes
64 bytes from 192.168.1.242: icmp_seq=0 ttl=64 time=178.376 ms
64 bytes from 192.168.1.242: icmp_seq=1 ttl=64 time=96.402 ms
64 bytes from 192.168.1.242: icmp_seq=2 ttl=64 time=12.666 ms
64 bytes from 192.168.1.242: icmp_seq=3 ttl=64 time=361.196 ms
64 bytes from 192.168.1.242: icmp_seq=4 ttl=64 time=152.410 ms
64 bytes from 192.168.1.242: icmp_seq=5 ttl=64 time=68.434 ms
64 bytes from 192.168.1.242: icmp_seq=6 ttl=64 time=190.384 ms
64 bytes from 192.168.1.242: icmp_seq=7 ttl=64 time=517.559 ms
64 bytes from 192.168.1.242: icmp_seq=8 ttl=64 time=124.860 ms
64 bytes from 192.168.1.242: icmp_seq=9 ttl=64 time=41.685 ms

--- 192.168.11.242 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 12.666/174.397/517.559/147.290 ms

There's no real difference between which MacBook does the pinging.

However, I get much more reasonable results if I ping a Windows desktop that's connected to the network via wired Ethernet from one of the wifi-connected Macs:

$ ping -c 10 192.168.1.10
PING 192.168.1.10 (192.168.1.10): 56 data bytes
64 bytes from 192.168.1.10: icmp_seq=0 ttl=128 time=3.774 ms
64 bytes from 192.168.1.10: icmp_seq=1 ttl=128 time=4.554 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=128 time=4.093 ms
64 bytes from 192.168.1.10: icmp_seq=3 ttl=128 time=2.852 ms
64 bytes from 192.168.1.10: icmp_seq=4 ttl=128 time=4.095 ms
64 bytes from 192.168.1.10: icmp_seq=5 ttl=128 time=4.100 ms
64 bytes from 192.168.1.10: icmp_seq=6 ttl=128 time=4.099 ms
64 bytes from 192.168.1.10: icmp_seq=7 ttl=128 time=7.130 ms
64 bytes from 192.168.1.10: icmp_seq=8 ttl=128 time=3.147 ms
64 bytes from 192.168.1.10: icmp_seq=9 ttl=128 time=3.924 ms

--- 192.168.1.10 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 2.852/4.177/7.130/1.092 ms

What's going on here between the Macs and how can I fix it?


Update: here are the ping results from the Windows machine (wired ethernet) to one of the Macbooks (wifi). It shows that the problem is directional, the erratically high ping times only occur when the Mac on Wifi is the target of the pings, not when it's the source.

C:\>ping -n 10 192.168.1.248

Pinging 192.168.1.248 with 32 bytes of data:
Reply from 192.168.1.248: bytes=32 time=240ms TTL=64
Reply from 192.168.1.248: bytes=32 time=160ms TTL=64
Reply from 192.168.1.248: bytes=32 time=81ms TTL=64
Reply from 192.168.1.248: bytes=32 time=305ms TTL=64
Reply from 192.168.1.248: bytes=32 time=227ms TTL=64
Reply from 192.168.1.248: bytes=32 time=1ms TTL=64
Reply from 192.168.1.248: bytes=32 time=65ms TTL=64
Reply from 192.168.1.248: bytes=32 time=295ms TTL=64
Reply from 192.168.1.248: bytes=32 time=216ms TTL=64
Reply from 192.168.1.248: bytes=32 time=135ms TTL=64

Ping statistics for 192.168.1.248:
    Packets: Sent = 10, Received = 10, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 305ms, Average = 172ms

Best Answer

It's wifi - there may be nothing to "fix" if you have lots of other people using wifi, especially on the same channel as you. Wifi is a shared resource. Cabled connections are not (and always better if you have a choice).

Are you in a house or apartment? How many of your neighbors are using wifi? Are you using channel 1, 6 or 11 on 2GHz? More importantly are your neighbors also using the same channel? Do NOT use anything other than 1, 6 or 11 on 2GHz bands - all the other channels will overlap with 1 and 6 or 6 and 11. 5GHz channels do not overlap in the same way so it's less of a deal with 5GHz.

A quick way to see who is around you and what channels they are using is to use an app like http://www.netspotapp.com to do a quick survey and see what is going on around you.

The more use of wifi around you, the more the ping times are going to vary. If you don't have neighbors close by, how many other devices do you have on wifi? It all adds up...