ITN 101 · Introduction to Network Concepts

Speed Lab

An internet speed test that shows its work. Run it, then read how every number was made.

Run the test

Press Start test. In about 25 seconds your browser will time some tiny messages, then download and upload random data as fast as the path between you and this server allows. Nothing is installed and nothing you send is saved.

Data use: a speed test moves a lot of data on purpose. On a fast connection this one can use several hundred megabytes. If you pay for mobile data by the gigabyte, use Wi-Fi.

Ready when you are.

  1. Latency
  2. Download
  3. Upload
  4. Route

Latency (ping)

– ms

Time for one tiny message to go to the server and come back.

Jitter

– ms

How much the latency changes from one message to the next.

Download

– Mbps

Data arriving from the server to you.

Upload

– Mbps

Data leaving you for the server.

warm-up – 0 0 s 8 s
Download speed, second by second (megabits per second). The shaded warm-up is not counted.
warm-up – 0 0 s 8 s
Upload speed, second by second (megabits per second). The shaded warm-up is not counted.
What exactly happens in each step?
  1. Latency. The browser sends 15 tiny web requests, one after another, and times each round trip, from the moment the request leaves to the moment the first byte of the answer returns. The result shown is the median (the middle value), so one slow reply does not spoil it. Jitter is the average change between one reply and the next.
  2. Download. The browser opens 4 connections to the server at the same time and asks each one for a 25-megabyte block of random data, again and again, for 8 seconds. It counts the bytes as they arrive. While that is happening it keeps sending pings to see if latency gets worse when the line is busy.
  3. Upload. The same idea in reverse: 3 connections each send blocks of random data to the server for 8 seconds. The server counts the bytes and throws them away.
  4. Route. The server traces the path back to you, one router at a time.

Why a warm-up? TCP does not start at full speed. It begins gently and doubles its sending rate until it finds the limit of the path. This is called slow start, and you can see it as the climb at the left of each chart. Counting that climb would make your connection look slower than it is, so the first 1.5 seconds are left out.

Why random data? Random bytes cannot be compressed. If the test sent a file full of zeros, something along the way could shrink it and the result would be too high.

Why several connections? One TCP connection can be held back by a single lost packet. Several at once fill the line more reliably, which is closer to what your connection can really carry. Fast.com and Speedtest do the same thing.

Where are you? Where is the server?

A speed test measures a path between two computers. This page looked up both ends.

You (the client)

Public IP address
looking up…
Network
–
Location guess
–
Connection
–

The server

Public IP address
–
Network
–
Location guess
–
What the owner says
–

How does this page know where I am?

It does not use GPS, and it never asked your browser for your location. It only used your public IP address, and it had to be told that address or it could not reply to you.

  1. Every packet carries a return address. The IP header of each packet you send has a source address and a destination address. The server reads the source address so it knows where to send the answer. That address is the public one your router or your ISP shows to the Internet, not the private 192.168.x.x or 10.x.x.x address of your own laptop or phone. If a whole classroom shares one router, the server sees every student as the same address. That sharing is called NAT.
  2. Addresses are handed out in blocks, and the records are public. A global organization (IANA) gives large blocks to regional registries (ARIN for North America). The registry gives smaller blocks to ISPs, colleges and companies. Anyone can look up who holds a block. The tool for that is called whois.
  3. Companies turn those records into a map. Geolocation providers combine the registry records with information from ISPs, Internet routing tables and their own measurements, and publish a database that says “addresses from here to here are probably in this city, on this network.” This server keeps a copy of one such free database (DB-IP Lite) as a file on its own disk and looks your address up there. Your address is not sent to any other company.
  4. The answer is an educated guess. The country is almost always right. The region is usually right. The city can easily be wrong, often by a long way. On a phone you may see the city where your carrier connects to the Internet. On a VPN you will see the VPN’s exit point instead of yourself.

The “Network” line is the organization that announces your block of addresses to the rest of the Internet. Each such network has a number, called an AS number. The Internet is tens of thousands of these networks agreeing to pass traffic to each other.

How does it know where the server is?

Two ways, and comparing them is the point. First, the page ran the same database lookup on the server’s own address. Second, the owner of the site simply knows: the server is rented from a hosting company, and the owner picked the data center when signing up. When the two answers agree, the database is doing well. You can check for yourself: nslookup fast.benlamb.net turns the name into the address shown above, and a whois search for that address at search.arin.net shows who holds it.

The route between you and the server

Your data does not travel on one wire. It is passed from router to router, and each pass is called a hop. A traceroute lists the hops. This one runs from the server back to you, and takes about 10 seconds.

Runs by itself after a speed test, or press the button.

How does a traceroute find the routers?

With a trick. Every IP packet has a counter called TTL (time to live). Each router that forwards the packet subtracts 1. When the counter reaches 0 the router throws the packet away and sends a short error message back to the sender: “time exceeded.” That message is an ICMP packet, and its source address is the router’s own.

  1. Send a packet with TTL 1. The first router drops it and replies. Now you know hop 1.
  2. Send a packet with TTL 2. It survives hop 1 and dies at hop 2, which replies. Now you know hop 2.
  3. Keep adding 1 until the destination itself answers.

The time between sending each packet and getting the reply is the round-trip time for that hop. This server sends 3 packets per hop and shows the average.

How to read the table

Why from the server, and not from my browser?

A web page is locked in a sandbox. It can make web requests, but it cannot build a raw packet or set the TTL, so a browser cannot run a traceroute or a real ping. The server can. The catch: the road from Boston to you is not always the road from you to Boston. Routes on the Internet are often asymmetric. To see your own direction, run this yourself and compare:

Windows (Command Prompt):   tracert fast.benlamb.net
macOS or Linux (Terminal):  traceroute fast.benlamb.net

How speed tests work

Fast.com, Speedtest and this page all follow the same recipe:

  1. Pick a server. The big services have thousands and choose one close to you.
  2. Measure latency with a few small messages.
  3. Download as much as possible for a few seconds, over several connections at once.
  4. Upload the same way.
  5. Divide the bits moved by the seconds it took.
Popular speed tests compared
TestWhere is the server?How it moves data
Fast.com (Netflix) Netflix’s own video servers, the same ones that stream shows to you, usually inside or next to your ISP. Ordinary HTTPS downloads and uploads from the browser. It opens more connections if your line is fast.
Speedtest (Ookla) Thousands of servers run by ISPs and hosting companies. It pings several and picks the quickest. Ookla’s own test protocol over TCP, with several connections at once. The website version runs it from the browser.
Cloudflare speed test The nearest Cloudflare data center. HTTPS requests of many different sizes, from tiny to large. It also reports latency while the line is busy.
M-Lab NDT (the test in Google search) Research servers in major cities. One single TCP connection for 10 seconds each way. Results are published as open data.
This page One server, near Boston. HTTPS downloads and uploads from the browser: 4 connections down, 3 up, 8 seconds each.
iperf3 Wherever you start one. You run both ends. Its own protocol on TCP or UDP port 5201, from the command line. Not usable from a web page.

Do speed-test websites use iperf?

No. iperf is a command-line tool that network engineers use to test a link when they control both ends: one computer runs iperf3 -s (server) and the other runs iperf3 -c (client). It speaks its own protocol on port 5201. A web browser can only speak web protocols, so no website can talk to an iperf server. Speed-test sites do the same kind of measurement using the tools a browser has: HTTPS requests and WebSockets on port 443.

If you have two computers on the same network, iperf is a great lab exercise:

Computer A:   iperf3 -s
Computer B:   iperf3 -c 192.168.1.20        (use A's address)
Reverse it:   iperf3 -c 192.168.1.20 -R

Where this test sits in the network layers

What this page uses at each layer
LayerWhat is used hereWhat it does in the test
ApplicationHTTP, protected by TLS (together: HTTPS)“Send me 25 megabytes” and “here are 16 megabytes” are ordinary web requests.
TransportTCP, port 443Delivers every byte in order, resends lost packets, and decides how fast to send.
NetworkIPv4, plus ICMP for the route traceAddresses each packet and carries it hop by hop across many networks.
Data link and physicalYour Wi-Fi or Ethernet, then cable, fiber or cellularMoves the bits across each single link. The slowest link sets your speed.

Why your number changes

“Speed” is really throughput: how much data actually got through during the test. It is never more than the slowest link on the path, and that link is often inside your own home.

Megabits and megabytes. Networks are measured in bits per second. Files are measured in bytes. One byte is 8 bits, so a 100 Mbps connection downloads about 12.5 megabytes each second. The lowercase b and the capital B matter: Mb is megabits, MB is megabytes.

Latency matters as much as speed. A video call or a game sends small amounts of data but needs each piece quickly. A connection with 500 Mbps and 300 ms of latency will feel worse on a call than one with 20 Mbps and 20 ms.

Lab questions

  1. Run the test three times. Write down download, upload and latency each time. How much do they vary?
  2. Convert your download result from Mbps to MB/s by hand. Does it match the tile?
  3. Run fast.com and compare. Which is higher? Use the table above to explain why.
  4. If you can, test once on Wi-Fi and once on a cable, or once near the access point and once far from it.
  5. Look at “Where are you?” Is the location guess right? If not, how far off is it, and why might that be?
  6. Compare your latency to the “fastest possible” time for your distance. What could account for the difference?
  7. Run tracert fast.benlamb.net on your own computer. Count the hops. Is it the same number as in the table here? Do you see the same network names?
  8. In the route table, find the hop where the network name changes. What two organizations are handing off your data?

Glossary

Bandwidth
The most data a link could carry each second. Think of the number of lanes on a road.
Throughput
The data that actually got through each second. Think of the cars that really arrived. This is what a speed test measures.
Bit and byte
A bit is a single 1 or 0. A byte is 8 bits.
Mbps
Megabits per second: one million bits each second.
Latency
The delay for a message to make a round trip, in milliseconds (thousandths of a second).
Jitter
How much latency varies. Low jitter matters for calls and games.
Packet
A small chunk of data with an address label. Everything on the Internet is cut into packets.
IP address
The number that identifies a device or network on the Internet, such as 148.230.90.150.
NAT
Network Address Translation. Lets many devices with private addresses share one public address.
Hop
One step from a router to the next.
TTL
Time To Live. A counter in each packet that drops by 1 at every router, so lost packets cannot circle forever.
TCP
Transmission Control Protocol. Delivers data reliably and in order, and controls sending speed.
ICMP
Internet Control Message Protocol. Carries error and test messages. Ping and traceroute use it.
ISP
Internet service provider. The company that connects you to the Internet.
AS number
Autonomous System Number. The ID of one independently run network on the Internet.
Geolocation by IP
Guessing a place from an IP address by looking it up in a database.