Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

How to get the Internet Speed

Thread view: 
moumitaghosh@tataelxsi.co.in - 31 Mar 2006 08:34 GMT
hi all,
I need to get the internet speed,how can i get this
plz help
James McGill - 31 Mar 2006 09:06 GMT
> hi all,
> I need to get the internet speed,how can i get this

Transfer a stream of bytes across a socket and measure the time elapsed.

You might be able to make some native query to get signal rate of an
interface, but that won't tell you anything (you can have a 100Mb
ethernet to a router that's connected via 56K)  

Networks can be asymmetric, can vary from one moment to the next, can
have all kinds of different latency issues.  If you want, say, a
webservice to know if the client is on a dialup versus a broadband
connection, the best thing to do is ask the user.  If that's not an
option

If you can trust the client clock and have enough precision, you could
have it send you a timestamp and get a rough idea of the transfer rate.
Or you could possibly make this transparent on the server side with a
redirect.  There might even be a way to do this in an Apache bridge with
a servlet container like Tomcat.  

If it's just a client program that wants to get the transfer rate from
the host it's running on, you could just make it do an http get against
google or ietf.org something reliable like that, and measure the time it
takes for the bytes to arrive.

Maybe there are better ways.  
Martin Gregorie - 01 Apr 2006 19:25 GMT
> hi all,
> I need to get the internet speed,how can i get this
> plz help

If the connection is to something outside your local LAN the most
significant factor is packet transit time, not bytes/sec, so I'll assume
transit time is what you want to measure.

You can measure UDP round trip times directly with the ping utility
program. Ping is a standard command line utility for virtually every
operating system.

There's no equivalent way to measure request/response round trip times
on a TCP connection. If you're using a *nix operating system (UNIX,
Linux, FreeBSD, Solaris, OS X) you can easily script a simple solution
by using netcat (known as nc on some systems) as both client and server,
send a known number of messages and use the time utility to measure the
elapsed time. If netcat isn't installed you can get it from
netcat.sourceforge.net.

If you have any other operating system you'll have to write a simple
client/server pair and time individual request/response pairs. Use the
Socket and Date classes for communication and timing respectively. See
also the Stopwatch class that was published here last week.

Signature

martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Roedy Green - 01 Apr 2006 20:23 GMT
>hi all,
>I need to get the internet speed,how can i get this
>plz help
see http://mindprod.com/jgloss/transmissionspeed.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.