Some Bits: Nelson's log

3 posts in March 2022

Measuring ISP congestion without load tests

My Starlink seems congested in the evenings. What are some strategies for measuring the congestion? The simple one is to run a speed test, see below for details on that. But speed tests are wasteful. Is there some lower impact monitoring I can do? This post is a bunch of ideas and questions, no solution.

Update Nov 2023: I’m finding IRTT is pretty good. It’s a fancy ping. It does a good job measuring both latency and packet loss and it’s not hard to pick out the signal of evening congestion.

Pings

My first thought was just to measure ping latency and packet loss; if the ISP is congested then latencies go up (queueing) and packets start getting dropped. Pings are a lot less traffic than load tests and there’s a lot of software to do them. This sort of works but it’s pretty noisy and pretty far removed from what I really care about, which is “can I use the Internet to do stuff?”

It might be smarter ping / packet loss measurements could work. My existing ping is already a little clever; every 15 seconds Telegraf sends 5 ICMP pings at once and reports what percentage was lost and a latency distribution. Packet Loss Test has an interesting take on measuring latency and jitter with WebRTC (in the browser!). iperf’s bursts of UDP packets are also a good way of measuring instantaneous throughput and could be done without using too much bandwidth. Ping probing is an idea worth exploring.

A related idea I wrote up is using some sort of traceroute-like probing to not only detect congestion but guess where it’s happening in the network. I think this is probably impractical in the general case, but maybe a custom solution for Starlink’s infrastructure could be helpful.

Passive monitoring

My next thought was to measure TCP retransmits at the router for existing traffic as it goes by. They’re a primary cause of low bandwidth and a primary signal of congestion. This should be doable in theory with stateful packet inspection in the router but I’ve never seen any software that does it. Anyone know about it? I also think the resulting data might be pretty indirect.

The other solution would be to measure TCP retransmits at the client endpoint. This is easy in Linux, probably not hard in Windows, but probably impossible on, say, my Roku streaming video device. It sounds like a significant hassle.

Any passive monitoring has a problem that you aren’t really sure if the congestion is on your client end or some problem on the server end. Load testing services presumably solve this by being well provisioned. But I suspect in practice most of my TCP traffic is going to very well connected sites like Youtube or Cloudflare and any slowness is more likely on my end than theirs.

Load test results

Running load tests is certainly the easiest thing and I’ve been doing that for months. Here’s a week of running an Ookla speedtest every 15-60 minutes:

The average of 130 is great. But every evening it dips to well below 50 Mbps. Worst measured is around 10Mbps. This testing shows the congestion problem pretty well.

The problem is load tests are expensive: each one download 250 megabytes of data over about 20 seconds (when things are fast). When I was running 4 an hour the speed tests were a significant fraction of my overall daily bandwidth usage, maybe 30% or more. They were making the video streaming worse. I’ve cut that back to once an hour but it’s still a waste.

Community monitoring

One bad thing about load testing is that it’s selfish; only I get the results of all that wasted bandwidth. Starlink Status tries to do better, by collecting stats from many users and sharing them. It’s a great idea but the execution is a bit lacking.

What would be really great is if Starlink were transparent and published its own traffic and congestion stats. Then I could just look to see how they’re doing. A few independent users could run their own tests to verify they aren’t misleading people. It’d be cool but I’ve never heard of an ISP volunteering this kind of competitive data.

Home LAN disaster mystery

I truly b0rked my home network yesterday. It took more than an hour to fix. I still don’t understand what went wrong but I’m wondering if my ethernet switches got in a bad state.

It started when I tried swapping my Ubiquiti router out for an OpenWRT router. The new router was working OK, the whole network was fine. I installed a few packages to OpenWRT (including wireguard, unconfigured) and rebooted it and then my network was down. No DHCP, couldn’t even connect with a static IP, OK I figured OpenWRT somehow broke and so swapped back to the old Ubiquiti router.

That’s when the mystery started. Nothing worked with the old router plugged back in. Again no DHCP, static IPs not working. Lots of blinking lights on the switches though, suggesting maybe some networking was still happening. I tried power cycling the router and the switches in the path between my computer and the router. No luck.

So then I began a tedious process of getting the network working starting from the router. Unplugged everything but one laptop. Still no DHCP. But static IP worked. That’s when I learned the router’s DHCP server wasn’t running. It was before! Not sure if UnifiOS “lost” the DHCP server setting? The Unifi controller was offline but my understanding is the router should keep its last config, which should have included DHCP service. Weird. So that’s one mystery, why did my router stop doing DHCP?

Fortunately the minimal configuration UI on the router itself does let you turn DHCP on. Turning that on and I had one router working with one laptop. And soon after that, one switch plugged into the router. But the Unifi access point plugged into the switch still didn’t seem to be working; connecting via WiFi got no DHCP. Weird.

But it got weirder when I went to the second switch, the big one at the center of my LAN and plugged into the first switch near the router. Nothing plugged into it worked. The ethernet cable coming to that switch worked on the laptop, but plug that into the switch and then the laptop into the switch and boom, no working ethernet. I finally just replaced the switch entirely and suddenly everything started working. Including the Unifi access points.

Today I tested the suspect switch and it seems fine. Also the router seems fine. So that’s another mystery, why did this equipment look like it wasn’t working after rebooting a router and works fine today?

One possible explanation for all of this is that somehow my ethernet switching got in a bad state. And that state was somehow polluting the network so nothing was working. I don’t think this is a very good theory. The switches are simple unmanaged Netgear GS108s, pretty bulletproof. No persistent state at all and nearly stateless entirely. I did try power cycling the switches a few times to no effect.

There is a bit of state in ethernet switches though: the spanning tree protocol. Also some sort of memory of which ethernet devices are plugged in to which port. Could that somehow have gotten corrupted?

My network is pretty simple. There’s no physical loops in the network topology (other than that implied by wifi). I’m not using VLANs at all, although I do note OpenWRT has some default VLAN configuration that I don’t understand and didn’t alter. There’s a total of maybe 5 unmanaged switches and 60 devices.

Honestly I’m just speculating about magical explanations. I don’t really know. I do know I’m scared to try swapping routers again.

Update: I tried the OpenWRT router again and failed, although not as catastrophically. It worked fine on first setup, then I rebooted it to test it and suddenly not only did I not have Internet, but the router wasn’t answering anything at all. No idea what’s going on. One guess is installing the wireguard packages with opkg somehow caused a problem, even though I didn’t configure wireguard. It also looks like Starlink’s Dishy terminal is not immediately answering DHCP requests from the router the moment it asks, so that’s not great. That doesn’t explain why I couldn’t even talk to the router at all though.

Google Takeout notes

I finally got my Google Takeout archives downloaded, the most important of my cloud backups. I tend to prefer Google for my services so a lot of stuff is there dating back 20 years. Google Takeout is an excellent product. What’s in the dump?

I chose to download Takeout’s default: everything but Access Log Activity. It came to about 67GiB of zip files, 72GiB uncompressed.

The top level of the dump includes a nice HTML explanation of what’s in it. With per-product documentation for the types of files you’ll find there and what formats they might be in.

Here’s info on some of the meaningful data I found that I was expecting to see.

  • 9GiB: Mail. The biggest and most precious of all my Google data. All stored in a single .mbox file, which is awkward but not an unreasonable choice. The file is not date sorted. The volume per year is confusing: 2012 and 2020 are big at 13,000+ messages. 2019 I only had 6000. Maybe it’s spam related. There’s also a few extra data files for things like filters, blocked users, etc.
  • 35GiB: Photos. I’m a heavy user of Google photos. Contains both original and edited images, also metadata in a simple JSON format. A little confused at the directory structure; many of the files are in folders like “Photos from 2020” but some are in per-Album directories, I think there are duplicates.
  • 23GiB: Drive. If you asked me I’d tell you I didn’t use Google Drive. I have no idea how this got so big. The useful stuff there is copies of my Google Docs; spreadsheets mostly. The big stuff is a bunch of photos I then imported to Google Photos, I could probably delete them from Drive. It’s a very random and poorly organized collection of stuff.
  • 2.5GiB: YouTube. All the content I’ve created (videos, comments). But also detailed watch and search histories going back 11 years.
  • 0.3GiB: Groups. MBOX format archives of Google Groups I’m an admin for.
  • 0.1GiB: Contacts. VCF format contact lists.
  • 0.1GiB: Calendar. ICS format, single file.
  • 0.3GiB: Location History. JSON files tracking my movements, used for Google Timeline.

And some of the less interesting or accidental stuff.

  • 0.3GB: My Activity, Google Pay. The biggest surprise to me; Google records meticulous details on when I use specific products, there’s online version of the product here. Goes back at least 10 years and includes Android apps, details of what Google Map views I’ve looked at, credit card transactions, YouTube video views, every search query for two years. It’s all stored in a generic format that seems to apply across Google products. Also the dump is an absolutely terrible HTML format with like 4KB of styled HTML per record. Example of a record for an Android app launch:
  • 0.1GiB: Maps. Data spread out over several directories. Bookmarked places, some KMZ files for custom maps I made.
  • 0.4GiB: Location History. Google’s recorded where my phone has been since I first installed Google Maps. They have a nice history browser for this, I also built my own visualizer product for the data. I really like having it but I think most people would find it surprising and creepy Google keeps this.
  • 0.7GiB: Google Play Games Services, Google Play Store, Android Device Configuration Service, Recorder. Stuff related to my Android phone, including a record of every version of every app I’ve installed and some saved game state.
  • 0.8GiB: Nest, Google Home. Stuff about my thermostat. Including 2 years of detailed temperature readings, etc from my house.
  • 0.6GiB: Blogger. I forgot I ever had a Blogspot blog but google didn’t. Also records of my comments on a lot of other blogs.
  • 0.6GiB: Voice. I have a Google Voice number I basically never use. But it gets spam voicemails, for which sound files and text transcripts have been saved for 7+ years.
  • 0.4GB: Google Account, Profile. A record of a year of explicit logins (as opposed to passive authentication). Love the inactive account emails I apparently wrote a few years ago: “What a horrible thing, but apparently I’m no longer able to access my Google account which means I’m likely dead or incapacitated.”
  • 0.1GB: Chrome. I don’t use Chrome much so this is very small. Among other things it contains a history of visited URLs going back 3 months.
  • 0.1GB: Hangouts. An archive of some GChat messages from 2017?

I’m pretty sanguine about all this data. I want Google to be keeping a lot of data for me and I trust them to be careful caretakers of it. Some of it is incredibly useful; I was really excited when I learned Google Maps had my location history, for instance. Google does a reasonable job letting you control just what you can track and I really appreciate being able to download the data.

The My Activity stuff is the one thing that made me nervous. Partly the awful format is coloring my impression. (There’s several projects on GitHub that parse and analyze it.) But also they’re storing a lot of sensitive data in a generic way that’s not sensitive to the particular app. I don’t really care they have a record of my credit card transactions, but I am a bit nervous at this second record of my Google Maps views or the exact times and places that I launched Grindr. I believe Google keeps this data in this format for security audits.