Skip to content

What bandwhich is

By the end of this chapter you can say, in one sentence, what question bandwhich answers that your other network tools cannot — and state the one rule that keeps its answers from misleading you.

The question with a name missing

Plenty of tools will tell you that your network is busy. Your router's lights blink. A speed test reports the link is full. Your system monitor shows the machine has moved a large number of bytes today. Every one of those answers is missing the same word: which.

Which program is sending this? Which program is receiving that? Are they talking to the address you expect, on a connection you recognise, at a rate that makes sense? A total cannot say. A total adds every process together and throws the names away, and the name is usually the part you actually need — the difference between "the backup is running" and "something I do not recognise is uploading at full speed" is a name, not a number.

bandwhich exists to put the names back. Its own one-line description is "a CLI utility for displaying current network utilization by process, connection and remote IP/hostname". Run it, and it shows a live display with three tables: how much each process is sending and receiving, the same figures for each connection, and the same again for each remote address — refreshed about once a second, for as long as you leave it running.

The rule: a match, and a sample

Two halves of one rule govern everything bandwhich shows, and this guide states it here and keeps pointing back to it:

A name in bandwhich is a match it made, not a proof of who sent the bytes — and a rate is a sample over a short window, not a measurement of a transfer.

The first half is about naming. bandwhich watches packets go past and then goes looking for the process that owns the connection they belong to. It usually finds it. Sometimes the process has already exited, or the socket is shared, or a tunnel has repackaged the traffic — and then the name is wrong, or missing, or points at the tunnel instead of the program you care about. Chapter 9 opens the matching up and shows it failing, once, in this guide's own lab.

The second half is about numbers. bandwhich counts packet sizes between refreshes and smooths them into a rate. A steady transfer produces a steady, believable figure. A burst produces a figure that says more about the window than about the burst — chapter 10 shows a transfer that finished in six hundredths of a second wearing a rate that was still on screen seconds later.

Keep both halves and bandwhich is a sharp instrument. Forget either, and the same screen will confidently mislead you.

What it never sees

bandwhich counts packets and reads their sizes and addresses. It does not open them. It can tell you that a process sent 800 kilobytes in the last second to a given address; it cannot tell you what those bytes were. That boundary is a feature — it is why the tool is safe to reach for on your own machine — and it is also a limit that chapter 12 states in full: no conclusion about what a flow contains can ever come from this screen.

Where it comes from

bandwhich is a free, open-source program written in Rust, started by Aram Drevekenin (the imsnif project) and now maintained by its community; the project lives at github.com/imsnif/bandwhich. This guide's lab ran bandwhich 0.23.1, the current release at the time of writing, taken from the project's release page. It runs on Linux, macOS, and Windows, and chapter 3 covers what installing it involves — including the part most tools do not have: it cannot work at all without elevated privileges, and it says so.

Check: without looking back, say what the three tables are, and say the rule out loud once — both halves. If you can, you have this chapter.