Intepret wired and wireless QoS configurations

   To implement QoS, specific traffic is selected and prioritzed over the other traffic. You can then provide preferential treatment to that traffic at the expense of all of the other traffic. QoS provides the following features:

  • Bandwidth guarantees
  • Buffering capabilities & dropping
  • Traffic policing & prioritization
  • Traffic shaping

   Service availability & transmission quality are essential for QoS, therefore high availability in a network is essential. There are four factors which can affect the transmission quality in a network:

  • Packet loss
  • Delay
  • Jitter
  • Lack of bandwidth

Packet Loss

   Packet loss is a relative measure of the number of packets that were not received compared to the number of packets transmitted. Loss is generally due to availability, so high availability should be implemented to reduce packet loss during non-congestion to zero.

Delay

   Delay is the time taken for a packet to travel from source to destination. There are two types of delay - fixed & variable. There are three types of fixed delay:

  • Propagation delay: the time required for data to travel over a fiber or copper medium.
  • Serialization delay: the time required to put all of the bits of a packet on the link. It is dependent on the speed of the link.
  • Processing delay: the amount of time it takes for a router or switch to receive a packet on an input interface and place it in the output queue of the output interface. Processing delay is influenced by:
    • Packet switching mode
    • Router architecture
    • CPU load
    • CPU speed

Jitter

   Jitter is a variable delay that is the difference in the end-to-end delay between packets. If one packet takes 50ms to travel from source to destination, and another takes 66ms, then the jitter is 16ms.


1.5.a QoS components

QoS Models

   A QoS model describes a set of QoS capabilities. Models can differ in how data is delivered across a network, so that they can provide differing delivery capabilities across a network. Cisco IOS supports three types of QoS service models:

  • Best-effort service: QoS is not implemented wit this model. Packets are delivered from source to destination without no guarantee of reliability or throughput.
  • Integrated service (IntServ): An application requests a specific service from the network before sending data. The request is made by sending an explicit, informing the network of its traffic profile and requests a service to meet the bandwidth & delay requirements. The network fulfills the request by performing packet classification, policing and queueing.
  • Differentiated services (DiffServ): IP traffic is divided into classes and marks packets based on business requirements so that different classes can be assigned different levels of service. QoS policies are defined and managed independently on each device in the network.

Classification & Marking

   Classification is the process of distinguishing one type of traffic from another by examining the packet header and determining which traffic should be treated differently. Once traffic is classified, marking is done to set a value in the packet or frame header. The marking is used to set the QoS trust boundary. A trust boundary defines network devices where the markings can be verified and adjusted.    Classification & marking tools set the trust boundary by looking at any of the following:

  • Layer 2 frame header fields: 802.1q class of service bits and MPLS experimental values.
  • Layer 3 packet header fields: IP precedence (IPP), differentiated service code point (DSCP), explicit congestion notification (ECN), & source/destination address.
  • Layer 4 parameters: source & destination TCP/UDP ports.
  • Layer 7 parameters: network based application recognition (NBAR) application signatures.

   Marking can be done at either layer 2 or layer 3, in one of the following header fields:

  • Priority code point (PCP): Within the 4-byte 802.1q frame header, the first two bytes is the tag protocol identifier (TPID), and the second two bytes is the tag control information (TCI) field. The first 3 bits of the TCI field is the priority code point field, and Ethernet frames can be marked as belonging to a specific class of service. With three available bits, eight possible classes of service are defined:
    • 0: Background (lowest priority)
    • 1: Best effort (default priority)
    • 2: Excellent effort
    • 3: Critical applications
    • 4: Low latency video
    • 5: Low latency voice
    • 6: Internetwork control
    • 7: Network control (highest priority)

Class of service markings can be mapped to the layer 3 IP header using the first 3 bits of the DSCP field in the header; which are the IP Precedence (IPP) bits.

  • IPv4/IPv6 DiffServ: the second byte in the IP header contains 6 bits for DSCP values, and a 2-bit explicit congestion notification field. The DSCP bits allows for up to 64 classification values.

Per-hop Behaviors

   A per-hop behavior (PHB) is the forwarding treatment applied to packets with the same DSCP value when traversing a link on a node. This could be either expediting, delaying, or dropping packets on each hop, based on the DSCP value. Four PHBs have been defined for general use:

  • Class selector (CS) PHB: The first three bits of the DSCP field are used as class selector bits. These bits provide backward compatibility with IP Precedence, which uses the same 3 bits. The last three bits are set to 0, which identifies a CS PHB. There are eight CS classes (CS0 - CS7) that correspond to the eight possible bit values.

  • Default forwarding (DF): All bits in the DSCP field are set to 0 and is intended to provide best-effort delivery for packets.

  • Assured forwarding (AF): guarantees a certain amount of bandwidth to a class. Packets marked with an AF class use the first 3 bits as the binary value of the AF class, the second two bits as the drop probability, with the sixth bit always set to 0.
    There are four defined AF classes - AF1, AF2, AF3, & AF4. Each is treated independently and represents an individual queue. An AF class is comprised of an IP precedence value (1-4) and a drop probability value (1-3).
    A device using AF PHBs must deal with congestion within each class with a congestion avoidance algorithm, and also handle short-term congestion from traffic bursts using a queueing algorithm.

  • Expedited forwarding (EF): Used for low delay, low latency, low jitter & assured bandwidth service. Packets using EF should marked with the binary value 101110 in the DSCP field. Bits 5 to 7 (101) correspond to the IP precedence field, and represents the highest user-definable IP precedence value used for delay-sensitive traffic.

Trust Boundary

   In order to scale QoS, packets should be marked by the host originating the packets or as close to the host as possible. When a frame or packet marked by the endpoint host with a CoS or DSCP value, the switch that receives it can either accept the value or re-mark the packet. If the packet or frame is accepted as marked, the trust boundary is considered to be at the endpoint host. If not, the trust boundary begins at the switch; and frames received from the host will be re-marked with the appropriate CoS or DSCP value.


1.5.b QoS policy

Modular QoS

   The modular QoS CLI (MQC) is Cisco’s method to implement QoS on Cisco routers. MQC presents a framework to create QoS policies that are used to classify traffic, and to do marking, policing, shaping, and congestion management & avoidance. QoS policies are created with MQC using the following compoenents:

  • Class maps: A class map defines the traffic to be classified, by matching traffic to criteria defined in the class map; i.e., an access list. Multiple class maps are used to classify multiple types of traffic. Class maps are created using the class-map class-map-name command, with one or more match statements within class map configuration mode for traffic classification.
  • Policy maps: A policy map applies QoS actions for the traffic classes defined in a class map. The policy map can include one or more class maps, and each class map can one or more QoS actions defined. Policy maps are created using the policy-map command.
  • Service policies: A service policy is used to apply policy maps to an interface in an inbound or outbound direction. Service policies are applied to the interface with the service-policy input|output name command.

   All traffic not matched by a explicit class map is matched by a default implicit class map named class-default. Traffic matched to the default class map is classified as best-effort, but other class-based QoS actions can be applied to the default class map if desired.

   Class-based marking using MQC can be done in two different ways:

  • The set command within a traffic class of a policy map.
  • Marking traffic that has exceeded a set threshold with the police command.

   The set commands that can be used to mark traffic in a class are:

  • set qos-group group-id
  • set cos cos-value
  • set precedence ip-precedence-value
  • set dscp ip-dscp-value

Policing and Shaping

   Traffic policers & shapers are QoS tools to influence the flow of traffic:

  • Policers: the mechanism that transmits or re-marks traffic within a configured traffic rate, and drops or marks down traffic that exceeds the configured rate. Policing causes TCP retransmission when traffic is dropped.
  • Shapers: the mechanism that buffers and delays traffic that peaks above the defined rate, until the traffic rate drops below the expected rate. Shapers used used for egress traffic, and usually on interfaces facing service providers.

   When a defined traffic rate is exceeded, the policer can either drop the traffic, or mark down the traffic into a traffic class with a lower priority. Traffic marked down to a lower-priority traffic class would then be more likely to be dropped by a congestion avoidance mechanism.

Token Bucket Algorithms

   Cisco IOS policers & shapers are based on token bucket algorithms. Token bucket algorithms use the following components:

  • Committed informate rate (CIR): The traffic rate defined where traffic will be policed, in bits per second.
  • Committed burst size (Bc): The maximum size of the CIR token bucket and the maximum amount of traffic sent within a Tc.
  • Committed time interval (Tc): The time interval over which the committed burst is sent.
  • Token: An object that represents 1 byte.
  • Token bucket: A bucket that accumulates tokens until a maximum amount of tokens is reached;, e.g. the Bc. Tokens are added to the bucket at a fixed rate - the CIR. Each packet that is transmitted causes tokens to be removed from the bucket according to the packet size. For example, a 1500 byte packet will consume 1500 tokens. If there are not enough tokens in the bucket to transmit the packet, then a policer or shaper can take action on the packet:
    • Buffer the packet until enough tokens have accumulated.
    • Drop the packet.
    • Mark down the packet to a lower priority traffic class.