# navigator.connection effectiveType always 4g, explained

> effectiveType tops out at 4g, so a gigabit line and a phone on one bar of LTE both say 4g. The tell is an rtt off the 50 ms steps Chrome rounds to.

Source: https://mosaicbrowser.com/blog/effective-type-always-4g

## Why navigator.connection says 4g on fibre

effectiveType tops out at 4g, so a gigabit line and a phone on one bar of LTE both say 4g. The tell is an rtt off the 50 ms steps Chrome rounds to.

![50 ms: Every rtt Chrome reports is a multiple of 50, beside a screenshot: a Mosaic leak test: every surface a site reads, checked from inside the profile page](https://mosaicbrowser.com/covers/effective-type-always-4g.webp)

`navigator.connection.effectiveType` says `4g` on fibre because `4g` is the fastest answer the API has. It is a bucket, not a reading of your line. Anything quicker than a 270 ms round trip and 700 kbps falls into it, so a gigabit line and a phone on a decent signal print the same two characters. The information is in `rtt` and `downlink`, and Chrome rounds both to fixed steps: on our build Mac, five launches of stock Chrome gave an `rtt` of 50 or 100 every time.

## Four buckets, and the top one is open-ended

The Network Information API has exactly four values for `effectiveType`. The spec's table:

| effectiveType | Round trip at least | Downlink at most |
| --- | --- | --- |
| slow-2g | 2000 ms | 50 kbps |
| 2g | 1400 ms | 70 kbps |
| 3g | 270 ms | 700 kbps |
| 4g | below the 3g line | no ceiling |

Chromium's version of that table lives in `net/nqe/network_quality_estimator_params.h`, and by default it reads only the HTTP round trip of recent requests. An estimate above 2010 ms is `slow-2g`, above 1420 ms is `2g`, above 272 ms is `3g`. Below 272 ms there is no further line to cross, which is why a source comment there says a threshold "should not be set for 4G" because "it is the fastest". There is no `5g` and no `fibre` value to land in.

So on its own the field is close to useless as a fingerprint. Desktops read `4g` almost without exception, and the rare `3g` mostly means a hotel Wi-Fi at 9 pm.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Machines that exist](https://mosaicbrowser.com/features/real-fingerprints)

## rtt and downlink are rounded before a page sees them

The other two fields are where the detail is, and both are blurred on purpose. The spec asks for 25 ms and 25 kbps steps. Chromium's `network_state_notifier.cc` is coarser:

- `rtt` goes to the nearest 50 ms, capped at 3000.
- `downlink` goes to the nearest 50 kbps, so 0.05 Mbps, capped at 10.
- Before either is rounded, it is multiplied by a factor from 0.90 to 1.10, picked from a hash of the site's hostname plus a salt that never leaves the device. Two sites can read different figures off one connection.

The comment above that code says why: to reduce fingerprinting.

We measured what that looks like on a stock Google Chrome on our build Mac, five fresh launches:

```
rtt 100  downlink 1.50
rtt 50   downlink 1.60
rtt 100  downlink 1.55
rtt 100  downlink 1.60
rtt 50   downlink 1.65

```

Every `rtt` is a multiple of 50 and every `downlink` sits on a 0.05 step. A real Chrome cannot report anything else.

## Where a spoof gives itself away

An `rtt` of 80 is a number no Chrome has ever reported. We know because our own generator used to produce it. It drew the round trip as a multiple of 10, so 60, 70, 90 and 110 were all possible, and most profiles landed on a figure Chrome cannot emit. A value-by-value audit against stock Chrome caught an `rtt` of 80 first and an `rtt` of 110 later. Each one was impossible rather than merely unusual: one line of JavaScript, `navigator.connection.rtt % 50`, separates it from every real browser.

We changed the draw, and counted the library on that machine: 45 profiles had been drawn from the old range. The audit now treats an `rtt` that is not a multiple of 25 as a problem in the same class as a Metal renderer claimed on Windows. Chromium's own step is 50, coarser than both the spec's 25 and that check, so a stored 75 would still be a number no Chrome reports. That is one more reason the decision below was the right one: the stored figure never reaches a page.

The bigger change was to stop overriding the object at all, for three reasons that each would have been enough:

- Chrome sends `ECT`, `RTT` and `Downlink` as client hint headers to sites that ask for them, and those are built from Chrome's network state rather than from the JavaScript object. Override the object in JavaScript and the headers still tell the truth, so the two disagree.
- A page can time a request itself. Fetch a small file, measure how long it took, and you have a round trip the browser did not report. A claimed 50 ms next to a measured 300 ms is a contradiction the spoof created. ([Detecting a proxy with two clocks](https://mosaicbrowser.com/blog/proxy-detection-by-latency) is that measurement, done on purpose.)
- The honest value is already right. Chromium estimates the connection from the traffic the profile actually sends, and a profile browses through its proxy. So the number describes the proxy's path, which is the thing it should agree with.

## What a profile on Tesseract Chrome reports

Our engine, Tesseract Chrome, can set `rtt` and `downlink` inside the engine itself, so the object and every frame and worker would agree. The launcher does not send it a value. Profiles report what Chromium measures over their own IP, rounded the way every Chrome rounds it, and `effectiveType` comes out as `4g` for the same reason it does on your desk.

That fits the rule we apply to every surface: change a value only if every route to it can be made to agree, and otherwise report the machine's truth. The connection is one of the cases where the truth is the better answer, unlike the host values listed in [the values every profile inherited from this Mac](https://mosaicbrowser.com/blog/values-inherited-from-the-host), where it was the problem.

## Checking your own browser

Open the console on any page and run:

```
const c = navigator.connection
;[c.effectiveType, c.rtt, c.downlink, c.rtt % 50]

```

On a real Chrome the last value is `0`. Run it again after the page has loaded a few more files and `rtt` may hop from 100 to 50, since the estimate is live. Run it on a second site and the figures can differ again, because of the per-site factor. A browser that answers `rtt: 80` passes none of that. For what one field like this is worth in bits, see [bits of identifying information](https://mosaicbrowser.com/blog/bits-of-identifying-information).

## Questions

### Why does navigator.connection.effectiveType always return 4g?

4g is the top bucket of four: slow-2g, 2g, 3g, 4g. The 3g line in the spec is a 270 ms round trip and 700 kbps, and everything faster lands in 4g with no ceiling, so a fibre line and a phone on two bars of LTE print the same string.

### Does effectiveType 4g mean I am on a mobile network?

No. The labels are named after phone networks, but Chrome fills them from timings of its own recent requests and never asks what the link is. A desktop on Ethernet reports 4g; a phone at the edge of a 5G cell can report 3g.

### Can I make Chrome report a different effectiveType?

Pick a 3G throttling preset in the DevTools Network panel and that tab reads 3g until you switch throttling off. That is what it is for: testing a page's slow path. Everywhere else the value is Chrome's live estimate, revised as requests finish.

### Which browsers support navigator.connection?

Chrome, Edge, Opera and other Chromium builds. On desktop Firefox and Safari, navigator.connection is undefined, so a browser whose User-Agent says Safari and which answers rtt: 100 has given itself away.

## Related

[Detecting a proxy with two clocks](https://mosaicbrowser.com/blog/proxy-detection-by-latency): A server times the TCP handshake to the IP and a round trip to the browser. Behind a proxy the second is longer, and the gap is the detour.

[The values every profile inherited from this Mac](https://mosaicbrowser.com/blog/values-inherited-from-the-host): A browser fingerprint value inherited from the host is identical across two unrelated profiles and equal to the computer. That test found dark mode and more.

[18.28 bits: what Cover Your Tracks' number measures](https://mosaicbrowser.com/blog/bits-of-identifying-information): Bits of identifying information is log2 of how rare your browser is in the EFF's sample. 18.28 bits is about one in 318,000, and it is not a tracking score.

[Browser fingerprint: what a site can read about your machine](https://mosaicbrowser.com/glossary/browser-fingerprint): A browser fingerprint is the set of values a site reads about your browser and computer, which together recognize you without cookies. What goes into one.

[Machines that exist: fingerprints drawn from real hardware](https://mosaicbrowser.com/features/real-fingerprints): Mosaic draws each profile's GPU, screen, CPU, memory and fonts from one real device, so the parts of a fingerprint agree with each other and with the host.







[Chrome is removing XSLT, and XSLTProcessor goes with it](https://mosaicbrowser.com/blog/chrome-removing-xslt): Chrome's "This site uses XSLT" banner marks a page built with XSLT, which Chrome is removing with window.XSLTProcessor. What breaks, and what it reveals.

## Mosaic, on your own computer

The browser this blog is about: its own Chromium, fingerprints from real machines and a proxy IP per profile. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
