Let's say I have a machine with 3 NICs; wifi, eth, and 3G. I'm trying to get the ESTIMATED speed (or bandwidth) at which a link CAN transmit at a given time for each of these interfaces and determine which one is the fastest. Again at a given time. I'm writing a linux kernel module. I'm using kernel version 2.6.35. Is there anyway to measure the available bandwidth? Even if it meant sending a testing ping to measure something like we do in measuring latency ...
3 Answers
iperf can help you measure actual bandwidth http://sourceforge.net/projects/iperf/

- 2,799
- 3
- 25
- 36
Actually, this is a difficult problem. If you know all three NICs connect to a common site, the obvious straightforward test is to transfer some data through each NIC and time them.
However, given the difficulty of the problem in general, it might be "good enough" to broadcast UDP through each NIC and time that. That fails to reveal any receive performance, but it is better than nothing.

- 56,922
- 16
- 83
- 148
At Linux, you should read /proc/net/dev (you have the total packages/bytes sent. Get these numbers at your 'start' and 'end' time)
http://linuxdevcenter.com/pub/a/linux/2000/11/16/LinuxAdmin.html http://www.linuxjournal.com/article/8381
(Source here: How can I get the current network interface throughput statistics on Linux/UNIX?)

- 1
- 1

- 555
- 5
- 11