Example: Configuring Forwarding Classes
By default on all platforms, four output queues are mapped to four FCs as shown in Forwarding Classes Overview. On Juniper Networks devices, you can configure up to eight FCs and eight queues.
To configure up to eight FCs, include the queue statement at the [edit class-of-service forwarding-classes] hierarchy level:
[edit class-of-service forwarding-classes] queue queue-number class-name;
The output queue number can be from 0 through 7, and you must map the forwarding classes one-to-one with the output queues. The default scheduler transmission rate and buffer size percentages for queues 0 through 7 are 95, 0, 0, 5, 0, 0, 0, and 0 percent, respectively.
For example, to configure a one-to-one mapping between eight FCs and eight queues, you would use the following configuration:
[edit class-of-service] forwarding-classes { queue 0 be; queue 1 ef; queue 2 af; queue 3 nc; queue 4 ef1; queue 5 ef2; queue 6 af1; queue 7 nc1; }
Defining Eight Classifiers
[edit class-of-service] classifiers { dscp dscp-table { forwarding-class ef { loss-priority low code-points [101000, 101001]; loss-priority high code-points [101010, 101011]; } forwarding-class af { loss-priority low code-points [010000, 010001]; loss-priority high code-points [010010, 010011]; } forwarding-class be { loss-priority low code-points [000000]; } forwarding-class nc { loss-priority low code-points [111000]; } forwarding-class ef1 { loss-priority low code-points [101100, 101101]; loss-priority high code-points [101110]; } forwarding-class af1 { loss-priority high code-points [101110]; } forwarding-class ef2 { loss-priority low code-points [101111]; } forwarding-class nc1 { loss-priority low code-points [111001]; } } }
Adding Eight Schedulers to a Scheduler Map
Configure a custom scheduler map that applies globally to all interfaces, except those that are restricted to four queues:
[edit class-of-service] scheduler-maps { sched { forwarding-class be scheduler Q0; forwarding-class ef scheduler Q1; forwarding-class af scheduler Q2; forwarding-class nc scheduler Q3; forwarding-class ef1 scheduler Q4; forwarding-class ef2 scheduler Q5; forwarding-class af1 scheduler Q6; forwarding-class nc1 scheduler Q7; } } schedulers { Q0 { transmit-rate percent 25; buffer-size percent 25; priority low; drop-profile-map loss-priority any protocol both drop-default; } Q1 { buffer-size temporal 2000; priority strict-high; drop-profile-map loss-priority any protocol both drop-ef; } Q2 { transmit-rate percent 35; buffer-size percent 35; priority low; drop-profile-map loss-priority any protocol both drop-default; } Q3 { transmit-rate percent 5; buffer-size percent 5; drop-profile-map loss-priority any protocol both drop-default; } Q4 { transmit-rate percent 5; priority high; drop-profile-map loss-priority any protocol both drop-ef; } Q5 { transmit-rate percent 10; priority high; drop-profile-map loss-priority any protocol both drop-ef; } Q6 { transmit-rate remainder; priority low; drop-profile-map loss-priority any protocol both drop-default; } Q7 { transmit-rate percent 5; priority high; drop-profile-map loss-priority any protocol both drop-default; } }
Configuring an IP Precedence Classifier and Rewrite Tables
[edit class-of-service] classifiers { inet-precedence inet-classifier { forwarding-class be { loss-priority low code-points 000; } forwarding-class af11 { loss-priority high code-points 001; } forwarding-class ef { loss-priority low code-points 010; } forwarding-class nc1 { loss-priority high code-points 011; } forwarding-class be1 { loss-priority low code-points 100; } forwarding-class af12 { loss-priority high code-points 101; } forwarding-class ef1 { loss-priority low code-points 110; } forwarding-class nc2 { loss-priority high code-points 111; } } } exp exp-rw-table { forwarding-class be { loss-priority low code-point 000; } forwarding-class af11 { loss-priority high code-point 001; } forwarding-class ef { loss-priority low code-point 010; } forwarding-class nc1 { loss-priority high code-point 111; } forwarding-class be1 { loss-priority low code-point 100; } forwarding-class af12 { loss-priority high code-point 101; } forwarding-class ef1 { loss-priority low code-point 110; } forwarding-class nc2 { loss-priority low code-point 111; } } inet-precedence inet-rw-table { forwarding-class be { loss-priority low code-point 000; } forwarding-class af11 { loss-priority high code-point 001; } forwarding-class ef { loss-priority low code-point 010; } forwarding-class nc1 { loss-priority low code-point 111; } forwarding-class be1 { loss-priority low code-point 100; } forwarding-class af12 { loss-priority high code-point 101; } forwarding-class ef1 { loss-priority low code-point 110; } forwarding-class nc2 { loss-priority low code-point 111; } }
Configuring an IDP Policy with a Forwarding Class
Configure an IDP policy with a forwarding class as an action to rewrite DSCP values of IP packets:
[edit class-of-service] security idp idp-policy policy_name rulebase-ips rule rule_name { then { action { class-of-service { forwarding-class forwarding-class-name; dscp-code-point value; } } } }