Monday, March 5, 2018

Estimating Bandwidth from Ping?

Sanity check, and a couple questions at the bottom. I'm trying to estimate the bandwidth of a path from the results of a simple ping. Here's my math. Am I getting this right and is there anything I'm missing?

First, I do two pings, one with a small payload of 36B (8B + 8B ICMP header + 20B IP header), and one with a large payload of 1500B (1472B + 8B ICMP header + 20B IP header).

ping -c 100 -i 0.05 -s 8 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 8(36) bytes of data. ... 16 bytes from 8.8.8.8: icmp_seq=100 ttl=55 time=30.5 ms --- 8.8.8.8 ping statistics --- 100 packets transmitted, 100 received, 0% packet loss, time 5005ms rtt min/avg/max/mdev = 30.378/31.817/34.563/0.908 ms ping -c 100 -i 0.05 -s 1472 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 1472(1500) bytes of data. ... 1480 bytes from 8.8.8.8: icmp_seq=100 ttl=55 time=34.1 ms --- 8.8.8.8 ping statistics --- 100 packets transmitted, 100 received, 0% packet loss, time 5007ms rtt min/avg/max/mdev = 31.775/34.018/65.031/3.521 ms, pipe 2 Subtract the larger min rtt from the smaller min rtt: 31.775 - 30.378 = 1.397 ms / 1000 = 0.001397 seconds Find the difference between payloads in bits: 1500 - 36 = 1464 B * 8 = 11712 b So, it took an extra 0.001397 seconds to transfer 11712 bits of data. 11712 / 0.001397 = 8383679.313 = 8.3 Mb/s 

Does this look right?

When bandwidth of a circuit is given, is that typically with or without the link layer headers? IP headers?

What about a common 1Gb Ethernet connection. Is that 1Gb with or without the link layer headers?



No comments:

Post a Comment