HTB(8) Linux HTB(8) NAME HTB−HierarchyTokenBucket SYNOPSIS tcqdisc...devdev(parentclassid|root)[handlemajor:]htb[defaultminor-id] tcclass...devdevparentmajor:[minor][classidmajor:minor]htbraterate[ceilrate] burstbytes[cburstbytes][priopriority] DESCRIPTION HTBismeantasamoreunderstandableandintuitivereplacementfortheCBQqdiscinLinux. BothCBQandHTBhelpyoutocontroltheuseoftheoutboundbandwidthonagivenlink.Both allowyoutouseonephysicallinktosimulateseveralslowerlinksandtosenddifferentkindsof trafficondifferentsimulatedlinks.Inbothcases,youhavetospecifyhowtodividethephysical linkintosimulatedlinksandhowtodecidewhichsimulatedlinktouseforagivenpackettobe sent. UnlikeCBQ,HTBshapestrafficbasedontheTokenBucketFilteralgorithmwhichdoesnot dependoninterfacecharacteristicsandsodoesnotneedtoknowtheunderlyingbandwidthofthe outgoinginterface. SHAPINGALGORITHM Shapingworksasdocumentedintc-tbf(8). CLASSIFICATION WithintheoneHRBinstancemanyclassesmayexist.Eachoftheseclassescontainsanother qdisc,bydefaulttc-pfifo(8). Whenenqueueingapacket,HTBstartsattherootandusesvariousmethodstodeterminewhich classshouldreceivethedata. Intheabsenceofuncommonconfigurationoptions,theprocessisrathereasy.Ateachnodewe lookforaninstruction,andthengototheclasstheinstructionrefersusto.Iftheclassfoundisa barrenleaf-node(withoutchildren),weenqueuethepacketthere.Ifitisnotyetaleafnode,we dothewholethingoveragainstartingfromthatnode. Thefollowingactionsareperformed,inorderateachnodewevisit,untilonesendsustoanother node,orterminatestheprocess. (i)Consultfiltersattachedtotheclass.Ifsenttoaleafnode,wearedone.Otherwise, restart. (ii)Ifnoneoftheabovereturnedwithaninstruction,enqueueatthisnode. Thisalgorithmmakessurethatapacketalwaysendsupsomewhere,evenwhileyouarebusy buildingyourconfiguration. LINKSHARINGALGORITHM FIXME QDISC TherootofaHTBqdiscclasstreehasthefollowingparameters: iproute2 10January2002 1 HTB(8) Linux HTB(8) parentmajor:minor|root ThismandatoryparameterdeterminestheplaceoftheHTBinstance,eitherattheroot ofaninterfaceorwithinanexistingclass. handlemajor: Likeallotherqdiscs,theHTBcanbeassignedahandle.Shouldconsistonlyofamajor number,followedbyacolon.Optional,butveryusefulifclasseswillbegeneratedwithin thisqdisc. defaultminor-id Unclassifiedtrafficgetssenttotheclasswiththisminor-id. CLASSES Classeshaveahostofparameterstoconfiguretheiroperation. parentmajor:minor Placeofthisclasswithinthehierarchy.Ifattacheddirectlytoaqdiscandnottoanother class,minorcanbeomitted.Mandatory. classidmajor:minor Likeqdiscs,classescanbenamed.Themajornumbermustbeequaltothemajornumber oftheqdisctowhichitbelongs.Optional,butneededifthisclassisgoingtohavechildren. priopriority Intheround-robinprocess,classeswiththelowestpriorityfieldaretriedforpacketsfirst. Mandatory. raterate Maximumratethisclassandallitschildrenareguaranteed.Mandatory. ceilrate Maximumrateatwhichaclasscansend,ifitsparenthasbandwidthtospare.Defaults totheconfiguredrate,whichimpliesnoborrowing burstbytes Amountofbytesthatcanbeburstatceilspeed,inexcessoftheconfiguredrate. Shouldbeatleastashighasthehighestburstofallchildren. cburstbytes Amountofbytesthatcanbeburstat’infinite’speed,inotherwords,asfastastheinterfacecantransmitthem.Forperfecteveningout,shouldbeequaltoatmostoneaverage packet.Shouldbeatleastashighasthehighestcburstofallchildren. NOTES DuetoUnixtimingconstraints,themaximumceilrateisnotinfiniteandmayinfactbequite low.OnIntel,thereare100timereventspersecond,themaximumrateisthatrateatwhich ’burst’bytesaresenteachtimertick.Fromthis,themininumburstsizeforaspecifiedratecan becalculated.Fori386,a10mbitraterequiresa12kilobyteburstas100*12kb*8equals10mbit. SEEALSO tc(8) HTBwebsite:http://luxik.cdi.cz/˜ devik/qos/htb/ iproute2 10January2002 2 HTB(8) Linux HTB(8) AUTHOR MartinDevera<devik@cdi.cz>.Thismanpagemaintainedbyberthubert<ahu@ds9a.nl> iproute2 10January2002 3