Thursday, February 16, 2012

QOS WRED

WRED

  • Conjestion Avoidance tool
  • Drops packets randomly before que is full
  • prevents tcp synchronisation (dropping window size retrainsmitting and all host get in synch retrainsmitting)
  • Drops packets on marked probability
  • Typically levels are based on dscp or ip prec
  • Non ip traffic is treated as precendence 0 non ip traffic will be dropped more often than ip traffic
  • You can not configure wred on subinterfaces
  • Wred is not supported with ATM
  • CEF must be enabled to use wred
  • min threshold is the point we will start dropping we do this based on value less than marked probabilty
  • the closer we get to the max threshold we will increasingly drop getting closer to the mark probability we will be at the marked probabilty at the max threshold
  • default is 1 out of 10 packets
  • IF we go beyond max threshold we are into using tail drop
  • This gives us better control on what is dropped precedence would have lower min and max threshold then precendence 3 so if we run into conjestion precedence 1 traffic will be radomly dropped first
  • WRED tracks average que depth  smoothened based on weight factor (usually ip prec or dscp)
avg = (old-avg*(1-1/2^n) + (q-size x 1/2^n)

Commands

random-detect dscp-based- specify random detect based on dscp values
random-detect dscp-based cs1 3 10 10- specfying max and min threshold for dscp value so min is 3 max is 10 and max probabilty is 1 out of 10 packets.
sh policy-map int-view stats in relation to random detect

ECN
  • THis is extension wred which allow the router mark packets signalling to the reciever that there is conjecstion  rather than dropping on recieving these marked packets when they get to reciever marked the reciever will slow down the transmission rate.
  • The end host like pc needs to be ecn capable
Commands

random-detect ecn

LAB


We will have a little scenrio here with WRED that HTTP traffic is to be given top priority
DNS have wred profile of 3 10 10 so at 3 packets it will start randomly dropping as it move
closer to 10
ok so first things first we need to classify the traffic as it comes in and mark
then outgoing we will run wred


So i created a class map to match the 2 protocols
r5(config)#class-map MATCHHTTP
r5(config-cmap)#match protocol http
r5(config-cmap)#exit
r5(config)#class-map MATCHDNS
r5(config-cmap)#match protocol dns
r5(config-cmap)#exit

Then a policy-map to set dscp value so http gets expedited which is the highest priority
and dns is getting cs1 which is similar to precendence 1 so not much priority

r5(config)#policy-map MATCH
r5(config-pmap)#class MATCHHTTP
r5(config-pmap-c)#set ip dscp ef
r5(config-pmap-c)#exit
r5(config-pmap)#class MATCHDNS
r5(config-pmap-c)#set ip dscp ?
  <0-63>   Differentiated services codepoint value
  af11     Match packets with AF11 dscp (001010)
  af12     Match packets with AF12 dscp (001100)
  af13     Match packets with AF13 dscp (001110)
  af21     Match packets with AF21 dscp (010010)
  af22     Match packets with AF22 dscp (010100)
  af23     Match packets with AF23 dscp (010110)
  af31     Match packets with AF31 dscp (011010)
  af32     Match packets with AF32 dscp (011100)
  af33     Match packets with AF33 dscp (011110)
  af41     Match packets with AF41 dscp (100010)
  af42     Match packets with AF42 dscp (100100)
  af43     Match packets with AF43 dscp (100110)
  cs1      Match packets with CS1(precedence 1) dscp (001000)
  cs2      Match packets with CS2(precedence 2) dscp (010000)
  cs3      Match packets with CS3(precedence 3) dscp (011000)
  cs4      Match packets with CS4(precedence 4) dscp (100000)
  cs5      Match packets with CS5(precedence 5) dscp (101000)
  cs6      Match packets with CS6(precedence 6) dscp (110000)
  cs7      Match packets with CS7(precedence 7) dscp (111000)
  default  Match packets with default dscp (000000)
  ef       Match packets with EF dscp (101110)
  <cr>
r5(config-pmap-c)#set ip dscp cs1
r5(config-pmap-c)#


This will be applied inbound on the incoming interface from the traffic source R4

r5(config)#int s0/1/0
r5(config-if)#service-policy input MATCH
r5(config-if)#

Now we configure the queing methods and wred first we need to match the dscp values assigned

r5(config)#class-map HTTP
r5(config-cmap)#match ip dscp ef

r5(config)#class-map DNS
r5(config-cmap)#match ip dscp CS1


r5(config-pmap)#class HTTP
r5(config-pmap-c)#priority percent 98
r5(config-pmap-c)#random-detect dscp-based
Must deconfigure priority in this class before issuing this command
r5(config-pmap-c)#

it will not allow us configure wred on the priority que
NOw we create a class for DNS
r5(config-pmap)#class DNS
r5(config-pmap-c)#bandwidth percent 1
r5(config-pmap-c)#random-detect dscp-based
r5(config-pmap-c)#random-detect dscp cs1 3 10 10

r5(config)#int fa0/0
r5(config-if)#service-policy output RANDOM

r5#
*Feb 16 23:48:19.439: %SYS-5-CONFIG_I: Configured from console by console
r5#sh policy-map int
 FastEthernet0/0
  Service-policy output: RANDOM
    Class-map: HTTP (match-all)
      30 packets, 1728 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: ip dscp ef (46)
      Queueing
        Strict Priority
        Output Queue: Conversation 264
        Bandwidth 98 (%)
        Bandwidth 98000 (kbps) Burst 2450000 (Bytes)
        (pkts matched/bytes matched) 0/0
        (total drops/bytes drops) 0/0
    Class-map: DNS (match-all)
      40 packets, 2920 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: ip dscp cs1 (8)
      Queueing
        Output Queue: Conversation 265
        Bandwidth remaining 1 (%)
        (pkts matched/bytes matched) 0/0
        (depth/total drops/no-buffer drops) 0/0/0
         exponential weight: 9
         mean queue depth: 0
   dscp    Transmitted      Random drop      Tail drop    Minimum Maximum  Mark
           pkts/bytes       pkts/bytes       pkts/bytes    thresh  thresh  prob
   af11       0/0               0/0              0/0           32      40  1/10
   af12       0/0               0/0              0/0           28      40  1/10
   af13       0/0               0/0              0/0           24      40  1/10
   af21       0/0               0/0              0/0           32      40  1/10
   af22       0/0               0/0              0/0           28      40  1/10
   af23       0/0               0/0              0/0           24      40  1/10
   af31       0/0               0/0              0/0           32      40  1/10
   af32       0/0               0/0              0/0           28      40  1/10
   af33       0/0               0/0              0/0           24      40  1/10
   af41       0/0               0/0              0/0           32      40  1/10
   af42       0/0               0/0              0/0           28      40  1/10
   af43       0/0               0/0              0/0           24      40  1/10
    cs1       5/365             0/0              0/0            3      10  1/10
    cs2       0/0               0/0              0/0           24      40  1/10
    cs3       0/0               0/0              0/0           26      40  1/10
    cs4       0/0               0/0              0/0           28      40  1/10
    cs5       0/0               0/0              0/0           30      40  1/10
    cs6       0/0               0/0              0/0           32      40  1/10
    cs7       0/0               0/0              0/0           34      40  1/10
     ef       0/0               0/0              0/0           36      40  1/10
   rsvp       0/0               0/0              0/0           36      40  1/10
default       0/0               0/0              0/0           20      40  1/10

we can see all the stats so we are cs1 there is no conjestion so there is no dropping at the
moment

No comments:

Post a Comment