QoS FUNdamentals

Visibility: Open to anyone

    Hi i am back with a new topic to discuss and it is about QoS/Quality of Service; Which is a topic that you need to master in professional and expert levels no matter which track you take as Collaboration, R&S or Wireless.


    This document gonna explain the basics about QoS:


    So in first place we have to check some basic concepts and one of them it is basically What is QoS ? The answer is simple, QoS it is a set of tools, like a toolbox which gives you the ability to optimize and improve your limitations (In this case WAN Bandwidth).


    Basically the WAN bandwidth is limited and expensive, we have to get the most of it, We must take advantage of it ! So QoS it is like a superhero which comes in rescue of our bandwidth and limitations, but wait... Every superhero has evil villains. And those villains are the followings:


    * Jitter

    * Delay

    * Packet Loss


    But... let's check what do we have in the toolbox:


    * Congestion Management Mechanisms: LLQ, CBWFQ, etc...

    * Congestion Avoidance Mechanisms: WRED

    * Link Efficiency Mechanisms: Policing, Shaping

    * Classification and Marking


    There are 3 methodologies of QoS and they're the followings:


    * Best Effort: Do Nothing !

    * IntServ: Reserves bandwidth per applications or types of traffics, uses RSVP protocol

    * DiffServ: Most used in todays networks, is a modular approach and can be combined with any other mechanisms described before as congestion management, avoidance, etc...


    So In QoS There are some terminlogy and are the followings:


    Behavior Aggregate (BA): A behavior aggregate is basically a collection withe the same DSCP markings or value

    Per Hop Behavior (PHB): A per hop behavior it is the QoS treatment applied to a determined BA

    DSCp: It is referred to a L3 QoS mark

    CoS: L2 QoS mark

    In Diffserv Model there are some PHB's:

    Expedited Forwarding = Think in a fast shipping order via AMAZON, which is prioritized and guaranteed

    Assure Forwarding = Think in a guaranteed AMAZON delivery, but not so prioritized as a fast shipping order

    Class Selector = It is used for backward compatibility with non-diffserv compliant devices

    So but... wait ! in an ip packet we have a field which ToS and that field contains the DSCp value, yeah ! sure, you're right ! but. what identifies those values, when means EF ? when means AF ? when meas CS ? Let's check:

    Basically we use just 6 of the 8 bits related to DSCp, the last two bits are always set to 0


    Screen Shot 2016-10-24 at 1.31.36 PM.png


    As you can see the bits 0-2 identifies the class or the PHB

    The bits 3-4 identifies the Drop Probability

    Bit 5 it is always set to 0

    The highest number if we turn on all the values to 1 is 63


    The expedited forwarding phb is identified because its decimal value is 46, so bits 0,2,3 and 4 are set to 1


    In the AF class there are 4 different phb with different drop probabilities as you can see, AF class is identified for decimal values 1 to 4:


    Screen Shot 2016-10-24 at 1.36.35 PM.png

    What about CS ?


    In CS classes bits 3-5 are always set to 0 as you can see there are 7 different CS Values:


    Screen Shot 2016-10-24 at 1.40.40 PM.png


    Ok... now i know about the different PHB's so... what's next ? you must know which traffic marks and which PHB use


    Screen Shot 2016-10-24 at 1.45.59 PM.png


    Let's check a basic example of a QoS MQC policy configuration:


    access-list 102 permit ip any

    access-list 103 permit ip any


    class-map match-any VIDEO


    match  dscp af41

    match access-group 102

    class-map match-any VOICE


    match  dscp ef

    match access-group 103

    class-map match-any SIGNALING


    match access-group 103

    match  dscp cs3

    match  dscp af31


    policy-map MY_QoS

    class VOICE

      set dscp ef

      priority percent 28

    class SIGNALING

      set dscp cs3

      bandwidth percent 15

      police rate percent 15

      conform-action set-dscp-transmit af21

      exceed-action drop

    class VIDEO

      set dscp af41

      bandwidth percent 20

      police rate percent 20

      conform-action set-dscp-transmit af21

      exceed-action drop

    class class-default

      bandwidth 1000

      shape 1000



    As you can see i have 4 classes and one of them is the default class which englobes any other traffic not classified or marked in any explicit class. Each class has it's bandwidth requirements and percentages, in VOICE class i have dedicated 28% of the link with prioritized, the access list 102 is matching all traffic which is generated from VOICE subnet in this case, the class map is classifying voice traffic as EF and in the policy map we have the keyword priority which means LLQ (i am gonna talk about LLQ in a next post, but basically it gives priority and guaranteed bandwidth to all voice traffic in this example).


    In VIDEO class there is a 20% of the link dedicated, there is no priority, but i has it's guaranteed bandwidth al signaling traffic is matching with dscp cs3 and dscp af31, why two phb's ? in old days Signaling was marked as AF31, on voice gateways and dial-peers it is still marked as AF31, specially in mgcp gateways, it is a good practice to set the signaling on dial-peers as CS3 as the following example:

    dial-peer voice 9809 voip

    description LOCAL CALLS

    translation-profile outgoing SIP

    destination-pattern ^9[2-9]..[2-9]......$

    session protocol sipv2

    session target ipv4:x.x.x.x

    dtmf-relay rtp-nte sip-notify sip-kpml h245-alphanumeric

    ip qos dscp cs3 signaling

    no vad


    In the case of MGCP's Gateways you must mark as the following:

    Router(config)# mgcp ip qos dscp cs3 signaling.

    Remember mgcp gateways do not use dial-peers :p

    There is another interesting thing to see in this class and in the SIGNALING class too ! and it is that the traffic is policed, son when the traffic reaches the limit bandwidth the traffic it is marked down in the case of video from AF41 to AF21, so it is marked as a DATA ! that's means that the video passes to be treated in the default class. but we see another keyword which is exceed action drop which is obvious... if exceeds the amount of bandwidth it's gonna drop it !

    In my next article i am gonna talk more about QoS and Congestion management/Avoidance Mechanisms.

    HTH and Thanks for reading !