top | item 29225308

macOS Monterey's new network quality tool is surprisingly good

468 points| danpetrov | 4 years ago |danpetrov.xyz

95 comments

order

ripperdoc|4 years ago

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.

artificialLimbs|4 years ago

    #!/bin/zsh
    ip addr | grep $localNetworkPrefix
    ping $localGateway
    ping 1.1.1.1
    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

perryizgr8|4 years ago

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

dzhiurgis|4 years ago

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}'

toast0|4 years ago

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.

dtaht|4 years ago

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.

screenshot|4 years ago

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.

e_proxus|4 years ago

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 ¯\_(ツ)_/¯)

exikyut|4 years ago

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
  [...]
  {"DurationMs":11373,"Bytes":1048729,"BPS":92212}
(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.

m_st|4 years ago

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.

dorianmariefr|4 years ago

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

blakesterz|4 years ago

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

handrous|4 years ago

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.

masklinn|4 years ago

“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.

mahathu|4 years ago

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.

ilikepi|4 years ago

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.

danpetrov|4 years ago

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.

curun1r|4 years ago

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.

0xFFFE|4 years ago

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

ksbrooksjr|4 years ago

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.

judge2020|4 years ago

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)

ManuelKiessling|4 years ago

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

danpetrov|4 years ago

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

mnadkvlb|4 years ago

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.

m0dest|4 years ago

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/

jmull|4 years ago

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).

lelandbatey|4 years ago

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.

miles|4 years ago

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.

unilynx|4 years ago

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

SquibblesRedux|4 years ago

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

kangaroozach|4 years ago

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.

divbzero|4 years ago

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?

DarthNebo|4 years ago

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

Doctor_Fegg|4 years ago

An intercap in a command line tool?

(Sounds good apart from that!)

knoebber|4 years ago

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.