Check Internet Speed with Apple Network Responsiveness
Tags: performance, tooling, tutorial
Published: 2021-11-19 15:50:18

<!-- wp:paragraph -->
<p>There are umpteen tools available to check the internet speed. SpeedTest, <a href="https://qainsights.com/deep-dive-into-cloudflares-speed-test/" target="_blank" rel="noreferrer noopener">Speed from Cloudflare</a>, Netflix's <a href="https://fast.com" target="_blank" rel="noreferrer noopener">Fast</a>, or if you use <a href="https://www.google.com/search?q=internet+speed" target="_blank" rel="noreferrer noopener">Google search</a>, you can test the internet speed and its analytics. In macOS Monterey, Apple has released a command line tool called <code>networkQuality</code>. In this blog article we will deep dive into networkQuality and its usage.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Launching networkQuality</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The only prerequisite to launch <code>networkQuality</code> is macOS Monterey. Launch the <code>terminal</code> from the <code>Finder</code>. In the terminal, type <code>networkQuality</code> and hit enter.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The tool will display the download and upload capacity for every second as shown below. </p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":8881,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image size-large"><a href="https://qainsights.com/wp-content/uploads/2021/11/image-2.png"><img src="https://qainsights.com/wp-content/uploads/2021/11/image-2-1024x87.png" alt="Testing" class="wp-image-8881"/></a><figcaption>Testing</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Once the test is done after ~15 seconds, you can see the summary of your internet performance.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":8882,"sizeSlug":"full","linkDestination":"media"} -->
<figure class="wp-block-image size-full"><a href="https://qainsights.com/wp-content/uploads/2021/11/image-3.png"><img src="https://qainsights.com/wp-content/uploads/2021/11/image-3.png" alt="" class="wp-image-8882"/></a></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>The <code>Responsiveness</code> in the above summary is in roundtrips completed per minute (RPM). Responsiveness measures the quality of the network by the number of roundtrips per minute.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>There are three categories in Responsiveness. <strong>Low, Medium, and High</strong>. High means there is a reliable network connection. Low means, you can see the issues while on a call or downloading a huge document or media file. Medium means, you can see a brief delay in the network.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To view the manual page, enter <code>man networkQuality</code> and hit enter.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>By default, networkQuality tests with parallel upload/download. If you want to test in sequential order add <code>-s</code> option to the command.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":8883,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image size-large"><a href="https://qainsights.com/wp-content/uploads/2021/11/image-4.png"><img src="https://qainsights.com/wp-content/uploads/2021/11/image-4-1024x68.png" alt="Download Stats" class="wp-image-8883"/></a><figcaption>Download Stats</figcaption></figure>
<!-- /wp:image -->

<!-- wp:image {"id":8884,"width":640,"height":54,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image size-large is-resized"><a href="https://qainsights.com/wp-content/uploads/2021/11/image-5.png"><img src="https://qainsights.com/wp-content/uploads/2021/11/image-5-1024x87.png" alt=" Upload Stats " class="wp-image-8884" width="640" height="54"/></a><figcaption> Upload Stats </figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>To view the output in JSON format, enter <code>networkQuality -c</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8886,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2021/11/image-7.png"><img src="https://qainsights.com/wp-content/uploads/2021/11/image-7-470x1024.png" alt="JSON output" class="wp-image-8886"/></a><figcaption>JSON output</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>To view the verbose output, enter <code>networkQuality -v</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8885,"sizeSlug":"full","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-full"><a href="https://qainsights.com/wp-content/uploads/2021/11/image-6.png"><img src="https://qainsights.com/wp-content/uploads/2021/11/image-6.png" alt="Summary" class="wp-image-8885"/></a><figcaption>Summary</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>To test other interface in the network, enter <code>networkQuality -I &lt;interface_name&gt;</code>. This will bind the interface and run the tests.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>By default, networkQuality uses the below configuration for testing.If you want to configure, you can use <code>the -C</code> option.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In the JSON file, there are three different URLs to test the network speed. Small and Large are for GET requests. The Upload URL is for POST request.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>{
  "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": "usqas2-edge-bx-023.aaplimg.com"
}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>Here is an example of a <a href="https://github.com/QAInsights/networkQuality/blob/main/config.json" target="_blank" rel="noreferrer noopener">custom configuration file</a>. But it is not properly working; If you find a solution, please share it in the comments.</p>
<!-- /wp:paragraph -->

<!-- wp:buttons {"contentJustification":"center"} -->
<div class="wp-block-buttons is-content-justification-center"><!-- wp:button {"backgroundColor":"global-color-8"} -->
<div class="wp-block-button"><a class="wp-block-button__link has-global-color-8-background-color has-background" href="https://github.com/QAInsights/networkQuality" target="_blank" rel="noreferrer noopener">networkQuality Repo</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:paragraph -->
<p>Using the <a href="https://qainsights.com/jump-start-with-fiddler-everywhere/" target="_blank" rel="noreferrer noopener">Fiddler Everywhere</a>, I captured the traffic when the test was running. Here is the screenshot. Totally, there were around 40+ requests made to conclude the testing.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":8891,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image size-large"><a href="https://qainsights.com/wp-content/uploads/2021/11/image-8.png"><img src="https://qainsights.com/wp-content/uploads/2021/11/image-8-1024x573.png" alt="" class="wp-image-8891"/></a><figcaption>Fiddler Capture during the test</figcaption></figure>
<!-- /wp:image -->

<!-- wp:generateblocks/headline {"uniqueId":"2264ddc3"} -->
<h2 class="gb-headline gb-headline-2264ddc3 gb-headline-text">Conclusion</h2>
<!-- /wp:generateblocks/headline -->

<!-- wp:paragraph -->
<p>Apple's <code>networkQuality</code> is not a full-fledged solution to test the network speed. There are many matured solutions that are available for free. But if you are in the Apple ecosystem and love being a fan of Apple, you can add <code>networkQuality</code> in your shell file.</p>
<!-- /wp:paragraph -->