Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Measuring latency
from the browser
Paper presented at #WebBR2015
Agustín Formoso - LACNIC Labs
simon.lacnic.net
@proyectosimonhttp://simon.lacnic.net
Agenda
• O projeto
• Latencia, Javascript, e TCP
• Os testes
• Próximos pasos
@proyectosimonhttp://simon.lacnic.net
The project
@proyectosimonhttp://simon.lacnic.net
The project
The problem
• Connectivity in LAC is good but not
optimal
• Presence of ...
@proyectosimonhttp://simon.lacnic.net
The project

Reports
BR <—> BR
BR <—> MX BR <—> Region
Connectivity information rega...
@proyectosimonhttp://simon.lacnic.net
Latency
One way
• Two clocks
• Clocks sync
• Hard
RTT
• One clock
• Easier
• Everyth...
@proyectosimonhttp://simon.lacnic.net
Why bother with the browser?
Pros
• Standard and widely-used
technologies
• Ran at t...
@proyectosimonhttp://simon.lacnic.net
Why bother with the browser?
@proyectosimonhttp://simon.lacnic.net
Why bother with the browser?
Cons
• Where is the delay happening?
• Do we need to kn...
@proyectosimonhttp://simon.lacnic.net
Latency, Javascript
and TCP
@proyectosimonhttp://simon.lacnic.net
Latency, Javascript and TCP
Some code
$.jsonp({
type: 'GET',
url: 'http://mytestpoin...
@proyectosimonhttp://simon.lacnic.net
Latency, Javascript and TCP
Connection establishment
• TCP connection overhead
• One...
@proyectosimonhttp://simon.lacnic.net
Latency, Javascript and TCP
Successive “GETs”
• Used every time after TCP
connection...
@proyectosimonhttp://simon.lacnic.net
Latency, Javascript and TCP
Successive “GETs”
• High level HTTP RTT
• t0, t1, d1, d2...
@proyectosimonhttp://simon.lacnic.net
Latency, Javascript and TCP
Successive “GETs”
• High level HTTP RTT
• t0, t1, d1, d2...
@proyectosimonhttp://simon.lacnic.net
Latency, Javascript and TCP
Comparison
• Tester running at the client
• tcpdump runn...
@proyectosimonhttp://simon.lacnic.net
The tests
@proyectosimonhttp://simon.lacnic.net
The tests
Testing our tool in Browserstack
• Cloud-based testing service
aimed at we...
@proyectosimonhttp://simon.lacnic.net
The tests
Javascript tool
• Ran in the virtual instance
• Fixed origin, fixed destina...
@proyectosimonhttp://simon.lacnic.net
The tests
The data: first glance
~360~350
@proyectosimonhttp://simon.lacnic.net
The tests
The data: time anomalies
@proyectosimonhttp://simon.lacnic.net
The tests
The data: serious time anomalies
@proyectosimonhttp://simon.lacnic.net
The tests
The data: IQR filtering
@proyectosimonhttp://simon.lacnic.net
The tests
The data: second glance
11 ms
@proyectosimonhttp://simon.lacnic.net
The tests
The data: adjusting it
+11 ms
@proyectosimonhttp://simon.lacnic.net
The tests
Normalising results
Windows 7
Windows
8.1
OS X Windows XP Windows 8
Chrome...
@proyectosimonhttp://simon.lacnic.net
The tests
Normalising results
• Two distinct behaviours
- Firefox vs. Chrome
- OS X ...
@proyectosimonhttp://simon.lacnic.net
Still…
• Uncertainties on virtualisation software
• No tests for mobile or Linux yet...
@proyectosimonhttp://simon.lacnic.net
Test conclusions
• The browser: great tool for delivering large-scale measurements b...
@proyectosimonhttp://simon.lacnic.net
LAC regional
matrix
[Lighter blue means faster]
• Origins on the left
• Destinations...
@proyectosimonhttp://simon.lacnic.net
Next steps
@proyectosimonhttp://simon.lacnic.net
Next steps
WebResourceAPI
@proyectosimonhttp://simon.lacnic.net
Next steps
WebResourceAPI
• connectStart
• connectEnd
• RTT = connectEnd - connectSt...
@proyectosimonhttp://simon.lacnic.net
Next steps
Doing HTTP HEAD
• No data payload!
• Get rid of big 404 pages.
}payload
@proyectosimonhttp://simon.lacnic.net
Next steps
• We need more tests! (currently at ~1.5K daily)
• More information at AS...
Obrigado!
Perguntas
/LACNIC/simon Colabore!
@proyectosimon Compartilhe!
simon.lacnic.net Visite!
agustin@lacnic.net
@agufo...
Upcoming SlideShare
Loading in …5
×

Measuring latency from the browser

635 views

Published on

Presentation for W3C BR

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Measuring latency from the browser

  1. 1. Measuring latency from the browser Paper presented at #WebBR2015 Agustín Formoso - LACNIC Labs simon.lacnic.net
  2. 2. @proyectosimonhttp://simon.lacnic.net Agenda • O projeto • Latencia, Javascript, e TCP • Os testes • Próximos pasos
  3. 3. @proyectosimonhttp://simon.lacnic.net The project
  4. 4. @proyectosimonhttp://simon.lacnic.net The project The problem • Connectivity in LAC is good but not optimal • Presence of IXPs, but inter-country connectivity still has to be improved • Information about connectivity is not easy to find or updated The solution • Objective
 Provide representative and up-to-date connectivity measurements to anyone interested in them • How
 Latency measurements from many origins, to many destinations, via different protocols
  5. 5. @proyectosimonhttp://simon.lacnic.net The project
 Reports BR <—> BR BR <—> MX BR <—> Region Connectivity information regarding a certain country against • The country itself • Other countries • The LAC region
  6. 6. @proyectosimonhttp://simon.lacnic.net Latency One way • Two clocks • Clocks sync • Hard RTT • One clock • Easier • Everything running in one endpoint (the application) • Send packet and time the RTT • Paths!
  7. 7. @proyectosimonhttp://simon.lacnic.net Why bother with the browser? Pros • Standard and widely-used technologies • Ran at the end user • Can trigger measurements automatically • Scales fast Cons • Browser and operating system combination differences - TCP connections are handled differently by browser and OS combination! - Browser Javascript engines vary - OSes handle processes differently • Need of normalising different environments!
  8. 8. @proyectosimonhttp://simon.lacnic.net Why bother with the browser?
  9. 9. @proyectosimonhttp://simon.lacnic.net Why bother with the browser? Cons • Where is the delay happening? • Do we need to know where is it happening? • Black-box test them!
  10. 10. @proyectosimonhttp://simon.lacnic.net Latency, Javascript and TCP
  11. 11. @proyectosimonhttp://simon.lacnic.net Latency, Javascript and TCP Some code $.jsonp({ type: 'GET', url: 'http://mytestpoint.net/1442778041426', error: function () { rtt = (+new Date - ts); } }); ts = +new Date;
  12. 12. @proyectosimonhttp://simon.lacnic.net Latency, Javascript and TCP Connection establishment • TCP connection overhead • One time only • Keep it open
  13. 13. @proyectosimonhttp://simon.lacnic.net Latency, Javascript and TCP Successive “GETs” • Used every time after TCP connection has been made
  14. 14. @proyectosimonhttp://simon.lacnic.net Latency, Javascript and TCP Successive “GETs” • High level HTTP RTT • t0, t1, d1, d2 • data t0 t1 }d1 }d2 If d1→0 and d2→0 then t1 - t0→RTT (http)
  15. 15. @proyectosimonhttp://simon.lacnic.net Latency, Javascript and TCP Successive “GETs” • High level HTTP RTT • t0, t1, d1, d2 • data “RTT (http)”
  16. 16. @proyectosimonhttp://simon.lacnic.net Latency, Javascript and TCP Comparison • Tester running at the client • tcpdump running at the client • Save both tcpdump and tester 
 output ~200 ~210
  17. 17. @proyectosimonhttp://simon.lacnic.net The tests
  18. 18. @proyectosimonhttp://simon.lacnic.net The tests Testing our tool in Browserstack • Cloud-based testing service aimed at web developers to check the look & feel and responsiveness of their sites • We use it to run our Javascript tool over many different OS and browser combination
 • We used automated Selenium tests
  19. 19. @proyectosimonhttp://simon.lacnic.net The tests Javascript tool • Ran in the virtual instance • Fixed origin, fixed destination • Simple HTTP GET • Time the RTT • Parallel sessions with a reference environment always present
  20. 20. @proyectosimonhttp://simon.lacnic.net The tests The data: first glance ~360~350
  21. 21. @proyectosimonhttp://simon.lacnic.net The tests The data: time anomalies
  22. 22. @proyectosimonhttp://simon.lacnic.net The tests The data: serious time anomalies
  23. 23. @proyectosimonhttp://simon.lacnic.net The tests The data: IQR filtering
  24. 24. @proyectosimonhttp://simon.lacnic.net The tests The data: second glance 11 ms
  25. 25. @proyectosimonhttp://simon.lacnic.net The tests The data: adjusting it +11 ms
  26. 26. @proyectosimonhttp://simon.lacnic.net The tests Normalising results Windows 7 Windows 8.1 OS X Windows XP Windows 8 Chrome family 0 +1.9 -7.2 -1.4 +0.1 Firefox
 family -3.9 -2.8 -11.4 -4.8 -5.6 Our reference environment[Results are in ms]
  27. 27. @proyectosimonhttp://simon.lacnic.net The tests Normalising results • Two distinct behaviours - Firefox vs. Chrome - OS X versus the rest [Lighter blue means faster]
  28. 28. @proyectosimonhttp://simon.lacnic.net Still… • Uncertainties on virtualisation software • No tests for mobile or Linux yet (~8% of seen traffic)
  29. 29. @proyectosimonhttp://simon.lacnic.net Test conclusions • The browser: great tool for delivering large-scale measurements but - Huge variety - Measurement noise can be high
  30. 30. @proyectosimonhttp://simon.lacnic.net LAC regional matrix [Lighter blue means faster] • Origins on the left • Destinations on the top
  31. 31. @proyectosimonhttp://simon.lacnic.net Next steps
  32. 32. @proyectosimonhttp://simon.lacnic.net Next steps WebResourceAPI
  33. 33. @proyectosimonhttp://simon.lacnic.net Next steps WebResourceAPI • connectStart • connectEnd • RTT = connectEnd - connectStart
 (kind of)
  34. 34. @proyectosimonhttp://simon.lacnic.net Next steps Doing HTTP HEAD • No data payload! • Get rid of big 404 pages. }payload
  35. 35. @proyectosimonhttp://simon.lacnic.net Next steps • We need more tests! (currently at ~1.5K daily) • More information at AS level • Customised reports • traceroutes (currently ICMP Pinging only)
  36. 36. Obrigado! Perguntas /LACNIC/simon Colabore! @proyectosimon Compartilhe! simon.lacnic.net Visite! agustin@lacnic.net @aguformoso

×