hcnp12班qos部分乾颐堂qos7_第1页
hcnp12班qos部分乾颐堂qos7_第2页
hcnp12班qos部分乾颐堂qos7_第3页
hcnp12班qos部分乾颐堂qos7_第4页
hcnp12班qos部分乾颐堂qos7_第5页
免费预览已结束,剩余34页可下载查看

付费下载

下载本文档

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

文档简介

1、Class-based PolicingObjectivesUpon completing this lesson, you will be able to: Describe class-based policingConfigure class-based policingMonitor and troubleshoot class-based policingClass-Based PolicingClass-based policing is used to limit a traffic class to a configured bit rate.It uses a token b

2、ucket model to measure the arrival rate of packets.Class-based policing is an improved version of the committed access rate (CAR) mechanism.Class-based policing is configured using the Modular QoS CLI.How Do Routers Measure Traffic Rate?Routers use the token bucket mathematical model to keep track o

3、f packet arrival rate.The Token Bucket model is used whenever a new packet is processed.The return value is conform or exceed.BandwidthTimeLink BandwidthRate LimitExceeding TrafficConforming Traffic700700Token Bucket500 bytes500 bytesConform Action200Token Bucket (cont.)300 bytesExceed Action300 byt

4、esToken BucketBc is normal burst size (specifies sustained rate).Be is excess burst size (specifies length of burst).BeBc of tokens is added every Tc msTc = Bc / CIRTimeLinkUseTc2*Tc3*Tc4*Tc5*TcBcBcBcBcBcBcLink BWAverage BW(CIR)BeClass-Based PolicingCAR uses one single token bucket to determine if a

5、 packet conforms to or exceeds the bit-rate policy.CAR用单桶来决定报文属于conform或者exceed组Class-based policing uses one or two token buckets to determine if a packet ,CB policing用单桶或者双桶来决定报文属于:Conformsis within the average bit rate平均速率之内的Exceedsexceeds the average bit rate but is within the allowed excess bur

6、st 超出平均速率的但是在过量突发之内的报文Violatesexceeds both the average bit rate and the allowed excess burst (optional)超出conform和execeedClass-Based Policing ActionsA packet can conform, exceed, or violate the rate limit.一个报文可以属于conform、exceed、violate组In response, the policer can take one of these actions流量监管可以有如下行为

7、::TransmitDrop以下为标记Set IP Precedence and transmitSet IP DSCP and transmitSet QoS group and transmitSet MPLS experimental bits and transmitSet Frame Relay DE bit and transmitSet ATM CLP bit and transmitSingle Token Bucket with Class-Based PolicingThe packet conforms to the policy if the size of the p

8、acket is less than or equal to the number of tokens in the token bucket.数据包的字节数小于等于令牌桶中的令牌数,则数据包遵守契约,同时从令牌桶移除相应数目的令牌700Be500 bytesConform Action700Single Token Bucket with Class-Based Policing (cont.)The packet exceeds the policy if the size of the packet is more than the number of tokens in the tok

9、en bucket.数据包中的字节数大于令牌桶中的令牌,超出契约,不移除令牌200Be300 bytesExceed ActionDouble Token Bucket with Class-Based PolicingThe packet conforms to the policy if the size of the packet is less than or equal to the number of tokens in the first token bucket-如果小于等于第一个令牌桶的数量,那么遵循conform策略限速将移除与数据包相同的令牌700400BcBe500 b

10、ytesConform Action700Double Token Bucket with Class-Based Policing (cont.)The packet exceeds the policy if the size of the packet is more than the number of tokens in the first token bucket and less or equal to the number of tokens in the second token bucket-如果到达的报文大小大于第一个令牌桶同时小于等于第二个令牌桶则遵循exceedCB限

11、速将与数据包字节等量的字节移除令牌桶200400BcBe300 bytesExceed Action400Double Token Bucket with Class-Based Policing (cont.)The packet violates the policy if the size of the packet is more than the number of tokens in the first and the second token bucket-到达报文大于等于每个令牌桶的令牌数则为violate不会移除任何的令牌桶200100BcBe400 bytesViolate

12、 ActionRefilling the Token BucketsThe number of tokens that have to be added is actually calculated every time a new packet has to be processed:TB1 = min(BC, TB1 + (Tnow - TLastPacket) * BitRate / 8)TB1TB2Add tokens at the configured bit rateExcess spills over into the second token bucketBcBeTime of

13、 the last packet secondsTime now secondsNew size of the token bucketPrevious size of the token bucket令牌桶的填充和消耗:在数据包到达时填充BC桶填充溢出的令牌不浪费会放入BE通,如果BE桶也填满则移除的令牌无法使用Configuring Class-Based Policingpolice avg-rate BC BE conform-action action exceed-action action violate-action actionRouter(config-pmap-c)#av

14、g-rate traffic rate in bps (8.000 to 200.000.000)BC normal burst sets the size of the first token bucket in bytes (default is 1500 or avg-rate/32, whatever is higher)BE excess burst sets the size of the second token bucket in bytes (equals BC if not configured)action can be:transmit (default conform

15、 action)drop (default exceed and violate action)set-prec-transmit ip-precedenceset-dscp-transmit dscpset-qos-transmit qos-groupset-mpls-exp-transmit mple-expset frde-transmit set-clp-transmitExample 1(单速率单桶) class-map match-all C1 match input-interface Serial1/0!policy-map P1 class C1 police cir 800

16、0 bc 1500 be 1000(可以只配置CIR自行计算Bc和Be) conform-action transmit exceed-action drop(没有配置violate,所以加接口验证时不会显示BE)!sh policy-map Policy Map P1 Class C1 police cir 8000 bc 1500 conform-action transmit exceed-action dropExample 2(双速率双桶)class-map match-all C1 match any !policy-map DualPIR class C1 police cir

17、8000 bc 1000 pir 9000 be 1000 conform-action transmit exceed-action transmit violate-action set-prec-transmit 3!sh policy-map Policy Map DualPIR Class C1 police cir 8000 bc 1000 pir 9000 be 1000 conform-action transmit exceed-action transmit violate-action set-prec-transmit 5验证PIRR1#show policy-map

18、interface Serial1/0 Service-policy input: P1 Class-map: C1 (match-all) 10 packets, 10140 bytes 5 minute offered rate 2000 bps, drop rate 0 bps Match: access-group 100 police: cir 8000 bps, bc 1500 bytes pir 9000 bps, be 1000 bytes conformed 2 packets, 1048 bytes; actions: transmit exceeded 0 packets

19、, 0 bytes; actions: transmit violated 8 packets, 9092 bytes; actions: set-prec-transmit 3 conformed 0 bps, exceed 0 bps, violate 2000 bps双速三色(双速双桶)双速三色(双速双桶)两个加令牌的速率,两个令牌桶,三种状态conform 符合从第一个令牌桶和第二个令牌桶同时取到令牌的exceed 超出从第一个令牌桶取令牌的violate 违规取不到令牌的Two Rate Three Color (2 Bucket) 双速率,三色(两个令牌桶)RFC 26981100

20、700BeBcTB2TB1CIR,根据到达时间和BC按比例填充PIR,更准确说法为根据到达时间和BE按照比例填充溢出的令牌不在使用双速率三色,两个令牌桶。引入峰值速率(PIRCIR)第一个桶是黄色,第二个桶是绿色令牌填充的区别:在需要被限制的数据包到达时,填充两个令牌桶。区别在于PIR是直接填充的无需等待CIR的溢出,无需非活跃期1100600Two Rate Three Color (2 Bucket) 双速率,三色(两个令牌桶)RFC 2698700BeBc500 bytesConform ActionTB1200TB2If the number of bytes in the packe

21、t is less than or equal to (=) the number of tokens in the CIR bucket, the packet conforms. CB Policing removes tokens from the CIR equal to the number of bytes in the packet, and performs the action for packets that conform to the contract. CB Policing also removes the same number of tokens from th

22、e PIR bucket-包的大小小于等于CIR桶中的令牌数称之为conform;CB policing从BC桶移除相应数目的字节数,注意此时也从BE桶移除相应的字节600Two Rate Three Color (2 Bucket) 双速率,三色(两个令牌桶)RFC 2698200BeBc300 bytesExceed Action300TB2TB1If the packet does not conform, and the number of bytes in the packet is less than or equal to (=) the number of tokens in

23、the PIR bucket, the packet exceeds. CB Policing removes tokens from the PIR bucket equal to the number of bytes in the packet, and performs the action for packets that exceed the contract.第一个桶够可以取,第二个桶不够取成为黄色-Exceed(小于BE桶的令牌数),CB policing从PIR桶中移除相应字节的报文Two Rate Three Color (2 Bucket) 双速率,三色(两个令牌桶)RF

24、C 2698300200BeBc400 bytesViolate ActionTB2TB1If the packet neither conforms nor exceeds, it violates the traffic contract. CB Policing does not remove tokens from either bucket, and performs the action for packets that violate the contract.两个桶都不够取称为红色Violate,CB policing不会从任何桶中移除令牌Class-Based Policin

25、g ExampleThe customer can locate a server at service provider premises (switched LAN). Class-based policing is used to limit the amount of traffic that the web server can generate (more flexible per-bandwidth pricing).Unknown traffic is rate-limited to 64 kbps to allow remote configuration of new se

26、rvers.Class-Based Policing Exampleclass-map match source-address mac 000d.dddf.0480!class-map match source-address mac 000d.dddc.ad21!policy-map ServerFarm class police 128000 conform-action transmit exceed-action drop class police 256000 conform-action transmit exceed-action drop class class-defaul

27、t police 64000!interface FastEthernet 0/0 service-policy input ServerFarm!Monitoring and Troubleshooting Class-Based PolicingRouter#show policy interface fastethernet 0/0 FastEthernet0/0 Service-policy input: ServerFarm (1207) Class-map: (match-all) (1209/6) 0 packets, 0 bytes 5 minute offered rate

28、0 bps, drop rate 0 bps Match: ip precedence 4 (1213) Match: source-address mac 000D.DDDF.0480 (1217) police: 128000 bps, 4000 limit, 4000 extended limit conformed 0 packets, 0 bytes; action: transmit exceeded 0 packets, 0 bytes; action: drop conformed 0 bps, exceed 0 bps violate 0 bps . Class-map: c

29、lass-default (match-any) (1229/0) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any (1233) police: 64000 bps, 2000 limit, 2000 extended limit conformed 0 packets, 0 bytes; action: transmit exceeded 0 packets, 0 bytes; action: drop conformed 0 bps, exceed 0 bps violate 0 bps

30、.SummaryUpon completing this lesson, you should be able to:Describe class-based policingConfigure class-based policingMonitor and troubleshoot class-based policingLesson ReviewWhat do CAR and class-based policing do?What are the main differences between CAR and class-based policing?Which marking opt

31、ions does class-based policing support?Which actions does class-based policing support?Class-based ShapingObjectivesUpon completing this lesson, you will be able to: Describe class-based shapingConfigure class-based shapingMonitor and troubleshoot class-based shapingClass-Based ShapingUse of class-b

32、ased shaping is similar to that of class-based policingClass-Based Shaping is used to rate-limit packetsDelays exceeding packets rather than dropping themHas no marking capabilitiesClass-based shaping is a version of generic traffic shaping (GTS) using the Modular QoS CLIClass-Based ShapingClass-Bas

33、ed ShapingRouter periodically updates the token bucket (every TC) and checks if any packets can be forwarded to the main queue.TC = BC / BitRateShaping Queue N TokenBucketEnoughTokens?packetCheck Shaping Queue NForwardYesDo NothingNoPacket SizeTokensQueue NBC+BEAdd TokensRefilling the Token BucketCl

34、ass-based shaping has two shaping methods:Shaping to the configured average rate (adds BC tokens every TC)每Tc时间内放入Bc大小的令牌Shaping to the peak rate (adds BC+BE tokens every TC)Average rate is forwarding packets at the configured average rate with allowed bursting up to BE when there are extra tokens a

35、vailablePeak rate is forwarding packets at the peak rate, which is calculated using this formula,PIR需要计算:PeakRate = AvgRate * (1+BE/BC)Configuring Class-Based Shapingshape average | peak bit-rate BC BERouter(config-pmap-c)#BC and BE can be omitted to let the router select the optimal values.shape ma

36、x-buffers queue-limitRouter(config-pmap-c)#Set the maximum number of packets that can be stored in the shaping queue.shaping Q中最大的包的数量,默认1000Class-Based Shaping Frame Relay Adaptationshape adaptive min-rateRouter(config-pmap-c)#Adapts the shaping rate when BECN bits are receivedEach BECN bit causes the shaping rate to be reduced to three-quarters of the previous rate but not below the min-rateThis command has effect only if used on Frame Relay interfacesshape fecn-ad

温馨提示

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

评论

0/150

提交评论