Available Bandwidth – How to Detect Without Congesting the Link

bandwidththroughput

A lot of applications have been designed to help us detect the bandwidth on a link (Link throughput capacity) connecting two servers such as iperf. Unfortunately, these softwares congest the network and calculate consequently the amount of traversed data over the time consumed.

Is there any method that allows to detect the available bandwidth on a link without congesting it knowing that the link default capacity is known to be around 1Gb/s? I mean maybe to check the OUT buffer in the kernel space frequently. Or maybe to detect by some means the traffic on the link, thereupon the available bandwidth would be its complementary.

Best Answer

Most operating systems will provide a measure of the link speed of the device. They will also provide a measure of how much traffic is flowing. You could subtract the two to get an approximation of the amount of free capacity. How exactly to read these values is outside the scope of this site (probably stack overflow is your best bet there).

However there are a few pitfalls with this technique

  1. The headline interface speed may or may not accurately reflect the actual speed of the interface. For Ethernet controllers in desktops and servers it's probably pretty good, for VMs, WiFi etc it's likely to be wildly inaccurate.
  2. Related to 1 some things may not be counted in the traffic counters but may still take up capacity on the link. This may limit your accuracy.
  3. On a shared medium such as wifi or really old Ethernet networks it won't tell you about traffic that is on the medium but not flowing to or from your system.
  4. It only tells you about available capacity on the link from the local machine to the nearest switch. It will not give you any visibility for conditions deeper in the network.

If you know precisely how the network is laid out and have administrative control over it you may be able to build a system that monitors traffic flows on all the devices (for example using SNMP), calculates the path between two end systems and works out where the bottleneck would be and how much capacity is available on the bottleneck link. Again though I would only regard it as an approximation and it's probably only practical in a highly controlled environment.

Related Topic