By dft
I’m trying to benchmark network latency with different packet sizes. Standard ICMP ping works great until a payload size of 1 KB. After that, it becomes increasingly unreliable with packet drop rates of > 80%. I also tried Ultra Ping which sends pings over UDP but none of the echoes reflected by the server arrive at the client.
When tunneling traffic via VPN everything works fine.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
The tool you want to use for benchmarking latency with different packet sizes is likely to be either ping or iperf. However, you might have to modify some system parameters if you’re seeing high packet drop rates or no echoes arriving at the client.
Here’s how you can perform a latency benchmark with different packet sizes:
ping:The -s option lets you specify the number of bytes of data to send. The packet size is this data size plus 8 bytes for the ICMP header, plus an additional 20 bytes for the IP header. For example, to send a 1400 byte packet, you can use:
ping -s 1372 -c 4 <target_IP>
Note: On some systems, you might need to use the -l option to set the packet size.
iperf:iperf is a tool for performing network throughput tests. It can test either TCP or UDP throughput. To perform an iperf test with UDP:
iperf -c <server_ip> -u -l <packet_size> -b <bandwidth>
Where:
<server_ip> is the IP address of the server.-u specifies that the test should use UDP.<packet_size> is the size of the packets to send.<bandwidth> is the target bandwidth for the test (like 10M for 10 Mbps).If you’re seeing packet drops with larger packet sizes, you might be exceeding the Maximum Transmission Unit (MTU) size of your network. Standard Ethernet has an MTU of 1500 bytes, and if you try to send a packet larger than that without fragmentation, it can lead to packet loss. Check your network’s MTU setting to make sure it’s not set too low.
If you’re using a VPN or tunneling protocol, the MTU might be lower due to the overhead of the VPN/tunneling protocol. In such cases, you might have to adjust your test packet size accordingly.
If none of the echoes are arriving at the client when using UDP, check that there’s no firewall blocking UDP traffic between the client and the server.
Also please note that these tools are only as accurate as the conditions of the network they’re testing. They can give you a general idea of network performance, but the actual performance can vary based on many factors.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.