How Mywebtest Measures Speed

Network Protocols

Mywebtest operates over TCP, using a combination of HTTP and WebSocket connections. All time-sensitive (that is, timing- or speed-related) communication occurs over WebSockets, whereas HTTP is used for ancillary exchanges (such as storing/retrieving results).

The traceroute test operates slightly differently. Although the results are communicated over a WebSocket, the test itself operates over ICMP. See the description of the Traceroute test for more details.

Individual Tests

Download

The client initiates a download speed test by requesting the server send a specified number of bytes. The total bytes transferred are split into "chunks", and the server sends each chunk as a separate WebSocket message.

As the client receives the chunks it computes the real-time download speed by measuring the time required to receive each chunk. When all chunks have been received the final download speed is computed as the total bytes transferred divided by the total time required to receive all chunks.

Upload

The client requests an upload test by informing the server of its intent to send a specified number of bytes. Once the server acknowledges the request the client begins sending data over the WebSocket. Similar to the download test, the client "chunks" the total transfer, sending each chunk as a separate WebSocket message. This allows the client to compute the real-time upload speed. When all chunks have been sent the final upload speed is computes as the total bytes transferred divided by the total time to send all chunks.

Latency

Latency is computed at the round-trip time (RTT) to send a short message and receive a reply over a WebSocket. The test is repeated multiple times, with the overall latency ( LL ) defined as the average of all measurements:

L=1n i=1n li L = rac{1}{n} sum_{i=1}^n l_i

where {l1,l2,,ln} {l_1, l_2, ldots, l_n} are the individual latency measurements.

Latency is computed under three conditions:

  1. While no other tests are executing.
  2. During the download test.
  3. During the upload test.

These are presented as the "unloaded", "download", and "upload" latency, respectively.

Jitter

Jitter ( JJ ) is defined as the standard deviation (without Bessel's correction) of the latency measurements, that is

J= 1n i=1n (liL) 2 J = sqrt{ rac{1}{n} sum_{i=1}^n left( l_i - L ight)^2}

where lil_i and LL are the individual and average latency as defined in the Latency test. Note jitter is based purely on already-obtained latency measurements, and so itself does not require additional client/server communications.

Traceroute

When initiated by the client, the server sends a series of ICMP probes to the client. The probes begin with an IP TTL of 1 and increase the TTL by one with each probe. Upon receipt of the ICMP "Time Exceeded" message the server records not only the IP address of the hop but the round-trip time (RTT) required to reach the hop. This continues until the client is reached, at which point the full network path from the server to the client is mapped, along with the latency at each hop.

In order to "smooth out" outliers, three probes are sent with each hop (TTL) and the hop RTT is computed as the average of the individual probe RTTs.