Echometer v1.7 Home Page
The problem:
Mirror sites are a common way of distributing thousands of copies of the
same software, they are also used for web sites that are very popular.
When a web designer includes a list of mirrors, it is usually with a suggestion
to the user to click on the closest site to the users machine.
To click on a site in the same country is generally a good hint, but
depending on to what networks are the user and the site conected, the information
may have to be routed through another country. This situation is quite
common in Europe, with competing communications companies that offer internet
access, but that do not conect to other companies int the same region.
Sometimes the linking point is as far away as the U.S.!
Also, to click in the geographically closest site, ignores the fact that
depending on the time of the day, some servers may be very busy while others
(maybe further away) may be almost unused and may responde faster.
The solution:
Web designers that include a list of mirrors in their pages can help the
users make an informed decision by including an Echometer applet for each
mirror. The applet will measure the round trip delay to the server and
display the result. This information may change during the day but the
best decision is always to connect to the server with the lowest round
trip delay.
To include Echometer in your html pages:
Echometer v1.7 is compiled in J2SE 5.0, that means it runs in about 97% of the browsers out there. The echometer.jar
file is signed by
Diego Moriarty. You don't have to know anything about Java,
just include something like this in your HTML page:
<a href=http://some.site.com/page.html>Click to go to the site</a>
<applet codebase="/echometer"
archive="echometer.jar" code="Echometer.class" WIDTH="95" HEIGHT="16">
<param name="url" value="http://some.site.com/page.html">
<a href="/echometer">Echometer</a></applet>
The only pieces of information used from the "url" parameter are the protocol
and the address (maybe in a future version the rest will be used).
Valid protocols are http, https, ftp, telnet and gopher. The address can be a
host name or an ip address. Note that http connections are often handled by proxies that respond immediately, this makes the results completely uninformative for many users.
There are three ways of using the codebase
attribute:
-
As above, pointing to moriartys.com. The user will have to pre-download
my certificate or the browser will ask the user to trust the applet. In this way you don't need to serve the applet from your site.
-
Pointing to your own site. Same as above, but you'll have to copy
Echometer to your site, then you don't depend on moriartys.com being up. Not including the
codebase
means that the applet is being served from the same website as the web page that uses it.
-
Pointing to the target site itself. You will have to make sure that a
copy of the unsigned Echometer is downloadable from it, the big advantage is that the user doesn't have to pre-download my certificate and
the browser won't ask any difficult questions.
The user may see these messages:
- Echometer: This is a link to this page and it is only shown by the
browser if it can not execute Java applets. The user should enable Java
applets in the browser, or upgrade to a Java enabled browser.
- Trying URL ... : There is still no answer from the host. The return value accessible to JavaScript (see explanation below) is -1.
- 1234ms : This (or other number of milliseconds) is the average
roundtrip to the server.
- Malformed URL: The writer of html has provided a bad URL (or
one with an invalid protocol) in the applet tag. It is probably a typo. Return value -2.
- Unknown host: Couldn't find IP address for the host specified
in the URL. It may be a typo or the target is not a registered address. Return value -3.
- Security: Echometer can not connect to the target because the
user has not allowed it to do so. Return value -4.
- Server down: The machine is connected to the internet, but the Web server (or
ftp, etc) is not running. Return value -5.
- Disconnected: There is an IP address for the host, but it is
not responding. Maybe the machine is disconnected from the internet, or
there is a firewall blocking a direct connection. Return value -6.
- IOException?: Unexpected/Unhandled IO error. Return value -7.
- Need URL! or Bad value: The parameters or values specified in the html are wrong. Return value -8.
- No answer: The connection has timed out waiting for an answer, this usually means a hungry firewall on the way. Return value -9.
Other parameters/funtionality:
By default Echometer returns and displays the average round trip, not the result of the last measurement. By adding the parameter window
you can specify that only the last N measurements be used to calculate the average. The default is all.
You can pass a further pause
parameter to specify the number of milliseconds to pause between measurements. The default pause is 5000 milliseconds.
By default the measurements will be repeated for ever, if you want to restrict this to just a few measurements you can pass the parameter measurements
with the number of maesurements to perform before stopping. After that (or when the user leaves the page) the applet will no longer consume any system resources.
With the type
parameter you can specify the type of connection that you want echometer to use: TCP/IP, UDP or ICMP. When using UDP the port number is taken from the URL. Trying to use ICMP is mostly useless, it is not fully implemented in any current version of J2SE. The default, and the most firewall-friendly type is TCP/IP.
Demonstration of the signed Echometer:
In order to see a demo of Echometer connecting to many targets, you can proceed from here in two different ways:
- You can install my certificate in your browser. By doing that you are certifying that Diego Moriarty (who signed the applet) is a good guy, I could have payed Verisign or Thawte to do that, but they charge hundreds of dollars and the procedure is a lot of hassle. Click here to add Diego Moriarty Certificate Authority to your browser's list. Usually applets are not allowed to connect to other computers (except
to where they come from), now that your browser knows about me, it will run the applet without further questions.
- You can still go to the demo page without downloading the certificate and the browser will warn you about the applet, but will give you the option to trust Echometer.
Ok? ready? Now you can see
the demo.
Demonstration of the unsigned Echometer:
You can forget all about certificates and permissions if you serve an unsigned Echometer applet from the same site that is the target of the Echometer, you can do this by using the unsigned-echometer.jar
instead of echometer.jar
. For example here is an unsigned echometer: The average roundtrip from your computer to moriartys.com is:
Enjoy!