Real-Time Network Monitoring with Iftop
Measuring Network Speed Between Hosts
While iftop is primarily a monitoring tool, creative users can leverage it to measure actual network speeds between specific hosts. The basic approach is to observe the bandwidth usage during a file transfer or other network operation and compare the measured rate against expected network capacity.
For example, to test upload speed to a specific server, you could initiate a large file upload to the target server and then enter
sudo iftop -i eth0 -f 'host target_server'
Then observe the outbound bandwidth rate during the transfer. This technique can help identify bottlenecks or confirm that you're getting the expected throughput from your network infrastructure. It's particularly valuable for troubleshooting speed issues where the theoretical network capacity doesn't match actual observed performance.
Identifying Bandwidth Hogs
One of the most common and valuable uses for iftop is identifying processes or connections consuming excessive bandwidth. On busy systems or networks, unexplained bandwidth usage can lead to performance degradation, quota overages, or even service disruptions. The cause for the excessive usage could be an unexpected backup, unauthorized media streaming, or even malware activity. Iftop provides the visibility needed to track down these bandwidth hogs.
If you notice slow network performance or unexpectedly high bandwidth usage, launch iftop and sort by bandwidth usage. You can identify the top consumers by examining the connection list. Then cross-reference the result with other tools like nethogs or lsof to zero in on the offending process.
Troubleshooting Network Performance Issues
Iftop serves as an excellent first-line tool for diagnosing various network performance problems. Its real-time connection view helps correlate user-reported issues with actual network behavior. You can use iftop to uncover uneven traffic distribution, troubleshoot unexpected traffic patterns, and diagnose protocol issues.
By observing traffic patterns during periods of poor performance, you can often pinpoint the root cause much faster than with trial-and-error approaches. The ability to see both the big picture of overall bandwidth usage and the micro view of individual connections makes iftop uniquely suited for this kind of troubleshooting.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Framework Laptop 13 Pro Competes with the Best
Framework has released what might be considered the MacBook of Linux devices.
-
The Latest CachyOS Features Supercharged Kernel
The latest release of CachyOS brings with it an enhanced version of the latest Linux kernel.
-
Kernel 7.0 Is a Bit More Rusty
Linux kernel 7.0 has been released for general availability, with Rust finally getting its due.
-
France Says "Au Revoir" to Microsoft
In a move that should surprise no one, France announced plans to reduce its reliance on US technology, and Microsoft Windows is the first to get the boot.
-
CIQ Releases Compatibility Catalog for Rocky Linux
The company behind Rocky Linux is making an open catalog available to developers, hobbyists, and other contributors, so they can verify and publish compatibility with the CIQ lineup.
-
KDE Gets Some Resuscitation
KDE is bringing back two themes that vanished a few years ago, putting a bit more air under its wings.
-
Ubuntu 26.04 Beta Arrives with Some Surprises
Ubuntu 26.04 is almost here, but the beta version has been released, and it might surprise some people.
-
Ubuntu MATE Dev Leaving After 12 years
Martin Wimpress, the maintainer of Ubuntu MATE, is now searching for his successor. Are you the next in line?
-
Kali Linux Waxes Nostalgic with BackTrack Mode
For those who've used Kali Linux since its inception, the changes with the new release are sure to put a smile on your face.
-
Gnome 50 Smooths Out NVIDIA GPU Issues
Gamers rejoice, your favorite pastime just got better with Gnome 50 and NVIDIA GPUs.
