QOS Notes: Part -1

Chapter-1: QOS Basics

  • 4 traffic character that QOS tool can affect;
    • BW, Delay, Jitter, packet loss
    • BW- number of bits per second
      • CIR – committed information rate
      • Clock rate vs Bandwidth CLI
        • Clock-rate: actual L1 bit rate
        • BW cli – BW value to be used by s/w.
  • QOS tools that affect bandwidth
    • Compression – compress header or payload
    • CAC – call admission control – reduces overall load by rejecting new calls
    • Queuing – By reserving minimum BW for a type of packets
  • Delay- overall delay in network;
    • Delay types;
      • Serialization delay – Fixed – (# bits sent/link speed) – time to place bits on physical medium.
      • Propagation delay – Fixed –Time to take a single bit to traverse physical medium.
      • Queuing delay- Variable-  Time spent in queue waiting for forward
      • Forwarding/processing delay- V- Time from receipt of packet to queued for Tx.
      • Shaping delay-v- Shaping, if configured causes delay
      • Network delay- v – Delay of a network passing through.
      • Compression delay – v- If enabled.
      • Codec delay- Fixed – delay due to codec process ~ 30 ms (including PD)
      • Packetization Delay – data device has to collect before start sending- 20 ms
      • De-Jitter Buffer Delay – Delay playing out voice to listener.- default 40 ms.
    • QOS tools that affect delay;
      • Queuing – separate Q for delay sensitive packets
      • LFI – Link Fragmentation and interleaving – LFI breaks larger packet to smaller one so that D-sensitive packets get a chance to pass via physical medium.
      • Compression – adds processing delay. Reduces serialization delay by reducing number of bits.
      • Traffic shaping – increase delay to avoid packet loss on other end.
  • Jitter – change in delay
    • QOS tools that affect jitter
      • Same tools as for delay.
  • Packet Loss – loss due to queue full.
    • QOS tools that affect packet loss
      • Queuing – increase queue length. But this increases delay also.
      • RED – Random Early Detection – Drops packets randomly so only few TCP window size reduces.
  • One-way delay budget; (ms)
    • 0-150 : acceptable range
    • 0-200: cisco acceptable range
    • 150-400 : Degraded service
    • 400+ : Unacceptable delay

Chapter 2: QOS Tools and Architecture:

  • Architecture:
    • Integrated Services (IntServ)
    • Differentiated Services (DiffServ)
    • Tool types:
      • Flow based QOS tools.
      • Class based QOS tools.
      • Classes of tools;
        • Classification and Marking;
          • Classification – to differentiate one packet from another. Typically using ACL. (‘match’ statement)
          • Marking – adding color to the differentiated packets. Typically using IP precedence or Differentiated Service Code Point-DSCP. ( ‘set’ statement)
          • Tools available:
            • Class-Based marking (CB-marking).
            • Network Based Application Recognition (NBAR)
        • Congestion Management (Queuing);
          • Directing marked packets to specific queues.
          • QOS tools; (Name – # of Qs – Notes)
            • Priority Queuing (PQ) – 4 – serves high priority queue over lower queue.
            • Custom Queuing (CQ) – 16 – serves number of bytes per queue. Round robin per queue.
            • Weighted Fair Queuing (WFQ) – 4096 – Based on flow. Each flow uses different queue. Q with lower volume and high precedence gets more service.
            • Class-Bases WFQ (CBWFQ) – 64 – percentage BW per queue.
            • Low Latency Queuing (LLQ) – N/A – variant of CBWFQ which makes some queue “priority” queues.
            • Modified deficit Round-Robin (MDRR) – 8 – similar to CQ. Exact percentage of BW per queue.
        • Shaping and Policing;
          • Shaping – shape the traffic to a particular link speed. Usually for egress traffic.
          • Policing – Checks the configured incoming rate with actual in-rate of traffic.
          • QOS tools;
            • CB-policing – CEF should be enabled.
            • CB-shaping – CEF should be enabled.
            • FRTS – Frame Relay traffic shaping.
        • Congestion Avoidance;
          • Purposefully drop TCP segments to avoid congestions.
          • Senders will half the window size.
          • QOS tools;
            • Random Early Detection (RED) – not implemented in IOS.
            • Weighted RED  (WRED) – weights based on IP precedence or DSCP. Drop those packets.
            • Explicit Congestion notification (ECN) – weights based on IP precedence or DSCP. Doesn’t drop the packet. Instead signals sender to slow down.
        • Link Efficiency;
          • Compression and Fragmentation- LFI.
          • Compression – payload and header compression.
          • QOS tools:  Many
        • Call Admission Control: (CAC)
          • Protects network from congestion by avoiding new calls (voice/video) than the network can support.
      • Flow based QOS tools;
        • Flows based on particular SRC MAC/IP , DES MAC/IP.
        • Good granularity. But will not scale when the number of flows are huge.
      • Class based QOS tools;
        • Classification based on web traffic. Say des port: 80
      • DiffServ QOS model;
        • Packets will be marked at the ingress of the network and other routers take action based on marked field.
        • Between AS, packets can be re-classified and re-marked.
        • Uses 6 bit DSCP field which allows 64 different classifications.
        • Diffserv terminologies;
          • Behavior aggregate (BA) – Group of packets falls under a single class.
          • MF classifier – Multifield classifier- Which selects packets based content of some IP header fields.
          • Per-Hop Behavior (PHB)
          • DS classifier – Router which classify packets. Used in the ingress boundary node.
        • Uses IP Precedence and DSCP value
        • IP precedence;
          • TOS byte – 8 bits.
          • First 3 bits are IP precedence – Higher the value, more important the traffic.
          • Next 4 bits – TOS fields.
            • Throughput
            • Delay
            • Reliability
            • Cost
          • 7th bit Unused.
        • DS field redefines TOS byte in the IP header.
        • DS field (8 bits)
          • First 6 bits are DSCP
          • Last 2 bits for ECN.
        • DiffServ has to build compatibility with IP precedence and DSCP.
      • Class-Selector PHB and DSCP values
        • DiffServ calls DSCP values used for backward-compatibility with IP precedence as “Class selectors”
        • Table; Name of class selector – Range of DSCP values- IP precedence value
          • CS0(Default) – (0-7) – 0
          • CS1 – (8-15) – 1
          • ..
          • CS7 – (56 -63) – 7
        • DiffServ suggest other 2 set of PHB and DSCP values – Assured Forwarding (AF) and expedited forwarding(EF)
      • Assured forwarding PHB;
        • 4 different queues. One for each class.
        • 3 different congestion thresholds to start dropping packets inside a queue.
        • Hence, 12 DSCP values are used.
        • AF11,AF12,AF13, AF21,…, AF43.
        • First digit shows the class it belongs and the second digit shows the probability of dropping. Higher digit implies higher probability of dropping.
      • EF PHB and DSCP values;
        • Low latency with a cap on bandwidth and a single DSCP value. EF.
        • States packets with DSCP “EF” should have minimum delay, jitter, and loss up to a guaranteed bandwidth level. (check via policing)
      • Best Effort;
        • Without QOS effect. Default DSCP value: BE
      • Integrated Service QOS model;
        • Uses a method where before a flow begins, it reserved the minimum BW required and delay for the flow from end-end.
        • RSVP to reserve Bandwidth. If a router doesn’t know RSVP, the reserve messages are passed through.
        • Scales poor

Chapter-3:  MQC, QPM and auto QOS

  • MQC- Modular QOS CLI
    • Makes easier to configure a device with QOS.
    • All CB- tools comes under MQC.
    • Classify a packet using “class-map” command.
    • Define PHB using “policy-map” command.
    • Apply the policy-map on either to ingress/egress traffic using “service-policy” command on an interface.
    • All class-map/policy-map names are case sensitive.
    • Class-map
      • Multiple match statements available.
      • “class-default” which classify packets missed by other class-map statements.
      • Match-all(default) , match-any options are available.
      • “Match-class” option to match another class.
    • QPM – QOS Policy Manager
      • Makes easy to configure and monitor QOS on big network.
      • QPM runs on servers and uses telnet to access the network devices.
      • QPM uses SNMP to write QOS config to network devices.
      • QPM makes use of Cisco works and LDAP directory to know about network devices.
    • AutoQos;
      • “auto qos” command automatically classifies, configure QOS CLI and perform QOS. Specifically for VOIP.
      • Classifies packets as voice payload, voice signaling, all other traffic (DSCP: BE).
      • AutoQoS VoIP requires that CEF be enabled first.
      • Cannot be used if the interface already has “service-policy” command.
      • Relays on “bandwidth” command on the interface.
      • Command “auto qos voip [trust] [fr-atm]”. “show auto qos”
      • For IOS switches;
        • “auto qos voip {cisco-phone| trust}
        • “cisco-phone” option when interface is connected to cisco phones. Uses CDP and trust packets from cisco phones
        • “trust” when connected to another switch. Used on trunk links alone. Trust the Cos settings on the packets.

Chapter-4: Classification and Marking;

  • CB classification can be done based on SRC IP, DES IP, IP precedence, IP DSCP, TCP, UPD, IGMP, ICMP,IP precedence, SRC MAC, CoS, DES MAC, input interface, RTP, Internal QOS group, NBAR protocol types.
  • When “match protocol” is configured, it means NBAR is used to have deep inspection on packet
  • Check “ip nbar protocol-discovery” command.
  • Cos Field: Class of service
    • First three bit of 801.1q tag field.
    • Other Marking fields;
      • Discard Eligibility – DE field in Frame relay
      • ATM defines Cell Loss Priority (CLP)
      • QOS group field: Internal Marking in Cisco GSR/ESR routers.
    • The IP Phone internally marks its own voice bearer traffic DSCP EF and CoS 5 by default, its own voice signaling traffic DSCP 31 and CoS 3. Default Data traffic would have DSCP: BE
    • Classify and mark as close to the ingress edge as possible.
    • When classifying based on URL, NBAR matches all packets beginning with the matched URL until it sees another HTTP request.
    • “load-interval” interface subcommand equivalent to “rate-interval” command.
    • Class-map optional;
      • “match all” or “match any”
      • “match all” is the default
      • Multiple match statement in the same class – AND operation.
      • Multiple values with one match statement – OR operation.
    • Classification when using VPN;
      • Ingress LSR copies the ToS byte from the IP header to MPLS header.
      • QOS pre-classification;
        • For Egress QOS policies facing VPN tunnel.
        • OS keeps the original unencrypted packet in memory until the Egress QoS actions have been taken.
        • “qos pre-classify” command.

Chapter-5: Congestion Management

  • Software Queues and Hardware queues;
    • IOS creates software queues according to the QOS policy method.
    • Hardware queue will be available for each interface. FIFO logic. Unaffected by queuing configuration. Also called “TX Ring” or “TX Queue”
    • Default size would be 16. Check the “tx_limited=0(16)” line on the output of “show controllers” command. If above value is 0, size is not limited by any QOS tool.
    • IOS shortens the interface Hardware Queue automatically when a software queuing method is configured.

Scheduling Concepts: FIFO, PQ, CQ, MDRR

  • FIFO;
    • First In First Out. No classification or scheduling needed.
    • WFQ is default. When we disable WFQ using “no fair-queue” interface subcommand, FIFO queuing will be enabled.
    • FIFO uses tail drop.
    • To change the size of FIFO queue, configure “hold-queue x out” interface subcommand. Check the current queue size using “show interface” command: “Output queue :0/40 (size/max)”
    • “Show interface” output shoes “Queueing strategy: fifo” if FIFO is enabled.
  • PQ scheduler;
    • Priority Queuing. Higher-priority queues always get serviced, with the side effect of starving the lower-priority queues.
    • Four Queues; High, Medium, Normal and Low.
    • Delay sensitive traffic will be handled
  • CQ:
    • Custom Queuing. Each queue is served for specified number of bytes.
    • 16 Queues available. It performs round-robin service on each queue, beginning with Queue 1. Does not have an option to always service one queue first.
  • MDRR;
    • Modified Deficit Round-Robin. Specifically for GSR model of routers.
    • CQ scheduler has a problem with trying to provide an exact percentage bandwidth for all queues, as it doesn’t perform fragmentation.
    • Uses the concept of QV, DC.
      • QV- Quantum value. Bytes configured per queue. Same as in CQ.
      • If too many bytes were taken from a queue, next time around through the queues, the number of “extra” bytes sent by MDRR is subtracted from the QV.
      • DC- Deficit Counter for each queue.

Queuing Tools : WFQ, CBWFQ, LLQ;

WFQ;

  • WFQ doesn’t have classification options. Packets classified based on each flow and flow is determined by 5-tuple + IP precedence.
  • 4096 queues per interface. Max length per queue is 4096. FIFO logic inside each queue.
  • WFQ scheduler uses numbers called Sequence number (SN). Also called “Finish Line” (FL)
  • Scheduler logic selects packets with lowest SN among the first packets in 4096 queues will be placed in TX-ring. Favors lower byte volume and higher precedence values.
  • SN= Previous_SN + (weight * new_packet_length)
  • Weight = 32,384 /(IP_Precedence + 1)
  • Higher precedence value with less packet length gets small SN value.
  • Modified Tail Drop policy;
    • Absolute limit on the number of packets enqueued among all queues is “hold-queue”.
    • Limit on number of packets per queue is “CDT”( congestive discard threshold)
    • If “hold-queue” limit reached, drop packet. Else calculate SN and check whether CDT has reached. If yes, check whether any packets with higher SN are in that queue. If yes, drop that higher SN packet and place this packet in queue. If not, drop the new packet.
  • Special WFQ queues;
    • IOS uses 8 hidden queues per interface with lowest weight for overhead traffic.
    • RSVP asks WFQ to create queue for each RSVP reserved flows.
    • IOS uses WFQ by default on all serial interfaces which has T1/E1 speed or below.
  • Commands;
    • “fair-queue [congestive-discard-threshold [dynamic-queues [rsvp reservable-queues]]]”
    • “hold-queue <length> out”
    • show queue <interface-name> <interface-number>
    • show queueing [custom | fair | priority | random-detect [interface xxxx]]]
  • “Queueing strategy: weighted fair” in the output of “show interface” command.
  • Best for data traffic. Not for voice/video.

CBWFQ;

  • Classification: Based on CB Marking.
  • Drop Decision: Tail drop or WRED. Default: Tail Drop
  • Maximum number of queues: 64
  • Maximum Queue length: 64
  • Scheduling inside each queue: FIFO on 63 queues; FIFO or WFQ on class-default queue
  • Scheduler logic: Not published. Each queue receives configured bandwidth.
  • Commands;
    • bandwidth {<bandwidth-kbps> | percent <percent>}
      • Must use either actual BW or % on all the classes in single policy map.
    • bandwidth {remaining percent <percent>}
    • queue-limit  <value> : sets the maximum number of packets in the queue.
      • Each class command will be a queue
    • fair-queue [queue-limit <value>]
      • Enables WFQ in class-default only. Can configure for all class in 7500 series.
    • random-detect dscp <thresholds>
      • Enables DSCP- based WRED in the class
    • random-detect precedence <thresholds>
      • Enables precedence-based WRED in the class.
    • max-reserved-bandwidth <percent>
      • Interface subcommands which allocates % of link BW that can be reserved for CBWFQ queues besides default-queue
      • Default: 75%. A policy map cannot allocate more than 75% of interface bandwidth. Remaining 25% to the class-default queue reserved by IOS.

LLQ;

  • CBWFQ scheduler serves packets on other queues though VOIP packets may weight on another queue. Delay sensitive packets are not handled efficiently.
  • Same concept as CBWFQ but it treats some classe/s as strict-priority queues which will be always served with “police” options so that other queues wouldn’t be starved.
  • If the packets in the LLQ exceed the configured policed value, packets would be dropped.
  • Configuration;
    • Instead of using the “bandwidth” command on a class, use the “priority” command. Can be in multiple classes.
    • “priority {<bw-kbps>| percent <value>} [<burst>]
    • The default burst size is equal to 200 milliseconds of traffic.
    • Police dropped packets can be seen in the output of “sh policy-m int<> output class <>”
  • “bandwidth remaining percent”;
    • Remaining BW = { bandwidth configured on interface – [ 25% of BW configured+ LLQ reservation]}

Advertisements
This entry was posted in QOS. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s