Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265
Source Link

Ping - big packet size problems

I have some problems with pinging hosts with big packet size.

I'm doing some research on latency between one configuration and another.

I have written bash/zsh script to make it simpler that pings 8.8.8.8 and then parses the output to get average ping value. Script below:

#!/bin/zsh
for SIZE in {100..65500..100}
do
    ping 8.8.8.8 -c 5 -s $SIZE > tempfile
    TEMP=$(cat tempfile | tail -1 | awk '{print $4}' | cut -d / -f 2)
    echo "$SIZE - $TEMP" | tee -a results
done
rm tempfile

The problem is that with big packets (more than 30kB when the standard value is 64b) ping just doesn't work, I don't get any response just like the server was unavailable. Interestingly, when I was in another location, everything worked fine (Internet connection is a bit worse there), problems there started about 60kB but here they start about 30kB and to get one (out of ~300 to the end and bigger=worse) result I need to call this script ~10-20 times. It's really annoying because for smaller packets it's working like a charm (with the same server 8.8.8.8).

Anybody has an idea what causes it?