You override the default packet forwarding behavior of the router when you configure CoS using IPv6 DiffServ. The three main areas of configuration are classifiers (by default, the router does not classify packets using DiffServ), scheduling (by default, the router only has two queues enabled), and rewrite rules (by default, the router does not rewrite CoS bits).
To implement and verify CoS using IPv6 DiffServ, you must configure the following:
You configure an MF classifier for IPv6 to detect packets of interest to CoS and assign the packet to the proper forwarding class independently of DSCP. To configure an MF classifier on a customer-facing link, configure a policer for the expedited forwarding traffic and a firewall filter to classify traffic.
- [edit firewall]
- policer ef-FIN-Policer-Profile {
-
- if-exceeding {
- bandwidth-percent 10;
- burst-size-limit 2k;
- }
- then loss-priority high;
- }
- family inet6 {
-
- filter mf-classifier {
- filter-specific;
-
- term AV {
-
- from {
-
- destination-address {
- 0:0:FFFF:172.16.79.11;
- }
- }
-
- then {
- loss-priority low;
- forwarding-class af-AV-class;
- }
- }
-
- term Finance {
-
- from {
-
- destination-address {
- O:0:FFFF:172.16.79.63;
- }
- }
-
- then {
- policer ef-FIN-Policer-Profile;
- forwarding-class ef-FIN-class;
- }
- }
-
- term Network-Control {
-
- from {
- traffic-class 192; # 192 is the 110000 traffic class.
- }
-
- then {
- forwarding-class nc-CONTROL-class; # This is network control
traffic.
- }
- }
-
- term Data {
- then forwarding-class be-DATA-class; # The rest is data.
- }
- }
- }
You apply an MF classifier firewall filter for IPv6 to customer interfaces. To apply an MF classifier firewall filter on customer-facing links, apply the classifier as an input filter at the [edit interfaces] hierarchy level.
- [edit interfaces]
- so-0/0/1 {
-
- unit 0 {
-
- family inet {
- address 192.168.54.1/24;
- }
-
- family inet6 {
-
- filter {
- input mf-classifier;
- }
- address 0:0:FFFF:192.168.54.1/120;
- }
- }
- }
You must assign the forwarding classes established by the MF classifier to output queues. To assign a forwarding class to an output queue, include the forwarding-classes statement at the [edit class-of-service] hierarchy level.
- [edit class-of-service]
- forwarding-classes {
- queue 0 be-DATA-class;
- queue 1 ef-FIN-class;
- queue 2 af-AV-class;
- queue 3 nc-CONTROL-class;
- }
You configure rewrite rules to replace DSCPs on packets received from the customer with the values expected by other routers. Rewrite rules use the forwarding class information and PLP used internally by the router to establish the DSCP on outbound packets. To configure rewrite rules, include the rewrite-rules statement at the [edit class-of-service] hierarchy level.
- [edit class-of-service]
- rewrite-rules rewrite-IPv6-dscps {
-
- forwarding-class be-DATA-class {
- loss-priority low code points 000000;
- loss-priority high code points 000001;
- }
-
- forwarding-class ef-FIN-class {
- loss-priority low code points 101110;
- loss-priority high code points 101111;
- }
-
- forwarding-class af-AV-class {
- loss-priority low code points 001010;
- loss-priority high code points 001100;
- }
-
- forwarding-class nc-CONTROL-class {
- loss-priority low code points 110000;
- loss-priority high code points 110001;
- }
- }
To apply the configured rewrite rules, include the rewrite-rules statement at the [edit class-of-service interfaces] hierarchy level.
- [edit class-of-service interfaces]
- so-0/1/1 {
-
- unit 0 {
-
- rewrite-rules {
- dscp-ipv6 rewrite-IPv6-dscps;
- }
- }
- }
You configure BA classifiers for IPv6 on network interfaces because the DSCPs have been explicitly rewritten on the edge routers. To configure a BA classifier for IPv6 DSCPs, include the dscp-ipv6 statement and give the classifier a name. Then import the default classifier and specify the forwarding class, loss priority, and code points for each established traffic class at the [edit class-of-service] hierarchy level.
- [edit class-of-service]
- classifiers {
-
- dscp-ipv6 IPv6-classifier {
- import default; # Uses the DSCP default map.
-
- forwarding-class be-DATA-class {
- loss-priority high code-points 000001;
- }
-
- forwarding-class ef-FIN-class {
- loss-priority high code-points 101111;
- }
-
- forwarding-class af-AV-class {
- loss-priority high code-points 001100;
- }
-
- forwarding-class nc-CONTROL-class {
- loss-priority high code-points 110001;
- }
- }
- }
To apply the configured classifier, include the classifiers statement at the [edit class-of-service interfaces] hierarchy level.
- [edit class-of-service interfaces]
- so-0/1/1 {
-
- unit 0 {
-
- classifiers {
- dscp-ipv6 IPv6-classifier;
- }
- }
- }
You configure RED drop profiles to determine the probability of DiffServ assured forwarding packets being discarded under congested conditions. To configure RED drop profiles for assured forwarding without the PLP bit set and with the PLP bit set, include the drop-profiles statement at the [edit class-of-service] hierarchy level.
- [edit class-of-service]
- drop-profiles {
-
- af-AV-normal {
-
- interpolate {
- fill-level [95 100];
- drop-probability [0 100];
- }
- }
-
- af-AV-with-PLP {
-
- interpolate {
- fill-level [60 70 80 90 95];
- drop-probability [80 90 95 97 100];
- }
- }
- }
Assured forwarding traffic with the PLP bit set has a more aggressive drop probability than traffic without the PLP bit set.
You configure schedulers to assign resources, priorities, and drop profiles to output queues. To configure a scheduler, include the schedulers statement at the [edit class-of-service] hierarchy level.
- [edit class-of-service]
- schedulers {
-
- be-DATA-scheduler {
- transmit-rate percent 40;
- buffer-size percent 40;
- priority low;
- }
-
- ef-FIN-scheduler {
- transmit-rate percent 10;
- buffer-size percent 10;
- priority high;
- }
-
- af-AV-scheduler {
- transmit-rate percent 45;
- buffer-size percent 45;
- priority high;
- drop-profile-map loss-priority low protocol any drop-profile
af-AV-normal;
- drop-profile-map loss-priority high protocol any drop-profile
af-AV-with-PLP;
- }
-
- nc-CONTROL-scheduler {
- transmit-rate percent 5;
- buffer-size percent 5;
- priority low;
- }
- }
You configure a scheduler map to assign a forwarding class to a scheduler. To configure a scheduler map, include the scheduler-maps statement and scheduler name at the [edit class-of-service] hierarchy level.
- [edit class-of-service]
- scheduler-maps {
-
- diffserv-cos-map {
- forwarding-class be-DATA-class scheduler be-DATA-scheduler;
- forwarding-class ef-FIN-class scheduler ef-FIN-scheduler;
- forwarding-class af-AV-class scheduler af-AV-scheduler;
- forwarding-class nc-CONTROL-class scheduler nc-CONTROL-scheduler;
- }
- }
To apply the configured scheduler map, include the scheduler-map statement at the [edit class-of-service] hierarchy level.