Sunteți pe pagina 1din 8

We Provide System Administration and Devops Services Click Here

(/)

SearchArticles...

HOMEPAGE(/)

ABOUTUS(HTTP://SLASHROOT.IN/ABOUTUS)

CONTACTUS(/CONTACT)

ARCHIVE(HTTP://SLASHROOT.IN/ARCHIVE)

ARCHIVES(/TAXONOMY/TERM/2)

SECURITYNOTES(/SECURITYNOTES)

TECHNICALNEWS(/TECHNICALNEWS)

NETWORKING(/NETWORKING)

Home(/)Archives(/taxonomy/term/2)IPERF:Howtotestnetwork
Speed,Performance,Bandwidth

IPERF:Howtotestnetwork
Speed,Performance,Bandwidth

SubmittedbySarathPillaionMon,02/04/201319:59

Tweet

58
Like

57(#)

(#)

Testingnetworkperformanceintermsofspeedandbandwidthis
anorminbothproductionandnonproductionenvironment.
We Provide System Administration and Devops Services Click Here
Adetailedreportofspeedandbandwidthanalysisisverymuch
necessaryforthedeploymentofnetworkdependentapplication
servers.Alsosometimesyouneedtodoublecheckthespeedof
yournetworkthroughputwhiletroubleshooting.Alltheserequires
areliablenetworkperformancetestingtool.Thispostwillbe
concentratingononesuchtoolcalledas"iperf".

IPERFisanopensourcetoolthatcanbeusedtotestnetwork
performance.Iperfismuchmorereliableinitstestresults
comparedtomanyotheronlinenetworkspeedtestproviders.

AnaddedadvantageofusingIPERFfortestingnetwork
performanceisthefactthat,itisveryreliableifyouhavetwo
servers,bothingeographicallydifferentlocations,andyouwant
tomeasurenetworkperformancebetweenthem.

Howtoinstalliperf?
Installingiperfisverymucheasy,ifyouhaveepelyum
repositoryenabled(inredhatsystem's).
1 [root@slashroot1~]#yuminstalliperf ?
2 (#
)
3 ================================================================================
4 PackageArchVersionRepositorySize
5 ================================================================================
6 Installing:
7 iperfi3862.0.51.el5epel52k

Installingiperffromsourceisalsoverymucheasy.Just
downloadtheiperfsourcepackagefromIperfSourcePackage
(http://sourceforge.net/projects/iperf/)

Anddoanormalsourceinstallationstepsasfollows.

1 #tarxvfiperf2.0.5.tar.gz ?
(#

TheabovecommandwillextractthetarpackageYou
downloadedfromtheabovelink.

Nowgetinsidetheextracteddirectoryandrunthebelow
commandtoconfigure,withthedefaultoptions.

1 [root@slashroot2~]#cdiperf2.0.5 ?
2 [root@slashroot2iperf2.0.5]#./configure (#
)

Nowletscompileitwith"make"command,andtheninstallit
using"makeinstall"command.

1 [root@slashroot2iperf2.0.5]#make ?
2 [root@slashroot2iperf2.0.5]#makeinstall (#
)

Howtoinstalliperfinwindowsmachine?
Installingiperfinwindowsisalsoquiteeasy.Letsseehow.
We Provide System Administration and Devops Services Click Here
YoucandownloadiperfforwindowsfromIperfForwindows
(http://iperf.fr/download/iperf_2.0.5/iperf2.0.52win32.zip).Now
unzipthiszipfiletoafoldernamed"iperf"andruntheiperf.exe
insidethatdirectory.

Forexampleihaveextracted,theiperfzipinC:\iperfdirectory,
sowillopentheWindowsCMD,andnavigatetothatdirectory,to
runtheiperf.execommand.
1 C:\>cdC:\iperf ?
2 C:\iperf>iperf.exe (#
)

Howtotestthenetworkspeedbetweenone
windowsmachineandalinuxmachine?
Asitoldbefore,iperfcanbeusedtoperformspeedtestbetween
remotemachine's.Itworksinaclientservermodel.

Theoperatingsystemdoesnotmatter,whileyouare
usingiperf.Thecommandsforusingiperfon
windowsisexactlythesameasinlinux.Andalso
otheroperatingsystem.Normallyinthetest
environment,iperfclientsendsdatatotheserverforthetest.

Beforegoingaheadwiththetest,letsunderstandsome
networkingconceptsrelatedtospeedtest.

NetworkThroughput

Transferrateofdatafromoneplacetoanotherwithrespectto
timeiscalledasthroughput.Throughputisconsideredaquality
measuringmetricforharddisks,networketc.Itsmeasuredin
Kbps(Kilobitspersecond),Mbps(Megabitsper
second),Gbps(Gigabitspersecond.)

TCPWindow

TCP(TransmissionControlProtocol),isareliabletransportlayer
protocolusedfornetworkcommunications.HowTCPworks,is
beyondthescopeofthisarticle.TCPworksonareliable
manner,bysendingmessagesandwaitingforacknowledgement
fromthereceiver.

Whenevertwomachine'sarecommunicatingwitheachother,
theneachofthemwillinformtheother,abouttheamountof
bytesitisreadytoreceiveatonetime.

Inotherwords,themaximumamountofdatathatasendercan
sendtheotherend,withoutanacknowledgementiscalledas
WindowSize.ThisTCPwindowsizeaffectsnetworkthroughput
verybadlysometimes.Letstakeanexample.
We Provide System Administration and Devops Services Click Here
Supposeyouwanttosenda500MBofdatafromonemachine
totheother,withthetcpwindowsizeof64KB.

Whichmeansforsendingthewhole500MBdata,thesending
machinehastowait800timesforanacknowledgementfromthe
receiver.

500MB/64KB=800

Soyoucanclearlyseethat,ifyouincreasetheWindowsizea
littlebittotuneTCP,itcanbringsignificantdifferencetothe
throughputachieved.

Supposeyouhaveawindowsmachineandwanttomeasurethe
speedbetweenitandanotherLinuxmachine,thenyouneedto
makeoneasclient,andanotherastheserver.Letsseehow.

WewillmakeourwindowsmachinetheserverandtheLinux
machineastheclient.
1 C:\iperf>iperf.exes ?
2 (#

)
3 ServerlisteningonTCPport5001
4 TCPwindowsize:64.0KByte(default)
5

Sargumentisusedforspecifyingserver

Theabovecommand,startsiperfserveronthewindows
machine,anditbydefaultrunsontheport5001bydefault.(It
alsoreportsthatthedefaultTCPwindowsizeis64.0KB).

LetstestthethroughputfromtheLinuxclientmachine,asshown
below.

1 [root@slashroot2~]#iperfc192.168.0.101 ?
2 (#

)
3 Clientconnectingto192.168.0.101,TCPport5001
4 TCPwindowsize:16.0KByte(default)
5
6 [3]local192.168.0.102port47326connectedwith192.168.0.101port5001
7 [ID]IntervalTransferBandwidth
8 [3]0.010.0sec308MBytes258Mbits/sec

Fromtheaboveoutput,youcanseethatigotaspeedof
258Mbits/sec.Theouputshowssomethingmore.
We Provide System Administration and Devops Services Click Here

Toshiba49"Class(48.5"
Diag.)LED1080pHDTV...

$24999

Interval:Intervalspecifiesthetimedurationforwhichthedata
istransferred.

Transfer:Alldatatransferredusingiperfisthroughmemory,and
isflushedoutaftercompletingthetest.Sothereisnoneedto
clearthetransferredfileafterthetest.Thiscolumnshowsthe
transferreddatasize.

Bandwidth:Thisshowstherateofspeedwithwhichthedatais
transferred.

Youcanstartyouriperfserveronyourdesiredportwiththe
followingmethod.
1 C:\iperf>iperf.exesp2000 ?
2 (#

)
3 ServerlisteningonTCPport2000
4 TCPwindowsize:64.0KByte(default)
5

Alsoyoucantelltheclienttoconnecttoyourdesiredserverport
andalsotweaksomemoreconnectionandreporting
parameter'sasshownbelow.
1 root@slashroot2~]#iperfc192.168.0.101t20p2000w40k
?
2 (#
)
3
4 Clientconnectingto192.168.0.101,TCPport2000
5 TCPwindowsize:80.0KByte(WARNING:requested40.0KByte)
6
7 [3]local192.168.0.1[02port60961connectedwith192.168.0.101port2000
8 [ID]IntervalTransferBandwidth
9 [3]0.020.0sec1.74GBytes747Mbits/sec

toptionusedintheabovecommandtellstotransferdatafor20
seconds.

pwilltelltheclienttoconnecttheport2000ontheserver

wwillspecifyyourdesiredwindowsizevalue.Asitoldbefore,
windowsizetuningwillimproveTCPtransferratetoacertain
extent.
Andyoucanclearlyseefromtheaboveoutputthatthe
We Provide System Administration and Devops Services Click Here
bandwidthforthewholetransferhasincreased,aswehave
increasedthewindowsize(Iamusingtwovirtualmachine'sin
onephysicalboxforthisiperfdemonstration,whichisthereason
amgettingexceptionaltransferrate's).

Youcanalsotelltheiperfclienttoshowthetransferrateatan
intervalof1second,forthewhole10secondtransfer,asshown
belowwithioption.
1 [root@slashroot2~]#iperfc192.168.0.100P1i1 ?
2 (#

)
3 Clientconnectingto192.168.0.100,TCPport5001
4 TCPwindowsize:16.0KByte(default)
5
6 [3]local192.168.0.102port49597connectedwith192.168.0.100port5001
7 [ID]IntervalTransferBandwidth
8 [3]0.01.0sec28.6MBytes240Mbits/sec
9 [3]1.02.0sec25.9MBytes217Mbits/sec
10 [3]2.03.0sec26.5MBytes222Mbits/sec
11 [3]3.04.0sec26.6MBytes223Mbits/sec
12 [3]4.05.0sec26.0MBytes218Mbits/sec
13 [3]5.06.0sec26.2MBytes220Mbits/sec
14 [3]6.07.0sec26.8MBytes224Mbits/sec
15 [3]7.08.0sec26.0MBytes218Mbits/sec
16 [3]8.09.0sec25.8MBytes216Mbits/sec
17 [3]9.010.0sec26.4MBytes221Mbits/sec
18 [3]0.010.0sec265MBytes222Mbits/sec

UntilnowwehaveonlyseenthethroughputofoneTCP
connection.Becausewhenyouruniperf,bydefaultifonly
createsoneTCPconnectionwiththeremoteserver.

YouMighthavenoticedthatsomeinternet
Downloadmanager'saresofastwhilethey
downloadanycontentfromtheinternet,compared
tothenormaloperatingsystemdownloader.The
mainreasonbehinditisthefactthattheyworkon"ParallelTCP
connections."Onesuchdownloadmanager,thatirememberis
"InternetDownloadManager"
(http://www.internetdownloadmanager.com).

Let'scheckthethroughputreportbyincreasingthenumberof
parallelconnectionsusing"iperf".
1 [root@slashroot2~]#iperfc192.168.0.100P20 ?
2 (#

)
3 Clientconnectingto192.168.0.100,TCPport5001
4 TCPwindowsize:16.0KByte(default)
5
6 [15]local192.168.0.102port57258connectedwith192.168.0.100port5001
7 [3]local192.168.0.102port57246connectedwith192.168.0.100port5001
8 [4]local192.168.0.102port57247connectedwith192.168.0.100port5001
9 [5]local192.168.0.102port57248connectedwith192.168.0.100port5001
10 [7]local192.168.0.102port57250connectedwith192.168.0.100port5001
11 [6]local192.168.0.102port57249connectedwith192.168.0.100port5001
12 [10]local192.168.0.102port57253connectedwith192.168.0.100port5001
13 [8]local192.168.0.102port57251connectedwith192.168.0.100port5001
14 [9]local192.168.0.102port57252connectedwith192.168.0.100port5001
15 [16]local192.168.0.102port57259connectedwith192.168.0.100port5001
16 [19]local192.168.0.102port57261connectedwith192.168.0.100port5001
17 [18]local192.168.0.102port57260connectedwith192.168.0.100port5001
18 [20]local192.168.0.102port57262connectedwith192.168.0.100port5001
19 [17]local192.168.0.102port57263connectedwith192.168.0.100port5001
19 [17]local192.168.0.102port57263connectedwith192.168.0.100port5001
We Provide
20 System Administration and Devops Services
[21]local192.168.0.102port57264connectedwith192.168.0.100port5001
Click Here
21 [11]local192.168.0.102port57254connectedwith192.168.0.100port5001
22 [12]local192.168.0.102port57255connectedwith192.168.0.100port5001
23 [13]local192.168.0.102port57256connectedwith192.168.0.100port5001
24 [14]local192.168.0.102port57257connectedwith192.168.0.100port5001
25 [22]local192.168.0.102port57265connectedwith192.168.0.100port5001
26 [ID]IntervalTransferBandwidth
27 [8]0.010.6sec16.6MBytes13.1Mbits/sec
28 [16]0.010.6sec16.6MBytes13.1Mbits/sec
29 [18]0.010.6sec16.5MBytes13.1Mbits/sec
30 [17]0.010.7sec16.6MBytes13.0Mbits/sec
31 [21]0.010.7sec15.6MBytes12.3Mbits/sec
32 [12]0.010.7sec17.5MBytes13.7Mbits/sec
33 [22]0.010.7sec16.6MBytes13.0Mbits/sec
34 [15]0.010.8sec17.8MBytes13.8Mbits/sec
35 [3]0.010.7sec18.5MBytes14.5Mbits/sec
36 [4]0.010.8sec18.1MBytes14.1Mbits/sec
37 [5]0.010.7sec17.6MBytes13.9Mbits/sec
38 [7]0.010.8sec18.4MBytes14.3Mbits/sec
39 [6]0.010.8sec17.0MBytes13.2Mbits/sec
40 [10]0.010.8sec16.8MBytes13.1Mbits/sec
41 [9]0.010.8sec16.8MBytes13.0Mbits/sec
42 [19]0.010.6sec16.5MBytes13.0Mbits/sec
43 [20]0.010.7sec16.5MBytes12.9Mbits/sec
44 [11]0.010.7sec18.0MBytes14.0Mbits/sec
45 [13]0.010.7sec17.8MBytes13.9Mbits/sec
46 [14]0.010.8sec18.2MBytes14.1Mbits/sec
47 [SUM]0.010.8sec344MBytes266Mbits/sec

Intheaboveshownexampleihavetoldiperfclienttocreate20
parallelTCPconnectionstotheremotehostwhilethedata
transfer.Andifobservetheoutput,youcanseeclearlythat20
differentportsontheclientisconnectedtothedefault5001port
ontheserver.

Andalloftheconnectionshaddifferenttransferrate,andatthe
endwegotacombinedthroughputof266Mbits/s.(Whichismuch
betterthatasingleTCPconnection.)

ConductingaUDPspeedtestiniperf
ConductingaUDPspeedtestusingiperfwillprovideyouwitha
coupleofmoreinformationaboutyournetworkwhichwillbevery
muchusefulinfindingnetworkbottlenecks.

Aswediscussedbefore,notonlyTCPwindowsizebutnetwork
parameter'slikethefollowingalsoaffectsthethroughput
achievedduringaconnectionn.

Outoforderdelivery
NetworkJitter
Packetlossoutoftotalnumberofpackets

Forconductionaniperfudptest,youneedtostarttheserver
withtheuoptionsothattheUDPport5001isopenedonthe
serverside.
1 C:\iperf>iperf.exesu ?
2 (#

)
3 ServerlisteningonUDPport5001
4 Receiving1470bytedatagrams
5 UDPbuffersize:64.0KByte(default)
6
6
We Provide System Administration and Devops Services Click Here
Nowletsstartthedatatransferfromtheclientsidebysending
UDPtraffic.
1 [root@slashroot2~]#iperfc192.168.0.100ub100m ?
2 (#

)
3 Clientconnectingto192.168.0.100,UDPport5001
4 Sending1470bytedatagrams
5 UDPbuffersize:107KByte(default)
6
7 [3]local192.168.0.102port50836connectedwith192.168.0.100port5001
8 [ID]IntervalTransferBandwidth
9 [3]0.010.0sec97.4MBytes81.7Mbits/sec
10 [3]Sent69508datagrams
11 [3]ServerReport:
12 [3]0.010.0sec97.4MBytes81.8Mbits/sec0.167ms49
13 [3]0.010.0sec1datagramsreceivedoutoforder
14 [root@slashroot2~]#

Intheaboveexample,ihaveusedboptiontospecifythe
bandwidthtouse(becausebydefaultiperfUDPonlyused
1Mbps,iwillrecommendusingyourfullavailablebandwidthto
getanidea)

uoptionsneedstobealsousedontheclientsideforspecifying
UDPtraffic.

Theouputtellsusthefollowinginformation.

Bandwidth=81.7Mbits/sec

Networkjitter=0.167ms(networkjitteristhedeviationintime
forperiodicarrivalofdatagram's.Ifyouaredoingthetestwith
server'sontheothersideoftheglobe,thenyoumightsee
higherjittervaluesiniperfoutput.)

OutofOrder=1datagram

Lost/Total=49/69508

0.07percentdatagramlossisnotatallsignificant,infactyoucan
saythatyougotanicenetworkpacketlossratio.

VOIPrequire'saverylessdatagramlossbecauseitsvoice
communication.Ahighdatagramlosscandropthecall
altogether.SoUDPtestingwithiperfwillbeverymuchhelpfulif
youhaveVOIPorothersuchcriticalapplicationsonyour
infrastructure.

Youcangetalltheoption'srelatedtoiperfwiththefollowing
command.

[root@slashroot2~]#iperfhelp

Ratethisarticle:
Average:4.9(87votes)

16Comments Sortby Oldest

S-ar putea să vă placă și