Networks Horizon

share

Thursday 26 April 2012


Quality of Service (QoS)-Part10
Implementing QoS on switches


Why do we require QoS in LAN where we have lots of bandwidth already available.


Reason 1: Allows traffic to be classified and marked as closed to the source as possible. It is Cisco's best strategy.
Reason 2: QoS on catalyst switches has to be really fast. Unlike router, QoS queuing is performed on hardware in switches due to its architecture. This is the reason, it is recommended to run applications like NBAR inside switches. This will save lots of processing on router as they will only need to treat pre-tagged packets.

Although it is much faster to run QoS inside switch, the major drawback is that all of the QoS is integrated into switch ASIC. ASIC is switching engine in the hardware. So every-catalyst switch is different in sesnse that every -catalyst has different hardware/engine.

Reason3: Policing can be performed to the source as possible. We can police per port and per vlan.

Switching Capabilities for QoS

  1. Queues (Priority or Standard)
  2. Threshold: Dropping method (Tail Drop, WRED)

For example:

  • 2Q2T=Can have 2 standard queues and 2 Threshold per queue
  • 1P2Q2T= one priority queue/2 standard queue and 2 Threshold per queue

Queues configuration methods:

  1. Priority Queuing-True Priority
  2. Weighted Round Robin (WRR)-Custom Queuing
  3. WRR with Priority Queue-PQ+CQ  ( this is LLQ for switches)


In CAT2950 switches queue number 4 is a priority queue by default

for example: 1PQ+3CQ

queues   1     2    3    4
packets  100   20  50    0

for example: 4CQ (WRR)

queues   1     2    3    4
packets  100   20  40    10

Threshold

Some of the switch model do not have threshold defined but there are some with below application:

  1. Tail Drop (If one threshold is defined)
  2. WRED (if 2 Threshold are available)

How to enable QoS on a switch:

Command:

switch(config)#mls qos

Once this command is applied another command is automatically added into configuration:

switch(config)#mls qos map cos-dscp 0 8 16 26 32 46 48 56

This means when we are getting CoS marking, it is automatically converting them into corrosponding DSCP values. For example, CoS value 2 is matching DSCP value of 16. Similarly CoS value 7 is matching DSCP value of 56.

Other commands:

switch(config)#mls qos map ?
       cos-dscp
       dscp-cos
       ip-prec-dscp
       more..

For example::

switch(config)#mls qos map dscp-cos <cos> <cos> <cos>.. to <dscp_value>
switch(config)#mls qos map dscp-cos 4 5 6 7 to 1

Marking when Connected device is a IP phone

switch(config)# int fa0/1
switch(config-if)#mls qos trust device cisco-phone

Above command will detect a connected cisco-phone through CDP and trust its marking . By default cisco-phone packet will have the marking of IP PREC 3. If any other device is connected, switch will mark the traffic with CoS value of ZERO.As alrady discussed CDP should be enabled on switch to detect the cisco phone.

If you are not using cisco-phone and using any other IP phone, you can simple put below command to trust all IP for of IP PRECEDENCE value.

switch(config-if)#mls qos trust ip-precedence


Queuing (Generally we have 4 queues)

Starting Weighted Round Robin
switch(config-if)# wrr-queue cos-map 1 0 1 2
switch(config-if)# wrr-queue cos-map 2 3 4
switch(config-if)# wrr-queue cos-map 3 6 7
switch(config-if)# wrr-queue cos-map 4 5


Assigning Bandwidth (In Relative values)

switch(config-if)# wrr-queue bandwidh 4 5 10 1

Above command means how much weight(stuff), we will grab from each queue on round robin basis.
Means fourth queue has been assigned with 50% of bandwidth.

In CAT 2950, there is fourth queue is priority queue by default so configuration should be like this:

switch(config-if)# wrr-queue bandwidh 4 5 10 0

First three queue will work in Weighted round robin and fourth queue bandwidth will be ZERO and traffic will get the priority always.

In CAT 3550, ASIC behaviour is different as discussed, so there is no need to put ZERO when priority queue is defined, an additional command is needed as below..

switch(config-if)# wrr-queue bandwidh 4 5 10 1
switch(config-if)# priority-queue out

In above case fourth queue bandwidth value will be ignored. and then it will behave like CAT 2950.

Other scenarios

If it is rquired to hardcoded on a switch port that everything we receive on that port should have CoS value of 2.

switch(config-if)# mls qos cos 2




No comments:

Post a Comment