Wireshark 300: Curing Latency and Network Slowness

本文介绍如何使用Wireshark工具诊断网络延迟问题,通过分析TCP对话时间戳,定位造成互联网连接缓慢的根本原因。文章详细解释了如何设置并解读Wireshark的Capture conversation timestamps功能,以找出网络中最大的延迟源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转自:vonnie

Laaatteennncyyyyy.

AKA SLOWNESS!  No one wants to deal with it but how many of us know the root cause of the problem?  With Wireshark you can figure out exactly what’s causing your internet connection to crawl.

 

Here’s the scenario:

Everytime a user tries to access the internet it takes the page forever to download.  What’s going on?

You can use Wireshark to gain insight on the problem.  You can either start your capture on the host computer itself or configure port-spanning on the Cisco switch to mirror the traffic out an adjacent switchport.  But let’s assume you don’t have access to the Cisco switch.  Maybe you’re not authorized or you don’t want to bother with switchport configuration on a Cisco switch.

At any given moment a single computer will have multiple TCP connections to various destinations so our first order of business is see the time difference between segments within a single TCP conversation.

Start the packet capture, right click the relevant row in the PDU data pane and mouse down to Protocol preferences.

Make sure Calculate conversation timestamps has check next to it.  You might also want to set this up in a new Wireshark profile.

(ps:上面提到的"Calculate conversation timestamps"这个功能只有TCP及基于TCP的上层协议才会有,分别对应wireshark处理TCP协议时用到的TSval和TSecr字段,其中TSval字段是TCP发送方的时钟,参考跳转;如果要计算捕获的TCP\DNS\HTTP包之间的时间差,可以分别使用:

1.tcp.time_relative或tcp.time_delta作为显示列,这两项正好对应TCP协议在"Packet detail"面板中的Timestamps选项;

2.DNS可以用dns.time作为显示列;

3.Http可以用http.time作为显示列;)

Now if you scroll down in the PDU details pane you’ll see a new section under the Transmission Control Protocol dissector called:

[Timestamps]

Now we can see the time in seconds since the last TCP segment in the current conversation.

Great, now let’s make it a little easier to read this by adding this valuable data as a new column.

Right click the TCP dissector in the details pane and choose Apply as Column from the popup menu.

Bam!

The new column appears but it’s a little too long isn’t it?

It says:

Time since previous frame in this TCP stream

But let’s rename it to:

Segment Delta

That way we’ll know this contains the change (delta) between TCP segments.

Right click the column and choose Edit Column Details…

Great, now double click the column to sort by slowest values and scroll through the output.  You’ll quickly see the TCP conversations responsible for the greatest latency.

To start this test for you, I downloaded a program called Netlimiter and installed it on my Windows 8.1 Virtual Machine.  Then I manually told Netlimiter to limit all inbound and outbound traffic flows to a wimpy 5kbps.  Ha!

So when I started the capture I could easily see the largest offenders.

You can see a segment delta of 941 milliseconds (almost a full second) from a request to download a JPG on 198.57.208.223 (which is fixedbyvonnie.com)

I hope this helps!  Leave me your questions, cheers or digital beer in the comments below.

 

 

 

Over 100 recipes to analyze and troubleshoot network problems using Wireshark 2 This book contains practical recipes on troubleshooting a data communications network. This second version of the book focuses on Wireshark 2, which has already gained a lot of traction due to the enhanced features that it offers to users. The book expands on some of the subjects explored in the first version, including TCP performance, network security, Wireless LAN, and how to use Wireshark for cloud and virtual system monitoring. You will learn how to analyze end-to-end IPv4 and IPv6 connectivity failures for Unicast and Multicast traffic using Wireshark. It also includes Wireshark capture files so that you can practice what you’ve learned in the book. You will understand the normal operation of E-mail protocols and learn how to use Wireshark for basic analysis and troubleshooting. Using Wireshark, you will be able to resolve and troubleshoot common applications that are used in an enterprise network, like NetBIOS and SMB protocols. Finally, you will also be able to measure network parameters, check for network problems caused by them, and solve them effectively. By the end of this book, you’ll know how to analyze traffic, find patterns of various offending traffic, and secure your network from them. What You Will Learn Configure Wireshark 2 for effective network analysis and troubleshooting Set up various display and capture filters Understand networking layers, including IPv4 and IPv6 analysis Explore performance issues in TCP/IP Get to know about Wi-Fi testing and how to resolve problems related to wireless LANs Get information about network phenomena, events, and errors Locate faults in detecting security failures and breaches in networks
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值