Measure Network Performance with iperf - www.enterprisenetworkingplanet.com

来源:百度文库 编辑:神马文学网 时间:2019/11/19 23:28:55
  • Admin & Management
  • How-To
  • Network News
  • Network OS
  • Security
  • Standards & Protocols
  • Networking In-Depth
  • Networking Glossary
  • Networking Products
June 25, 2010Hot Topics :prev
  • Cloud Computing
  • Networking
  • Active Directory
  • Unix
  • Dtrace
  • Samba
  • Linux
nextNetworking &CommunicationsNetwork OSRead More in Network OS »

Measure Network Performance with iperf

  • February 13, 2007
  • By Carla Schroder
  • Submit Feedback »
  • More by Author »

 

In the beginning was the circuit-switched voice network. Every call wasgiven a dedicated connection for the duration of the call, like a trainon a track, and life was good. Then came the Internet, and lo! beardedgeeks did rampantly stuff data packets over analog circuits, and theresult was like a crowded freeway with contentions and collisions. Butthese same circuits could handle far more traffic, even if it wascongested and dangerous. And thus did e-mail, Web surfing, and onlineshopping come to the masses.

But this was not good enough for mad Web designers and dementedmarketing life-forms, who decreed that computers should be just liketelevisions, pushing Rich Content and Enhanced Multi-media Experiences(translation: commercials) into our mouths like baby birds. Fortunately,this was hampered by the nature of packet-switched networks and TCP/IP,which try hard to guarantee that data packets will arrive at theirdestinations, but not in any particular time frame or order. And thus wehave online streaming video that does not stream, but stalls and jerks,and unsynchronized jittery audio, like a parody of bad educationalfilms.

But, as with all technologies, it can be used for good or ill, and atlong last streaming media is being employed for actually useful thingslike VoIP, videophones, and Internet conferencing. So now we havelegitimate reasons to want our packet-switched networks to behave likecircuit-switched networks. But (there are many buts inherent in thistopic) as long as we're stuck on IPv4 networks there isn't a lot we cando about this. It takes a lot of clever routing and caching to createthe equivalent of a dedicated high-occupancy lane on the informationhighway, because QoS in IPv4 is a joke. You can mark your packets anyway you want, and most routers will ignore your wishes.

  • Post a comment
  • Print Article

Linux is blessed with a truckload of software utilities for findingbottlenecks and other problems. Maybe you'll be able to do somethingabout the problem, maybe not, but at least you can find out what andwhere it is.

iperf

iperf is a nifty little program for measuring throughput, jitterand datagram loss. It has both client and server pieces, so it requiresinstallation at both ends of the connection you're measuring. I like tohave three terminals laid out so I can see all of them at once. One forthe client, one for the server, and one running tcpdump just to see allthose packets zoom by. Interestingly, tcdump causes a significantslowdown, which you can see for yourself. First start up iperf inserver mode, then run it from the client PC with these commands:
carla@xena:~$ iperf -sterry@uberpc:~$ iperf -c xena
By default iperf uses TCP/UDP port 5001, so make sure it's notblocked. This is the result of a run without tcpdump running:
------------------------------------------------------------Server listening on TCP port 5001TCP window size: 85.3 KByte (default)------------------------------------------------------------[  4] local 192.168.1.10 port 5001 connected with 192.168.1.76 port 471[  4]  0.0-10.0 sec    112 MBytes  93.8 Mbits/sec
Pretty nice- that's as good as you can get on Fast Ethernet. This iswhat happens when tcpdump is running:
[  5]  0.0-10.0 sec  56.5 MBytes  47.3 Mbits/sec
By default, iperf flings TCP packets over your wires as fast aspossible. A bi-directional test, which is the -d option, runsboth ways:
terry@uberpc:~$ iperf -c xena -d[  4]  0.0-10.0 sec    109 MBytes  91.3 Mbits/sec[  5]  0.0-10.0 sec  84.5 MBytes  70.8 Mbits/sec
Debugging multi-cast network problems can drive you buggy. iperfcan test multi-cast performance by running several servers listening onyour multi-cast address:
admin@server1:~$ iperf -su -B 224.0.0.1admin@server2:~$ iperf -su -B 224.0.0.1user@client1:~$ iperf -c 224.0.0.1 -u -b 512k
You'll want to set the -b value to a speed appropriate for yournetwork, and use your own multi-cast IP address.

You may use your own files for testing throughput on compressed anduncompressed files by specifying the filenames on the client:

terry@uberpc:~$ iperf -c xena -F [filename]

Testing UDP

Testing UDP is fun too. Stop the server with Ctrl+C, then run thesecommands:
carla@xena:~$ iperf -suterry@uberpc:~$ iperf -c xena -u[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec  0.003 ms    0/  893 (0%)
That's quite a difference. In fact, I would use the word "sucks". Why isUDP so slow? Because iperf's default is 1.05 Mbits/second, soit's not a network problem. We can try some different values to see whathappens. Let's tell it to use all available bandwidth:
carla@xena:~$ iperf -suterry@uberpc:~$ iperf -c xena -u -b 100m[ ID] Interval       Transfer     Bandwidth       Jitter     Lost/Total     Datagrams[  4]  0.0-10.0 sec    113 MBytes  95.0 Mbits/sec  0.008 ms  544/81389 (0.67%)[  4]  0.0-10.0 sec  1 datagrams received out-of-order

That's very good speed, and 0.67% datagram loss is insignificant. That'sa good clean connection. UDP has been promoted from a bit player to aprotocol of importance, thanks to VoIP. VoIP traffic uses UDP instead ofTCP because of the lower overhead. A bit of datagram loss doesn't harmthe quality of VoIP calls, but TCP's dogged determination to deliverpackets no matter how late or out-of-order can make a real hash of voicecalls. Depending on network conditions and the quality of your IPphones, a VoIP call can tolerate as much as 10% UDP datagram loss.

Applications determine how many TCP or UDP packets are sent, and whatsize. To get a more real-world idea of performance, you can set the sizeof the UDP datagram to the same size that your applications use. Thisis easy to find- run tcpdump and filter for udp datagrams:

# tcpdump -p udp11:41:17.618421 IP uberpc.alrac.net.ipp > 192.168.1.255.ipp: UDP, length 200

This example whales on your line by sending 200-byte datagrams at 100Mbits/second:

carla@xena:~$ iperf -su -i 1terry@uberpc:~$ iperf -c xena -u -l 200 -b 100m [  3]  0.0-10.0 sec    106 MBytes  88.9 Mbits/sec  0.219 ms 2683/187644 (1.4%)

The -i option generates a progress display every second. Evenmore important to VoIP is the jitter value, which in this example is0.219 milliseconds. That's enough to be noticeable; and you'll soundlike you're driving on a bumpy road.

Nextweek we'll look at more ways to figure out what the heck is muckingup your network, and how to use iperf and other tools to debugInternet problems.

Resources

  • Iperf
  • tcpdump

Tutorial courtesy of Enterprise NetworkingPlanet.

1.gemtitle {line-height: 14px;font-family: verdana,arial,helvetica;color: #333333;font-size: 10pt;}#gemhover a {display: block;line-height: 14px;height: 140px;padding: 5px 5px 5px 5px;font-family: verdana,arial,helvetica;border: 1px solid #303030;background-color: #FFFFCC;color: #333333;font-size: 8pt;}#gemhover a:link, #gemhover a:visited {color: #333333;text-decoration: none;}#gemhover a:hover, #gemhover a:active {background-color: #FFFF99;color: #333333;text-decoration: none;border: 1px dashed #303030;}#gemhover img { margin-right:5px; }An SMB's Guide to the World of Storage Technology
Sponsored by Synology

The world of data storage can be intimidating to small businesses, butthis Internet.com eBook can help you make informed decisions about yourstorage needs.


Networking Solutions






Free Newsletters:


Most Popular Stories

  • Today
  • Windows
  • Linux&Unix
  • 1 Join Samba 3 to Your Active Directory Domain
  • 2 Understand IPv6 Addresses
  • 3 Squeeze Your Gigabit NIC for Top Performance
  • 4 Networking 101: Understanding Spanning Tree
  • 5 Push Windows Printer Drivers with CUPS
  • 1 Push Windows Printer Drivers with CUPS
  • 2 Installing Exchange 2010 Step-by-Step
  • 3 Use Samba With Windows 7 Clients
  • 4 Configure Microsoft's RemoteApp for Terminal Services
  • 5 Robocopy Polices Windows File Permissions
  • 1 Understanding NIC Bonding with Linux
  • 2 Share iSCSI Volumes With Linux Clients via ZFS
  • 3 Is Sticking With Solaris a Wise Choice?
  • 4 Join Samba 3 to Your Active Directory Domain
  • 5 Provide Robust Clustered Storage with Linux and GFS

Partners















More Networking

  • EnterpriseNetworkingPlanet
  • InstantMessagingPlanet
  • EnterpriseStorageForum
  • PracticallyNetworked
  • Networking Glossary


Key IT Solutions

  • Intel Resource Center
  • Microsoft Windows Server 2008 R2 Index
  • Microsoft | Unified Communications
  • Google Cloud Computing Resource Center
  • Microsoft SQL Server 2008 Index
@charset "UTF-8"; /* CSS Document */ /* JOM CSS */ #jomfooter { border: 0; margin: 5px; padding: 5px; } #jomfooter * { font-family: Arial, Helvetica, sans-serif; padding: 0; margin: 0; } #jomfooter img { border: 0; behavior: url('/icom_includes/footers/css/iepngfix.htc'); padding: 5px; padding: expression('0'); } #jomfooter p { font-size: 11px; line-height: 20px; margin: 10px; } #jomfooter form b { font-size: 12px; } #jomfooter a { text-decoration: underline; } #jomfooter a:hover { text-decoration: none; } #jomfooter table td { border: 0; } /* GEMS Solutions CSS */ #jomfooter #solsect { margin: 0 auto; padding: 10px 0; width: 720px; } #jomfooter #solsect .top { background: url('/icom_includes/footers/soltopbg.gif') repeat-x #bbb; height: 26px; margin-bottom: 1px; } #jomfooter #solsect .top a { font-size: 16px; font-weight: bold; color:#333; text-decoration:none; margin-left: 5px; padding: 0; line-height: 25px; } #jomfooter #solsect .top a:hover { text-decoration: none; } #jomfooter #solsect .solsectpad { background: #fff; } #jomfooter #solsect .solsectpad .main { background:url('/icom_includes/footers/solmidbg.gif') repeat-x #e7e8e3; padding: 5px; margin-bottom: 1px; } #jomfooter #solsect .solsectpad .main h2 { font-size: 12px; color: #000; font-weight: normal; padding-bottom: 3px; } #jomfooter #solsect a { color: #333; font-size: 10px; text-decoration: none; line-height: 13px; } #jomfooter #solsect a:hover { text-decoration: underline; }


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Solutions

Whitepapers and eBooks

Helpful Cloud Computing Resources
Article: Key Cloud Computing Cost Considerations
Article: Microsoft SQL Server 2008 Express--A Free, Powerful Database for Web Development
Article: An Introduction to Hyper-V Virtualization
Protecting Lost or Stolen PCs
Article: Create a Contact List Application with Multi-Touch
PDF: Getting Ahead of Malware
Microsoft PDF: Fact-Based Comparison of Hosted Services: Google vs. Microsoft
MORE WHITEPAPERS, EBOOKS, AND ARTICLES

Webcasts

The Intel PC Total Cost of Ownership Estimator
Video: Disable Lost PCs and Data Remotely
Intel Video: Protecting Lost or Stolen PCs
MORE WEBCASTS, PODCASTS, AND VIDEOS

Downloads and eKits

Download: Windows Azure SDK
60-Day Trial: Microsoft Office Professional Plus 2010
HP PartnerONE | SolutionsINFINITE
MORE DOWNLOADS, EKITS, AND FREE TRIALS

Tutorials and Demos

Guide: Recommendations for Implementing Cloud Security
Article: Explore Application Lifecycle Management Tools in Visual Studio 2010
Internet.com Hot List: Get the Inside Scoop on IT and Developer Products
New Security Solutions Using Intel(R) vPro(TM) Technology
All About Botnets
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES