QOS 之 queueing

1、FIFO QUEUE
2、WFQ QUEUE
3、PRIORITY QUEUE
4、CUSTOM QUEUE
5、CLASS BASED WEIGHTED FAIR QUEUE
6.   Low latency queuing(LLQ)
7.  CLASS BASED   Low latency queuing
默認情況下<=E1的線路默認啓用的就是WFQ,E1=2.048M,大於E1默認就是FIFO。
 
分類:WFO加權隊列,是基於flow的形式默認分類的,不需要人工干預。默認的是WFO丟棄不是尾丟棄,我們要明白兩個概念 class and flow class 手工定義classification  making像PQ CQ, 而flow基於sou ip  des ip tcp/udp port transport protocol TOS.默認是256個flow。
明白這兩個概念:congestive discard threshold (CDT)
                                  Hold-Queue Out limit (HQL)
加隊:early droping when the congestive discard thresold (CDT)is reached
aggressive droping when the hold-queue out limit (HQO)is reached
也就是說有個一個數據包進入緩存經過flow進入也一個隊列,包的個數大於CDT,如果這個隊列已滿,直接drop,沒有滿insert,包的個數大於HQL,隊列已滿 drop 不是最長隊列的包,會aggerssive drop 最長隊列的那個包,這個數據包insert
調度:finish time=real packet size/(ip precedent+1) FT最小的先發送
看個例子:

A1 的FT=50 A2=60 B1=100 B2=150
所以順序是 A1  A2  B1  B2
其實making優先級是沒有作用,關鍵我們要看action 在低速鏈路上我們默認的隊列機制是WFQ 所以語音的ip pre5 有高的優先級,看以先走
 
R2#show int s1/0
Serial1/0 is up, line protocol is up
  Hardware is M4T
  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:50, output 00:00:02, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: weighted fair       默認的WFQ
  Output queue: 0/1000/64/0 (size/max total/threshold/drops) 64 CDT  HQL 1000 
     Conversations  0/1/256 (active/max active/max total)   總共flow的個數
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1158 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     1 packets input, 332 bytes, 0 no buffer
     Received 1 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     3 packets output, 646 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 output buffer failures, 0 output buffers swapped out
     2 carrier transitions     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up
 
R2(config-if)#fair-queue 128 1024  37 (CDT  動態Q   RSVP )
                                      64   256   0  (默認)
R2(config-if)#hold-queue 2000 out    HQO
R2#show queueing fair
Current fair queue configuration:
  Interface           Discard    Dynamic  Reserved  Link    Priority
                      threshold  queues   queues    queues  queues
  Serial1/0           128        1024     37        8       1   
  Serial1/1           64         256      0         8       1   
  Serial1/2           64         256      0         8       1   
  Serial1/3           64         256      0         8       1  
PQ:介紹
priority queueing 默認有四個優先級,默認的是尾丟棄,高優先級的先出去,等優先級高的隊列發出去完了在發送下面的隊列,這個不足容易造成低優先級的隊列餓死!
Router(config)#priority-list 2 ?
  default      Set priority queue for unspecified datagrams
  interface    Establish priorities for packets from a named interface  基於接口(入口)
  protocol     priority queueing by protocol                    基於協議
  queue-limit  Set queue limits for priority queues   限制優先級隊列的大小
1\HIGH
2\MEDIUM
3\NORMAL
4\LOW
access-list 110 permit gre any any
access-list 110 permit ip any host 192.168.1.100
priority-list 1 protocol ip high list 110
priority-list 1 protocol ip medium tcp smtp
priority-list 1 protocol ip normal udp ntp
priority-list 1 protocol ip low tcp www
priority-list 1 queue-limit 40 20 20 20    (20 40 60 80默認)
interface Serial1/0
  priority-group 1
Router#show queueing priority
Current DLCI priority queue configuration:
Current priority queue configuration:
List   Queue  Args
1      high   protocol ip          list 110
1      medium protocol ip          tcp port smtp
1      normal protocol ip          udp port ntp
1      low    protocol ip          tcp port www
1      high   limit 40
1      medium limit 20
1      normal limit 20
1      low    limit 20
Router#show int s1/0
Serial1/0 is up, line protocol is up 
  
 Queueing strategy: priority-list 1
  Output queue (queue priority: size/max/drops):
     high: 0/40/0, medium: 0/20/0, normal: 0/20/0, low: 0/20/0
CQ 介紹:尾丟棄 調度輪詢調度 17個class
R2(config)#queue-list 1 ?
  default        Set custom queue for unspecified datagrams
  interface      Establish priorities for packets from a named interface   基於接口
  lowest-custom  Set lowest number of queue to be treated as custom  默認0是先執行 我們在這可以設置
  protocol       priority queueing by protocol                                    基於協議
  queue          Configure parameters for a particular queue     對queue配置響應的參數
   stun           Establish priorities for stun packets 

 
access-list 110 permit gre any any
access-list 110 permit ip any any precedence critical
queue-list 1 interface Ethernet0/0 2
queue-list 1 protocol ip 3 tcp www
queue-list 1 protocol ip 3 list 110
queue-list 1 queue 2 limit 3000
queue-list 1 queue 3 limit 3000
 
interface Serial1/0
 no ip address
 serial restart-delay 0
 custom-queue-list 1
R2#show queueing custom
Current custom queue configuration:
List   Queue  Args
1      2      interface Ethernet0/0        
1      3      protocol ip          tcp port www
1      3      protocol ip          list 110
1      2      limit 3000
1      3      limit 3000

R2(config)#queue-list 1 lowest-custom 2   隊列0 1 是優先級最高的相當於PQ+CQ
LLQ 介紹 :對語音流量設置優先 相當於PQ+WFQ
在WFQ的基礎之上設置
 
this is used for links with speed less than 1.544Mbps(T1)
R1(config)#int s1/0
R1(config-if)#ip rtp
R1(config-if)#ip rtp pr
R1(config-if)#ip rtp priority ?
  <2000-65535>  Lower bound of UDP destination port
R1(config-if)#ip rtp priority 16384 16383  ?

R1(config-if)#ip rtp priority 16384 16383 ?
  <0-2000>  Maximum allowed bandwidth in kbps
R1(config-if)#ip rtp priority 16384 16383 100(爲語音預留的帶寬)
 
CLASS BASED WEIGHTED FAIR QUEUE介紹:
 
 64+1(default)  手工分類+制定帶寬    尾丟棄   輪詢轉發
bandwidth 
bandwidth percent  總帶寬的百分比
bandwidth remaining percent  實際可用的帶寬百分比(總帶寬的百分比*0.75*Y%)
bandwith(av)=bandwith(total)*0.75—MWrtp
 
class-map match-all VTOP  
 match ip rtp 16384 16383
用NBAR抓的流量 用NBAR抓流量是比較簡單的,可以根據特定的協議去抓
我們還可以用ACL抓流量
(access-list 110 permit ip any any precedence 5
class-map match-all VTOP
match access-group 110)
class-map match-all WWW
 match protocol http

policy-map CBWFQ
 class VTOP
  bandwidth percent 50
 class WWW
  bandwidth percent 20
 class class-default
  bandwidth percent 30
interface Serial1/0
 R2(config-if)#max-reserved-bandwidth 100
no ip address
 serial restart-delay 0
 max-reserved-bandwidth 100
 service-policy output CBWFQ
 hold-queue 2000 out
我們還可以在默認的定義爲WFQ
 
class class-default
fair-queue
LLQ
 
low-latency queueing 低延遲隊列 相當於WFQ+PQ 首先接口隊列要是WFQ
R1(config)#int s1/0
R1(config-if)#ip rtp
R1(config-if)#ip rtp pr
R1(config-if)#ip rtp priority ?
  <2000-65535>  Lower bound of UDP destination port
R1(config-if)#ip rtp priority 16384 16383  ?

R1(config-if)#ip rtp priority 16384 16383 ?
  <0-2000>  Maximum allowed bandwidth in kbps
R1(config-if)#ip rtp priority 16384 16383 100(爲語音預留的帶寬)
max-reserved-bandwith percent(%)
實際帶寬=全部帶寬*75%-帶寬RTP(爲語音預留的帶寬)
 
CBLLQ 可以設置PQ讓其優先 有PQ你就先走
 
policy-map CBWFQ
class VTOP
 priority  percent 50  強制優先
 
 
 
 
 
 
 
 
 
 

 

 
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章