NETEM(8) Linux NETEM(8) NAME NetEm−NetworkEmulator SYNOPSIS tcqdisc...devDEVICE]addnetemOPTIONS OPTIONS:=[LIMIT][DELAY][LOSS][CORRUPT][DUPLICATION][REORDER-ING][RATE] LIMIT:=limitpackets DELAY:=delayTIME[JITTER[CORRELATION]]] [distribution{uniform|normal|pareto|paretonormal}] LOSS:=loss{randomPERCENT[CORRELATION]| statep13[p31[p32[p23[p14]]]]| gemodelp[r[1-h[1-k]]]}[ecn] CORRUPT:=corruptPERCENT[CORRELATION]] DUPLICATION:=duplicatePERCENT[CORRELATION]] REORDERING:=reorderPERCENT[CORRELATION][gapDISTANCE] RATE:=rateRATE[PACKETOVERHEAD[CELLSIZE[CELLOVERHEAD]]]] DESCRIPTION NetEmisanenhancementoftheLinuxtrafficcontrolfacilitiesthatallowtoadddelay,packet loss,duplicationandmoreothercharacteristicstopacketsoutgoingfromaselectednetworkinterface.NetEmisbuiltusingtheexistingQualityOfService(QOS)andDifferentiatedServices(diffserv)facilitiesintheLinuxkernel. netemOPTIONS netemhasthefollowingoptions: limitpackets limitstheeffectofselectedoptionstotheindicatednumberofnextpackets. delay addsthechosendelaytothepacketsoutgoingtochosennetworkinterface.Theoptionalparametersallowstointroduceadelayvariationandacorrelation.Delayandjittervaluesareexpressed inmswhilecorrelationispercentage. distribution allowtheusertochoosethedelaydistribution.Ifnotspecified,thedefaultdistributionisNormal. Additionalparametersallowtoconsidersituationsinwhichnetworkhasvariabledelaysdepending ontrafficflowsconcurringonthesamepath,thatcausesseveraldelaypeaksandatail. lossrandom addsanindependentlossprobabilitytothepacketsoutgoingfromthechosennetworkinterface.It isalsopossibletoaddacorrelation,butthisoptionisnowdeprecatedduetothenoticedbad behavior. iproute2 25November2011 1 NETEM(8) Linux NETEM(8) lossstate addspacketlossesaccordingtothe4-stateMarkovusingthetransitionprobabilitiesasinput parameters.Theparameterp13ismandatoryandifusedalonecorrespondstotheBernoulli model.Theoptionalparametersallowstoextendthemodelto2-state(p31),3-state(p23and p32)and4-state(p14).State1correspondstogoodreception,State4toindependentlosses, State3toburstlossesandState2togoodreceptionwithinaburst. lossgemodel addspacketlossesaccordingtotheGilbert-Elliotlossmodeloritsspecialcases(Gilbert,Simple GilbertandBernoulli).TousetheBernoullimodel,theonlyneededparameterispwhiletheotherswillbesettothedefaultvaluesr=1-p,1-h=1and1-k=0.TheparametersneededfortheSim-pleGilbertmodelaretwo(pandr),whilethreeparameters(p,r,1-h)areneededfortheGilbert modelandfour(p,r,1-hand1-k)areneededfortheGilbert-Elliotmodel.Asknown,pandrare thetransitionprobabilitiesbetweenthebadandthegoodstates,1-histhelossprobabilityinthe badstateand1-kisthelossprobabilityinthegoodstate. ecn canbeusedoptionallytomarkpacketsinsteadofdroppingthem.Alossmodelhastobeusedfor thistobeenabled. corrupt allowstheemulationofrandomnoiseintroducinganerrorinarandompositionforachosenpercentofpackets.Itisalsopossibletoaddacorrelationthroughtheproperparameter. duplicate usingthisoptionthechosenpercentofpacketsisduplicatedbeforequeuingthem.Itisalsopossibletoaddacorrelationthroughtheproperparameter. reorder tousereordering,adelayoptionmustbespecified.Therearetwowaystousethisoption(assuming’delay10ms’intheoptionslist). reorder25%50%gap5 inthisfirstexample,thefirst4(gap-1)packetsaredelayedby10msandsubsequentpacketsare sentimmediatelywithaprobabilityof0.25(withcorrelationof50%)ordelayedwithaprobabilityof0.75.Afterapacketisreordered,theprocessrestartsi.e.thenext4packetsaredelayedand subsequentpacketsaresentimmediatelyordelayedbasedonreorderingprobability.Tocausea repeatablepatternwhereevery5thpacketisreorderedreliably,areorderprobabilityof100%can beused. reorder25%50% inthissecondexample25%ofpacketsaresentimmediately(withcorrelationof50%)whilethe othersaredelayedby10ms. rate delaypacketsbasedonpacketsizeandisareplacementforTBF.Ratecanbespecifiedincommonunits(e.g.100kbit).OptionalPACKETOVERHEAD(inbytes)specifyanperpacketoverheadandcanbenegative.Apositivevaluecanbeusedtosimulateadditionallinklayerheaders. AnegativevaluecanbeusedtoartificialstriptheEthernetheader(e.g.-14)and/orsimulatea linklayerheadercompressionscheme.Thethirdparameter-anunsignedvalue-specifythecell-size.Cellsizecanbeusedtosimulatelinklayerschemes.ATMforexamplehasanpayloadcellsize of48bytesand5bytepercellheader.Ifapacketis50bytethenATMmustusetwocells:2*48 iproute2 25November2011 2 NETEM(8) Linux NETEM(8) bytespayloadincluding2*5byteheader,thusconsume106byteonthewire.Thelastoptional valueCELLOVERHEADcanbeusedtospecifypercelloverhead-forourATMexample5. CELLOVERHEADcanbenegative,butusenegativevalueswithcaution. Notethatratethrottlingislimitedbyseveralfactors:thekernelclockgranularityavoidaperfect shapingataspecificlevel.Thiswillshowupinanartificialpacketcompression(bursts).Another influencefactorarenetworkadapterbufferswhichcanalsoaddartificialdelay. LIMITATIONS ThemainknownlimitationofNetemarerelatedtotimergranularity,sinceLinuxisnotarealtimeoperatingsystem. EXAMPLES tcqdiscadddeveth0rootnetemrate5kbit201005 delayalloutgoingpacketsondeviceeth0witharateof5kbit,aperpacketoverheadof20 byte,acellsizeof100byteandapercelloverheadof5byte: SOURCES 1.

HemmingerS.,"NetworkEmulationwithNetEm",OpenSourceDevelopmentLab,April 2005(http://devresources.linux-foundation.org/shemminger/netem/LCA2005paper.pdf) 2.

NetempagefromLinuxfoundation,(http://www.linuxfoundation.org/en/Net:Netem) 3.

SalsanoS.,LudoviciF.,OrdineA.,"Definitionofageneralandintuitivelossmodelfor packetnetworksanditsimplementationintheNetemmoduleintheLinuxkernel",available athttp://netgroup.uniroma2.it/NetemCLG SEEALSO tc(8),tc-tbf(8) AUTHOR NetemwaswrittenbyStephenHemmingeratLinuxfoundationandisbasedonNISTnet.This manpagewascreatedbyFabioLudovici<fabio.ludoviciatyahoodotit>andHagenPaulPfeifer <hagen@jauu.net> iproute2 25November2011 3