-3

I want write a code to get the available bandwidth. Using one of the algorithm.ex.spruce / pathload.

I wanted to a code in C++ in Windows. I have got linux code . But i wanted a Windows based code , which can get me up and down bandwidth.

onmyway133
  • 45,645
  • 31
  • 257
  • 263
vishal
  • 91
  • 1
  • 6

2 Answers2

1

Bandwidth for what resource? If this is a network resource there isn't anything in any language or the OS that will give you any real estimation of bandwidth. You would need to call out to something at the other end of the link you need to traverse and get an estimation of bandwidth at that point in time.

Or better said... You would need to call a file on a web server to test the download speed of someone's home Internet connection. Keep in mind that the numbers obtained are only accurate for that point in time though. As the bandwidth on any resource can be higher or lower when you actually use them since external factors always affect bandwidth (other prorcesses, users, etc.)

Why do you need the bandwidth and for what resource?

Frazell Thomas
  • 6,031
  • 1
  • 20
  • 21
  • Code for what? You didn't answer my base question of "for what?" at all. Bandwidth is just the measure of how muc data can be transferred between two objects over a given path. That could be for I/O, Network, RAM, etc... – Frazell Thomas Nov 26 '10 at 05:42
  • I think the question gave it all. Pathload is a technique to measure network bandwidth. – Syaiful Nizam Yahya Feb 06 '14 at 00:22
0

If you asking, you not up to it. Converting linux to windows requires knowledge of both platform, which you clearly doesnt have.

In my experience, almost all network friendly bandwidth estimation algorithm (pathload, pathchirp etc) are unsuitable for high speed bandwidth. Those old algorithm are suitable and practical if the bandwidth is around 1mb. Also, these algorithm assume the network is 'clean'(no other traffic). Nowadays, almost all of these 'network friendly' algorithm is not practical.

Other variant bandwidth estimation tools like netperf, netcps is based on brute force method. Brute force method are not network friendly. Most of this algorithm have problem with latency(if tcp based) and reached hdd read/write speed(if write to hdd instead of memory).

IMO, the best bandwidth estimation tools is UDP based(not influenced by latency unlike tcp) brute force(not influenced by other traffic) with custom made control flow tuned for high speed networks.

Other problem you will encounter is code optimization. You must ensure that your code is highly optimized. If you use c#, GC will pose a possible problem.

Syaiful Nizam Yahya
  • 4,196
  • 11
  • 51
  • 71