Hacker News new | past | comments | ask | show | jobs | submit login
macOS Monterey's new network quality tool is surprisingly good (danpetrov.xyz)
468 points by danpetrov 22 days ago | hide | past | favorite | 95 comments

Nice! A network tool I've always wanted is one that automates the investigation you have to do manually if you are experienceing "internet issues". I mean, the check list is quite straightforward but still a pretty manual process, stuff like: - Do I have the expected IP? - Is there large packet loss or latency issues hinting at connectivity issues? - Can I ping the local gateway? - Can I ping to outside network? - Is my nearest DNS responding? - Is another, remote DNS responding? - What does Downdetector or similar say about the service I'm trying?

It would be nice with a one click tool that just went through this in order and gave a diagnosis.

    ip addr | grep $localNetworkPrefix
    ping $localGateway
    ping $DNS01
    ping $DNS02
    open -a Safari https://downdetector.com/status/%1
Do `chmod +x ./scriptname.sh` to make executable and run with argument (e.g. net.sh facebook) to check a particular service.

Edit: Thanks @Shared404

ip doesn't exist on macOS. That is a Linuxism.

You can use the following:

   netstat -rn -f inet | grep default | head -n 1 | awk '{ print $2 }'
To get the default gateway that is the preferred one on macOS, so you don't need to hard code it.

  scutil --dns
Will display the DNS servers/split DNS configuration as well.

I still type 'ip a s' on osx machines multiple times a week, even though I know it doesn't exist for many years.

If on wifi one can also simply option click the wifi icon in the menu bar. Maybe some people don't know yet, it was a late discovery for me option click shows more information there.

For quick internet access check I like 'curl ipconfig.sh'

I'm on my phone but I think you can do this if you're using awk anyway:

  netstat -rn -f inet | awk '/default/ {print $2;exit}'

> Edit: Not sure how to do single spaced newline here.

If you prepend each line with 4 spaces it'll format as code.

  I believe only 2 spaces
  are required.

Check out https://github.com/ycd/dstp . It's still pretty young but it tries to solve that problem. The author needs more feedback.

This is what windows network troubleshooter was meant to be. But it never seems to work.

I have xBar plugin (formely BitBar) that pings Cloudflare:

   ping -c 1 -n 1.1  2>/dev/null | awk -F '/' 'END {printf "%.2f ms\n", $5}'

Also your router

   GATEWAY=$(netstat -nr | grep '^default' | grep en0 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
   ping -c 1 -n -q $GATEWAY 2>/dev/null | awk -F '/' 'END {printf "%.2f ms\n", $5}'

Needs something about MTU too. A popular way to mess up a network is to configure it for a too large MTU and not send the ICMPs that would tell you otherwise.

It's not "one click", but flent is the goto tool we use to probe networks for a multiplicity of problems. It's available for most OSes, including OSx. See flent.org.

Interestingly it uses their own CDN infrastructure by default by checking https://mensura.cdn-apple.com/api/v1/gm/config for which endpoint to use.

That's also the beauty of Fast.com, that it uses the Netflix content servers as benchmark and not some ISP edge hosted Speedtest server with special priority.

That gives a more realistic expectation of how Netflix, and in this case Apple downloads, will actually perform. And it can't be artificially boosted by the ISP.

That being said, I assume both Netflix and Apple have very special CDNs with ISP co-located content servers in many cases so it is still not a realistic measurement of generic Internet performance (but Speedtest is even worse, so ¯\_(ツ)_/¯)

There is a flip side to fast.com, though: it’s much more likely that it will encounter throttled speeds on mobile devices, since many unlimited plans keep the connection to Netflix artificially slow.

Not endorsing that for a second but I was using fast.com as an absolute measure of internet speed until I realised this. But speedtest has the issues you’ve outlined too, there are very few 100% reliable options!

The flip side was and I guess still is the exact reason for existence of fast.com. ISPs were throttling Netflix, so Netflix rolled out its own speed-testing service on its own infrastructure to publicly shame ISPs about the throttling.

Without knowing about that background information, I suppose use of fast.com is a bit tricky.

Another issue with Fast.com is that sometimes it'll choose an OpenConnect box, which is inherently a box at a super close ISP datacenter meant for achieving gigabit speed without the ISP incurring upstream transit costs.

But who cares? If that's the same box that I connect to when I view Netflix content, then that's the performance I want to know about. Unless you are saying this OpenConnect box (will have to look whatever that is up later) is different from what connection is made when I hit Play, then that could be an issue.

Then again, Fast.com is primarily a tool for Netflix. It let's its users feel like they are getting "useful" information, but actually provides much more useful information to Netflix than users. If that data generated from Fast.com use allows them to provide better service, then great. So if from time to time they decide to switch to different boxes (premise), then I'm actually okay with that too.

I think the key part is needing that understanding that it tells you how fast Netflix will perform, which is likely not the same as general internet performance. That can be useful to compare with tools like https://speed.cloudflare.com/ to see how your ISP's peering holds up but it's definitely an important nuance.

Hmmm, I hadn't visited Fast.com in some time. Just visited, and it quite clearly states "Your Internet Speed" and the title of the page visible in the tab is "Internet Speed Test". I can't imagine why people would be consfused. /s

I clicked around to see if they defined it in more detail about specifically testing Netflix CDN vs general internet activity, but I found not such information. However, this has always been understood on my part to be the case. Maybe because of where I was working when it first came on scene? I clearly didn't get that information from their website.

This is true of most internet speed tests though. Even speedtest.net uses their own servers. If you're measuring for speed you just need to be sure that the server has higher bandwidth available than your ISP.

If you're looking for a generic internet connectivity test then you'll need to test a few dozen sites at least, with diversity in which CDN's they're using and so on.

Just like the Netflix/fast.com tests networking speed to Netflix, the cloudflare test is for networking speed to cloudflare.

Neither of those give you a general internet performance indicator. You'd need to run many tests to really know, and it depends on your ISPs network, transit and peering, most of which is pretty opaque.

Yes but the difference I had in mind is that Cloudflare is generally available (i.e. I can't host my website on OpenConnect) and they don't seem to push as far into local deployments. I've never seen a Cloudflare trace route stay entirely on my ISP's network whereas that's usually the case for Netflix.

Now, that might not be faster — my local Cloudflare endpoint appears to be ~16ms vs ~20ms for my ISP's Netflix deployment but it can tell you whether they're routinely underprovisioning peering capacity even if it doesn't give you as much data as a distributed test would.

That's the thing, ideally you would perform a test for every single service that you use directly to their network.

In my previous company where we were doing live broadcast, we would have speed testers pre-installed on all the hub and edge servers, so we could get realistic numbers for a specific use case (for example, requesting. a video stream from Germany).

I've always found this site to be useful for speedtesting https://www.dslreports.com/speedtest?nav=2

Will have to test this at night. Apple TV app is barely useable here at 8-9PM here, constantly dropping to 480p or worse. Torrents is still better UX in 2021.

With such specific timing, my suspicions would immediately jump to oversubscribed cable internet and the ISP doing some shenanigans to prioritize non-streaming over streaming traffic in some way.

Exactly. fast.com goes down the drain at exact same time.

That said it's pretty weird since there isn't much ATV users here.

As predicted - it went down from 100-200 mbps to ~40.

   Download Responsiveness: Medium (902 RPM)

That was high, around 2000 rpm in the day

> And it can't be artificially boosted by the ISP.

Well it can... by the ISP unthrottling access to Netflix. Which is exactly what Netflix wants them to do! :)

Ah, thanks for this! I was going to ask if someone could run `strings` on the binary.

I get back:

    "version": 1,
    "urls": {
      "small_https_download_url": "https://mensura.cdn-apple.com/api/v1/gm/small",
      "large_https_download_url": "https://mensura.cdn-apple.com/api/v1/gm/large",
      "https_upload_url": "https://mensura.cdn-apple.com/api/v1/gm/slurp"
    "test_endpoint": "ausyd2-edge-bx-006.aaplimg.com"
I can't pinpoint the semantic value of `test_endpoint`. However,

- .../small gives me 0 bytes

- .../large gives me 4 gigabytes (!!) which I presume I am expected to range-request parts of

- .../slurp accepts input and gives me some stats back.

Upload tests are simple:

  $ head -c 1048576 /dev/zero | curl -vvv -F 'test=@-' https://mensura.cdn-apple.com/api/v1/gm/slurp
(Excuse my really bad ADSL2+.)

The above is on Linux but I expect the effort to port that to macOS would be low. By all means post any needed modifications if you figure that out.

Slightly OT, but I'd like to express my astonishment about a positive article about a new tool making it to the front page. Somehow these days it's always rants about new stuff.

Nice and short read.

Aren't you kind of ranting about rants? And am I ranting about you ranting about rants? :)

I'd say rants are a tad longer. :)

Just tried running it on my (terribly inconsistent and laggy) directv/att satellite internet, and the process crashed with NSInvalidArgumentException. https://gist.github.com/judge2020/ff0279a51ed59a56aa184867c0... (14" MBP base model)

The programmer either meant to use NSNull or setValue:forKey or simply forgot a nil check.


Pretty lame mistake to let slip through review and testing and a common enough error that Apple calls it out in its documentation:


Simple! Use macOS Monterey’s new software quality tool to debug this. I’ve heard it’s surprisingly good!

Huh interesting, works fine on my 2018 Intel MBP. Surprising to see a bug like this on the newest models.

I doubt its a bug in a particular model. I'm on an M1 Max and the tool works without issues.

I am guessing its an bug in the tool itself that the user ran into.

Works on my M1 Air.

This is a neat little tool. I had no idea that was hiding in there. Anyone have any other little hidden gems on MacOS?

There are tons of excellent pieces of Apple software that come with iOS[EDIT macOS, that is] (or are free to download).

Preview's simply amazing and I miss it very much on every other platform, including iOS, but probably doesn't count as a hidden gem.

One that took me way too long to discover was the Digital Color Meter. It's a color picker that comes up instantly (much of what's so great about Apple's software is that they give at least half a shit about performance, unlike seemingly everyone else these days—it shouldn't be impressive that a color picker window comes up instantly from a cold start, but in the current software environment, it kinda is) and works for everything on your screen.

The built-in screen zoom is pretty neat. Hold `Ctrl` and use the vertical scroller on whatever pointing device you have to zoom in and out. Real nice when you want to take a (much) closer look at a thing without affecting layout: it zooms your viewport without affecting any of the actual content, unlike, say, increasing font size.

Looks like it’s been updated, I don’t remember the different zoom type options. Maybe I just never discovered them.


Spotlight is also amazing, but like Preview I suppose it doesn't count as a hidden gem.

Finder's column view is also excellent. I think it's the best way to navigate the filesystem through GUI; the way it displays nested directories is just super nice. It makes me wonder why other OS don't haven't copied this layout in their filesystem explorer.

Grapher.app is also perhaps a hidden gem.

I agree Preview.app is amazing. It's fast, has a lot of features and not bloated at all. However I think recent built-in apps are so bad almost unusable (like Music.app and TV.app), Preview's elegance seems to be a lost art in Apple.

What’s wrong with the AppleTV app? Perf is fine. UI/X is par with HBOMax, Disney+. Definitely better than Prime Video.

I might have different use case than most people that I mainly use it to manage local video files and sync with my phone. The bugs are very similar to the bugs on Music.app where there's a lot of desync between app & local folder, duplicate entries, broken thumbnail, clunky UX etc. The quality difference between that and older macOS built-in softwares is pretty obvious imo (the most obvious drop is Music.app rewrite in Big Sur)

Oh wow, how have I never noticed the Color Meter!? Thanks for pointing to that!

I used to use sip. Didn’t realize Apple made a native one. Thanks!

“Network Link Conditioner” essentially does the opposite but it’s a really neat tool: it lets you degrade your connection, so you can test how software reacts to degraded network conditions, and don’t need to install and configure third-party proxies and the like.

The biggest drawback is it affects the entire machine, you can’t enable the conditioner on a per-process basis, so it can be a bit rough on the other “normal” usage of the machine.

There’s also a version on iOS.

Other normal traffic on the machine going through that conditioner has side effects on your application as well.

The other major drawback is that you cannot download it without an iCloud account...

In the file settings ("Get Info") you can set a "stationary pad" flag means whenever the file gets edited, a copy is created, and the original file doesn't change.

When you're taking a screenshot of a portion of the screen you can hold the spacebar to move the rectangle around.

Is this Copy-on-Write? Is the copy a real file or is this a filesystem implementation detail?

The stationary feature has existed since the “Classic” days. Probably MacOS 7. So it comes from the HFS era.

It would be more accurate to say when you open a file with the Stationary flag set, a new of copy of the document is open in the default application. I don’t think a file system copy is created until you save.

Stationary pads were already implemented in the Lisa UI, but it took quite some time to show up in classic MacOS - https://www.applefritter.com/node/3198

APFS has CoW semantics, so I would assume it uses the APFS filesystem features.

I'm pretty sure that feature is older than OS X, let alone APFS. It might be implemented using CoW now, but it certainly hasn't always been.

macOS has had a "hidden" WiFi diagnostic tool for years. It produces real-time-ish graphs of (IIRC) three different signal strength metrics, and it also dumps the data to a file on the desktop as it's doing so. By holding down the "Option" key and clicking the WiFi icon in the menu bar, the dropdown menu will display additional information about the wireless interface, and it will also include an entry that reads "Wireless Diagnostics..." or similar.

I've poked around with Wireless Diagnostics in the past and I've never seen any graphs or signal strength metrics. It's only ever created a diagnostics data file (which takes many minutes and can't be cancelled once it's started) and done nothing else.

The diagnostics data file is annoying to read, too...

After you open Wireless Diagnostics, select Window > Performance.

There's also tool in the AppStore called WiFi Explorer that may be more what you're looking for.


Thank you so much for this. I think this is worthy of a separate HN post.

On a related note, these hidden features are really annoying. How hard would it be to have a WiFi diags link in the WiFi dropdown? Why does Apple think that hiding things makes for a better user experience? Is it so that the people in the know get to feel like arcane knowledge masters? As it is, I have started randomly holding down option and command to see if there are hidden options. /rant Does anyone know of a site that catalogs these hidden macos options?

I think this is a great method for reducing user interface complexity, by taking rarely useful things out of the main flow.

Option-click is pretty much the only trick used for menus, and it's fairly universal across the nearly 80 years of Mac. The incidence of people that would be helped by those graphs, and the people that option-click is pretty high, so this seems like a great combination. It's similar to option-letter for inputting characters not on the keyboard (alt-code on Windows).

Exposing my parents to one more menu item that will never help them, and mostly confuse them and reduce their scanning speed, well, that's really not worth it. Every option has a cost, and different people bear the weight of that cost differently. Some people like having 30 different brands of canned tomatoes to choose from at the grocery store. Others would prefer 2 or even 1, that are more carefully curated. My favorite grocer is like this. It's a tiny store, an eighth the size of a super market or less, but has a better butcher, better basic groceries, and a more extensive selection of rarer ingredients than a Safeway. It just doesn't have an entire aisle of pasta brands. That's not for everyone, but it is for me. The Mac also doesn't have to be for everyone, it for the people it fits, it fits really well.

> it's fairly universal across the nearly 80 years of Mac

  2021 - 1984 == 37
I concur with your other points. :)

Oops, I thought I had typed 40... 80 would have been in the days of Turing!

It's always good when a surprisingly-large measurement of historical distance is just a simple typo.

Far better than when the surprise fades into realization that the measurement is accurate, and that your internal estimate of time acceleration needs updating!

The more I think about your points, the more I understand the whys. As someone who is moderately technical and new to macos, I wish there was a global "power user" setting.

> a global "power user" setting.

You can get shockingly far just by holding the "Option" key while taking a lot of actions/looking at a lot of menus. Always the first thing I try.

Grapher, it is a nice program to plot functions (2D and 3D):


There is also "networksetup", which allows you to do pretty much anything you want with network configuration. Useful if you want to e.g. automate VPN network switching or locations.

> Useful if you want to e.g. automate VPN network switching or locations

Can you elaborate on that a bit, please?

If you have a VPN named "MyVPN" you can start it from the command line with: networksetup -connectpppoeservice "MyVPN".

I use this as part of an ssh ProxyCommand. It's wonderful.

Oh no. Oh no oh no.

You don't mean Apple's implemented the Wi-Fi autoconfig functionality Ubuntu failed to deliver in ~2008, do you?

Because if they have... they'll have done it... correctly.

If the binary and/or supporting libraries have any references to FieldAgents in them... we're doomed. That's Skynet, right there.

Can you expand a bit? Some quick Googling didn't reveal anything useful to me -- what exactly are you talking about?

Sure, and apologies (I think my comment went up to 2 points but now at 0, hehe).

It's a reference to https://xkcd.com/416/.


I’m not sure if I’d consider it hidden, but there’s so much that can be done with the oascript utility. The idea that most GUI apps can be queried or controlled from the command line is super powerful, even if AppleScript is somewhat obtuse.

As an example, I have shell aliases setup to cd into the folder(s) open in Finder or reference files selected in Finder.

You can create your own CA & Certificates from "Keychain Access". Quite useful.

This is much simpler than some of the other utilities mentioned, but I love pbcopy and pbpaste. Being able to pipe from stdout straight to the clipboard, or vice versa, is really useful.

A version of this is also available on iOS (I think since iOS 15.0), although it only shows the RPM: https://support.apple.com/en-gb/HT212313

This tool is also mentioned in that page, albeit briefly.

I hope this improves the network stack in ipads as well. Now that apple has same cpu arch on both ipads and macs, i expect better network tools for ipads.

I recently tried setting my ipad 5g as a hotspot but couldnt share the internet over the ethernet over my dock. If i could do that, it would enable the full 1+ gigabit 5g speeds that i get natively on ipad to the 2.5G port on the usb-c dock connected ethernet.

I also tried tethering through usb-c which gave only 250mbps.

Finally settled using wifi tethering which maxes around 600mbps.

It would be great if there is possibility to share 5g over ethernet, that would blow any 5g hotspot out of water with the chipset apple have put in the ipads.

This is awesome. I hope the client code will be included in the Apple's open source repository [1] after they update it for Monterey. It's hard to fully rely on a test without seeing its implementation, especially the responsiveness portion.

[1] https://opensource.apple.com/

This is a nice little addition.

The UX is nicer than even the best web sites for this (assuming you're comfortable with the command line).

Interestingly, I'm having serious problems just loading the web page; visiting the page gets me into a redirect loop, visible in cURL like so:

    $ curl -v --http1.1 https://danpetrov.xyz/macos/2021/11/14/analysing-network-quality-macos.html
    > GET /macos/2021/11/14/analysing-network-quality-macos.html HTTP/1.1
    > Host: danpetrov.xyz
    > User-Agent: curl/7.68.0
    > Accept: */*
    < HTTP/1.1 301 Moved Permanently
    < location: https://danpetrov.xyz/macos/2021/11/14/analysing-network-quality-macos.html
It's returning a 'location' that's the same as the source, leading to me never seeing the actual page.

EDIT: It's back now, working and visible.

As others have commented, that capital Q is a strange choice for sure, and because so many other commands begin with "network", autocomplete is needlessly distant. But it's easy enough to set "nq" as an alias for networkQuality.

I cooked up a little app that has a UI front-end for these statistics. https://apps.apple.com/us/app/network-quality-test/id1596010...

Over here we tuned up virgin media fiber to have the least latency under normal working conditions yet seen, using sqm and the sch_cake algorithm. Pretty graphs here:


I don't know what rpm score that network would get as yet.

We've been having regular videoconferences to discuss this concept tuesdays 9:30 AM PDT over here:


(use any login, no password, chrome is best)

There's also the "rpm" mailing list on lists.bufferbloat.net

Too bad it doesn't have a -4/-6 option. I was just debugging some connectivity issues which seem to happen only to ipv6

Can anyone speak to "responsiveness?" Is this essentially the inverse of latency?

Does it separate WiFi from internet? Seems most people don’t even understand the difference. You could have strong internet but poor WiFi in a certain spot or for a certain time.

This is great. I’ve encountered connectivity issues the past couple weeks and have been looking for tools like this.

Are there similar tools for assessing WiFi quality and bandwidth?

If only they fixed the tab groups issue of recurrence despite deletion & not keeping new sites in the same tab group either...

An intercap in a command line tool?

(Sounds good apart from that!)

You can do `networkQuality -c` and it will output json. It would be fun to make a tiny web front end for it on localhost.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact