Shopping cart

Subtotal:

$0.00

JN0-664 Class of Service (CoS)

Class of Service (CoS)

Detailed list of JN0-664 knowledge points

Class of Service (CoS) Detailed Explanation

What is CoS?

Class of Service (CoS) is a network mechanism used to ensure Quality of Service (QoS) by prioritizing different types of traffic. In modern networks, not all traffic is created equal:

  • Some types of traffic, like voice and video, are sensitive to latency and jitter.
  • Other types, like file downloads or backups, can tolerate delays.

CoS manages network congestion and ensures service quality by:

  1. Identifying and classifying traffic.
  2. Assigning priorities.
  3. Managing queues and scheduling.

Key Concepts

1. Traffic Classification

Traffic classification is the process of categorizing packets into classes based on specific criteria. These classes help assign appropriate QoS treatments.

Common Classification Methods:
  1. DSCP (Differentiated Services Code Point):

    • Part of the IP header, DSCP uses 6 bits to classify traffic into different service levels.
    • Example: Expedited Forwarding (EF) for voice, Assured Forwarding (AF) for video.
  2. IP Precedence:

    • An older method using the Type of Service (ToS) field in IPv4 headers to prioritize traffic.
  3. VLAN Tags:

    • In Layer 2 (Ethernet) networks, VLAN tags can carry a priority field (802.1p) to classify traffic.

2. Scheduling

Scheduling determines how packets are forwarded when multiple traffic types compete for bandwidth. The scheduler decides the order and amount of traffic sent.

Common Scheduling Techniques:
  1. Strict Priority Queues:

    • High-priority queues (e.g., voice) are always served first.
    • Risk: Lower-priority queues may experience starvation.
  2. Weighted Fair Queuing (WFQ):

    • Allocates bandwidth to all queues based on predefined weights.
    • Ensures fairness while still prioritizing critical traffic.
  3. Deficit Round Robin (DRR):

    • An advanced fair queuing method, allowing proportional bandwidth allocation while addressing packet size variations.

3. Traffic Shaping and Policing

Shaping and policing manage the rate of traffic entering or leaving the network.

  1. Traffic Shaping:

    • Smooths out bursty traffic by buffering excess packets and sending them at a controlled rate.
    • Ensures consistent bandwidth usage.
  2. Traffic Policing:

    • Drops or re-marks packets exceeding a defined rate limit.
    • Enforces bandwidth policies but may cause packet loss.

Why Shaping and Policing Matter:
They help prevent congestion by controlling the flow of data and ensuring that higher-priority traffic gets through during peak usage.

4. Queue Management

Queue management determines how packets are handled when queues become full due to congestion.

Common Techniques:
  1. Random Early Detection (RED):

    • Drops packets randomly before the queue is completely full.
    • Reduces the chance of global synchronization (when all TCP flows reduce their rates simultaneously).
  2. Weighted Random Early Detection (WRED):

    • A variation of RED that assigns different drop probabilities based on traffic priority.
    • Ensures high-priority traffic is less likely to be dropped.

Use Cases

CoS is crucial in networks where certain applications need preferential treatment. Common use cases include:

  1. Voice over IP (VoIP):

    • Ensures low latency and minimal jitter for real-time voice communications.
  2. Video Streaming:

    • Guarantees consistent bandwidth to avoid buffering and quality degradation.
  3. Enterprise Applications:

    • Prioritizes mission-critical traffic (e.g., financial transactions) over less important data.
  4. Congestion Management:

    • Prevents network bottlenecks by managing bandwidth allocation during peak usage.

Junos Configuration

1. Define a Scheduler:

A scheduler specifies how bandwidth is allocated among different traffic classes.

set class-of-service schedulers priority-scheduler transmit-rate percent 30
2. Classify Traffic Using DSCP:

Classify packets based on DSCP values and map them to a forwarding class.

set class-of-service classifiers dscp af forwarding-class AF1
3. Configure Shaping and Policing:

Limit traffic for a specific interface to prevent congestion.

set class-of-service traffic-shaping interface ge-0/0/0 shaping-rate 100m
set class-of-service policers policer1 if-exceeding bandwidth-limit 50m

Best Practices for CoS

  1. Understand Application Requirements:

    • Determine the bandwidth, latency, and jitter requirements for your applications.
  2. Use a Hierarchical Approach:

    • Implement traffic classification first, then apply scheduling and shaping.
  3. Test Policies Before Deployment:

    • Ensure QoS configurations do not unintentionally drop critical traffic.
  4. Monitor and Adjust:

    • Use tools like SNMP or telemetry to monitor traffic and adjust policies as needed.

Conclusion

Class of Service is a fundamental part of modern network QoS, ensuring that critical traffic gets prioritized during congestion. By combining traffic classification, scheduling, shaping, and queue management, CoS delivers a balanced and efficient use of network resources.

Class of Service (CoS) (Additional Content)

1. Forwarding Classes & Loss Priorities in Junos

Forwarding Classes (FC)

In Junos, Forwarding Classes define how traffic is queued and scheduled for transmission. Each forwarding class is mapped to a scheduler queue that determines:

  • Queue priority

  • Bandwidth share

  • Scheduling algorithm (e.g., strict-priority or weighted)

Examples of typical forwarding classes:

  • BE (Best Effort)

  • AF (Assured Forwarding)

  • EF (Expedited Forwarding for voice/video)

set class-of-service forwarding-classes queue 1 forwarding-class BE

Loss Priority

Each Forwarding Class can also be assigned one of two loss priorities:

  • Low Loss Priority (LLP): Less likely to be dropped.

  • High Loss Priority (HLP): More likely to be dropped when congestion occurs.

set class-of-service forwarding-classes queue 1 forwarding-class BE loss-priority low

WRED (Weighted Random Early Detection) uses loss priority to influence drop probability. Traffic marked as HLP will reach the drop threshold faster than LLP traffic under congestion.

2. Traffic Profiles & Three-Color Marking (Policers)

Juniper supports color-aware policing using the Single-Rate Three Color Marker (srTCM) or Two-Rate Three Color Marker (trTCM).

Color Definitions:

Color Condition Action
Green Within committed rate Forward
Yellow Exceeds committed but below peak May mark/drop
Red Exceeds peak rate Drop
set firewall policer POLICER1 if-exceeding bandwidth-limit 100m burst-size-limit 10m
set firewall policer POLICER1 then loss-priority high discard

Use Case in BGP/MPLS VPNs:

  • Color-based treatment can be used to prioritize core (backbone) traffic over local-access traffic.

  • For example, red traffic can be dropped aggressively at the PE before it reaches the P routers.

This marking system is critical for congestion-aware drop policies and SLA enforcement.

3. Hierarchical Class of Service (H-CoS)

In large-scale service provider networks, Hierarchical CoS is used to create multi-level traffic shaping and scheduling. This is especially important in:

  • Multi-tenant environments (e.g., per-VRF or per-customer shaping)

  • Access-to-core rate control

Key Features in Junos:

  • Apply shaping per logical unit (unit x) or per scheduler.

  • Create scheduler maps that define parent-child relationships.

  • Schedule at:

    • Top level (e.g., per customer or per VLAN)

    • Mid-level (per application type)

    • Bottom level (individual queues)

set class-of-service schedulers SCHED-VOICE transmit-rate percent 30
set class-of-service scheduler-maps MAP1 forwarding-class EF scheduler SCHED-VOICE
set class-of-service interfaces ge-0/0/0 unit 0 scheduler-map MAP1

In the exam, you may be asked to identify the component that enables queue-level shaping within a per-customer shaping policy — the answer is H-CoS with scheduler-maps.

4. DSCP Rewrite Rules (Output Marking)

While classifiers are used for ingress classification, rewrite rules are applied on egress to modify packet markings.

Rewrite Rules in Junos

Example for DSCP-based rewrite:

set class-of-service rewrite-rules dscp af forwarding-class AF1 loss-priority low code-points 001010

Attach the rewrite rule to an interface:

set interfaces ge-0/0/0 unit 0 rewrite-rules dscp af

This ensures that outbound packets carry DSCP values appropriate for the forwarding class and loss priority assigned internally.

Common Misconception on Exams:

  • Many confuse classifier and rewrite-rule functions.

  • Classifier = Input classification

  • Rewrite-rule = Output marking

Exam trick: If the question says "modifying DSCP value on outbound packets", the answer is always rewrite-rules, not classifiers.

Summary Table

Topic Key Details
Forwarding Class & LP FC defines queue; LP (high/low) affects WRED drop likelihood
Three-Color Marking Green/yellow/red classification for traffic policing; uses trTCM
Hierarchical CoS Allows shaping/scheduling at multiple levels (per VRF/unit/class)
Rewrite Rules Output DSCP/CoS value marking based on forwarding class and LP
WRED & LP Interaction High-loss-priority traffic dropped earlier under congestion

Frequently Asked Questions

What is the purpose of forwarding classes in Junos CoS?

Answer:

Forwarding classes categorize traffic into queues with specific scheduling behavior.

Explanation:

Forwarding classes allow routers to classify packets based on criteria such as DSCP, MPLS EXP bits, or interface policies. Once classified, packets are placed into queues that determine how traffic is prioritized during congestion. For example, voice traffic might be assigned to a high-priority queue while bulk data traffic is placed in a lower-priority queue. This mechanism ensures latency-sensitive traffic receives appropriate treatment in service provider networks.

Demand Score: 70

Exam Relevance Score: 86

What is the difference between traffic policing and traffic shaping?

Answer:

Policing drops excess traffic immediately, while shaping buffers traffic and sends it later.

Explanation:

Traffic policing enforces bandwidth limits by discarding packets that exceed configured thresholds. It is typically used to enforce strict service limits. Traffic shaping, in contrast, delays packets temporarily by buffering them and releasing them at a controlled rate. This approach smooths traffic bursts and avoids unnecessary packet loss. In service provider environments, shaping is commonly applied on egress interfaces while policing is applied on ingress edges.

Demand Score: 68

Exam Relevance Score: 84

Why is queue scheduling important in service provider networks?

Answer:

It determines how packets from different classes are transmitted during congestion.

Explanation:

Queue scheduling defines how available bandwidth is distributed among traffic classes when multiple queues contain packets. Scheduling algorithms such as priority scheduling or weighted round-robin allow operators to guarantee bandwidth or latency characteristics for specific traffic types. Without proper scheduling policies, critical applications like voice or control traffic could experience delays or packet loss during congestion events.

Demand Score: 65

Exam Relevance Score: 82

JN0-664 Training Course