{"id":111,"date":"2025-01-31T16:09:20","date_gmt":"2025-01-31T07:09:20","guid":{"rendered":"https:\/\/blog.interstellar.co.jp\/en\/?p=111"},"modified":"2025-01-31T16:09:21","modified_gmt":"2025-01-31T07:09:21","slug":"measuring-network-performance-between-linux-mac-and-windows-terminals-iperf-ntttcp","status":"publish","type":"post","link":"https:\/\/blog.interstellar.co.jp\/en\/2025\/01\/31\/measuring-network-performance-between-linux-mac-and-windows-terminals-iperf-ntttcp\/","title":{"rendered":"Measuring network performance between Linux, Mac, and Windows terminals (iperf\/ntttcp)"},"content":{"rendered":"\n<p>Hello, this is Agata.<\/p>\n\n\n\n<p>In this article, we will be looking at how to measure network performance between Linux, Mac and Windows terminals.<\/p>\n\n\n\n<p>However, if you are using Windows, please go to Microsoft&#8217;s page.<\/p>\n\n\n\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/virtual-network\/virtual-network-bandwidth-testing?tabs=windows\">https:\/\/learn.microsoft.com\/en-us\/azure\/virtual-network\/virtual-network-bandwidth-testing?tabs=windows<\/a><\/p>\n\n\n\n<p>It seems that people are measuring using iperf3 on Windows without worrying about it, but as this Microsoft article explains, because it is not running on Windows&#8217; native API, there is a possibility that the results will differ from the actual performance.<br>Windows users should refer to the above Microsoft article and use ntttcp.<\/p>\n\n\n\n<p>Of course, iperf3 is not compatible with Windows to Linux or Windows to Mac.<br>For Linux, the Linux version of ntttcp has been released, so use this.<br>Unfortunately, the Mac version of ntttcp does not appear to have been released. If you want to measure between Mac and Windows, you may have to use iperf, although it is not accurate.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When measuring on Linux or Mac<\/h2>\n\n\n\n<p>So, let&#8217;s get back on track and look at measuring on Linux or Mac.<\/p>\n\n\n\n<p>To measure, you need to install iperf3 on both of the two devices you want to measure.<\/p>\n\n\n\n<p>There is a server side and a client side of iperf3, but you can switch between them using options, so you can install the same version on both.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installation<\/h3>\n\n\n\n<p>First, let&#8217;s install ipef3.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Linux (Ubuntu)<\/h4>\n\n\n\n<p>we will use Ubuntu as an example.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo apt install iperf3<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Mac<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">brew install iperf3<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Measurement<\/h3>\n\n\n\n<p>The process is basically the same for both Linux and Mac.<\/p>\n\n\n\n<p>One of the two devices is designated as the server, and the other as the client. You can decide which one is which as you like.<\/p>\n\n\n\n<p>Start iperf3 in server mode on the device that will be the server, and start iperf3 in client mode on the device that will be the client.<\/p>\n\n\n\n<p>If your firewall is enabled, disable it or open the port used by iperf3 (the default is 5201).<\/p>\n\n\n\n<p>Use the following command to start the server side first.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">iperf3 -s<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Execution results<\/h3>\n\n\n\n<p>The following execution results will be displayed on the client side.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">Connecting to host 192.168.0.1, port 5201\n[  5] local 192.168.0.129 port 50893 connected to 192.168.0.1 port 5201\n[ ID] Interval           Transfer     Bitrate\n[  5]   0.00-1.00   sec  75.9 MBytes   636 Mbits\/sec                  \n[  5]   1.00-2.00   sec  61.0 MBytes   511 Mbits\/sec                  \n[  5]   2.00-3.00   sec  68.8 MBytes   578 Mbits\/sec                  \n[  5]   3.00-4.00   sec  71.2 MBytes   598 Mbits\/sec                  \n[  5]   4.00-5.00   sec  67.0 MBytes   560 Mbits\/sec                  \n[  5]   5.00-6.00   sec  70.0 MBytes   589 Mbits\/sec                  \n[  5]   6.00-7.00   sec  72.9 MBytes   610 Mbits\/sec                  \n[  5]   7.00-8.00   sec  60.0 MBytes   503 Mbits\/sec                  \n[  5]   8.00-9.00   sec  72.8 MBytes   610 Mbits\/sec                  \n[  5]   9.00-10.00  sec  63.9 MBytes   538 Mbits\/sec                  \n- - - - - - - - - - - - - - - - - - - - - - - - -\n[ ID] Interval           Transfer     Bitrate\n[  5]   0.00-10.00  sec   683 MBytes   573 Mbits\/sec                  sender\n[  5]   0.00-10.02  sec   682 MBytes   571 Mbits\/sec                  receiver\n\niperf Done.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Other<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Setting the measurement time<\/h3>\n\n\n\n<p>If you start it as it is, the measurement time is set to 10 seconds. This may cause measurement errors to increase due to temporary fluctuations in network load.<\/p>\n\n\n\n<p>Therefore, it may be better to set the measurement time to a longer time, such as 60 seconds.<\/p>\n\n\n\n<p>The measurement time can be set using the -t option.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">iperf3 -c 192.168.8.3 -t 60<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Measuring in the opposite direction<\/h3>\n\n\n\n<p>Incidentally, when you start the client normally, the data is sent from the client to the server and measured.<\/p>\n\n\n\n<p>If you want to measure the speed in the opposite direction for some reason, you can switch it by simply adding -R to the client side options.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">iperf3 -c 192.168.0.1 -R\nConnecting to host 192.168.0.1, port 5201\nReverse mode, remote host 192.168.0.1 is sending\n[  5] local 192.168.0.129 port 51116 connected to 192.168.0.1 port 5201\n[ ID] Interval           Transfer     Bitrate\n[  5]   0.00-1.00   sec  76.8 MBytes   641 Mbits\/sec                  \n[  5]   1.00-2.00   sec  79.2 MBytes   667 Mbits\/sec                  \n[  5]   2.00-3.00   sec  81.0 MBytes   677 Mbits\/sec                  \n[  5]   3.00-4.00   sec  80.6 MBytes   676 Mbits\/sec                  \n[  5]   4.00-5.00   sec  80.4 MBytes   674 Mbits\/sec                  \n[  5]   5.00-6.00   sec  80.4 MBytes   674 Mbits\/sec                  \n[  5]   6.00-7.00   sec  78.9 MBytes   662 Mbits\/sec                  \n[  5]   7.00-8.00   sec  76.5 MBytes   644 Mbits\/sec                  \n[  5]   8.00-9.00   sec  80.2 MBytes   671 Mbits\/sec                  \n[  5]   9.00-10.00  sec  78.1 MBytes   657 Mbits\/sec                  \n- - - - - - - - - - - - - - - - - - - - - - - - -\n[ ID] Interval           Transfer     Bitrate         Retr\n[  5]   0.00-10.02  sec   795 MBytes   666 Mbits\/sec   12            sender\n[  5]   0.00-10.00  sec   792 MBytes   664 Mbits\/sec                  receiver\n\niperf Done.<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">JSON output<\/h3>\n\n\n\n<p>If you are planning to process the data in some way later, it may be more convenient to output it in JSON format.<\/p>\n\n\n\n<p>As you can see from the following sample, it is output in more detail.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">iperf3 -c 192.168.0.1 -J\n{\n\t\"start\":\t{\n\t\t\"connected\":\t[{\n\t\t\t\t\"socket\":\t5,\n\t\t\t\t\"local_host\":\t\"192.168.0.129\",\n\t\t\t\t\"local_port\":\t51240,\n\t\t\t\t\"remote_host\":\t\"192.168.0.1\",\n\t\t\t\t\"remote_port\":\t5201\n\t\t\t}],\n\t\t\"version\":\t\"iperf 3.18\",\n\t\t\"system_info\":\t\"Darwin Agata-MacBook-Pro.local 23.6.0 Darwin Kernel Version 23.6.0: Thu Sep 12 23:34:49 PDT 2024; root:xnu-10063.141.1.701.1~1\/RELEASE_X86_64 x86_64\",\n\t\t\"timestamp\":\t{\n\t\t\t\"time\":\t\"Fri, 31 Jan 2025 05:12:25 UTC\",\n\t\t\t\"timesecs\":\t1738300345\n\t\t},\n\t\t\"connecting_to\":\t{\n\t\t\t\"host\":\t\"192.168.0.1\",\n\t\t\t\"port\":\t5201\n\t\t},\n\t\t\"cookie\":\t\"2lmxmjdwqnodwixbylwsplixxex4geldlzo6\",\n\t\t\"tcp_mss_default\":\t1448,\n\t\t\"target_bitrate\":\t0,\n\t\t\"fq_rate\":\t0,\n\t\t\"sock_bufsize\":\t0,\n\t\t\"sndbuf_actual\":\t131072,\n\t\t\"rcvbuf_actual\":\t131072,\n\t\t\"test_start\":\t{\n\t\t\t\"protocol\":\t\"TCP\",\n\t\t\t\"num_streams\":\t1,\n\t\t\t\"blksize\":\t131072,\n\t\t\t\"omit\":\t0,\n\t\t\t\"duration\":\t60,\n\t\t\t\"bytes\":\t0,\n\t\t\t\"blocks\":\t0,\n\t\t\t\"reverse\":\t0,\n\t\t\t\"tos\":\t0,\n\t\t\t\"target_bitrate\":\t0,\n\t\t\t\"bidir\":\t0,\n\t\t\t\"fqrate\":\t0,\n\t\t\t\"interval\":\t1\n\t\t}\n\t},\n\t\"intervals\":\t[{\n\t\t\t\"streams\":\t[{\n\t\t\t\t\t\"socket\":\t5,\n\t\t\t\t\t\"start\":\t0,\n\t\t\t\t\t\"end\":\t1.004466,\n\t\t\t\t\t\"seconds\":\t1.0044660568237305,\n\t\t\t\t\t\"bytes\":\t72351744,\n\t\t\t\t\t\"bits_per_second\":\t576240429.49773228,\n\t\t\t\t\t\"omitted\":\tfalse,\n\t\t\t\t\t\"sender\":\ttrue\n\t\t\t\t}],\n\t\t\t\"sum\":\t{\n\t\t\t\t\"start\":\t0,\n\t\t\t\t\"end\":\t1.004466,\n\t\t\t\t\"seconds\":\t1.0044660568237305,\n\t\t\t\t\"bytes\":\t72351744,\n\t\t\t\t\"bits_per_second\":\t576240429.49773228,\n\t\t\t\t\"omitted\":\tfalse,\n\t\t\t\t\"sender\":\ttrue\n\t\t\t}\n\t\t}, {\n\t\t\t\"streams\":\t[{\n\t\t\t\t\t\"socket\":\t5,\n\t\t\t\t\t\"start\":\t1.004466,\n\t\t\t\t\t\"end\":\t2.002778,\n\t\t\t\t\t\"seconds\":\t0.998311996459961,\n\t\t\t\t\t\"bytes\":\t73007104,\n\t\t\t\t\t\"bits_per_second\":\t585044388.99971151,\n\t\t\t\t\t\"omitted\":\tfalse,\n\t\t\t\t\t\"sender\":\ttrue\n\t\t\t\t}],\n\t\t\t\"sum\":\t{\n\t\t\t\t\"start\":\t1.004466,\n\t\t\t\t\"end\":\t2.002778,\n\t\t\t\t\"seconds\":\t0.998311996459961,\n\t\t\t\t\"bytes\":\t73007104,\n\t\t\t\t\"bits_per_second\":\t585044388.99971151,\n\t\t\t\t\"omitted\":\tfalse,\n\t\t\t\t\"sender\":\ttrue\n\t\t\t}\n\t\t}, {\n\t\t\t\"streams\":\t[{\n\t\t\t\t\t\"socket\":\t5,\n.\n.\n.<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hello, this is Agata. In this article, we will be looking at how to measure network performance between Linux, Mac and Windows terminals. However, if you are using Windows, please go to Microsoft&#8217;s page. https:\/\/learn.microsoft.com\/en-us\/azure\/virtual-network\/virtual-network-bandwidth-testing?tabs=windows It seems that people are measuring using iperf3 on Windows without worrying about it, but as this Microsoft article explains, because it is not running on Windows&#8217; native API, there is a possibility that the results will differ from the actual performance.Windows users should refer to the above Microsoft article and use ntttcp. Of course, iperf3 is not compatible with Windows to Linux or Windows to Mac.For Linux, the Linux version of ntttcp has been&#8230;<\/p>\n","protected":false},"author":2,"featured_media":113,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"vkexunit_cta_each_option":"","footnotes":""},"categories":[18],"tags":[29,28,5,30,27],"class_list":["post-111","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application","tag-iperf","tag-linux","tag-mac","tag-ntttcp","tag-windows"],"_links":{"self":[{"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":2,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":114,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/posts\/111\/revisions\/114"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/media\/113"}],"wp:attachment":[{"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}