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

Download Article PDF now with Express Checkout
Price $2.95
(incl. VAT)

Buy Linux Magazine

Related content

  • Top Ten Tops

    The famous Unix admin utility known as Top has many imitators. We take a look at some of the top Top tools.

  • Charly's Column

    Network monitors are a dime a dozen, but Nload, which separates incoming and outgoing traffic and draws graphs on the console without X, is unique.

  • Linux News

    News

    • US gov embraces open data
    • Apache Cdorked.A exploit discovered
    • News Bites

    New Intel CEO

    • FSF scolds W3C
    • Torvalds releases Kernel 3.9
    • Xen new LF collaboration project

    Operating Systems

    • Debian 7.0“wheezy” debuts
    • Windows XP most likely to be victim of attack.
  • Bpytop

    Linux users have many options for monitoring system resources, but bpytop, a new Python port of bashtop, more than stands out from the crowd.

  • The sys admin’s daily grind: Sysdig

    In this issue, sys admin columnist and tool veterinarian Charly Kühnast invites Sysdig, the jack-of-all-trades among system diagnostic tools, into his surgery for a quick checkup. The project promises to unite the functionality of lsof, iftop, netstat, tcpdump, and others.

comments powered by Disqus
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.

Learn More

News