Bandwidth  in computer networking refers to the data rate supported by a network connection or interface. One most commonly expresses bandwidth in terms of bits per second (bps). The term comes from the field of electrical engineering, where bandwidth represents the total distance or range between the highest and lowest signals on the communication channel (band).

Bandwidth represents the capacity of the connection. The greater the capacity, the more likely that greater performance will follow, though overall performance also depends on other factors, such as latency.

Here is the list of bandwidth monitoring tools for your network bandwidth:

bmon is a portable bandwidth monitor and rate estimator running on various operating systems. It supports various input methods for different architectures.

Various output modes exist including an interactive curses interface, lightweight HTML output but also formatable ASCII output.

Statistics may be distributed over a network using multicast or unicast and collected at some point to generate a summary of statistics for a set of nodes. 

Install bmon in Debian
# apt-get install bmon

This program will output a PNG and a text file that can be used in scripts or be included in web pages to show current bandwidth usage. The amount of total bandwidth can be customized. The PNG output appears as a bar graph showing maximum possible usage with the current inbound or outbound usage shown as a differently colored bar.

Install bwbar in Debian
# apt-get install bwbar

This will complete the installation
There is a /etc/default/bwbar file to configure before this package will work and here is my config

# Directory to put files into
# Who to run as
# What are the options (eth0, scale of 1.5mbps)
OPTIONS=”eth0 1.5″

Now you need to chnage the permissions using the following command
# chown -R www-data:www-data /var/www/bwbar/

Start the bwbar using the following command
# /etc/init.d/bwbar start

You can also launch bwbar using the following command
bwbar eth0 100 -x 200 -y 7 -t 10 -p network.png -f network.txt -d /var/www/bwbar &

You will see at http://serverip/bwbar 
BandWidth Monitor This is a very tiny bandwidth monitor (not X11). Can monitor up to 16 interfaces in the in the same time, and shows totals too.

Install bwm Debian
# apt-get install bwm

small and simple console-based bandwidth monitor.Bandwidth Monitor NG is a small and simple console-based live bandwidth monitor.

Bandwidth Monitor NG is a small console-based live network and disk I/O bandwidth monitor for Linux, BSD, Solaris, Mac OS X, and others. It supports /proc/net/dev, netstat, getifaddr, sysctl, kstat, /proc/diskstats, /proc/partitions, IOKit, devstat, and libstatgrab. An unlimited number of interfaces and disks are supported. Interfaces and disks are added or removed dynamically from the list. You can white or blacklist interfaces and disks. The output includes KB/s, Kb/s, packets, errors, average, max, and total sum, and can be viewed via curses, a plain console, CSV, or HTML. Configuration can be done through a config file or the command line.

Install bwm-ng in Debian
# apt-get install bwm-ng

iftop does for network usage what top does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts.

rates:分别表示过去 2s 10s 40s 的平均流量

#iftop -i eth0 -n       就可以看到eth0网卡的流量状况:
iftop 相关命令 :
# iftop -i eth1
$ iftop -B
直接显示IP, 不进行DNS反解:
$ iftop -n
直接显示连接埠编号, 不显示服务名称:
$ iftop -N
$ iftop -F or
其他参数可下 iftop -h 看说明.
进入iftop画面时, 可按 p 切换是否显示连接埠, n 切换显示IP或主机的domain name, N切换显示连接埠代号或名称, p暂停显示, b切换是否显示长条, B切换计算几秒内的平均流量, 其他按键可以按h观看说明.

Install iftop in Debian
# apt-get install iftop

IP Flow Meter (IPFM) is a bandwidth analysis tool, that measures how much bandwidth specified hosts use on their Internet link.

Important notice
As you may have noticed, IPFM has not been actively developed for years. I (tibob) will no longer maintain or modify IPFM.

Have a look at the Similar Projects page fore more active projects. Feel free to complete the page with other projects you know of. Due to spams, the whole trac site has been changed to read-only.

What is IPFM ?
IP Flow Meter (IPFM) is a bandwidth analysis tool, that measures how much bandwidth specified hosts use on their Internet link.

It is written using libpcap (, so it ought to be portable. We develop it under Linux and FreeBSD. It was reported to work under OpenBSD, NetBSD and IRIX; if you own other Un*ces, just tell us if it works and/or report any problem.

IPFM is distributed under GPL

What does IPFM do ?
IPFM produces text files containing bandwitdh consumption per host in bytes :

HOST                          IN         OUT       TOTAL           12345     6666684     6679029         1232314       12345     1244659         6645632         123     6645755

Almost everything is configurable :
* which hosts to log
* Output time interval and time offset
* Output file name (with date in it)
* reverse DNS resolution
* IN, OUT or TOTAL sorting 

Who wrote IPFM ?
Many people contributed to IPFM. Here are main contributors, you should check IPFM changelog for more details.

* Andres KRAPF and Robert CHERAMY wrote first versions of IPFM.
* Samuel Hocevar added some features.
* Loic Tortay wrote a big patch that was partially included into IPFM v0.11.5

Install ipfm in Debian
# apt-get install ipfm

Now if you want to configure this for your network you need to copy example configuration file from /usr/share/doc/ipfm/examples if you want to check this file click here,once you configure this file you need to start the service using the following command
# /etc/init.d/ipfm start

Measure and display the rate of data across a network connection or data being stored in a file.

Install speedometer in Debian
Check which version of python is the default by running
python -V

Then issue the following commands as root to install speedometer (choose the correct Urwid package for your python version, ie. if python -V reports version 2.3.X then install python2.3-urwid)

apt-get install python2.4-urwid

Download the source file.
As user issue the following commands in the directory that you downloaded the source file

# cp /usr/local/bin/speedometer
# chown root: /usr/local/bin/speedometer
# chmod 755 /usr/local/bin/speedometer

Now you can run the speedometer application using the following

Speedometer Usage
Usage: speedometer [options] tap [[-c] tap]

Available options
speedometer -h

Usage: speedometer [options] tap [[-c] tap]…
Monitor network traffic or speed/progress of a file transfer. At least one tap must be entered. -c starts a new column, otherwise taps are piled vertically.

[-f] filename [size] display download speed [with progress bar]
-f must be used if directly following another file tap without an expected size specified
-rx network-interface display bytes received on network-interface
-tx network-interface display bytes transmitted on network-interface

-i interval-in-seconds eg. “5″ or “0.25″ default: “1″
-p use plain-text display (one tap only)
-b use old blocky display instead of smoothed display even when UTF-8 encoding is detected
-z report zero size on files that don’t exist instead of waiting for them to be created

Usage Examples
How long it will take for my 38MB transfer to finish?
speedometer favorite_episode.rm $((38*1024*1024))

How quickly is another transfer going?
speedometer dl/big.avi

How fast is this LAN?
$ cat /dev/zero | nc -l -p 12345
$ nc host-a 12345 > /dev/null
$ speedometer -rx eth0

How fast is the upstream on this ADSL line?
speedometer -tx ppp0

How fast can I write data to my filesystem? (with at least 1GB free)
dd bs=1000000 count=1000 if=/dev/zero of=big_nothing &

cbm — the Color Bandwidth Meter — displays the current traffic on all network devices.
Display some help and exit.

Display version information and exit.

Interactive Control
cbm can be controlled with the following keys:

Select an interface to show details about.
Exit from the program.
Switch between bits per second and bytes per second.
Increase the update delay by 100ms.
Decrease the update delay by 100ms.

Install cbm in Debian
First you need to download the .deb package

once you have the .deb package you need to install using the following comamnd
# dpkg -i cbm_0.1-1_i386.deb

pktstat listens to the network and shows the bandwidth being consumed by packets of various kinds in realtime. It understands some protocols (including FTP,HTTP, and X11) and adds a descriptive name next to the entry (e.g., ‘RETR cd8.iso’, ‘GET’ or ‘xclock -fg blue’).

Display a real-time list of active connections seen on a network interface, and how much bandwidth is being used by what. Partially decodes HTTP and FTP protocols to show what filename is being transferred. X11 application names are also shown. Entries hang around on the screen for a few seconds so you can see what just happened. Also accepts filter expressions á la tcpdump. 

Install pktstat in Debian
First you need to download .rpm package from here once you have the .rpm package you need to convert this .rpm file to .deb file using alien

Install alien
# apt-get install alien

Now you need to use the follwoing command to convert .rpm to .deb
# alien -k pktstat-1.7.2q-0.i386.rpm

Now you should be having pktstat_1.7.2q-0_i386.deb package

Install pktstat in Debian
# dpkg -i pktstat_1.7.2q-0_i386.deb

ibmonitor is an interactive linux console application which shows bandwidth consumed and total data transferred on all interfaces.

Its main features are:
Shows received, transmitted and total bandwidth of each interface
Calculates and displays the combined value of all interfaces
Displays total data transferred per interface in KB/MB/GB
Values can be displayed in Kbits/sec(Kbps) and/or KBytes/sec(KBps)
Can show maximum bandwidth consumed on each interface since start of utility
Can show average bandwidth consumption on each interface since start of utility
The output with all features (max, avg and display in Kbps and KBps) easily fits on a 80×24 console or xterm
Can interactively change its output display format depending on key pressed by user.

Install ibmonitor in Debian
First you need to download the latest version from here

Now you have ibmonitor-1.4.tar.gz
Extract this file using the following commands
tar xvfz ibmonitor-1.4.tar.gz

cd ibmonitor
If you want to run the application use the following command,Once you are in ibmonitor folder use

While tools to measure network performance, such as ttcp, exist, most are very old and have confusing options. Iperf was developed as a modern alternative for measuring TCP and UDP bandwidth performance.

Iperf  是一个网络性能测试工具。Iperf可以测试TCP和UDP带宽质量。Iperf可以测量最大TCP带宽,具有多种参数和UDP特性。Iperf可以报告带宽,延迟抖动和数据包丢失。

Iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.

Install iperf in Debian
# apt-get install iperf

iperf Syntax
iperf [-s|-c host] [options]

iperf -c server address -F file-name
iperf -c server address -I
The -F option is for file input.
The -I option is for input from stdin.

If you want more details and available options check man page
tcptrack is a sniffer which displays information about TCP connections it sees on a network interface. It passively watches for connections on the network interface, keeps track of their state and displays a list of connections in a manner similar to the unix ‘top’ command. It displays source and destination addresses and ports, connection state, idle time, and bandwidth usage.


Tcptrack安装相当简单,在Debian GNU/Linux或者 ubuntux系统上,可以使用如下的命令安装:
apt-get install tcptrack

# tcptrack -i

例如:# tcptrack -i eth1
# tcptrack -i eth0 -r 10

# tcptrack -i eth1 port 22

再如:#tcptrack -i eth0 port 80

从左到右分别显示客户端的IP地址和端口号、服务器的IP地址和端口号、状态、空闲时间和传输速率。如果用户想查看完整的使用方法,可以阅读其手册。 总之,Tcptrack应该是一个不错的工具。

Install tcptrack in Debian
# apt-get install tcptrack

tcptrack Syntax
tcptrack [-dfhvp] [-r ] -i []

tcptrack requires only one parameter to run: the -i flag followed by an interface name that you want tcptrack to monitor. This is the most basic way to run tcptrack
tcptrack -i eth0

tcptrack can also take a pcap filter expression as an argument. The format of this filter expression is the same as that of tcpdump and other
libpcap-based sniffers. The following example will only show connections from host
tcptrack -i eth0 src or dst

The next example will only show web traffic (ie, traffic on port 80)
tcptrack -i eth0 port 80

nload is a console application which monitors network traffic and bandwidth usage in real time. It visualizes the in- and outgoing traffic using two graphs and provides additional info like total amount of transfered data and min/max network usage.

nload默认分为上下两块:上半部分是:Incoming也就是进入网卡的流量,下半部分是:Outgoing,也就是从这块网卡出去的流量,每部分都有当前流量(Curr),平均流量 (Avg),最小流量(Min),最大流量(Max),总和流量(Ttl)这几个部分。另外也可以自己定义流量数值显示的单位。
使用‘/usr/local/nload/bin/nload –help’可以看到具体的相关参数了。

nload eth0 - 查看名叫eth0网卡的流量


vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that vnStat won't actually be sniffing any traffic and also ensures light use of system resources. However, in Linux at least a 2.2 series kernel is required.

vnStat是一个应用于Linux或BSD平台,对网卡流量做监控。 因为并非是基于网络包嗅探的方式而是基于/proc的分析。现在vnStat已经有出vnstat PHP frontend 扩展了,可以以PHP脚本的形式直接调用vnStat监测的数据。

This program is open source / GPL'ed and can be installed either as root or as a single user. Better instructions are included in the README. 

* quick and simple to install and get running
* gathered statistics persists through system reboots
* can monitor multiple interfaces at the same time
* several output options
o summary, hourly, daily, monthly, weekly, top 10 days
o optional png p_w_picpath output (using libgd) 
* months can be configured to follow billing period
* light, minimal resource usage
* same low cpu usage regardless of traffic
* can be used without root permissions
* online color configuration editor 


IPTraf is a console-based network statistics utility for Linux. It gathers a variety of figures such as TCP connection packet and byte counts, interface statistics and activity indicators, TCP/UDP traffic breakdowns, and LAN station packet and byte counts.



* An IP traffic monitor that shows information on the IP traffic passing over your network. Includes TCP flag information, packet and byte counts, ICMP details, OSPF packet types.
* General and detailed interface statistics showing IP, TCP, UDP, ICMP, non-IP and other IP packet counts, IP checksum errors, interface activity, packet size counts.
* A TCP and UDP service monitor showing counts of incoming and outgoing packets for common TCP and UDP application ports
* A LAN statistics module that discovers active hosts and shows statistics showing the data activity on them
* TCP, UDP, and other protocol display filters, allowing you to view only traffic you're interested in.
* Logging
* Supports Ethernet, FDDI, ISDN, SLIP, PPP, and loopback interface types.
* Utilizes the built-in raw socket interface of the Linux kernel, allowing it to be used over a wide range of supported network cards.
* Full-screen, menu-driven operation. 

启动IPTraf,首先你将看到版权声明,按任意键后就进入了主菜单。注意:使用iptraf需要root权限。IPTraf需要引用/usr /share/terminfo目录中的终端信息数据库,因此如果这个目录位于其它的位置,IPTraf将输出"Error opening terminal"错误信息之后,启动失败。这种情况可以通过如下方式解决:
#export TERMINFO

#ln -s /usr/lib/terminfo /usr/share/terminfo




-i 网络接口
让IPTraf监视特定的网络接口,例如:eth0。-i all表示监视系统的所有网络接口。


-d 网络接口

-s 网络接口

-z 网络接口
监视局域网的特定网络接口。-l all表示全部。

-t timeout


-L filename
如果使用-B参数,使用-L filename使IPTraf把日志信息写入其它的文件(filename)中。如果filename不包括文件的绝对路径,就把文件放在默认的日志目录(/var/log/iptraf)。

这个参数现在已经不用了。原来,如果IPTraf运行在使用IP地址伪装(IP Masquerading)的内核上时,会出现大量的警告信息。现在新版的IP Masquerading代码已经没有这个问题了。



ifstat报告是一个工具,报告接口状态,是一个网络流量监测程序,能查看网卡的流出和流入的字节。就像网络接口带宽的vmstat / iostat的做其他系统计数器。Ifstat工具是个网络接口监测工具,监控I/O状态和CPU状态。它可以监测本地接口内核投票计数器,或远程主机使用SNMP接口。

#的apt - get安装ifstat


KB /秒/秒出以KB
0.12 0.24
0.06 0.12
0.10 0.18
0.06 0.12
0.15 0.12

-l    监测环路网络接口(lo)。缺省情况下,ifstat监测活动的所有非环路网络接口。经使用发现,加上-l参数能监测所有的网络接口的信息,而不是只监测lo的接口信息,也就是说,加上-l参数比不加-l参数会多一个lo接口的状态信息。

-a  监测能检测到的所有网络接口的状态信息。使用发现,比加上-l参数还多一个plip0的接口信息,搜索一下发现这是并口(网络设备中有一个叫PLIP (Parallel Line Internet Protocol). 它提供了并口...)

-z  隐藏流量是无的接口,例如那些接口虽然启动了但是未用的

-i  指定要监测的接口,后面跟网络接口名

-s  等于加-d snmp:[comm@][#]host[/nn]] 参数,通过SNMP查询一个远程主机

-h 显示简短的帮助信息

-n 关闭显示周期性出现的头部信息(也就是说,不加-n参数运行ifstat时最顶部会出现网络接口的名称,当一屏显示不下时,会再一次出现接口的名称,提示我们显示的流量信息具体是哪个网络接口的。加上-n参数把周期性的显示接口名称关闭,只显示一次)

-t 在每一行的开头加一个时间戳(能告诉我们具体的时间)

-T 报告所有监测接口的全部带宽(最后一列有个total,显示所有的接口的in流量和所有接口的out流量,简单的把所有接口的in流量相加,out流量相加)

-w  用指定的列宽,而不是为了适应接口名称的长度而去自动放大列宽

-W 如果内容比终端窗口的宽度还要宽就自动换行

-S 在同一行保持状态更新(不滚动不换行)注:如果不喜欢屏幕滚动则此项非常方便,与bmon的显示方式类似

-b 用kbits/s显示带宽而不是kbytes/s(bit和byte有何区别应该都知道吧)

-q 安静模式,警告信息不出现

-v 显示版本信息

-d 指定一个驱动来收集状态信息


是一个用来替换 vmstat, iostat, netstat, nfsstat 和 ifstat 这些命令的工具,是一个全能系统信息统计工具。可以完成vmstat,iostat,netstat等等工具才能完成的任务,而且是彩色显示的,各种情况一目了然,它可通过参数来指定显示哪些内容,如只显示CPU、内存等等,一切都可以定制。它不是一纯粹的网络流量处理工具。

dstat is a versatile replacement for vmstat, iostat, netstat, nfsstat, and ifstat. It includes various counters (in separate plugins) and allows you to select and view all of your system resources instantly; you can, for example, compare disk usage in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval).

安装命令:apt-get install dstat

Dstat options:
-c, --cpu              显示CPU情况
-C 0,3,total           include cpu0, cpu3 and total
-d, --disk             显示磁盘情况
-D total,hda           include hda and total
-g, --page             enable page stats
-i, --int              enable interrupt stats
-I 5,eth2              include int5 and interrupt used by eth2
-l, --load             enable load stats
-m, --mem              显示内存情况
-n, --net              显示网络情况
-N eth1,total          可以指定网络接口
-p, --proc             enable process stats
-s, --swap             显示swap情况
-S swap1,total         可以指定多个swap
-t, --time             enable time counter
-y, --sys              enable system stats
--ipc                  报告IPC消息队列和信号量的使用情况
--lock                 enable lock stats
--raw                  enable raw stats
--tcp                  enable tcp stats
--udp                  enable udp stats
--unix                 enable unix stats

-M stat1,stat2         enable external stats
--mods stat1,stat2

-a, --all              使用-cdngy 缺省的就是这样显示
-f, --full             使用 -C, -D, -I, -N and -S 显示
-v, --vmstat           使用-pmgdsc -D 显示

--integer              show integer values
--nocolor              disable colors (implies --noupdate)
--noheaders            只显示一次表头以后就不显示了,使用重定向写入文件时很有用
--noupdate             disable intermediate updates
--output file          写入到CVS文件中

The Multi Router Traffic Grapher or just simply MRTG is free software for monitoring the traffic load on network links. It allows the user to see traffic load on a network over time in graphical form.



Project Homepage
Cacti is a complete network graphing solution designed to harness the power of RRDTool’s data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive,easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.

Cacti 在英文中的意思是仙人掌的意思,Cacti是一套基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具。它通过snmpget来获取数据,使用RRDtool绘画图形,而且你完全可以不需要了解RRDtool复杂的参数。它提供了非常强大的数据和用户管理功能,可以指定每一个用户能查看树状结 构、host以及任何一张图,还可以与LDAP结合进行用户验证,同时也能自己增加模板,功能非常强大完善。

Project Homepage