了解流量监管整形_第1页
了解流量监管整形_第2页
了解流量监管整形_第3页
了解流量监管整形_第4页
了解流量监管整形_第5页
已阅读5页,还剩21页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

TrafficPolicingandShapingUnderstandingTrafficPolicingandShapingTrafficPolicingandShapingOverviewThesemechanismsmustclassifypacketsbeforepolicingorshapingthetrafficrate.Trafficshapingqueuesexcesspacketstostaywithinthedesiredtrafficrate.Trafficpolicingtypicallydropsormarksexcesstraffictostaywithinatrafficratelimit.TrafficPolicingExampleRate-limitfile-sharingapplicationtrafficto56kbps.Donotrate-limittrafficfrommission-criticalserver.TrafficShapingExampleBothsituationsresultinbufferingandindelayedordroppedpacketsCentraltoremotesitespeedmismatchRemotetocentralsiteoversubscriptionPolicingvs.ShapingingandoutgoingdirectionsOut-of-profilepacketsaredroppedDroppingcausesTCPretransmitsSupportspacketmarkingor

re-markingLessbufferusage(shapingrequiresanadditionalshapingqueuingsystem)OutgoingdirectiononlyOut-of-profilepacketsarequeueduntilabuffergetsfullBufferingminimizesTCPretransmitsMarkingorre-markingnotsupportedShapingsupportsinteractionwithFrameRelaycongestionindicationSingleTokenBucketIfsufficienttokensareavailable(conformaction):Tokensequivalenttothepacketsizeareremovedfromthebucket.Thepacketistransmitted.SingleTokenBucket(Cont.)IfsufficienttokensareNOTavailable(exceedaction):Drop(ormark)thepacketSingleTokenBucketClass-BasedPolicingBcisnormalburstsizeTcisthetimeintervalCIRisthecommittedinformationrateCIR=Bc/Tc

police的token注入方法是:每当police一个数据包,就注入tokenEverytimeapacketispoliced,CBpolicingputs

sometokensbackintotheBucket.Thenumberoftokensplacedinto

注入数量如下:(Current_packet_arrival_time–Previous_packet_arrival_time)*Police_rate/8DualTokenBucket(SingleRate)

Class-BasedPolicingBe:ExcessburstsizeTc:TokensinBcbucketTe:TokensinBebucketThereturnvalueisconformorexceedorviolateDual-RateClass-BasedPolicingTc:TokensinCIRbucketTp:TokensinPIRbucketEnforcetrafficpolicingaccordingtotwoseparaterates:CommittedInformationRatePeakInformationRateDual-RateClass-Based

Policing(Cont.)Two-ratepolicermarkspacketsaseitherconforming,exceeding,orviolatingaspecifiedrate.If(B>Tp),thepacketismarkedasviolatingthespecifiedrate都不减少token数量If(Tp>B>Tc),thepacketismarkedasexceedingthespecifiedrate,andtheTptokenbucketisupdatedas

Tp=Tp–B此时有个问题,下次再来一个数据包,可能Tp<Tc;Ifthepacketismarkedasconformingtothespecifiedrate,andbothtokenbuckets(TcandTp)areupdatedasTp=Tp–BandTc=Tc–B.同时减少token的数量单速率配置方法:以下4个配置命令含义一样police8000010001000policecir8000010001000policecir80000bc1000be1000policerate80000bpsburst1000bytespeak-burst1000bytes双速率配置方法:policy-mapyeslab7classp1policecir8000bc1500pir10000be5000conform-actiontransmitexceed-actionset-prec-transmit1violate-actionset-prec-transmit1

r2#showpolicy-mapinterfaces2/0Serial2/0Service-policyoutput:yeslab7Class-map:p1(match-all)15packets,1052bytes5minuteofferedrate0bps,droprate0bpsMatch:anypolice:

cir8000bps,bc1500bytespir10000bps,be5000bytesconformed1packets,48bytes;actions:transmitexceeded0packets,0bytes;actions:set-prec-transmit1violated0packets,0bytes;actions:set-prec-transmit1conformed0bps,exceed0bps,violate0bpsClass-BasedTrafficShaping每隔Tc,往桶里注入Bc个token,是一次性注入,不是匀速注入。然后shapergateopen,什么时候关闭呢?在桶里没有token的时候就关闭了,然后在下一个Tc开始的时候在打开并一次性注入Bc个token1.发送单个数据包的速率等于link的物理层速率2.通过减少发送时间来降低速率如上图:link速率128K,限制到64k,就只能用一半的时间用来发送数据流,设置TC的值为125ms,因此每次发送数据包的时间就为62.5ms,Bc=62.5ms*128Kbps=8000bit填充token的方法:每125ms的开始就填充Bc个tokenWhenconfiguringshaping,youtypicallyconfiguretheshapingrateandoptionallytheBc(典型假设TC为4ms).Ifyouconfigurebothvalues,IOSchangestheTcsothattheformulaismet配置举例:shapeaveragepercent10

125ms红色为CIR的值,用带宽比例表示紫色为TC的值,单位为ms自动计算出的BC值为:19300Service-policyoutput:yeslabClass-map:p1(match-all)138packets,37338bytes5minuteofferedrate0bps,droprate0bpsMatch:anyQueueingqueuelimit64packets(queuedepth/totaldrops/no-bufferdrops)0/0/0(pktsoutput/bytesoutput)0/0shape(average)cir154400,bc19300,be19300targetshaperate154400无Beshaping配置——1配置举例:shapeaverage1000000

12000红色表示CIR紫色表示BCTC值将会自动计算:12000/1000000=120msService-policyoutput:yeslabClass-map:p1(match-all)298packets,113530bytes5minuteofferedrate0bps,droprate0bpsMatch:anyQueueingqueuelimit64packets(queuedepth/totaldrops/no-bufferdrops)0/0/0(pktsoutput/bytesoutput)160/76614shape(average)cir1000000,bc12000,be12000targetshaperate1000000无Beshaping配置——2对shaping的单桶单速率无BE,桶的大小为BC,如果一个数据包来,token够用,转发,同时减少token相应的数量;如果一个数据包来,token不够,等下一个tc的注入的token。从宏观效果来看,总体速率保持为CIR对shaping的单桶单速率有BE,桶的大小为BE+BC。该类型的shaping增加了对bursty流量的容忍能力,但是从宏观效果来看,总体速率还是保持为CIR有Beshaping配置policy-mapyeslab8classp1shapeaverage1000000120006000r2#showpolicy-mapinters2/0Serial2/0Service-policyoutput:yeslab8Class-map:p1(match-all)38packets,2527bytes5minuteofferedrate0bps,droprate0bpsMatch:anyQueueingqueuelimit64packets(queuedepth/totaldrops/no-bufferdrops)0/0/0(pktsoutput/bytesoutput)38/2588shape(average)cir1000000,bc12000,be6000targetshaperate1000000用peak配置速率policy-mapyeslab8classp1shapepeak1000000120006000However,usingpeakrateshaping,thetrafficsentabovetheCIR(thedelta)couldbedroppedifthenetworkescongested.Ifyournetworkhasadditionalbandwidthavailable(overtheprovisionedCIR)andtheapplicationorclasscantolerateoccasionalpacketloss,thatextrabandwidthcanbeexploitedthroughtheuseofpeakrateshaping.However,theremaybeoccasionalpacketdropswhennetworkcongestionoccurs.IfthetrafficbeingsenttothenetworkmuststrictlyconformtotheconfigurednetworkprovisionedCIR,thenyoushoulduseaveragetrafficshaping.对peakrate的说明CiscoIOSTraffic-PolicingMechanismsCiscoIOSTraffic-ShapingMechanismsApplyingRateLimitingSummaryTrafficshapingandpolicingaremechanismsthatuseclassificationtolimittrafficrate.Trafficshapingqueuesexcesspacketstostaywithinthecontractualrate.Trafficpolicingtypicallydropsexcesstraffictostaywithinthelimit;alternatively,itcanre-mark,thensendexcesstraffic.Bothtrafficpolicingandshapingensurethattrafficdoesnotexceedabandwidthlimit,buttheyhavedifferentimpactsonthetraffic.Trafficrateismeteredusingatokenbucketmathematicalmodel.Withtrafficpolici

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论