1

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.

3 Answers 3

0

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.

0
1

The bandwidth of a link can be locally detected (e.g. in Windows wmic NIC get description,speed).

The bandwidth of a path can be much more complicated and often can't be detected without actually testing the speed (esp. in the Internet). Within your own network you may e.g. be running a routing protocol that you could extract the information from.

However, usually you don't have to detect (theoretical) bandwidth because the commonly used TCP protocol will do all this for your application. Effective bandwidth along a path changes all the time depending on overall traffic.

3
  • Thank you for your answer, however it does not address explicitly the problem. Firstly, "wmic NIC get speed" returns the full speed of the NIC not the available bandwidth in the presence of background traffic. Secondly, the TCP/IP uses the congestion protocol to detect the available bandwidth. Jul 17, 2017 at 10:30
  • 2
    The currently used bandwidth would have to be queried from the OS's performance counters (which is outside the scope of NE). As it seems to be a programming question I think it's better suited for StackOverflow.
    – Zac67
    Jul 17, 2017 at 11:07
  • @Mohamad-jaafar, the full speed of the NIC is the bandwidth, which is defined as the maximum number of bps that the link can handle. Perhaps you mean the throughput, which is something different. TCP detects the RTT, which is something else, IP doesn't do any type of detection.
    – Ron Maupin
    Jul 17, 2017 at 13:24
1

It is common for manged switches to maintain per port usage reports which can be queried based on traffic type You would get those through SNMP or Netflow reports on Cisco compatible devices. Most NMS software supports both access types.

The NMS software will probably support a basic capture, of which link bandwidth is usually included. If the switch manufacture did fancy things, you may need to load a MIB(for SNMP) file that has all of the data queries which the switch supports. When that is loaded into the NMS application the NMS can then make more detailed queries to the device.

2
  • Thank you. I've never knew about that. I will give it a look. Jul 18, 2017 at 21:52
  • edited to include notes about MIB for SNMP based Network Management Services hosts Jul 21, 2017 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.