Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Configuring Basic Packet Flow Through the Junos OS CoS Process

    Figure 1 and Figure 2 show the components of the Junos OS CoS features, illustrating the sequence in which they interact.

    Figure 1: CoS Classifier, Queues, and Scheduler

    CoS Classifier, Queues,
and Scheduler

    Figure 2: Packet Flow Through CoS- Configurable Components

    Packet Flow Through CoS-
Configurable Components

    The following configuration demonstrates the packet flow through the CoS process:

    Define Classifiers

    If you trust the CoS values in the packet headers, you can use behavior aggregate classification to map those values to a forwarding class and drop priority. For example:

    [edit class-of-service]
    classifiers {
    exp exp_classifier {
    forwarding-class data-queue {
    loss-priority low code-points 000;
    loss-priority high code-points 001;
    }
    forwarding-class video-queue {
    loss-priority low code-points 010;
    loss-priority high code-points 011;
    }
    forwarding-class voice-queue {
    loss-priority low code-points 100;
    loss-priority high code-points 101;
    }
    forwarding-class nc-queue {
    loss-priority low code-points 110;
    loss-priority high code-points 111;
    }
    }

    If you do not trust the CoS values in the packet headers, you can use the more complex multifield classification to map ingress traffic to a forwarding class and drop priority. For example:

    [edit firewall]
    family inet {
    filter classify {
    term sip {
    from {
    protocol [ udp tcp ];
    port 5060;
    }
    then {
    forwarding-class nc-queue;
    loss-priority low;
    accept;
    }
    }
    }
    }

    Apply Classifiers to Incoming Packets on Interfaces

    You apply behavior aggregate classifiers to logical interfaces at the [edit class-of-service interfaces] hierarchy level. For example:

    [edit class-of-service]
    interfaces {
    so-* {
    unit 0 {
    classifiers {
    exp exp_classifier;
    }
    }
    }
    t3-* {
    unit 0 {
    classifiers {
    exp exp_classifier;
    }
    }
    }
    }

    You apply multifield classifiers as input filters to logical interfaces at the [edit interfaces] hierarchy level. For example:

    [edit interfaces]
    fe-0/0/2 {
    unit 0 {
    family inet {
    filter {
    input classify;
    }
    address 10.12.0.13/30;
    }
    }
    }

    Define Policers to Limit Traffic and Control Congestion

    If you need to rate-limit a traffic flow, either by discarding excess traffic (hard policing) or reassign excess traffic to a different forwarding class and/or loss priority (soft policing), define a policier and apply the policer to a firewall filter for that traffic flow. For example:

    [edit firewall]
    policer be-lp {
    if-exceeding {
    bandwidth-limit 10m;
    burst-size-limit 62500;
    }
    then loss-priority high;
    }
    family inet {
    filter be-lp {
    term t1 {
    from {
    protocol tcp;
    port 80;
    }
    then policer be-lp;
    then loss-priority low;
    then accept;
    }
    }
    }

    Define Drop Profiles

    Use drop profiles to define the drop probabilities across the range of delay-buffer occupancy, supporting the random early detection (RED) process.

    [edit class-of-service]
    drop-profiles {
    be-red {
    fill-level 20 drop-probability 25;
    fill-level 30 drop-probability 50;
    fill-level 40 drop-probability 75;
    fill-level 50 drop-probability 100;
    }
    }

    Assign Each Forwarding Class to a Queue

    To provide differentiated services to each forwarding class, assign each forwarding class to it’s own output queue. For example:

    [edit class-of-service]
    forwarding-classes {
    queue 0 data-queue;
    queue 1 video-queue;
    queue 2 voice-queue;
    queue 3 nc-queue;
    }

    Define Schedulers

    Define the scheduler characteristics for each forwarding class. For example:

    [edit class-of-service]
    schedulers { #
    data-scheduler {
    transmit-rate percent 50;
    buffer-size percent 50;
    priority low;
    drop-profile-map loss-priority high protocol any drop-profile be-red;
    }
    video-scheduler {
    transmit-rate percent 25;
    buffer-size percent 25;
    priority strict-high;
    }
    voice-scheduler {
    transmit-rate percent 20;
    buffer-size percent 20;
    priority high;
    }
    nc-scheduler {
    transmit-rate percent 5;
    buffer-size percent 5;
    priority high;
    }
    }

    Define Scheduler Maps

    Use scheduler maps to map schedulers to forwarding classes. For example:

    [edit class-of-service]
    scheduler-maps {
    sched1 {
    forwarding-class data-queue scheduler data-scheduler;
    forwarding-class video-queue scheduler video-scheduler;
    forwarding-class voice-queue scheduler voice-scheduler;
    forwarding-class nc-queue scheduler nc-scheduler;
    }
    }

    Define CoS Header Rewrite Rules

    Use rewrite rules to redefine the CoS bit pattern of outgoing packets. For example:

    [edit class-of-service]
    rewrite-rules {
    inet-precedence inet-rewrite {
    forwarding-class data-queue {
    loss-priority low code-point 000;
    loss-priority high code-point 001;
    }
    forwarding-class voice-queue {
    loss-priority low code-point 010;
    loss-priority high code-point 011;
    }
    forwarding-class video-queue {
    loss-priority low code-point 100;
    loss-priority high code-point 101;
    }
    forwarding-class nc-queue {
    loss-priority low code-point 110;
    loss-priority high code-point 111;
    }
    }
    }

    Apply Scheduler Maps and Rewrite Rules to Egress Interfaces

    [edit class-of-service]
    interfaces {
    ge-* {
    scheduler-map sched1;
    unit * {
    rewrite-rules {
    inet-precedence inet-rewrite;
    }
    }
    }
    }

    Modified: 2017-09-13