Example: CoS with IPv6 DiffServ Configuration
![]()
Figure 13 shows the complete topology for IPv6 DiffServ, complete with interfaces and IPv6 addresses. The IPv4-mapped IPv6 address format described in RFC 1884 is used.
Begin your configuration on Router 2, the core router. This ensures that when DiffServ is enabled on the edge routers, CoS is enabled end to end through the network. The core router configuration is a little simpler because no MF classification is configured in the core.
Router 2
[edit]class-of-service {classifiers { # Router 2 classifiers.dscp-ipv6IPv6-classifier{import default; # Uses the DSCP default map.forwarding-classbe-DATA-class{loss-priority high code-points 000001;}forwarding-classef-FIN-class{loss-priority high code-points 101111;}forwarding-classaf-AV-class{loss-priority high code-points 001100;}forwarding-classnc-CONTROL-class{loss-priority high code-points 110001;}}}drop-profiles { # Router 2 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];}}}forwarding-classes { # Router 2 forwarding classes.queue 0be-DATA-class;queue 1ef-FIN-class;queue 2af-AV-class;queue 3nc-CONTROL-class;}interfaces { # Router 2 class-of-service interfaces.so-1/0/1 { # Connected to R1.scheduler-mapdiffserv-cos-map;unit 0 {classifiers {dscp-ipv6IPv6-classifier;}rewrite-rules {dscp-ipv6rewrite-IPv6-dscp;}}}so-1/0/2 { # Connected to R3.scheduler-mapdiffserv-cos-map;unit 0 {classifiers {dscp-ipv6IPv6-classifier;}rewrite-rules {dscp-ipv6rewrite-IPv6-dscp;}}}}rewrite-rulesrewrite-IPv6-dscps{ # Router 2 rewrite rules.forwarding-classbe-DATA-class{loss-priority low code points 000000;loss-priority high code points 000001;}forwarding-classef-FIN-class{loss-priority low code points 101110;loss-priority high code points 101111;}forwarding-classaf-AV-class{loss-priority low code points 001010;loss-priority high code points 001100;}forwarding-classnc-CONTROL-class{loss-priority low code points 110000;loss-priority high code points 110001;}}scheduler-maps { # Router 2 scheduler maps.diffserv-cos-map{forwarding-classbe-DATA-classschedulerbe-DATA-scheduler;forwarding-classef-FIN-classscheduleref-FIN-scheduler;forwarding-classaf-AV-classscheduleraf-AV-scheduler;forwarding-classnc-CONTROL-classschedulernc-CONTROL-scheduler;}}schedulers { # Router 2 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-profileaf-AV-normal;drop-profile-map loss-priority high protocol any drop-profileaf-AV-with-PLP;}nc-CONTROL-scheduler{transmit-rate percent 5;buffer-size percent 5;priority low;}}}interfaces { # R2 interfaces.so-1/0/1 { # Connected to R1.unit 0 {family inet {address 10.0.0.1/24;}family inet6 {address 0:0:FFFF:10.0.0.1/120;}}}so-1/0/2 { # Connected to R3.unit 0 {family inet {address 10.0.1.1/24;}family inet6 {address 0:0:FFFF:10.0.1.1/120;}}}}Continue your configuration on Router 1 and Router 3, the edge routers. These routers get firewall-filter-based MF classifiers and rewrite rules for markers as well as schedulers and drop profiles on the core-facing interfaces.
Router 1
[edit]class-of-service {classifiers { # Router 1 classifiers.dscp-ipv6IPv6-classifier{import default; # Uses the DSCP default map.forwarding-classbe-DATA-class{loss-priority high code-points 000001;}forwarding-classef-FIN-class{loss-priority high code-points 101111;}forwarding-classaf-AV-class{loss-priority high code-points 001100;}forwarding-classnc-CONTROL-class{loss-priority high code-points 110001;}}}drop-profiles { # Router 1 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];}}}forwarding-classes { # Router 1 forwarding classes.queue 0be-DATA-class;queue 1ef-FIN-class;queue 2af-AV-class;queue 3nc-CONTROL-class;}interfaces { # Router 1 class-of-service interfaces.so-0/1/1 { # To servers.scheduler-mapdiffserv-cos-map;unit 0 {classifiers {dscp-ipv6IPv6-classifier;}rewrite-rules {dscp-ipv6rewrite-IPv6-dscp;}}}rewrite-rulesrewrite-IPv6-dscps{ # Router 1 rewrite rules.forwarding-classbe-DATA-class{loss-priority low code points 000000;loss-priority high code points 000001;}forwarding-classef-FIN-class{loss-priority low code points 101110;loss-priority high code points 101111;}forwarding-classaf-AV-class{loss-priority low code points 001010;loss-priority high code points 001100;}forwarding-classnc-CONTROL-class{loss-priority low code points 110000;loss-priority high code points 110001;}}scheduler-maps { # Router 1 scheduler map.diffserv-cos-map{forwarding-classbe-DATA-classschedulerbe-DATA-scheduler;forwarding-classef-FIN-classscheduleref-FIN-scheduler;forwarding-classaf-AV-classscheduleraf-AV-scheduler;forwarding-classnc-CONTROL-classschedulernc-CONTROL-scheduler;}}schedulers { # Router 1 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-profileaf-AV-normal;drop-profile-map loss-priority high protocol any drop-profileaf-AV-with-PLP;}nc-CONTROL-scheduler{transmit-rate percent 5;buffer-size percent 5;priority low;}}}firewall { # Router 1 firewall policer and filter.policeref-FIN-Policer-Profile{if-exceeding {bandwidth-percent 10;burst-size-limit 2k;}then loss-priority high;}family inet6 {filtermf-classifier{filter-specific;term AV {from {destination-address {0:0:FFFF:172.16.79.11;}}then {loss-priority low;forwarding-classaf-AV-class;}}term Finance {from {destination-address {O:0:FFFF:172.16.79.63;}}then {policeref-FIN-Policer-Profile;forwarding-classef-FIN-class;}}term Network-Control {from {traffic-class 192; # 192 is the 110000 traffic class.}then {forwarding-classnc-CONTROL-class; # This is network control traffic.}}term Data {then forwarding-classbe-DATA-class; # The rest is data.}}}}interfaces { # Router 1 interfaces.so-0/0/1 { # To servers.unit 0 {family inet {address 192.168.54.1/24;}family inet6 {filter {inputmf-classifier;}address 0:0:FFFF:192.168.54.1/120;}}}so-0/1/1 { # Connected to R2.unit 0 {family inet {address 10.0.0.2/24;}family inet6 {address 0:0:FFFF:10.0.0.2/120;}}}}Router 3
[edit]class-of-service {classifiers { # Router 3 classifiers.dscp-ipv6IPv6-classifier{import default; # Uses the DSCP default map.forwarding-classbe-DATA-class{loss-priority high code-points 000001;}forwarding-classef-FIN-class{loss-priority high code-points 101111;}forwarding-classaf-AV-class{loss-priority high code-points 001100;}forwarding-classnc-CONTROL-class{loss-priority high code-points 110001;}}}drop-profiles { # Router 3 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];}}}forwarding-classes { # Router 3 forwarding classes.queue 0be-DATA-class;queue 1ef-FIN-class;queue 2af-AV-class;queue 3nc-CONTROL-class;}interfaces { # Router 3 class-of-service interfaces.so-2/0/1 { # To servers.scheduler-mapdiffserv-cos-map;unit 0 {classifiers {dscp-ipv6IPv6-classifier;}rewrite-rules {dscp-ipv6rewrite-IPv6-dscp;}}}rewrite-rulesrewrite-IPv6-dscps{ # Router 3 rewrite rules.forwarding-classbe-DATA-class{loss-priority low code points 000000;loss-priority high code points 000001;}forwarding-classef-FIN-class{loss-priority low code points 101110;loss-priority high code points 101111;}forwarding-classaf-AV-class{loss-priority low code points 001010;loss-priority high code points 001100;}forwarding-classnc-CONTROL-class{loss-priority low code points 110000;loss-priority high code points 110001;}}scheduler-maps { # Router 3 scheduler map.diffserv-cos-map{forwarding-classbe-DATA-classschedulerbe-DATA-scheduler;forwarding-classef-FIN-classscheduleref-FIN-scheduler;forwarding-classaf-AV-classscheduleraf-AV-scheduler;forwarding-classnc-CONTROL-classschedulernc-CONTROL-scheduler;}}schedulers { # Router 3 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-profileaf-AV-normal;drop-profile-map loss-priority high protocol any drop-profileaf-AV-with-PLP;}nc-CONTROL-scheduler{transmit-rate percent 5;buffer-size percent 5;priority low;}}firewall { # Router 3 firewall policer and filter.policeref-FIN-Policer-Profile{if-exceeding {bandwidth-percent 10;burst-size-limit 2k;}then loss-priority high;}family inet6 {filtermf-classifier{filter-specific;term AV {from {destination-address {0:0:FFFF:172.16.79.11;}}then {loss-priority low;forwarding-classaf-AV-class;}}term Finance {from {destination-address {O:0:FFFF:172.16.79.63;}}then {policeref-FIN-Policer-Profile;forwarding-classef-FIN-class;}}term Network-Control {from {traffic-class 192; # 192 is the 110000 traffic class.}then {forwarding-classnc-CONTROL-class; # This is network control traffic.}}term Data {then forwarding-classbe-DATA-class; # The rest is data.}}}}interfaces { # Router 3 interfaces.so-2/0/0 { # To servers.unit 0 {family inet {address 1172.16.79.1/24;}family inet6 {filter {inputmf-classifier;}address 0:0:FFFF:172.16.79.1/120;}}}so-2/0/1 { # to R2unit 0 {family inet {address 10.0.1.2/24;}family inet6 {address 0:0:FFFF:10.0.1.2/120;}}}}