{"id":3016,"date":"2010-08-16T11:41:15","date_gmt":"2010-08-16T18:41:15","guid":{"rendered":"http:\/\/mightyohm.com\/blog\/?p=3016"},"modified":"2015-09-26T11:11:03","modified_gmt":"2015-09-26T18:11:03","slug":"measuring-network-performance-with-iperf","status":"publish","type":"post","link":"https:\/\/mightyohm.com\/blog\/2010\/08\/measuring-network-performance-with-iperf\/","title":{"rendered":"Measuring network performance with iperf"},"content":{"rendered":"<p>My new place in Austin came with a huge perk for a tech geek like me &#8211; it came pre-wired for ethernet in every room. \u00a0(Well, technically not <em>every<\/em> room is wired. \u00a0The laundry room, bathrooms, and garage are not, an understandable oversight.)<\/p>\n<p>After installing a new <a href=\"http:\/\/www.anrdoezrs.net\/click-3238164-10440897?url=http%3A%2F%2Fwww.newegg.com%2FProduct%2FProduct.aspx%3FItem%3DN82E16833127082%26nm_mc%3DAFC-C8Junction%26cm_mmc%3DAFC-C8Junction-_-Network%2B-%2BSwitches-_-D-Link-_-33127082&amp;cjsku=N82E16833127082\" target=\"_top\">D-Link Gigabit Ethernet Switch<\/a><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.ftjcfx.com\/image-3238164-10440897\" border=\"0\" alt=\"\" width=\"1\" height=\"1\" \/>, I wanted to check the throughput to see if I was actually getting gigabit speeds &#8211; particularly because the house is wired with CAT-5e cable (and not the recommended <a href=\"http:\/\/en.wikipedia.org\/wiki\/Category_6_cable\">CAT-6<\/a>).<\/p>\n<p>There are many ways to measure network throughput. \u00a0In the past I have usually copied a file across the network and used a stopwatch to get a relative sense of speed. \u00a0However, due to file sharing protocol overhead I always got disappointing results and never knew maximum capability of my network.<\/p>\n<p>This time, based on the advice of a more network-savvy friend, I decided to use a command-line tool called <a href=\"http:\/\/sourceforge.net\/projects\/iperf\/\">iperf<\/a>.<\/p>\n<p>iperf is a command-line tool to measure network performance. \u00a0It is very powerful, but also easy to use for simple tests. \u00a0For a more complete overview of what iperf is and what it can be used for, check out\u00a0<a href=\"http:\/\/openmaniak.com\/iperf.php\">this tutorial<\/a> or <a href=\"http:\/\/en.wikipedia.org\/wiki\/Iperf\">the iperf page on Wikipedia<\/a>. \u00a0iperf has a lot of options, and I won&#8217;t cover the majority of them here. \u00a0For more usage information, consult the <a href=\"http:\/\/manpages.ubuntu.com\/manpages\/lucid\/en\/man1\/iperf.1.html\">iperf manual<\/a>.<\/p>\n<p>If you run Debian or Ubuntu (Linux), iperf can be installed by executing<\/p>\n<pre><strong>sudo apt-get install iperf<\/strong><\/pre>\n<p>I did these tests with OS X on the Mac since both of my Macs have gigabit ethernet ports and my older PCs don&#8217;t. \u00a0A package for iperf is\u00a0conveniently\u00a0available from <a href=\"http:\/\/www.macports.org\/\">Macports<\/a>. \u00a0It can be installed via the graphical package manager <a href=\"http:\/\/porticus.alittledrop.com\/\">Porticus<\/a> or opening a Terminal window and typing<\/p>\n<pre><strong>sudo port install iperf<\/strong><\/pre>\n<p>In my case, all I wanted was a quick test of TCP\/IP network performance. \u00a0This is easy to do, but it\u00a0requires two computers, a client and a server, both connected to the network under test. \u00a0Ideally, there should be no other network traffic during the test, as this will affect the results.<\/p>\n<p>On the first computer, launch the iperf server by executing<\/p>\n<pre><strong>iperf -s<\/strong><\/pre>\n<p>You should see something like this:<\/p>\n<pre>------------------------------------------------------------\r\nServer listening on TCP port 5001\r\nTCP window size: 64.0 KByte (default)\r\n------------------------------------------------------------<\/pre>\n<p>On the 2nd computer (the client), open a Terminal window and run<\/p>\n<pre><strong>iperf -c <\/strong>&lt;IP address or hostname of server&gt;<strong> -i 1<\/strong><\/pre>\n<p>Within a few seconds, you should start to see reports coming in on both the client and server terminal windows:<\/p>\n<pre>------------------------------------------------------------\r\nClient connecting to mini.home, TCP port 5001\r\nTCP window size:   129 KByte (default)\r\n------------------------------------------------------------\r\n[  3] local 192.168.24.135 port 65142 connected with 192.168.24.77 port 5001\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  0.0- 1.0 sec    110 MBytes    924 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  1.0- 2.0 sec    101 MBytes    850 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  2.0- 3.0 sec    109 MBytes    914 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  3.0- 4.0 sec    100 MBytes    841 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  4.0- 5.0 sec    111 MBytes    927 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  5.0- 6.0 sec    102 MBytes    853 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  6.0- 7.0 sec    110 MBytes    923 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  7.0- 8.0 sec    102 MBytes    858 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  8.0- 9.0 sec  79.4 MBytes    666 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  9.0-10.0 sec  93.6 MBytes    785 Mbits\/sec\r\n[ ID] Interval       Transfer     Bandwidth\r\n[  3]  0.0-10.0 sec  1018 MBytes    854 Mbits\/sec<\/pre>\n<p>The last report (for the interval 0.0-10.0 sec) is the average throughput for the entire test. \u00a0I&#8217;m more than happy with 854 Mbits (927 Mbits\/sec peak!) given my fairly long runs of CAT-5e cable and other machines using the network. \u00a0 Contrast this with my results over 802.11g wireless:<\/p>\n<pre>[ ID] Interval \u00a0 \u00a0 \u00a0 Transfer \u00a0 \u00a0 Bandwidth\r\n[ \u00a03] \u00a00.0-10.0 sec \u00a024.9 MBytes \u00a020.9 Mbits\/sec<\/pre>\n<div>Ouch.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>My new place in Austin came with a huge perk for a tech geek like me &#8211; it came pre-wired for ethernet in every room. \u00a0(Well, technically not every room is wired. \u00a0The laundry room, bathrooms, and garage are not, an understandable oversight.) After installing a new D-Link Gigabit Ethernet Switch, I wanted to check &hellip; <a href=\"https:\/\/mightyohm.com\/blog\/2010\/08\/measuring-network-performance-with-iperf\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Measuring network performance with iperf<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[443],"tags":[335,240,334,66,336,82],"class_list":["post-3016","post","type-post","status-publish","format-standard","hentry","category-projects-2","tag-computers","tag-ethernet","tag-iperf","tag-linux","tag-networking","tag-wifi"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pioCd-ME","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":2024,"url":"https:\/\/mightyohm.com\/blog\/2009\/06\/microchip-internet-radio-demonstration-board\/","url_meta":{"origin":3016,"position":0},"title":"Microchip Internet Radio Demonstration Board","author":"Jeff","date":"June 23, 2009","format":false,"excerpt":"Microchip Technology, makers of the PIC microcontroller, have released a demo board for the 8-bit PIC18F67J60 that is pre-programmed to function as an internet radio receiver. Anyone familiar with the blog knows that I have a special love for internet streaming radio, so it shouldn't be a surprise that this\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/mightyohm.com\/blog\/category\/electronics\/"},"img":{"alt_text":"Microchip Internet Radio Demonstration Board","src":"https:\/\/i0.wp.com\/mightyohm.com\/blog\/wp-content\/uploads\/2009\/06\/95837-1.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1872,"url":"https:\/\/mightyohm.com\/blog\/2009\/05\/building-a-wifi-radio-part-9-a-few-odds-and-ends\/","url_meta":{"origin":3016,"position":1},"title":"Building a Wifi Radio &#8211; Part 9, A Few Odds and Ends","author":"Jeff","date":"May 27, 2009","format":false,"excerpt":"This is the ninth part of an ongoing series about building a low cost, open source streaming internet radio based on the ASUS WL-520gU Wireless Router.\u00a0 If you haven\u2019t already, check out the previous parts (see the links at the end of this article) for some background about the project.\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/mightyohm.com\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"http:\/\/www.ftjcfx.com\/image-3238164-10440897","width":350,"height":200},"classes":[]},{"id":516,"url":"https:\/\/mightyohm.com\/blog\/2008\/11\/building-a-wifi-radio-part-4-installing-openwrt\/","url_meta":{"origin":3016,"position":2},"title":"Building a Wifi Radio &#8211; Part 4, Installing OpenWrt","author":"Jeff","date":"November 3, 2008","format":false,"excerpt":"This is the fourth part of an ongoing series about building a low cost, open source streaming internet radio.\u00a0 If you haven\u2019t already, check out parts one, two, and three for some background about the project. At this point you should have an Asus WL-520GU wireless router with a serial\u2026","rel":"","context":"In &quot;Projects&quot;","block_context":{"text":"Projects","link":"https:\/\/mightyohm.com\/blog\/category\/projects-2\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mightyohm.com\/blog\/wp-content\/uploads\/2008\/11\/openwrt_logo.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":445,"url":"https:\/\/mightyohm.com\/blog\/2008\/10\/arduino-featured-in-wired\/","url_meta":{"origin":3016,"position":3},"title":"Arduino featured in Wired","author":"Jeff","date":"October 22, 2008","format":false,"excerpt":"Arduino is featured in the November issue of Wired. Check out the full article here: Build It. Share It. Profit. Can Open Source Hardware Work?","rel":"","context":"In &quot;Microcontrollers&quot;","block_context":{"text":"Microcontrollers","link":"https:\/\/mightyohm.com\/blog\/category\/microcontrollers\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":480,"url":"https:\/\/mightyohm.com\/blog\/2008\/10\/building-a-wifi-radio-part-3-hacking-the-asus-wl-520gu\/","url_meta":{"origin":3016,"position":4},"title":"Building a Wifi Radio &#8211; Part 3, Hacking the Asus WL-520GU","author":"Jeff","date":"October 30, 2008","format":false,"excerpt":"This is the third part of an ongoing series about building a low cost, open source streaming internet radio.\u00a0 If you haven\u2019t already, check out part one and part two for some background about the project. Hacking the Asus WL-520GU Wireless Router: In the last part of this series, I\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/mightyohm.com\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"http:\/\/www.awltovhc.com\/image-3238164-10440897","width":350,"height":200},"classes":[]},{"id":1148,"url":"https:\/\/mightyohm.com\/blog\/2009\/02\/building-a-wifi-radio-part-8-adding-a-tuning-control\/","url_meta":{"origin":3016,"position":5},"title":"Building a Wifi Radio &#8211; Part 8, Adding a Tuning Control","author":"Jeff","date":"February 3, 2009","format":false,"excerpt":"This is the eighth part of an ongoing series about building a low cost, open source streaming internet radio based on the ASUS WL-520gU Wireless Router.\u00a0 If you haven\u2019t already, check out the previous parts (see the links at the end of this article) for some background about the project.\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/mightyohm.com\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"http:\/\/www.ftjcfx.com\/image-3238164-10440897","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/posts\/3016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/comments?post=3016"}],"version-history":[{"count":10,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/posts\/3016\/revisions"}],"predecessor-version":[{"id":5025,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/posts\/3016\/revisions\/5025"}],"wp:attachment":[{"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/media?parent=3016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/categories?post=3016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mightyohm.com\/blog\/wp-json\/wp\/v2\/tags?post=3016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}