Luke Oliff.

TIL: Testing Network Latency With ping Custom Payload Sizes

·TIL·1 min read·Luke Oliff

ping tells you if a server is reachable. With custom payload sizes it tells you how the network handles the actual data you send.

ping -s 1600 api.example.com

Sends packets with 1600 bytes of data instead of the default 56. Audio streaming sends packets this size or larger. If these start dropping but small pings work, the issue is packet size not connectivity.

ping -c 10 -s 8000 api.example.com

Send 10 large packets and measure loss. Speech frames at 16kHz 16-bit mono are about 320 bytes per 20ms frame. Multiple frames per packet add up fast.

ping -D -s 1600 api.example.com | awk '{print $1, $7}'

The -D flag prints timestamps. Capture latency variation over time to spot network congestion patterns.

Does ping payload size affect the result?

Yes. Some networks prioritise small packets. Test with the payload size your application actually sends.

What is a good latency for voice?

Under 100ms is excellent. 100-300ms is acceptable. Over 300ms becomes noticeable in real time interactions.