Java: Does anyone know a library that determines the quality of an Internet connection?

I know that a simple URLConnection for Google can determine if I am connected to the Internet, because I am sure that everything is good and good on the Internet. If I can’t connect to Google. But what I'm looking for at this stage is a library that can measure the effectiveness of my Internet connection in terms of BOTH response and available bandwidth. BUT , I do not want to measure how much bandwidth is potentially available, as it is too resource intensive. I just need to be able to test, or not, I can get something like X kB in Y time. Does such a library already exist?

+6
java networking monitoring
source share
3 answers

It is impossible to judge this. In today's world of ADSL 2+ with a 20-bit Mb / s download speed, you are pretty much driven by the speed of everything upstream of you. For example, if you connect to a site in another country, the main bottleneck is probably international communication. If you are connected to a site in the same city as you, then you are probably limited by the speed of the uplink (for example, they can be 10 MB / s, and they will serve many people at the same time).

Thus, the answer to the question "can I get X KB in no more than Y seconds" depends entirely on where you are loading from. And so the best way to answer this question is to actually start the download from where you plan to download, and then time.

In terms of responsiveness, this is basically the same question. You can make an ICMP request to the server in question, but many servers will have firewalls installed that do not send ICMP packets without response, so they are not accurate (moreover, if then the ping is much less than ~ 100 ms, then the biggest contribution to latency is probably from the internal processing of the server, and not from the real network, which means that ICMP ping will be useless anyway).

This generally relates to the characteristics of the network - and, in particular, to the Internet (because it is so complicated) - you cannot reliably measure anything about site X and conclude that site Y. If you want to know how site Y will respond quickly, then you just need to connect to site Y and start the download.

+2
source share

Calculating a user's ability to reliably download a given number of bits over a given period of time can be difficult, but you can start with some code found at http://commons.apache.org/net/ . In any case, this may indicate latency and throughput.

0
source share

The answer may be incorrect in a millisecond (replace any other period) after you have measured it.

Look at any application that will give you the number "remaining boot time." Note that it is usually incorrect and / or constantly updated, and only becomes accurate at the last second.

In principle, so many changes are inevitable in any sufficiently complex network, such as the Internet, that the only real measure is available only after the fact.

0
source share

All Articles