我有一个小办公室网络,并且遇到巨大的互联网链接延迟。我们有一个简单的网络拓扑结构:配置为运行Ubuntu 10.10服务器的路由器,2个网卡(一个连接到互联网,另一个连接到办公网络)和一台连接20台计算机的交换机。我在路由器上收集了一个巨大的tcpdump日志,我想绘制一个直方图,其RTT时间为,全部为 TCP流,以尝试找出此延迟问题的最佳解决方案。那么,有人可以告诉我如何使用wireshark或其他工具来做到这一点吗?使用wireshark或其他工具绘制RTT直方图
6
A
回答
11
Wireshark的或tshark的可以给你TCP RTT为每个接收到使用tcp.analysis.ack_rtt其测量捕获一个TCP包和用于该数据包的ACK之间的时间增量ACK分组。
你必须要小心,这是大部分的ACK包会从您的办公用机员在确认从互联网上接收的数据包,这样你就可以测量RTT路由器之间看到来自互联网的数据包,看到来自你的办公机器的确认。
要测量您的互联网RTT,您需要查找来自互联网的ACK(确认从您的网络发送的数据)。假设你的办公用机有一个像192.168.1.x的IP地址,你已经登录你的路由器的LAN端口上的所有数据,你可以使用显示过滤器,像这样:
tcp.analysis.ack_rtt and ip.dst==192.168.1.255/24
要转储的RTT成。用于分析的csv,你可以像这样使用tshark命令;
tshark -r router.pcap -Y "tcp.analysis.ack_rtt and ip.dst==192.168.1.255/24" -e tcp.analysis.ack_rtt -T fields -E separator=, -E quote=d > rtt.csv
- -r选项告诉tshark的从.pcap文件读取
- -Y选项指定显示过滤器使用(-R而不-2已被弃用)
- 的-e选项指定输出
- 了-t选项字段中指定的输出格式
你ç在运行此命令之前,使用mergecap实用程序将所有pcap文件合并到一个文件中。将此输出转换为直方图应该很简单!
-1
You can use tshark statistics to create a table of all tcp conversations: $ tshark -r test.pcap -q -z conv,tcp ================================================================================ TCP Conversations Filter: | | | Total | | Frames Bytes | | Frames Bytes | | Frames Bytes | 192.168.108.2:2720 147.234.1.253:21 28 2306 18 1047 46 3353 147.234.1.253:58999 192.168.108.2:2721 3 170 2 122 5 292 192.168.108.2:2718 147.137.21.94:139 0 0 3 186 3 186 192.168.108.2:2717 147.137.21.94:445 0 0 3 186 3 186 ================================================================================ Or use this little script: for file in `ls -1 *.pcap` do tshark -r $file -q -z conv,tcp > $file.txt done
1
这里的5分钟perlscript通过rupello的回答启发:
#!/usr/bin/perl
# For a live histogram of rtt latencies, save this file as /tmp/x.pl and chmod +x /tmp/x.pl, then run:
# tshark -i br1 -R "tcp.analysis.ack_rtt and ip.dst==192.168.1.0/24" -e tcp.analysis.ack_rtt -T fields -E separator=, -E quote=d | /tmp/x.pl
# Don't forget to update the interface "br1" and "and ip.dst==..." bits as appropriate.
@t[$m=0]=20;
@t[++$m]=10;
@t[++$m]=5;
@t[++$m]=2;
@t[++$m]=1;
@t[++$m]=0.9;
@t[++$m]=0.8;
@t[++$m]=0.7;
@t[++$m]=0.6;
@t[++$m]=0.5;
@t[++$m]=0.4;
@t[++$m]=0.3;
@t[++$m]=0.2;
@t[++$m]=0.1;
@t[++$m]=0.05;
@t[++$m]=0.04;
@t[++$m]=0.03;
@t[++$m]=0.02;
@t[++$m]=0.01;
@t[++$m]=0.005;
@t[++$m]=0.001;
@t[++$m]=0;
@h[0]=0;
while (<>) {
s/\"//g; $n=$_; chomp($n);
for ($i=$m;$i>=0;$i--) { if ($n<=$t[$i]) { $h[$i]++; $i=-1; }; };
if ($i==-1) { $h[0]++; };
print "\033c";
for (0..$m) { printf "%6s %6s %8s\n",$t[$_],sprintf("%3.2f",$h[$_]/$o*100),$h[$_]; };
}
假如把它放在你的smokeping图和...实用的“的统计瑞士军刀”这一直激励着待机...
tshark的新版本似乎更好地使用“tshark”前面的“stdbuf -i0 -o0 -e0”。
PS有谁知道wireshark是否内置了DNS和ICMP rtt stats或者如何轻松获取这些内容?
相关问题
- 1. 如何绘制其他两个直方图条总和的直方图?
- 2. 绘制直方图
- 3. 绘制直方图
- 4. 绘制直方图
- 5. 用python绘制直方图
- 6. 使用Pylab绘制直方图
- 7. 使用pyplot绘制直方图
- 8. 使用集群绘制直方图
- 9. 使用python和quickdraw绘制直方图
- 10. 使用熊猫绘制直方图python
- 11. 使用gnuplot绘制词频直方图
- 12. 使用bar3绘制3D直方图
- 13. 使用Python绘制直方图
- 14. 使用matplot.lib绘制直方图
- 15. 绘制图形直方图
- 16. 用Paint.net铅笔工具绘制直线
- 17. 绘制二分图的工具或库?
- 18. 如何仅使用awt或其他绘图机制部分绘制字符?
- 19. Can Flot(或任何其他JQuery图表库)绘制方程吗?
- 20. 使用Wireshark或ngrep保存FLV视频 - 或其他任何
- 21. CCScrollLayer或其他方法,使图库视图垂直滚动
- 22. 绘制一种直方图
- 23. 绘制直方图条件
- 24. 如何使用clang或其他工具生成数据流图?
- 25. 使用在线工具或matlab绘制图形
- 26. 绘制直方图或散点图与当前的直方图的matplotlib
- 27. 用点代替直方图绘制直方图
- 28. 在直方图上绘制直线
- 29. 绘制垂直直方图C#
- 30. 在直方图中使用qplot()绘制垂直峰值线R
我没有看到这个问题的相关性。 – MaxVT