We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You have a problem. Measuring bandwidth can be extremely difficult. I'm assuming what you're wanting to do is simply see how 'fast' a DSL connection is?
This is a problem I looked at a while back. The simplest way seems to be to have a client server arrangement. The client connects to the server, and downloads a (large ish) file. The time taken to download is your bandwidth measure. In perl, well, refer elsewhere for code, but you could simply have a server that prints 1M bytes, and time how long it takes your client to recieve that. Alternatively, you can use FTP and upload and download a file. That's generally a reasonable measure :) Other alternatives include using pings of various sizes. By comparing the round trip time of a ping of 1 byte payload. 10 bytes of payload, 100 bytes etc. The theory being that there's a 'basic' round trip time for the small pings, that increases in direct proportion to the size of the data. If your're actually looking to view/control bandwidth from another application, may I recommend trying to get a copy of "ntop" for viewing. Controlling bandwidth is difficult, requires bending RFCs and is a quite profitable business on the net. In reply to Re: Bandwidth Testing
by Preceptor
|
|