{"id":6007,"date":"2022-08-17T08:45:21","date_gmt":"2022-08-17T08:45:21","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=6007"},"modified":"2022-08-17T08:45:21","modified_gmt":"2022-08-17T08:45:21","slug":"iperf-network-speed","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/iperf-network-speed","title":{"rendered":"iPerf &#8211; Network Speed"},"content":{"rendered":"<p class=\"x_MsoNormal\">There\u2019s a tool called iPerf which is essentially a CLI speed test server and client. It runs better on Linux because there\u2019s less shenanigans that go on inside the network stack but works well on Windows as well.<\/p><p class=\"x_MsoNormal\">A few things you need to be aware of before running this if you want accurate results.<\/p><p class=\"x_MsoNormal\">The first is a thing called Bandwidth Delay Product (BDP). In the network stack all applications request an amount of memory to be allocated as a buffer for incoming data. If you make this too small; you\u2019re going to artificially limit your bandwidth.<\/p><p class=\"x_MsoNormal\">To calculate BDP it\u2019s a little complicated \u2013 there\u2019s a calculator here\u00a0<a href=\"https:\/\/www.speedguide.net\/bdp.php\" target=\"_blank\" rel=\"noopener noreferrer\" data-auth=\"NotApplicable\" data-linkindex=\"0\">https:\/\/www.speedguide.net\/bdp.php<\/a><\/p><p class=\"x_MsoNormal\">1. Determine MSS, maximum anticipated RTT latency and advertised maximum bandwidth.<br aria-hidden=\"true\" \/>(for example, 1460 MSS, 300ms max latency, 6Mbit\/s max bandwidth).<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>2. Find the unscaled RWIN value (largest even multiple of MSS less than 65535):<br aria-hidden=\"true\" \/>65535 \/ 1460 (MSS) = 44.9<br aria-hidden=\"true\" \/>round down to even number = 44<br aria-hidden=\"true\" \/>44 x 1460 = 64240 (this is the optimal\u00a0<u>unscaled<\/u>\u00a0RWIN value for broadband connections)<br aria-hidden=\"true\" \/><br aria-hidden=\"true\" \/>3. Multiply the unscaled RWIN by 2 until it is larger than BDP<br aria-hidden=\"true\" \/>Our BDP for 6Mbps @ 300 latency is:<br aria-hidden=\"true\" \/>6000 kbps x 300ms = 1800000 \/ 8 = 225000<br aria-hidden=\"true\" \/>64240 (unscaled RWIN) x 2 x 2 &#8230; =\u00a0<b>256960<\/b>\u00a0(number larger than BDP, this is the optimal RWIN)<\/p><p class=\"x_MsoNormal\">If you\u2019re running iPerf and doing a UDP based test (remembering UDP has a much lower overhead than TCP so will give you a more accurate result) you need to tell iPerf the amount of bandwidth you\u2019re expecting the link to support with the -b switch<\/p><p class=\"x_MsoNormal\">Also keep in mind if you\u2019re running this on a live environment during production hours you\u2019re going to saturate a link.<\/p><p class=\"x_MsoNormal\">The last is windows firewall is not your friend here.<\/p><p class=\"x_MsoNormal\">Fortigate also has a poor mans version of iPerf but you can\u2019t start it in server mode.<\/p><p class=\"x_MsoNormal\"><a href=\"https:\/\/community.fortinet.com\/t5\/FortiGate\/Technical-Tip-Interface-speed-test-on-the-firewall-for-the\/ta-p\/191988?externalID=FD48743\" target=\"_blank\" rel=\"noopener noreferrer\" data-auth=\"NotApplicable\" data-linkindex=\"1\">https:\/\/community.fortinet.com\/t5\/FortiGate\/Technical-Tip-Interface-speed-test-on-the-firewall-for-the\/ta-p\/191988?externalID=FD48743<\/a><\/p><p class=\"x_MsoNormal\"><a href=\"https:\/\/community.fortinet.com\/t5\/FortiGate\/Technical-Tip-Use-cases-for-diagnose-traffictest-command\/ta-p\/197784\" target=\"_blank\" rel=\"noopener noreferrer\" data-auth=\"NotApplicable\" data-linkindex=\"2\">https:\/\/community.fortinet.com\/t5\/FortiGate\/Technical-Tip-Use-cases-for-diagnose-traffictest-command\/ta-p\/197784<\/a><\/p><p class=\"x_MsoNormal\">To start iperf as a server.<\/p><p class=\"x_MsoNormal\">Iperf3 -s<\/p><p class=\"x_MsoNormal\" aria-hidden=\"true\">\u00a0<\/p><p class=\"x_MsoNormal\">To start iPerf as a client.<\/p><p class=\"x_MsoNormal\"># TCP Test \u2013 Data Client -&gt; Server<\/p><p class=\"x_MsoNormal\">iperf3 -c &lt;ip&gt; -P 10 -t 60 -w 3M<\/p><p class=\"x_MsoNormal\"># TCP Test \u2013 Data Server -&gt; Client<\/p><p class=\"x_MsoNormal\">iperf3 -c\u00a0 &lt;ip&gt; -P 10 -t 60 -w 3M -R<\/p><p class=\"x_MsoNormal\"># UDP Test \u2013 Data Client -&gt; Server<\/p><p class=\"x_MsoNormal\">iperf3 -c\u00a0 &lt;ip&gt; -P 10 -t 60 -w 3M -b 1000M<\/p><p class=\"x_MsoNormal\"># UDP Test \u2013 Data Server -&gt; Client<\/p><p class=\"x_MsoNormal\">iperf3 -c\u00a0 &lt;ip&gt; -P 10 -t 60 -w 3M -b 1000M -R<\/p>","protected":false},"excerpt":{"rendered":"<p>There\u2019s a tool called iPerf which is essentially a CLI speed test server and client. It runs better on Linux because there\u2019s less shenanigans that go on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3904,1321,1399],"class_list":["post-6007","post","type-post","status-publish","format-standard","hentry","category-research","tag-iperf","tag-network","tag-speed"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/6007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=6007"}],"version-history":[{"count":2,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/6007\/revisions"}],"predecessor-version":[{"id":6012,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/6007\/revisions\/6012"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=6007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=6007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=6007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}