Classification and Marking

  • The goal of Quality of Service (QoS) is to give certain types of network traffic priority over others during periods of congestion.
  • Classification organizes network traffic (packets) into different traffic classes (categories), a fundamental step in implementing QoS.
    • To apply different treatments to various types of traffic, we first need to identify them.

Methods of Classifying Traffic:

  • Access Control Lists (ACLs): Only traffic that matches the ACL’s criteria receives the specified QoS treatment, while other traffic doesn’t.
  • NBAR (Network Based Application Recognition): Performs deep packet inspection up to Layer 7, identifying specific traffic types based on application protocols.
  • Layer 2 and Layer 3 Headers: These contain fields used for classification:
    • PCP (Priority Code Point) in the Ethernet header (802.1Q tag).
    • DSCP (Differentiated Services Code Point) in the IP header for higher granularity.

PCP and CoS

  • PCP (Priority Code Point) is also known as Class of Service (CoS) and is defined by the IEEE 802.1p standard.
    • It consists of 3 bits, allowing for 8 different values (2Âł = 8).

  • PCP Value 0:

    • Indicates Best Effort delivery with no guarantees on quality or delivery speed.
  • PCP Values 3 and 5:

    • PCP 3: Used for call signaling traffic (establishing phone calls).
    • PCP 5: Used for the voice traffic itself.
  • PCP can only be applied in environments where dot1q tags exist, such as:

    • Trunk Links.
    • Access Links with voice VLANs.

The IP ToS Byte


  • The Type of Service (ToS) byte in the IP header includes 6 bits for DSCP and 2 bits for ECN (Explicit Congestion Notification).

IP Precedence (Old Method)

  • Similar to PCP, IP Precedence (IPP) uses values from 0 to 7:

    • 6 and 7: Reserved for network control traffic (e.g., OSPF messages between routers).
    • 5: Voice traffic.
    • 4: Video traffic.
    • 3: Voice signaling.
    • 0: Best effort traffic.
  • IP Precedence provides only 6 useful values, which may not be flexible enough for modern networks.


Differentiated Services Code Point (DSCP)

  • Defined in RFC 2474 (1998), DSCP allows for more flexibility and standardization in marking different types of traffic.
  • Benefits of standard DSCP markings:
    • Simplifies QoS design and implementation.
    • Facilitates consistent QoS practices between ISPs and enterprises.

Standard DSCP Markings

  • Default Forwarding (DF): Best effort traffic.
  • Expedited Forwarding (EF): Low loss, low latency, and low jitter traffic (typically voice).
  • Assured Forwarding (AF): Provides different classes with varying levels of drop precedence.
  • Class Selector (CS): Backward compatibility with IP Precedence (IPP).

Default Forwarding (DF)

  • Best Effort Traffic with a DSCP value of 0.

Expedited Forwarding (EF)

  • Used for time-sensitive traffic such as voice, marked with a DSCP value of 46.

Assured Forwarding (AF)

  • Four traffic classes, each with three levels of drop precedence.
    • Higher drop precedence means a greater likelihood of the packet being dropped during congestion.

Examples of Assured Forwarding:







  • AF41 (highest priority) receives the best treatment.
  • AF13 (lowest priority) receives the worst treatment.

Class Selector (CS)

  • Provides backward compatibility with IP Precedence using eight DSCP values.


RFC 4954

  • Developed with Cisco’s assistance, RFC 4954 standardizes QoS values across various traffic types.

Key Recommendations:

  • Voice traffic: EF.
  • Interactive video: AF4x.
  • Streaming video: AF3x.
  • High-priority data: AF2x.
  • Best effort: DF.

Trust Boundaries

  • Trust boundaries define where QoS markings from incoming traffic are trusted.
    • Trusted markings are passed along unchanged.
    • Untrusted markings are modified according to network policy.

  • When IP phones connect to a switch, it’s recommended to extend the trust boundary to the phone itself, ensuring traffic from PCs does not abuse high-priority markings.


Queuing and Congestion Management

  • When traffic arrives faster than it can be forwarded, packets are stored in a queue.
    • If the queue is full, new packets are dropped (tail drop).
    • Random Early Detection (RED) avoids tail drops by dropping packets early during congestion.

  • Multiple queues are essential for handling different types of traffic, classified based on factors like DSCP markings.

  • Scheduling determines the order in which packets are forwarded from the queue. A common scheduling method is Weighted Round-Robin (WRR):

    • Round-robin: Packets from each queue are forwarded in turn.
    • Weighted: Higher priority queues are serviced more frequently.

Class-Based Weighted Fair Queuing (CBWFQ)

  • A popular scheduling method that guarantees each queue a specific percentage of bandwidth during congestion.

Low Latency Queuing (LLQ)

  • LLQ designates certain queues as strict priority, meaning packets in these queues are always processed first. This minimizes delay and jitter for time-sensitive traffic like voice and video.

  • Downside: LLQ can starve other queues if strict priority queues are constantly full, but this can be mitigated by policing traffic rates.

Shaping and Policing

  • Traffic shaping: Buffers excess traffic when the rate exceeds the configured limit.

  • Traffic policing: Drops excess traffic or re-marks it when the rate exceeds the limit.

  • Burst traffic is temporarily allowed over the configured rate to accommodate applications that send data in bursts.