[转载]Yeslab安德CCIE技术文档QoS之CBLLQ

顶!

一、理论支持

LLQ(Low-latency Queuing)队列适合于时延敏感的流量。CBWFQ却不适合,因为WFQ是公平的,对时延敏感的流量(语音流量和多媒体流量)得不到优先的调度,LLQ既保证了最小带宽也保证了低时延。
CBLLQ=CBWFQ+PQ,对自定义的属于PQ的流量优先调度,但又不会像PQ一样无限制的调度下去,因为我们设置了带宽值,如果超过了保证带宽就会有带宽监管(police);对低优先级的类,采用CBWFQ的调度;默认的类(class default)调度机制为WFQ或者FIFO(可配置)。

二、拓扑描述

如图所示,已经配置了串行链路的直连
拓扑描述图

三、实验步骤

1、我们采用MQC的方式配置基本的CB-LLQ
R1(config)#ip access-list extended TELNET
R1(config-ext-nacl)#permit tcp host 12.1.1.1 host 12.1.1.2 eq 23---定义一个精确的telnet流量

 
R1(config)#class-map TELNET
R1(config-cmap)#match access-group name TELNET 
R1(config)#policy-map TELNET
R1(config-pmap-c)#priority ?---定义LLQ,关键字为priority(CBWFQ为bandwidth),有两种指定带宽方式:绝对带宽和百分比
  <8-2000000>  Kilo Bits per second
  percent      % of total bandwidth 
R1(config-pmap-c)#priority 8---注意这里的带宽单位是K 
R1(config)#int s1/0
R1(config-if)#service-policy output TELNET---只能应用在出接口方向 
我们来做验证:
R1#telnet 12.1.1.2---已经telnet成功
Trying 12.1.1.2 ... Open 
User Access Verification 
Password:
R2>exit 
[Connection to 12.1.1.2 closed by foreign host]
R1#sh access-lists ---已经有包做了匹配
Extended IP access list TELNET
    10 permit tcp host 12.1.1.1 host 12.1.1.2 eq telnet (26 matches) 
R1#sh policy-map 
  Policy Map TELNET
    Class TELNET
      Strict Priority
      Bandwidth 8 (kbps) Burst 200 (Bytes) 
R1#sh policy-map interface s1/0
 Serial1/0 
  Service-policy output: TELNET 
    Class-map: TELNET (match-all)
      26 packets, 1197 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: access-group name TELNET
      Queueing
        Strict Priority---队列机制为CBLLQ
        Output Queue: Conversation 264
        Bandwidth 8 (kbps) Burst 200 (Bytes)
        (pkts matched/bytes matched) 26/1197
        (total drops/bytes drops) 2/100 
    Class-map: class-default (match-any)
      5 packets, 401 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any 
再来查看可用接口极其带宽情况:
R1#sh int s1/0
Serial1/0 is up, line protocol is up
  Hardware is M4T
  Internet address is 12.1.1.1/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, crc 16, loopback not set
  Keepalive set (10 sec)
  Restart-Delay is 0 secs
  Last input 00:00:03, output 00:00:04, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 2
  Queueing strategy: Class-based queueing---这里显示CB queueing,但是没有具体队列,可以用上一条验证命令R1#sh policy-map interface s1/0查看
  Output queue: 0/1000/64/2 (size/max total/threshold/drops)
     Conversations  0/1/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1150 kilobits/sec---可用带宽为1150kbps,我们来计算一下,总带宽为1504,默认只有75%可用1504*0.75-8=1158-8-1150

2、用另一种配置百分比的情况验证

R1(config)#policy-map TELNET          
R1(config-pmap)#class TELNET               
R1(config-pmap-c)#no priority 8              
R1(config-pmap-c)#priority percent ?
  <1-100>  percentage 
R1(config-pmap-c)#priority percent 10 
R1#sh policy-map interface 
 Serial1/0 
  Service-policy output: TELNET 
    Class-map: TELNET (match-all)
      28 packets, 1285 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: access-group name TELNET
      Queueing
        Strict Priority
        Output Queue: Conversation 264
        Bandwidth 10 (%)
        Bandwidth 154 (kbps) Burst 3850 (Bytes)---这里的10%取整是154kbps
        (pkts matched/bytes matched) 0/0
        (total drops/bytes drops) 0/0 
    Class-map: class-default (match-any)
      115 packets, 7537 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any
R1#sh int s1/0             
Serial1/0 is up, line protocol is up
  Hardware is M4T
  Internet address is 12.1.1.1/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, crc 16, loopback not set
  Keepalive set (10 sec)
  Restart-Delay is 0 secs
  Last input 00:00:00, output 00:00:01, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 2
  Queueing strategy: Class-based queueing
  Output queue: 0/1000/64/2 (size/max total/threshold/drops)
     Conversations  0/1/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1004 kilobits/sec---可用带宽1158-154=1005kbps
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     2701 packets input, 173167 bytes, 0 no buffer
     Received 2672 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     2717 packets output, 174260 bytes, 0 underruns
     0 output errors, 0 collisions, 14 interface resets
     0 output buffer failures, 0 output buffers swapped out
     15 carrier transitions     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up 
 
实验完成
欢迎大家继续关注Ender的文档以及更多视频
原文地址:https://www.cnblogs.com/4geek/p/12685525.html