为何选择hping3 rtt>> sockperf延迟

时间:2018-03-17 12:33:42

标签: performance networking tcp latency hping

我试图在同一网络中的linux VM上运行tcp hping3,得到avg rtt~5ms

sudo hping3 -S -p 22 10.1.0.8 -c 100
...
len=44 ip=10.1.0.8 ttl=64 DF id=0 sport=22 flags=SA seq=98 win=29200 rtt=0.6 ms
len=44 ip=10.1.0.8 ttl=64 DF id=0 sport=22 flags=SA seq=99 win=29200 rtt=1.4 ms

--- 10.1.0.8 hping statistic ---
100 packets transmitted, 100 packets received, 0% packet loss
round-trip min/avg/max = 0.6/5.2/9.7 ms

如果我使用sockperf工具测量延迟,平均延迟时间约为0.5毫秒

(sockperf.bin ping-pong -i 10.1.0.8 -p 8302 -t 15 --pps=max )
sockperf output: 
[[2;35m====> avg-lat=495.943 (std-dev=484.312)
[[0msockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0sockperf: Summary: Latency is 495.943 usecsockperf: 
[[2;35mTotal 15119 observations
[[0m; each percentile contains 151.19 observationssockperf: ---> <MAX> observation = 6839.398sockperf: ---> percentile 99.999 = 6839.398sockperf: ---> percentile 99.990 = 5292.623sockperf: ---> percentile 99.900 = 4023.327sockperf: ---> percentile 99.000 = 2434.115sockperf: ---> percentile 90.000 = 1005.612sockperf: ---> percentile 75.000 =  638.746sockperf: ---> percentile 50.000 =  360.516sockperf: ---> percentile 25.000 =  178.134sockperf: ---> <MIN> observation =   45.356

想知道这两个工具的延迟之间存在如此大的差异的原因是什么。测量来自hping3的tcp rtt的内部方式和来自sockperf的tcp延迟是否相同? 我在这里做错了吗?

要验证我还尝试使用psping工具

测量同一网络中两个Windows VM之间的tcp延迟
Connecting to 10.1.0.7:8888: from 10.1.0.6:62312: 1.03ms

TCP connect statistics for 10.1.0.7:8888:
  Sent = 100, Received = 100, Lost = 0 (0% loss),
  Minimum = 0.59ms, Maximum = 9.82ms, Average = 1.05ms

0 个答案:

没有答案