<font face="times new roman" size="3"><p style="margin:0;padding:0;"><span style="font-family: 'times new roman'; font-size: 12pt;">
<p style="margin:0;padding:0;margin: 0; padding: 0;"><span style="font-family: 'times new roman'; font-size: 12pt;"> </span></p>
<p style="margin:0;padding:0;margin: 0; padding: 0;">Actually, using HTTP 1.1 GET  that generates a single packet in each direction for a ping is quite reasonable.  In fact, it is "better" for measuring actual path latencies, since ICMP pings *could* be discriminated against in a router along the way (in the "old days" people in the routing community suggested that ICMP should be diverted off of the "fast path" to avoid degrading the user experience).</p>
<p style="margin:0;padding:0;margin: 0; padding: 0;"> </p>
<p style="margin:0;padding:0;margin: 0; padding: 0;">I've been using this technique to measure bufferbloat-induced delays on Phones and Android phones for quite a while.  I have a couple of servers that use nginx "status" handlers to generate a short GET response without touching files as my "targets".</p>
<p style="margin:0;padding:0;margin: 0; padding: 0;"> </p>
<p style="margin:0;padding:0;margin: 0; padding: 0;">Since it depends on HTTP 1.1's re-use of the underlying TCP connection for successive GET commands, it's a bit fragile.</p>
<p style="margin:0;padding:0;margin: 0; padding: 0;"> </p>
<p style="margin:0;padding:0;margin: 0; padding: 0;">Javascript can be made to do a lot of performance testing - you can access both TCP and DNS protocols from the browser, so if you play cards right, you can cause single TCP exchanges and single UDP exchanges to happen with cooperative servers (web servers using HTTP 1.1 and DNS resolvers using uncacheable UDP name lookups).</p>
<p style="margin:0;padding:0;margin: 0; padding: 0;"> </p>
<p style="margin:0;padding:0;margin: 0; padding: 0;"> </p>
<p style="margin:0;padding:0;margin: 0; padding: 0;"> </p>
<!--WM_COMPOSE_SIGNATURE_START--><!--WM_COMPOSE_SIGNATURE_END-->
<p style="margin:0;padding:0;margin: 0; padding: 0;"><br /><br />On Sunday, April 28, 2013 10:56am, "Rich Brown" <richb.hanover@gmail.com> said:<br /><br /></p>
<div id="SafeStyles1367174334">
<p style="margin:0;padding:0;margin: 0; padding: 0;">> This is indeed a cool hack. I was astonished for a moment, because it was a<br />> bedrock belief that you can't send pings from Javascript. And in fact, that is<br />> still true.<br />> <br />> Apenwarr's code sends short HTTP queries of the format shown below to each of two<br />> hosts:<br />> <br />> http://gstatic.com/generate_204<br />> http://apenwarr.ca/blip/<br />> <br />> The Blip tool shows ~60-70ms for the gstatic host, and ~130 msec for the latter.<br />> Ping times are ~52 msec and 125msec, respectively. These times seem to track<br />> response times by my eye (no serious analysis) to load both on my primary<br />> (bloated) router and CeroWrt.<br />> <br />> Still a cool hack.<br />> <br />> Rich<br />> <br />> -------------------------<br />> HTTP Request & Response for typical blip "ping"<br />> <br />> OPTIONS /generate_204 HTTP/1.1<br />> Host: gstatic.com<br />> Connection: keep-alive<br />> Access-Control-Request-Method: GET<br />> Origin: http://gfblip.appspot.com<br />> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31<br />> (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31<br />> Access-Control-Request-Headers: accept, origin, x-requested-with<br />> Accept: */*<br />> Referer: http://gfblip.appspot.com/<br />> Accept-Encoding: gzip,deflate,sdch<br />> Accept-Language: en-US,en;q=0.8<br />> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3<br />> <br />> HTTP/1.1 204 No Content<br />> Content-Length: 0<br />> Content-Type: text/html; charset=UTF-8<br />> Date: Sun, 28 Apr 2013 12:37:17 GMT<br />> Server: GFE/2.0<br />> <br />> <br />> On Apr 26, 2013, at 7:04 PM, Dave Taht <dave.taht@gmail.com> wrote:<br />> <br />> > Apenwarr has developed a really unique tool for seeing latency and<br />> > packet loss via javascript. I had no idea this was possible:<br />> ><br />> > http://apenwarr.ca/log/?m=201304#26<br />> ><br />> ><br />> ><br />> > --<br />> > Dave Täht<br />> ><br />> > Fixing bufferbloat with cerowrt:<br />> http://www.teklibre.com/cerowrt/subscribe.html<br />> > _______________________________________________<br />> > Bloat mailing list<br />> > Bloat@lists.bufferbloat.net<br />> > https://lists.bufferbloat.net/listinfo/bloat<br />> <br />> _______________________________________________<br />> Cerowrt-devel mailing list<br />> Cerowrt-devel@lists.bufferbloat.net<br />> https://lists.bufferbloat.net/listinfo/cerowrt-devel<br />></p>
</div>
<p style="margin:0;padding:0;"> </p>
</span></p></font>