5

We have a DSL , how can we calculate the available bandwidth so that we can shape the packet, We can assume the bandwidth to be 100mbps on the ethernet interface However, in DSL devices, the train rate(Bandwidth rate ) is varies according to different situation. How can i get the available bandwidth rate(from varies)?. Any method is there for getting the available bandwidth value?

Sheng Xengg
  • 125
  • 1
  • 1
  • 8
  • 2
    Every network interface can vary...you are not guaranteed 100mbps; it is simply the speed at which it CAN transmit. – Aaron McIver Feb 22 '11 at 17:43
  • Hi sir Aaron! so any idea how to determine the available bandwidth sir? – Sheng Xengg Feb 22 '11 at 17:46
  • Can you explain more about how you plan to "shape the packet"? What is your goal? – Justin Feb 22 '11 at 18:20
  • i can't find it right now, but Google's Measurement Lab (http://www.measurementlab.net) has an API to test our internet connection speed. µTorrent is an application that uses this service. – Ian Boyd Feb 22 '11 at 21:58

2 Answers2

7

"Bandwidth" is not something you can determine for a single computer. As a minimum you need to specify both endpoints. Even your assumption of 100 mbps on Ethernet may be wrong, as the cable or the other endpoint may not be capable of the full transfer rate. Usually this is done by Quality of Service functionality incorporated into the network transfer, and it is not an easy thing to do.

In our multiplayer game (using UDP) we have used Packet Pair Probing successfully, and even if it is not universal, it was the most reliable from all methods we have tried. I am afraid it is out of scope of this answer to describe it in more detail, but this answer gives quite good description of something very similar in easy to understand terms:

Basically, if you start from zero bandwidth and increase bandwidth use, latency very slowly increases - until you hit about 90% of your bandwidth. Then latency goes through the roof, up to another plateau, after which it again increases slowly.

Community
  • 1
  • 1
Suma
  • 33,181
  • 16
  • 123
  • 191
0

Available bandwidth changes every time a packet is injected into the network from anywhere. It is not available via any API. TCP/IP already does 'packet shaping'. Your objective is unclear.

user207421
  • 305,947
  • 44
  • 307
  • 483