Wireshark 301: Finding the busiest computers on your network

本文介绍使用Wireshark分析网络中最繁忙的计算机和流量的方法。通过三种方式:流过滤器、会话过滤器和跟随TCP流,可以精确地识别和隔离网络中产生大量流量的设备,并提供统计数据进行进一步分析。

转自:vonnie

Network Latency is a big issue but how do you find the busiest computers on your network?

With Wireshark, it’s super easy.  Let’s not waste any time!

 

There are three ways to zoom in on individual network conversations in Wireshark.  You can see which protocols are the busiest and you can see the exact network applications that are responsible for that traffic.

I’m going to show you three easy methods to isolate your top offenders and then we’ll finish things off by reviewing some interesting statistics between those devices.

Bashing the busiest offenders

You have three options for reviewing individual traffic streams.

  • Stream Filters
  • Conversation Filters
  • Follow the TCP stream

Let’s look at TCP since it’s the most interesting.

Scoping out Stream Filters

I’ve got a packet capture here between my Windows 8.1 PC and ubuntu.com

If you click a TCP segment in the PDU list you’ll see a [Stream Index] value in the PDU details pane.

This number shows you which TCP conversation you selected.  Each TCP session gets a unique stream index number so we’re looking at stream number 0.

Also notice the value in the status bar says tcp.stream.  If you right click the TCP stream, mouse over Prepare as filter and pick Selected you’ll see all the data for just that stream

It actually updates the Display Filter to show the TCP stream for the given stream index. ]

This is probably one of the fastest ways to see all the data for a given stream.

Conversation Filters

Have you ever gone to a rowdy cocktail party and just wished you could mute everyone else in the room?  It’s like trying to have a phone call from the front row of a rock concert.  It would be super nice if you could download an app to turn the volume down on a the world for a moment.

Wireshark gives you this super muting power – the only difference is that the mute button applies to network conversations.

We can ignore everything except interesting network conversations.

Right-click the appropriate row in Wireshark and choose Conversation Filter.

If you pick Ethernet it’ll filter layer 2 frames, IP filters layer 3 packets and TCP filters layer 4 segments.  It’s a great way to quickly strip superfluous information from your Wireshark view.

Following TCP stream

The last option is to simply right click the TCP segment and choose Follow TCP Stream.  This was the first Wireshark trick I learned back in college.  I remember being captivated by all the information Wireshark was able to cull from the wire and reassemble.  It was amazing. (and it still is!)

I mean just look at the gold Wireshark mined from this packet capture.

The Stream Content is showing me that the user attempted to access a resource called t-shirt.png using Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0 which is IE 11 on Windows 8.1.

How did I know that?  I just copied and dropped that User Agent string into user-agents.me.

It’s amazing how much data you can pull from packet captures.

So here’s the question: who is our biggest talker on the network?

And the answer is all in the statistics.  We can then create display filters based on the statistics.

Click Statistics in the menu bar and hit Conversations from the drop down menu.

You’ll see tabs for all the conversations in the capture with the number of streams.  Let’s pick TCP.

And now ladies and gentleman prepare to be astounded!

Double click the Bytes column to see which IP address on your network was sending the most traffic on the link.

Isn’t this cool?  You can see the source host, the destination server, protocol and number of bytes transmitted.

These are your top talkers.

Now just right click your most garrulous TCP segment, go to Apply as Filter, choose Selected and determine how you want it.  You can see all traffic between A (10.0.2.15) and B (assets.ubuntu.com) in both directions.  But that’s not the only option.

You can also show just the traffic sent from A to B or from B to A.  Or even from A to anyone and more.  Wireshark gives you ultimate control in filtering your packets and this is why I freggin’ adore this application.

Praise God for the Shark!

That’s how it works.

Now go to that users cubilcle and shut him down.  Tell him to stop slurping all the bandwidth from your other users who are actually trying to do work!

hahha.

Alright that’s it for this one.  I’m so glad you’ve joined me on our adventures into Wireshark.  Let me know if you have in questions in the comments below.

 

在使用 Wireshark 进行网络数据包捕获时,用户可能会遇到错误提示 `BIOCPROMISC: Operation not supported on socket`。该错误通常出现在尝试将网络接口设置为混杂模式(promiscuous mode)时,而系统或驱动程序不支持该操作[^1]。 ### 常见原因 - **操作系统限制**:某些操作系统(如 Windows 某些版本)或虚拟化环境不支持将网卡设置为混杂模式。 - **驱动程序不兼容**:网卡驱动可能未正确实现混杂模式的支持。 - **权限不足**:Wireshark 需要足够的权限才能更改网络接口的模式,若未以管理员身份运行,可能无法启用混杂模式。 - **虚拟网络接口问题**:在虚拟机或容器环境中,虚拟网络接口可能不具备与物理接口相同的底层控制能力。 ### 解决方法 1. **使用物理网络接口** 若当前使用的是虚拟网络接口(如桥接或 NAT 模式下的虚拟机),尝试改用物理网卡进行捕获。 2. **以管理员权限运行 Wireshark** 在 Windows 上,右键点击 Wireshark 快捷方式,选择“以管理员身份运行”;在 Linux 上,使用 `sudo wireshark` 启动程序。 3. **更新网卡驱动和操作系统** 确保网卡驱动为最新版本,并检查操作系统是否安装了最新的补丁和支持更新。 4. **使用管道捕获方式(Pipe Capture)** 可通过命令行工具(如 `tcpdump` 或 `dumpcap`)先进行捕获,再将数据流传递给 Wireshark 分析,避免直接操作混杂模式: ```bash dumpcap -i eth0 -w - | wireshark -k -i - ``` 5. **更改捕获方式(Windows)** 若使用的是 WinPcap/Npcap,可在 Wireshark 的首选项中更改捕获驱动: - 打开 Wireshark → `Edit` → `Preferences` → `Input` → `Capture` - 尝试切换 `Use WinPcap/Npcap` 模式或更新 Npcap 库。 6. **禁用混杂模式手动捕获** 如果无需监听所有流量,可以在捕获选项中取消“混杂模式”选项(虽然这会限制捕获范围,但可绕过该错误)。 ### 示例:使用 dumpcap 管道方式捕获 ```bash dumpcap -i eth0 -w - | wireshark -k -i - ``` 该命令通过 `dumpcap` 捕获数据包并实时传递给 Wireshark,避免直接设置混杂模式。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值